Page 1 of 1

setting mac address through device tree

Posted: Fri Jan 26, 2018 4:22 pm
by sandy56
I am trying to set the ethernet mac address through the device tree. I tried adding

Code: Select all

 local-mac-address = [01 02 03 04 05 06];
to the [email protected] node in the .dts file and compiled it. But on rebooting I find that the mac-address is still in its default address. Does anyone know how to set the mac-address to the device tree?

Re: setting mac address through device tree

Posted: Fri Jan 26, 2018 4:31 pm
by PhilE
You've got two options:
1. Set the "mac-address" property in the same location as the "local-mac-address" property is found in the .dtb. The firmware overwrites "local-mac-address" but leaves "mac-address" (which is checked first) free in case the .dtb wants to override it.
2. Use the "force_mac_address=aa:bb:cc:dd:ee:ff" config.txt setting, which overrides the normal serial-number-derived value for "local-mac-address".