[U-Boot] ethernet: ROM MAC address vs env variable MAC address

Lukasz Majewski lukma at denx.de
Thu Nov 9 10:14:24 UTC 2017


Hi Prabhakar,

> Hi All, 
> 
> I am seeing following type of code for MAC address write for a
> network device.
> 
> net/eth-uclass.c  eth_post_probe()   or net/eth_legacy.c
> eth_write_hwaddr()
> 
> 	eth_env_get_enetaddr_by_index("eth", dev->seq, env_enetaddr);
> 	if (!is_zero_ethaddr(env_enetaddr)) {
> 		if (!is_zero_ethaddr(pdata->enetaddr) &&
> 		    memcmp(pdata->enetaddr, env_enetaddr, ARP_HLEN)) {
> 			printf("\nWarning: %s MAC addresses don't
> match:\n", dev->name);
> 			printf("Address in ROM is          %pM\n",
> 			       pdata->enetaddr);
> 			printf("Address in environment is  %pM\n",
> 			       env_enetaddr);
> 		}
> 
> 		/* Override the ROM MAC address */
> 		memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN);
> 
> Why ROM MAC address getting overwritten by environment env MAC
> address. MAC address is something unique and assigned to a particular
> device. So one should never change its MAC address.
> 

It may happen that company which uses NXP processor wants to use their
own set of MAC addresses.

> Please suggest. 
> 
> Regards,
> Prabhakar
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171109/28cb3e2f/attachment.sig>


More information about the U-Boot mailing list