Skip to content

Commit 1f1db75

Browse files
RadxaNaokihauke
authored andcommitted
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: d16d276 ("rockchip: add support for Radxa E52C") Fixes: 0839345 ("rockchip: add support for Radxa ROCK 5 ITX/ITX+") Fixes: 4a78af9 ("rockchip: add support for Radxa ROCK 5T") Link: openwrt/openwrt#20202 Signed-off-by: FUKAUMI Naoki <[email protected]> Link: openwrt/openwrt#20608 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent b33df7b commit 1f1db75

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

target/linux/rockchip/armv8/base-files/etc/board.d/01_leds

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ friendlyarm,nanopi-r3s|\
1515
friendlyarm,nanopi-r4s|\
1616
friendlyarm,nanopi-r4s-enterprise|\
1717
friendlyarm,nanopi-r6c|\
18-
radxa,e52c|\
1918
xunlong,orangepi-r1-plus|\
2019
xunlong,orangepi-r1-plus-lts)
2120
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
@@ -40,6 +39,10 @@ friendlyarm,nanopi-r76s)
4039
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
4140
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
4241
;;
42+
radxa,e52c)
43+
ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
44+
ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan"
45+
;;
4346
esac
4447

4548
board_config_flush

target/linux/rockchip/armv8/base-files/etc/board.d/02_network

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ rockchip_setup_interfaces()
1515
friendlyarm,nanopi-r4s|\
1616
friendlyarm,nanopi-r4s-enterprise|\
1717
friendlyarm,nanopi-r6c|\
18-
radxa,e52c|\
1918
radxa,rockpi-e|\
2019
xunlong,orangepi-r1-plus|\
2120
xunlong,orangepi-r1-plus-lts)
@@ -26,9 +25,7 @@ rockchip_setup_interfaces()
2625
friendlyarm,nanopi-r76s|\
2726
lunzn,fastrhino-r66s|\
2827
radxa,e25|\
29-
radxa,rock-3b|\
30-
radxa,rock-5-itx|\
31-
radxa,rock-5t)
28+
radxa,rock-3b)
3229
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
3330
;;
3431
friendlyarm,nanopi-r5s)
@@ -37,6 +34,21 @@ rockchip_setup_interfaces()
3734
friendlyarm,nanopi-r6s)
3835
ucidef_set_interfaces_lan_wan 'eth0 eth2' 'eth1'
3936
;;
37+
radxa,e52c)
38+
ucidef_set_network_device_path 'wan' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
39+
ucidef_set_network_device_path 'lan' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
40+
ucidef_set_interfaces_lan_wan 'lan' 'wan'
41+
;;
42+
radxa,rock-5-itx)
43+
ucidef_set_network_device_path 'eth0' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
44+
ucidef_set_network_device_path 'eth1' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
45+
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
46+
;;
47+
radxa,rock-5t)
48+
ucidef_set_network_device_path 'eth1' 'platform/a40c00000.pcie/pci0003:30/0003:30:00.0/0003:31:00.0'
49+
ucidef_set_network_device_path 'eth0' 'platform/a41000000.pcie/pci0004:40/0004:40:00.0/0004:41:00.0'
50+
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
51+
;;
4052
sinovoip,rk3568-bpi-r2pro)
4153
ucidef_set_interfaces_lan_wan 'lan0 lan1 lan2 lan3' 'eth0'
4254
;;

target/linux/rockchip/image/armv8.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ define Device/radxa_e52c
225225
UBOOT_DEVICE_NAME := generic-rk3588
226226
DEVICE_DTS := rk3582-radxa-e52c
227227
DEVICE_PACKAGES := blkdiscard kmod-r8169
228+
DEVICE_COMPAT_VERSION := 1.1
229+
DEVICE_COMPAT_MESSAGE := Network interface names have been changed
228230
endef
229231
TARGET_DEVICES += radxa_e52c
230232

0 commit comments

Comments
 (0)