[U-Boot] [PATCH 1/3] net: Adds Fast Ethernet Controller driver for Armada100

Mike Frysinger vapier at gentoo.org
Tue Aug 23 19:21:04 CEST 2011


On Tuesday, August 23, 2011 11:30:38 Ralph Metzler wrote:
> Wolfgang Denk writes:
>  > > ok I just wanted to clear myself.. I do not have a dedicated hardware
>  > > storage in my ethernet controller so I will just look into environment
>  > > variable ethaddr, if its set I will just copy it to driver layer and
>  > > if it is not set, I let the user set it. He/She may use the tools
>  > > provided with U-Boot to generate a random MAC or by any mean get a
>  > > MAC and store it in env which is gonna be one time unless env gets
>  > > corrupt or cleared by user. Which means no MAC generation in code...
>  > > 
>  > > Please correct me if my understanding wrong...
>  > 
>  > This is correct, except for the nitpick that nobody should ever use a
>  > truly random MAC address - if no valid MAC address is available, one
>  > should at least make sure to pick one of the locally administered
>  > Ethernet address pool (2nd LSB in the most significant byte of the
>  > address must be set).
> 
> It is even more annoying that the Linux network driver for
> Armada 100 (pxa168_eth.c) does the same thing (random MAC) which made
> it impossible to properly assign IPs or even have the same in u-boot
> and Linux.
> 
> Since the pxa168 ethernet seems to (correct me if I am wrong)
> store all MACs, including its own, in a buffer allocated in main memory,
> it is not possible to set it in u-boot and then read it out in Linux.
> So, I introduced "pxa168_mac" as Linux command line argument to pass
> ethaddr to pxa168_eth. Or does anybody have a better solution?

the latest u-boot tree should call write_hwaddr when there is a valid mac 
available (i.e. "ethaddr" is in the env).  then linux should be able to say 
"hey, the mac is already set to a valid one" and leave it be.

if linux always blows it away, you can certainly use the tried & true method: 
read the u-boot env from userspace (fw_printenv) and then manually set it 
yourself with `ifconfig hw class <mac>`.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110823/ee717637/attachment.pgp 


More information about the U-Boot mailing list