diff --git a/config/boards/rock-s0.conf b/config/boards/rock-s0.conf index c344cc05cb68..e42490a068a4 100644 --- a/config/boards/rock-s0.conf +++ b/config/boards/rock-s0.conf @@ -5,12 +5,12 @@ BOARD_NAME="Rock S0" BOARDFAMILY=rockchip64 BOARD_MAINTAINER=brentr -BOOTCONFIG=rock-s0-rk3308_defconfig -BOOT_FDT_FILE=rockchip/rk3308-rock-s0.dtb - KERNEL_TARGET=current,edge KERNEL_TEST_TARGET=current +BOOTCONFIG=rock-s0-rk3308_defconfig +BOOT_FDT_FILE=rockchip/rk3308-rock-s0.dtb + DEFAULT_CONSOLE=serial SERIALCON=ttyS0 MODULES_BLACKLIST="rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi gpu_sched lima hantro_vpu panfrost" @@ -28,5 +28,13 @@ function post_family_config__rocks0() { declare -g BOOTDIR="u-boot-${BOARD}" declare -g BOOTSCRIPT=boot-rockchip64-ttyS0.cmd:boot.cmd - unset family_tweaks_bsp # disable from rockchip64_common + family_tweaks_bsp() { #overrides rockchip64_common.inc + #Rock S0's Ethernet MAC appears to be derived from rootfs image + #Install udev script to assign its MAC based on SOC's unique serial number + bsp=$SRC/packages/bsp/radxa3308 + rules=etc/udev/rules.d + + install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev && + install -m 644 $bsp/$rules/05-rocks0-MACaddress.rules $destination/$rules + } } diff --git a/config/boards/rockpi-s.conf b/config/boards/rockpi-s.conf index 7344c9883d0c..d1362fc06130 100644 --- a/config/boards/rockpi-s.conf +++ b/config/boards/rockpi-s.conf @@ -5,12 +5,12 @@ BOARD_NAME="Rockpi S" BOARDFAMILY=rockchip64 BOARD_MAINTAINER=brentr -BOOTCONFIG=rock-pi-s-rk3308_defconfig -BOOT_FDT_FILE=rockchip/rk3308-rock-pi-s.dtb - KERNEL_TARGET=current,edge KERNEL_TEST_TARGET=current +BOOTCONFIG=rock-pi-s-rk3308_defconfig +BOOT_FDT_FILE=rockchip/rk3308-rock-pi-s.dtb + DEFAULT_CONSOLE=serial SERIALCON=ttyS0 MODULES_BLACKLIST="rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi gpu_sched lima hantro_vpu panfrost" @@ -31,11 +31,11 @@ function post_family_config__rockpis() { family_tweaks_bsp() { #overrides rockchip64_common.inc #Install udev script that derives fixed, unique MAC addresses for net interfaces #that are assigned random ones -- like RockPI-S's WiFi network interfaces - bsp=$SRC/packages/bsp/rockpis + bsp=$SRC/packages/bsp/radxa3308 rules=etc/udev/rules.d install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev && - install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules + install -m 644 $bsp/$rules/05-rockpis-MACaddress.rules $destination/$rules } } diff --git a/packages/bsp/radxa3308/etc/udev/rules.d/05-rockpis-MACaddress.rules b/packages/bsp/radxa3308/etc/udev/rules.d/05-rockpis-MACaddress.rules new file mode 100644 index 000000000000..498280b5535d --- /dev/null +++ b/packages/bsp/radxa3308/etc/udev/rules.d/05-rockpis-MACaddress.rules @@ -0,0 +1,14 @@ +#If a network interface is being assigned a different MAC on each boot, or the +#MAC address is based on the disk image, rather than being unique to hardware, +#enable the corresponding line below to derive that interface's MAC from +#the RK3308 SOC's unique serial number. +#All the two digit hex code prefixes passed to fixEtherAddr should be unique +#and chosen such that (n-2)%4 == 0 + +#Otherwise, the RockPI-S wifi chip MACs will be different on each boot +KERNEL=="wlan0", ACTION=="add" RUN+="fixEtherAddr %k 0a" +KERNEL=="p2p0", ACTION=="add" RUN+="fixEtherAddr %k 0e" + +#v2024.10 u-boot derives built-in ethernet MAC for RockPI-S from the CPUid +#so, the fix for interface end0 should no longer be needed +#KERNEL=="end0", ACTION=="add" RUN+="fixEtherAddr %k 06" diff --git a/packages/bsp/radxa3308/etc/udev/rules.d/05-rocks0-MACaddress.rules b/packages/bsp/radxa3308/etc/udev/rules.d/05-rocks0-MACaddress.rules new file mode 100644 index 000000000000..889f96fbc389 --- /dev/null +++ b/packages/bsp/radxa3308/etc/udev/rules.d/05-rocks0-MACaddress.rules @@ -0,0 +1,10 @@ +#If a network interface is being assigned a different MAC on each boot, or the +#MAC address is based on the disk image, rather than being unique to hardware, +#enable the corresponding line below to derive that interface's MAC from +#the RK3308 SOC's unique serial number. +#All the two digit hex code prefixes passed to fixEtherAddr should be unique +#and chosen such that (n-2)%4 == 0 + +#In v2024.10 u-boot, RockS0's built-in ethernet MAC is derived from the CPUid +#so, the fix for interface end0 should no longer be needed +#KERNEL=="end0", ACTION=="add" RUN+="fixEtherAddr %k 06" diff --git a/packages/bsp/rockpis/lib/udev/fixEtherAddr b/packages/bsp/radxa3308/lib/udev/fixEtherAddr similarity index 100% rename from packages/bsp/rockpis/lib/udev/fixEtherAddr rename to packages/bsp/radxa3308/lib/udev/fixEtherAddr diff --git a/packages/bsp/rockpis/etc/udev/rules.d/05-fixMACaddress.rules b/packages/bsp/rockpis/etc/udev/rules.d/05-fixMACaddress.rules deleted file mode 100644 index 87a948aa9779..000000000000 --- a/packages/bsp/rockpis/etc/udev/rules.d/05-fixMACaddress.rules +++ /dev/null @@ -1,6 +0,0 @@ -#If a network interface is being assigned a new, different address on each boot, -#enable the corresponding line below to derive its MAC addr from UUID of rootfs -#Beware that all the two digit hex code prefixes below must be unique! - -KERNEL=="wlan0", ACTION=="add" RUN+="fixEtherAddr %k 0a" -KERNEL=="p2p0", ACTION=="add" RUN+="fixEtherAddr %k 0e"