AnsweredAssumed Answered

iMX6 Dual Plus SET OTP value for FEC MAC Address not working

Question asked by sijil cv on Sep 28, 2016
Latest reply on Sep 28, 2016 by igorpadykov

Hi,

 

I’m facing issues while setting MAC address for  iMX6 Dual plus based custom board. I have tried flashing the following OTP registers. The OTP flashing was successful but the board doesn't pick up the flashed mac address, its always going to the random MAC.

 

Say for eg the MAC address to be set is 00:23:a1:47:1b:80

 

echo 0x00000023 >/sys/fsl_otp/HW_OCOTP_MAC1

echo 0xa1471b80 >/sys/fsl_otp/HW_OCOTP_MAC0

 

Could you please verify the above commands. Is there anything wrong with the byte order ?

Is there any specific details to be added to Ethernet  node in device tree?

 

fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 0e:88:a4:78:c2:7c

 

 

In the u-boot the following error messages comes up "Error: FEC address not set."

Is there anything to be done in the u-boot level itself ?

 

I have gone through the imx6 fec driver code. its given as it will fetch from otp as 3rd level. But I'm not sure how the platform data ( pdata->mac) is populated with otp read MAC address.

 

/*
* 3) from flash or fuse (via platform data)
*/
if (!is_valid_ether_addr(iap)) {
#ifdef CONFIG_M5272
if (FEC_FLASHMAC)
iap = (unsigned char *)FEC_FLASHMAC;
#else
if (pdata)
iap = (unsigned char *)&pdata->mac;
#endif
}

 

kernel version: 4.1.15-6QuadPlus+ga4d2a08

 

When I tried to set mac address as kernel parameter it works perfectly.   “fec.macaddr=0x00,0x22,0xa0,0x47,0x1b,0x80”

 

Could you please help me to resolve this issue. I need MAC address to be placed in OTP.

 

Outcomes