rockchip: make NIC name predictable for Radxa E52C/ROCK 5 ITX/ROCK 5T
authorFUKAUMI Naoki <[email protected]>
Fri, 31 Oct 2025 12:14:48 +0000 (12:14 +0000)
committerHauke Mehrtens <[email protected]>
Sun, 9 Nov 2025 20:56:13 +0000 (21:56 +0100)
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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20608
Signed-off-by: Hauke Mehrtens <[email protected]>
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/image/armv8.mk

index 92b50453614075d8f29d46de394dd03a7b9892ab..cb7b7f5ec8bde3ec21d823c2e87e3d31619f2924 100644 (file)
@@ -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
index bda17f9041739878ff96c36142dd2c177d9f8ad7..d6d8f4b0bbb925f00ec97718a0670d76f0cb45aa 100644 (file)
@@ -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'
                ;;
index 7dccab12169196a834169e5ee46204f8e5032171..e94ea47c2c3f87edd8460ccc5429aa1a9092e9fd 100644 (file)
@@ -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