We are using an i.MX287 and currently running maintain kernel 2.6.35.3
Currently, 32 bits of MAC address is set by OTP bits. This is working for us. We can set fuses and these 32 bits will be detected and set properly.
However, first 8 bits which is part of vendor ID is always "00:04". How can we change this in the kernel/driver so that these bits are configurable?
We are only using one Ethernet interface (eth0) on this chip
Thanks!
已解决! 转到解答。
For reference, the MAC address is set by mx28_init_fec() init function in arch/arm/mach-mx28/device.c
mac[0] and mac[1] are hard coded here into the fec platform data structure, and the other 4 bytes are set by the OTP registers.
My solution will be to read both OTP registers 0-1 and use both of them to set the entire 48 bit mac address. This will give maximum flexibility in addressing our units.
Originally OTP register 0 was for eth0 and OTP register 1 for eth1 since the imx28 has two Ethernet interfaces. Our hardware platform has removed eth1, so we will use both registers for the MAC
Thanks
Jason
Hi Jason
one can try to set in uboot:
U-Boot> setenv ethaddr 00:04:9F:00:EA:D7
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you. I agree this may be the best solution.
Right now, uboot does not set MAC address bootarg for kernel. One option is patching uboot to take the full MAC address from the first two words of OTP bits and send to the kernel.
I would still like any information, if possible, on how we can do this in the kernel without changes to uboot. The first 2 bytes of the MAC are being set somehow when the kernel boots, since ethaddr bootarg is not being set by uboot.
For reference, the MAC address is set by mx28_init_fec() init function in arch/arm/mach-mx28/device.c
mac[0] and mac[1] are hard coded here into the fec platform data structure, and the other 4 bytes are set by the OTP registers.
My solution will be to read both OTP registers 0-1 and use both of them to set the entire 48 bit mac address. This will give maximum flexibility in addressing our units.
Originally OTP register 0 was for eth0 and OTP register 1 for eth1 since the imx28 has two Ethernet interfaces. Our hardware platform has removed eth1, so we will use both registers for the MAC
Thanks
Jason