cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bhuang2
Visitor
Visitor
5,036 Views
Registered: ‎08-02-2008

How to read local MAC address from eeprom for ethernet device during booting the kernel?

Hi everyone, 

 

In the past, the *ppc* linux had a piece of code in its simple bootloader to retrieve local MAC address from  eeprom.  When the community migrate to *powerpc* linux, it seems that we can only 

 

a) hard-code a MAC address in the device tree file in advance

b) use i2c eeprom interface at user space after booting into the kernel

 

for accessing MAC address.

 

In my situation, I have tens of FPGA boards running in parallel. It makes the first approach very inconvenient to me because I don't want to hard-code every MAC address for all of the boards. However, since each FPGA board use NFS rather than Ramdisk for its own run-time environment (believe or not, its size is larger than a 512MB DDR2 can host), I need to retrieve local MAC address for ethernet device before the kernel send DHCP requests to the server. 

 

I spent last few days playing around with u-boot. I thought it would pass the local MAC address to the kernel but it didn't. Every time when the kernel boots up, the hard-code MAC address in dtb file just overwrite the local MAC address. Am I wrong here? Any idea?

 

Thanks.

 

Ben

 

0 Kudos
2 Replies
bhuang2
Visitor
Visitor
5,013 Views
Registered: ‎08-02-2008

I am able to pass MAC address from u-boot to the kernel now. Thank you.

0 Kudos
4,976 Views
Registered: ‎10-05-2010

Hello bhuang,

how did you do that? I wanted to pass the cmdline arguments of the kernel via uboot but it also always took the hardcoded cmdlin from the dts file.

Can you give me any hints?

Thanks,

Marco

0 Kudos