How do I set first 2 bytes of i.MX28 MAC address?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How do I set first 2 bytes of i.MX28 MAC address?

ソリューションへジャンプ
1,601件の閲覧回数
jkuz
Contributor II

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!

ラベル(3)
タグ(2)
1 解決策
1,310件の閲覧回数
jkuz
Contributor II

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

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,310件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

1,310件の閲覧回数
jkuz
Contributor II

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. 

0 件の賞賛
返信
1,310件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

one can look in linux/drivers/net/fec.c

~igor

0 件の賞賛
返信
1,311件の閲覧回数
jkuz
Contributor II

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

0 件の賞賛
返信