[U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address

Mike Frysinger vapier at gentoo.org
Mon May 11 18:56:59 CEST 2009


On Monday 11 May 2009 12:37:28 Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:24 Mon 11 May     , Mike Frysinger wrote:
> > On Monday 11 May 2009 10:24:54 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 15:26 Mon 11 May     , Wolfgang Denk wrote:
> > > > In message Jean-Christophe wrote:
> > > > > > there is no need for that on purpose.  the network layer will
> > > > > > recheck the environment every time it gets initialized, and it
> > > > > > gets initialized with every network step.  this is already
> > > > > > documented in doc/README.enetaddr.
> > > > >
> > > > > Unfortunatly we need it to set the enetaddr in the register of the
> > > > > soc evenif there is no ethernet transfer as for the macb on at91 or
> > > > > the dm9000. This how the kernel pass the mac address for the
> > > > > bootloader.
> > > >
> > > > You mean, this is how U-Boot is supposed to pass the MAC address to
> > > > the Kernel, right?
> > > >
> > > > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > > > design principles which say NOT to initialize things it does not use
> > > > itself, and (2) a bug in the Linux kernel that should be fixed there.
> > > >
> > > > In this case it may be just writing to  a  register  without  further
> > > > initialization  of the hardware, but if we allow for that you can bet
> > > > that tomorrow someone will  try  and  add  code  that  requires  more
> > > > extensive initialization of the hardware for the same purpose, and he
> > > > will argue that his code must go in because there is preexisting code
> > > > that does the same.
> > >
> > > this exactly what is done only write mac hw register
> > > without init the eth stack
> > >
> > > before we do need to init the mac and detect the phy if we want to
> > > store now we have to call the set_hw_enetaddr
> >
> > then we agree you're doing it wrong and this patch is not needed/wanted
> >
> > there is this FAQ, but i think we can add more info to it:
> > http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
>
> It does not work ether

your solution blatantly ignores the issues raised in the FAQ.  you cant push a 
change without clearing addressing those.

> how do you deal with multiple nic?

the ATAG/FDT tree handles most arches.

for the rest you have two major issues to address:
 - how do i pass it to the next OS ?
    * have the OS read the u-boot environment
    * have the OS read the command line
 - how does the OS set it ?
    * add a board hook to set it
    * set it via user space and normal methods (`ifconfig hw`)

> how do set a mac for NFS Rootfs?

use initramfs

> how do you boot a *mainline* kernel?

i dont know why you're emphasizing mainline.  if it's your board and if you 
implement the change correctly, submit it to mainline.
-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/20090511/2e4100ca/attachment.pgp 


More information about the U-Boot mailing list