rockchip: add NanoPi R4S Enterprise Edition build
authorTianling Shen <cnsztl@immortalwrt.org>
Sat, 17 Feb 2024 05:54:36 +0000 (13:54 +0800)
committerNick Hainke <vincent@systemli.org>
Mon, 19 Feb 2024 19:52:06 +0000 (20:52 +0100)
FriendlyElec renamed the NanoPi R4S board with EEPROM (mac address)
to "enterprise" edition, and it was added as a "new" board in upstream
kernel.

This patch switched to use that upstreamed dts and removed local
EEPROM patch.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
package/boot/uboot-rockchip/Makefile
target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
target/linux/rockchip/armv8/base-files/etc/board.d/02_network
target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
target/linux/rockchip/image/armv8.mk
target/linux/rockchip/patches-6.1/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch [deleted file]
target/linux/rockchip/patches-6.1/105-nanopi-r4s-sd-signalling.patch

index 2682a0afd69461b68c7f60bb51ddb1593653ad82..595d788973b7d1f85634f43e4c375a3581681aa0 100644 (file)
@@ -107,7 +107,8 @@ define U-Boot/nanopi-r4s-rk3399
   $(U-Boot/rk3399/Default)
   NAME:=NanoPi R4S
   BUILD_DEVICES:= \
-    friendlyarm_nanopi-r4s
+    friendlyarm_nanopi-r4s \
+    friendlyarm_nanopi-r4s-enterprise
 endef
 
 define U-Boot/rock-pi-4-rk3399
index 43dcd5501619585067834dbc4718566969675eeb..ad846666003e7b37cb27c97d06f1a9234bdb972f 100644 (file)
@@ -12,6 +12,7 @@ friendlyarm,nanopi-r2c|\
 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_led_netdev "wan" "WAN" "green:wan" "eth0"
index 2a83acc85c0a58b15345ec5be7f04bf75ff3d534..f87b17dbc1b14694adbc4927e75ba970ddd4b54d 100644 (file)
@@ -11,6 +11,7 @@ rockchip_setup_interfaces()
        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'
@@ -27,27 +28,6 @@ rockchip_setup_interfaces()
        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"
@@ -61,19 +41,20 @@ rockchip_setup_macs()
                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)
index 852e84a6e4cc2e3979995961525e4adea6d29561..1bdf235da1cdb9909f8d47b97c6e43f93a456233 100644 (file)
@@ -37,7 +37,8 @@ xunlong,orangepi-r1-plus-lts)
        set_interface_core 2 "eth0"
        set_interface_core 4 "eth1" "xhci-hcd:usb[0-9]+"
        ;;
-friendlyarm,nanopi-r4s)
+friendlyarm,nanopi-r4s|\
+friendlyarm,nanopi-r4s-enterprise)
        set_interface_core 10 "eth0"
        set_interface_core 20 "eth1"
        ;;
index 310ab286873d387ed86248f20813a69fa31ecb1d..4c1da55f803ccd567566a54f252ea29ac46818ce 100644 (file)
@@ -55,6 +55,16 @@ define Device/friendlyarm_nanopi-r4s
 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
diff --git a/target/linux/rockchip/patches-6.1/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-6.1/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
deleted file mode 100644 (file)
index 792028b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-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";
- };
index 856970738aaacd501de68bd5ab2db954f04fb448..b3c941821aaaf8a3474772df845acca401ac05fc 100644 (file)
@@ -22,7 +22,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
        status = "okay";
 --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
 +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
-@@ -121,6 +121,11 @@
+@@ -112,6 +112,11 @@
        status = "disabled";
  };