Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20638 Discussions

MAC Address changes on reboot

Altera_Forum
Honored Contributor II
6,743 Views

I've noticed that each time I reboot or power cycle the SoC, it appears to have a different MAC address. I thought that the MAC address should be fixed for a device and was not reprogrammable. On further investigation, it appears the EMAC register map has 128 MAC address registers. Does linux build use these? Is there actually a hard coded address in the MAC or does it require an external MAC address EEPROM to read from? 

 

I'm using yocto project linux version 3.9.0, is there a known issue with reading the MAC address? Or is the MAC address supposed to be programmed by software each boot-up?
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
3,405 Views

Look at the kernel log. 

The kernel is probably assigning a random value because the hardware isn't supplying one. 

The MAC address has to come from an EEPROM somewhere.
0 Kudos
Altera_Forum
Honored Contributor II
3,405 Views

Ah yes, "Warning: failed to set MAC address" in U-boot log,  

 

I had wrongly assumed that a MAC address was hard coded internal to the device, I had not noticed until now that it was a random number.
0 Kudos
Altera_Forum
Honored Contributor II
3,405 Views

Ok, I've got a MAC address SPI EEPROM on the SPIM0 interface on the HPS and SPIM0 is configured as an SPI interface in QSYS. 

 

Where does u-boot expect to read the MAC address from? Can anyone point me to the u-boot source code for this?
0 Kudos
Altera_Forum
Honored Contributor II
3,405 Views

If you're using Linux on the SoC, one way to force a constant MAC address is to edit /etc/network/interfaces to include something like: 

 

auto eth0 iface eth0 inet dhcp hwaddress ether 00:11:22:33:44:55
Altera_Forum
Honored Contributor II
3,405 Views

This topic is a little bit old, but it is difficult to find answer to this question. Changing /etc/network/interfaces don't work on Angstrom Linux (provided by Terasic).  

To permanently set MAC address, you need to abort booting procedure by pressing any key (which will give you access to U-Boot) and then type: 

setenv ethaddr 00:11:22:33:44:55 saveenv 

 

I hope this will help people looking for answer. 

 

Best regards, 

Kamil Panek
0 Kudos
Altera_Forum
Honored Contributor II
3,405 Views

 

--- Quote Start ---  

This topic is a little bit old, but it is difficult to find answer to this question. Changing /etc/network/interfaces don't work on Angstrom Linux (provided by Terasic).  

To permanently set MAC address, you need to abort booting procedure by pressing any key (which will give you access to U-Boot) and then type: 

setenv ethaddr 00:11:22:33:44:55 saveenv 

 

I hope this will help people looking for answer. 

 

Best regards, 

Kamil Panek 

--- Quote End ---  

 

 

I am also seeing the problem where my MAC address is randomized on reboot. I have tried setting the ethaddr in the uboot environment, but it appears this variable is not being passed to the llinux kernel. The ethaddr variable in the uboot environment remains the same after each reboot, but the MAC address assigned to this interface by linux is random. We are running Angstrom v2014.12 on the Arria 10 SoC. We are using the reference design from rocketboards. Do you have any idea why this is happening?
0 Kudos
Altera_Forum
Honored Contributor II
3,405 Views

 

--- Quote Start ---  

I am also seeing the problem where my MAC address is randomized on reboot. I have tried setting the ethaddr in the uboot environment, but it appears this variable is not being passed to the llinux kernel. The ethaddr variable in the uboot environment remains the same after each reboot, but the MAC address assigned to this interface by linux is random. We are running Angstrom v2014.12 on the Arria 10 SoC. We are using the reference design from rocketboards. Do you have any idea why this is happening? 

--- Quote End ---  

 

 

I have found that setting the local-mac-address in the .dts file has set the mac address correctly. For some reason Angstrom does not seem to read/use variables from uboot at all.
JPete49
Beginner
3,405 Views

Probably shooting in the dark on such an old thread, but was there any solution to this issue that didn't involve changes to the .dts file and having to rebuild the device tree? Trying to use the default Terasic Angstrom distro on a DE10-Standard.

0 Kudos
Reply