public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] ethernet: ROM MAC address vs env variable MAC address
Date: Thu, 9 Nov 2017 11:14:24 +0100	[thread overview]
Message-ID: <20171109111424.37bd74d2@jawa> (raw)
In-Reply-To: <HE1PR04MB12410876E4BA09FC9CD7800C97560@HE1PR04MB1241.eurprd04.prod.outlook.com>

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>

  reply	other threads:[~2017-11-09 10:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 12:02 [U-Boot] ethernet: ROM MAC address vs env variable MAC address Prabhakar Kushwaha
2017-11-09 10:14 ` Lukasz Majewski [this message]
2017-11-13 19:49 ` Wolfgang Denk
2017-11-14  9:31   ` Mike Looijmans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171109111424.37bd74d2@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox