friendlyarm,nanopi-r2c-plus|\
friendlyarm,nanopi-r2s|\
friendlyarm,nanopi-r4s|\
+ friendlyarm,nanopi-r4s-enterprise|\
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)
ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
esac
}
-nanopi_r4s_get_mac()
-{
- local interface=$1
- local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
- local address
-
- if [ -f "$eeprom_path" ]; then
- address=$(get_mac_binary "$eeprom_path" 0xfa)
- if [ "$interface" = "lan" ]; then
- address=$(macaddr_setbit_la "$address")
- fi
- else
- address=$(macaddr_generate_from_mmc_cid mmcblk1)
- if [ "$interface" = "lan" ]; then
- address=$(macaddr_add "$address" 1)
- fi
- fi
-
- echo "$address"
-}
-
rockchip_setup_macs()
{
local board="$1"
wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
- friendlyarm,nanopi-r4s)
- wan_mac=$(nanopi_r4s_get_mac wan)
- lan_mac=$(nanopi_r4s_get_mac lan)
- ;;
- friendlyarm,nanopi-r5c)
- wan_mac=$(macaddr_generate_from_mmc_cid mmcblk*)
- lan_mac=$(macaddr_add "$wan_mac" 1)
- ;;
friendlyarm,nanopi-r2c-plus|\
+ friendlyarm,nanopi-r4s|\
friendlyarm,nanopi-r5s)
wan_mac=$(macaddr_generate_from_mmc_cid mmcblk1)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
+ friendlyarm,nanopi-r4s-enterprise)
+ wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
+ lan_mac=$(macaddr_setbit_la "$wan_mac")
+ ;;
+ friendlyarm,nanopi-r5c)
+ wan_mac=$(macaddr_generate_from_mmc_cid mmcblk*)
+ lan_mac=$(macaddr_add "$wan_mac" 1)
+ ;;
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)
wan_mac=$(macaddr_add "$(cat /sys/class/net/eth1/address)" -1)
endef
TARGET_DEVICES += friendlyarm_nanopi-r4s
+define Device/friendlyarm_nanopi-r4s-enterprise
+ DEVICE_VENDOR := FriendlyARM
+ DEVICE_MODEL := NanoPi R4S Enterprise Edition
+ DEVICE_VARIANT := 4GB LPDDR4
+ SOC := rk3399
+ UBOOT_DEVICE_NAME := nanopi-r4s-rk3399
+ DEVICE_PACKAGES := kmod-r8168
+endef
+TARGET_DEVICES += friendlyarm_nanopi-r4s-enterprise
+
define Device/friendlyarm_nanopi-r5c
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R5C
+++ /dev/null
-From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
-From: Tianling Shen <cnsztl@gmail.com>
-Date: Mon, 7 Jun 2021 15:45:37 +0800
-Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
-
-NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
-stores the MAC address.
-
-Signed-off-by: Tianling Shen <cnsztl@gmail.com>
----
- arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
-+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
-@@ -68,6 +68,15 @@
- status = "disabled";
- };
-
-+&i2c2 {
-+ eeprom@51 {
-+ compatible = "microchip,24c02", "atmel,24c02";
-+ reg = <0x51>;
-+ pagesize = <16>;
-+ read-only; /* This holds our MAC */
-+ };
-+};
-+
- &i2c4 {
- status = "disabled";
- };