[U-Boot] u-boot soft and hard ethernet addresses

Duncan Hare dh at synoia.com
Wed Nov 15 23:19:11 UTC 2017


Date: Tue, 14 Nov 2017 10:31:56 +0100
From: Mike Looijmans <mike.looijmans at topic.nl>
To: Wolfgang Denk <wd at denx.de>, Prabhakar Kushwaha
    <prabhakar.kushwaha at nxp.com>
Cc: "u-boot at lists.denx.de" <u-boot at lists.denx.de>,
    "joe.hershberger at ni.com" <joe.hershberger at ni.com>
Subject: Re: [U-Boot] ethernet: ROM MAC address vs env variable MAC
    address
Message-ID: <45c912c9-ce5a-4ee0-326a-e1dadce04b65 at topic.nl>
Content-Type: text/plain; charset="utf-8"; format=flowed

On 13-11-17 20:49, Wolfgang Denk wrote:
> Dear Prabhakar,
> 
> In message <HE1PR04MB12410876E4BA09FC9CD7800C97560 at HE1PR04MB1241.eurprd04.prod.outlook.com> you wrote:
>>
>> Why ROM MAC address getting overwritten by environment env MAC address.
> 
> Because in U-Boot we give the user the freedom to do what he
> needs/wants to do.  Usually the environment value gets initialized
> from the value in the ROM, so there is no difference anyway. But if
> the user wants a specific setting, he can change it.
> 
>> MAC address is something unique and assigned to a particular device. So one should never change its MAC address.
> 
> U-Boot follows good old UNIX style here:
> 
> "UNIX was not designed to stop you from doing stupid things,  because
> that would also stop you from doing clever things."      - Doug Gwyn

Many board manufacturers "assign" this unique MAC address by printing it on a 
sticker and sticking that on the board somewhere. It's pretty darn hard to 
read a printed sticker in software, so we have to revert to solutions that 
actually work.

In the "clever things" department, protocols like IPv6 merrily broadcast your 
MAC address across gateways on the big bad internet, so if you value your 
privacy, you'll appreciate the possibility to change your MAC address at will.



Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans at topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail

P
to get the real hardware address used delete the variable ethaddr before saving the environment.
This forces the board code the load the actual hardware address, if there is one, into the environment at start time.
Otherwise you will always boot with the Ethernet address from the first time the environment was saved. 

Which make the environment not portable to multiple boards.

 Duncan Hare

714 931 7952


More information about the U-Boot mailing list