It does not need any extra gpio lines in the .dts file.
Adding the wp-gpio lines actually causes the at24 module to fail to load because it notices the conflict with the green led driver.
you can write a mac-adress there for ethernet and wifi as imho these are not fixed, but not sure if they can be read via dts linking or changed from userspace afterwards
Regarding MAC addresses.
I have seen on other platforms two different methods used, so I expect they are both already in the kernel source code:
On ARM platforms:
stored in uboot env variables, then uboot passes them in the command line. uboot can also use these for net-boot. This is quite a good solution as it can be both used by uboot and edited by the user if needed. I think uboot can also insert these from the env into the device tree.
stored in the device tree.
On X86:
Stored in the ethernet device hardware
Stored in the BIOS
I don’t see any harm in adding the eeprom as an option for a source of MAC addresses.
We could read MAC addresses from eeprom in uboot, and modify dtb that uboot passes to Linux. This doesn’t need uboot to have driver for the ethernet MAC.
as u-boot does not see the dsa-ports the only (and maybe the easiest) way will be mapping a mac-adress-property there, but would be better to have phandle to eeprom-subnode
We need to write a driver for handling mac address inside the eeprom if we want to do in in linux rather than uboot. I don’t think upstream would accept it.
local-mac-address is not in the dtb file, it must get injected into the device tree by uboot.
It uses the single mac address it finds, and then just adds one to the last digit for any other ethernet interfaces it needs.
Looking at the kernel source code. It can get the MAC address from two locations:
device-tree
nvram
If we wish to get it from nvram, we probably need to have the nvram calls read the eeprom
In which case, the variables stored in nvram are of the string form "mac-address= … "
One would have to check the kernel source code to check exactly what format the MAC address is expected to be.
So, in summary, so long as we store the MAC address in a format that the existing Linux kernel source code expects, we should not need to upstream anything.
but that requires changes to the Linux kernel source code for a mediatek specific method of setting MAC addresses. Upstream will probably reject it, in favor of a more generic method of setting MAC address. I.e. the methods already available in the upstream linux kernel source code.
I think we could get the upstream method of reading the MAC address from NVRAM to work on the BPI-R4, and thus no need any upstream changes. It would just be a matter of formatting the MAC address correctly and putting it where the upstream kernel expects to see it.
No, local-mac-address could be coded in original dts as a default address. And mac-address would override that and should be injected to dtb by bootloader.