-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Older U-Boots assign RockPI-S and RockS0 their Ethernet MAC based on disk image. #7517
base: main
Are you sure you want to change the base?
Conversation
So, use the same mechanism we've been using to deal with the RockPI-S random WiFi MAC addresses to derive unique, fixed Ethernet MACs as well.
Mainline U-Boot should inject a |
@Kwiboo Interestingly, U-Boot has always been reading the unique RK3308 cpuid# from the board and exporting it to its environment as: (for example) cpuid#=55524b55313830303500000000072353 But the ethaddr and eth1addr vars generated did not incorporate that cpuid# to ensure uniqueness until recently. (not in v2022.04, anyway) u-boot v2024.10 does incorporate this fix, so the user space fix is no longer needed. I'll alter the PR to just add support for the user space fix to the RockS0, but leave it disabled by default. |
…unique CPUid So, disable the userspace derivation of MAC from the CPUid for end0 by default
Would not be a better idea to just backport the fix to older u-boot and completely remove the userland fix? |
Even if one were to backport the recent U-Boot fix, there is still the case of the RockPi-S WiFi being assigned random MACs at each boot. This is a problem common to many network peripherals on low-cost platforms. That said, I'll leave this in draft status because the best "fix" is simply to move to the new u-boot, which fixes the MAC problem (for Ethernet, at least) and a few other outstanding issues. |
I agree the best fix is to move to newer u-boot, which fixes a variety of things among the others. About the wifi, it is a different beast: it depends on the wifi chip, but usually they have a small efuse and they initialize the MAC address by themselves within firmware or driver. I never had difficulties with realtek chips for example, even though I don't know exactly where is the code that assigns the MAC address. Anyway, for sure u-boot has not to deal with wifi MAC address. |
@paolosabatino |
Uses the same mechanism we've been using to deal with the RockPI-S random WiFi MAC addresses to derive unique, fixed Ethernet MACs as well.
Description
Radxa appears to have omitted any hardware to store a unique MAC address on each of their RK3308 based devices. Users have trouble when putting two or more devices running copies of the same image on the same LAN. See:
(https://forum.armbian.com/topic/42663-how-to-change-ethernet-mac-address-on-image/)
@Kwiboo pointed out that U-Boot should handle this.
U-Boot v2024.10 added logic to correctly derive the Ethernet MAC from the SOC's unique CPUid, but older versions lacked this.
So, this PR was altered to disable the userspace fix to the end0 interface by default.
(https://armbian.atlassian.net/jira/software/c/projects/AR/issues/AR-2541
The end result is that this PR makes NO code changes. It merely reorganizes these udev scripts for fixing MAC addresses so they can be applied to all Radxa rk3308 based boards (RockS0 and RockPI-S)
How Has This Been Tested?
Checklist: