How can I get a mac address from serial EEPROM on PetaLinux?
Run the below command and then select the following:
---> Subsystem AUTO Hardware Settings --> Ethernet Settings --> Ethernet MAC address
Set the MAC address of the primary Ethernet.
Note: If the MAC address is programmed into EEPROM, keep this empty.
Use one of the two methods below to program the MAC address to EEPROM:
In previous versions of the SCUI (earlier than 2016.4), it was possible to set the MAC Address in the SCUI GUI.
However, from the 2017.1 release on, that option no longer exists, and you can only get the MAC Address from the board.
However, you can manually take it back by adding the following section to config.json (rdf0382-zcu102-system-controller-es2-2017-2.zip) , saving the config.json, and relaunching the SCUI.
The modified file is attached to this Answer Record.
2) Writing EEPROM Using I2C Commands over U-Boot
In U-Boot the Ethernet MAC address is configured as an environment variable.
The MAC address environment variable can be changed from the U-Boot console and then saved into the bootenv Flash partition using the saveenv command.
However this method only saves the MAC address to QSPI flash partition, not EEPROM.
As a result, you will need to Write EEPROM Using I2C Commands.
Before writing, you need to know the address of EEPROM.
Below is the mac address information of EEPROM defined in u-boot for a ZCU102 board.
Use this information to update the MAC address to EEPROM with the i2c command:
Then reboot the u-boot.
In the boot log, you can confirm that the EEPROM is updated:
|Name||File Size||File Type|
|Boards & Kits||