MAC Address
Factory MAC Address
Each board leaves the factory with a unique Ethernet MAC address stored in the
U-Boot environment as the ethaddr variable.
Flashing an image overwrites the U-Boot environment, so the factory MAC address is lost. After flashing, the board uses the MAC address programmed in the SoC OTP memory. If the OTP memory is blank, a random MAC address is generated at every boot.
Before flashing the board for the first time, write down the factory MAC address. Use one of the following methods:
-
In the U-Boot console (stop autoboot over the Serial Connection):
U-Boot consoleprintenv ethaddr -
In Linux:
Linux shell on the boardcat /sys/class/net/eth0/address
Program the MAC Address to OTP
To keep the same MAC address regardless of the flashed image, program it to the SoC OTP (one-time programmable) memory. U-Boot reads it from OTP at every boot and passes it to Linux in the device tree.
Programming OTP memory is irreversible. The MAC address can be programmed only once and cannot be changed or erased afterwards. Double-check the address before burning it.
Use the factory MAC address recorded earlier, an address from an OUI range
assigned to your organization, or a locally administered address (second
least significant bit of the first byte set, e.g. 02:xx:xx:xx:xx:xx).
To open the U-Boot console, connect to the board as described in the Serial Connection section and press any key during boot to stop autoboot.
On the SL2619, the MAC address is stored in two dedicated OTP fields and
programmed with the U-Boot otpwrite command:
| Field | Content | Example (3a:92:e5:1b:2c:f3) |
|---|---|---|
577 | MAC address bytes 2 to 5 | 0xe51b2cf3 |
578 | MAC address bytes 0 and 1 | 0x00003a92 |
Reading the MAC address from OTP requires an image with U-Boot from Synaptics SDK v2.6.0 or newer.
Check the OTP Fields
Make sure that both fields are blank:
otpread 577
otpread 578
Expected output:
read otp[577] data=0x00000000
read otp[578] data=0x00000000
Burn the MAC Address
Write both fields with the 0xFFFFFFFF mask. For example, for MAC address
3a:92:e5:1b:2c:f3:
otpwrite 577 0xe51b2cf3 0xFFFFFFFF
otpwrite 578 0x00003a92 0xFFFFFFFF
Verify the MAC Address
Read the fields back:
otpread 577
otpread 578
Expected output:
read otp[577] data=0xe51b2cf3
read otp[578] data=0x00003a92
Reset the board, stop autoboot again, and check the address used by U-Boot:
reset
net_init
printenv ethaddr
Expected output:
ethaddr=3a:92:e5:1b:2c:f3
In Linux, the address is assigned to the eth0 interface:
cat /sys/class/net/eth0/address
The address stays the same after every reboot and after flashing a new image.