How to set a MAC address when using U-Boot with CONFIG_CMD_NET=n

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

How to set a MAC address when using U-Boot with CONFIG_CMD_NET=n

ソリューションへジャンプ
10,000件の閲覧回数
jiriluznicky
Contributor III

Hello,

is there any recommended way, how to set MAC address for FEC on iMX6UL when networking is disabled in U-Boot? We have MAC address burned in fuses. When U-Boot is compiled with networking support ethaddr is set as environment value, and propagated to kernel correctly.

When networking support is disabled, MAC address is not set. We got this error:

fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00

I thought, that MAC address fuses are read by kernel driver, but obviously not. Or is there something missing in dts file?

Edit:

there is a piece of code in fec_main.c in function fec_get_mac, which obviously should do it.

Thanks for any info

Jiri

ラベル(1)
1 解決策
7,542件の閲覧回数
igorpadykov
NXP Employee
NXP Employee
0 件の賞賛
返信
6 返答(返信)
7,540件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Jiri

one can try suggestion provided in sect.43.3.2 Getting a MAC Address

attached Linux Manual

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
7,540件の閲覧回数
jiriluznicky
Contributor III

Hi,

the section 45.3.2 Getting a MAC Address in Linux Manual is only described what function fec_get_mac in Ethernet driver do. So, there is nothing more to try. There are four options. Three options which work (kernel cmd line, dts file, MAC set by bootloader) and one which doesn't (OCOTP alias Fuses).

To be more specific. In function fec_get_mac is following code (line 1637):

        /*

         * 3) from flash or fuse (via platform data)

         */

               ...

                if (pdata)

                        iap = (unsigned char *)&pdata->mac;

The question is, who set pdata->mac earlier.

0 件の賞賛
返信
7,540件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

one can check linux/..arm/mach-imx/common.c

0 件の賞賛
返信
7,540件の閲覧回数
jiriluznicky
Contributor III

Honestly, I would by very surprised (and happy) if someone shows me the exact location when the read of OCOTP_MAC is done in kernel code.

0 件の賞賛
返信
7,540件の閲覧回数
jiriluznicky
Contributor III

In linux-4.6.2 to be more specific. Or is it present only in old 3.14 from BSP.

0 件の賞賛
返信
7,543件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

linux-4.6.2 is not supported, please try official nxp bsps from i.MX6 product page

http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-process...

0 件の賞賛
返信