summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUKAUMI Naoki2025-10-31 12:14:48 +0000
committerHauke Mehrtens2025-11-09 20:56:13 +0000
commit1f1db7543220b70610782bdaa56050466094c14a (patch)
treeba262e7097e67cfad7277e187b722ac712795af6
parentb33df7ba330c7482916e5c761e28a8eb726b10f6 (diff)
downloadopenwrt-1f1db7543220b70610782bdaa56050466094c14a.tar.gz
rockchip: make NIC name predictable for Radxa E52C/ROCK 5 ITX/ROCK 5T
The probe order for PCIe buses and devices is non-deterministic, making the names eth0 and eth1 unpredictable (they may be swapped). This patch fixes the names by referencing the device path using `ucidef_set_network_device_path`. The mapping between silkscreen labels on the board/case and OpenWrt interface names is as follows: - E52C LAN: lan WAN: wan - ROCK 5 ITX RJ45 1: eth0 RJ45 2: eth1 - ROCK 5T RJ45_1: eth0 RJ45_2: eth1 For Radxa E52C, this breaks compatibility of the network config; therefore, set DEVICE_COMPAT_VERSION to `1.1`. Fixes: d16d2765bd ("rockchip: add support for Radxa E52C") Fixes: 0839345211 ("rockchip: add support for Radxa ROCK 5 ITX/ITX+") Fixes: 4a78af9876 ("rockchip: add support for Radxa ROCK 5T") Link: https://github.com/openwrt/openwrt/issues/20202 Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> Link: https://github.com/openwrt/openwrt/pull/20608 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/rockchip/armv8/base-files/etc/board.d/01_leds5
-rw-r--r--target/linux/rockchip/armv8/base-files/etc/board.d/02_network20
-rw-r--r--target/linux/rockchip/image/armv8.mk2
3 files changed, 22 insertions, 5 deletions
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
index 92b5045361..cb7b7f5ec8 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
@@ -15,7 +15,6 @@ friendlyarm,nanopi-r3s|\
friendlyarm,nanopi-r4s|\
friendlyarm,nanopi-r4s-enterprise|\
friendlyarm,nanopi-r6c|\
-radxa,e52c|\
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
@@ -40,6 +39,10 @@ friendlyarm,nanopi-r76s)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
;;
+radxa,e52c)
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
+ ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan"
+ ;;
esac
board_config_flush
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
index bda17f9041..d6d8f4b0bb 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
@@ -15,7 +15,6 @@ rockchip_setup_interfaces()
friendlyarm,nanopi-r4s|\
friendlyarm,nanopi-r4s-enterprise|\
friendlyarm,nanopi-r6c|\
- radxa,e52c|\
radxa,rockpi-e|\
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)
@@ -26,9 +25,7 @@ rockchip_setup_interfaces()
friendlyarm,nanopi-r76s|\
lunzn,fastrhino-r66s|\
radxa,e25|\
- radxa,rock-3b|\
- radxa,rock-5-itx|\
- radxa,rock-5t)
+ radxa,rock-3b)
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
;;
friendlyarm,nanopi-r5s)
@@ -37,6 +34,21 @@ rockchip_setup_interfaces()
friendlyarm,nanopi-r6s)
ucidef_set_interfaces_lan_wan 'eth0 eth2' 'eth1'
;;
+ radxa,e52c)
+ ucidef_set_network_device_path 'wan' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
+ ucidef_set_network_device_path 'lan' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
+ ucidef_set_interfaces_lan_wan 'lan' 'wan'
+ ;;
+ radxa,rock-5-itx)
+ ucidef_set_network_device_path 'eth0' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
+ ucidef_set_network_device_path 'eth1' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
+ ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
+ ;;
+ radxa,rock-5t)
+ ucidef_set_network_device_path 'eth1' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
+ ucidef_set_network_device_path 'eth0' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
+ ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
+ ;;
sinovoip,rk3568-bpi-r2pro)
ucidef_set_interfaces_lan_wan 'lan0 lan1 lan2 lan3' 'eth0'
;;
diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
index 7dccab1216..e94ea47c2c 100644
--- a/target/linux/rockchip/image/armv8.mk
+++ b/target/linux/rockchip/image/armv8.mk
@@ -225,6 +225,8 @@ define Device/radxa_e52c
UBOOT_DEVICE_NAME := generic-rk3588
DEVICE_DTS := rk3582-radxa-e52c
DEVICE_PACKAGES := blkdiscard kmod-r8169
+ DEVICE_COMPAT_VERSION := 1.1
+ DEVICE_COMPAT_MESSAGE := Network interface names have been changed
endef
TARGET_DEVICES += radxa_e52c