Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-03-05 Thread Mike Frysinger
On Saturday 20 February 2010 04:37:17 Philippe De Muyter wrote:
 On Sat, Feb 20, 2010 at 10:30:32AM +0300, Maxim Podbereznyi wrote:
  Hi Philippe!
  
  May be it is a little bit tricky but you can just read the u-boot
  environment from you Linux driver and use the ethaddr variable. I did
  the same for osk5912
 
 Thanks, but I need something more straightforward.  The ethernet driver in
 linux must know the mac address at startup to be able to have root on nfs.

a small static initramfs would take care of this just fine
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-21 Thread Wolfgang Denk
Dear Philippe De Muyter,

In message 20100221004733.ga22...@frolo.macqel you wrote:
 
  Hope you can easily adapt it to your kernel!
 
 So the library fucntion to retrieve the value of a u-boot environment
 variable is 'fw_getenv'.  I do not have that function in my linux sources.

Did I not already point you to tools/env/* ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Without freedom of choice there is no creativity.
-- Kirk, The return of the Archons, stardate 3157.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-21 Thread Wolfgang Denk
Dear Philippe De Muyter,

In message 20100220235945.ga15...@frolo.macqel you wrote:
 
  Complain about this to the Linux architecture maintainers - there have
  been many and longf discussions about this before.
 
 Do you mean lkml or some other mailing list or individual ?

I had especially the ARM list and RMK in mind.

  Today we consider the device tree to be the Right Thing (TM) to pass
  such information to the kernel, and more and more architectures use
  this method.
 
 AFAIK, device trees are powerpc-specific and my board is coldfire based.

Several other architecture use the device tree as well, and more are
following. For example, an adaption for ARM is on the way right now.

  As long as it's not available for your architecture, the most
  straightforward way is to pass an ethaddr=... argument on the
  kernel command line. Drivers can pick it up easily there. Just don't
  expect that such Linux driver code will be accepted for mainline.
 
 I don't like that method because it can easily be forgotten by someone
 changing bootargs for some other reason.  IMO bootargs should only be used for
 configuration choices.

Well, that's mostly a matter of taste. At least it's an architecutre
independent, standardized way to pass information.

 I'd rather go for an additional parameter given by u-boot to linux with
 the address of the used u-boot environment, passed the same way that the
 address of bd_info is given to linux (for coldfire's, that's on the stack)

i. e. you create yet another, non-standard solution - exactly what you
complained about originally.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Humanity has the  stars  in  its  future,  and  that  future  is  too
important  to be lost under the burden of juvenile folly and ignorant
superstition.  - Isaac Asimov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Philippe De Muyter
Hi Maxim,

On Sat, Feb 20, 2010 at 10:30:32AM +0300, Maxim Podbereznyi wrote:
 Hi Philippe!
 
 May be it is a little bit tricky but you can just read the u-boot
 environment from you Linux driver and use the ethaddr variable. I did the
 same for osk5912

Thanks, but I need something more straightforward.  The ethernet driver in
linux must know the mac address at startup to be able to have root on nfs.

Previously, the mac addresses were stored in the bd_info struct, but that
has been removed, but alas not replaced by a common mechanism for all
architectures.

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Philippe De Muyter
Hi Maxim,

On Sat, Feb 20, 2010 at 10:30:32AM +0300, Maxim Podbereznyi wrote:
 Hi Philippe!
 
 May be it is a little bit tricky but you can just read the u-boot
 environment from you Linux driver and use the ethaddr variable. I did the
 same for osk5912

Sorry, I replied too fast, It seems that I misunderstood your answer.
How do you access the U-boot environment from the linux driver ?
Is there a linux kernel library function to retrieve one element of a
U-boot environment ?  Does U-boot tell linux where the U-boot environment
resides in memory ?

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Wolfgang Denk
Dear Philippe De Muyter,

In message 20100220093717.ga9...@frolo.macqel you wrote:

 Previously, the mac addresses were stored in the bd_info struct, but that
 has been removed, but alas not replaced by a common mechanism for all
 architectures.

Complain about this to the Linux architecture maintainers - there have
been many and longf discussions about this before.

Today we consider the device tree to be the Right Thing (TM) to pass
such information to the kernel, and more and more architectures use
this method.

As long as it's not available for your architecture, the most
straightforward way is to pass an ethaddr=... argument on the
kernel command line. Drivers can pick it up easily there. Just don't
expect that such Linux driver code will be accepted for mainline.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Philippe De Muyter
Hello Wolfgang,

On Sat, Feb 20, 2010 at 04:08:45PM +0100, Wolfgang Denk wrote:
 Dear Philippe De Muyter,
 
 In message 20100220093717.ga9...@frolo.macqel you wrote:
 
  Previously, the mac addresses were stored in the bd_info struct, but that
  has been removed, but alas not replaced by a common mechanism for all
  architectures.
 
 Complain about this to the Linux architecture maintainers - there have
 been many and longf discussions about this before.

Do you mean lkml or some other mailing list or individual ?

 
 Today we consider the device tree to be the Right Thing (TM) to pass
 such information to the kernel, and more and more architectures use
 this method.

AFAIK, device trees are powerpc-specific and my board is coldfire based.

 
 As long as it's not available for your architecture, the most
 straightforward way is to pass an ethaddr=... argument on the
 kernel command line. Drivers can pick it up easily there. Just don't
 expect that such Linux driver code will be accepted for mainline.

I don't like that method because it can easily be forgotten by someone
changing bootargs for some other reason.  IMO bootargs should only be used for
configuration choices.

I'd rather go for an additional parameter given by u-boot to linux with
the address of the used u-boot environment, passed the same way that the
address of bd_info is given to linux (for coldfire's, that's on the stack)

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Philippe De Muyter
Hi Maxim,

On Sat, Feb 20, 2010 at 05:49:53PM +0300, Maxim Podbereznyi wrote:
 
 The code for MontaVista with kernel 2.4:
 
 static int nicGetMacAddress(u8* macaddr)
 {
[...]
   endptr = fw_getenv(sf, ethaddr);
[...]
 }
 
 Hope you can easily adapt it to your kernel!

So the library fucntion to retrieve the value of a u-boot environment
variable is 'fw_getenv'.  I do not have that function in my linux sources.

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-20 Thread Ben Warren
Hi Philippe,

On Sat, Feb 20, 2010 at 4:47 PM, Philippe De Muyter p...@macqel.be wrote:

 Hi Maxim,

 On Sat, Feb 20, 2010 at 05:49:53PM +0300, Maxim Podbereznyi wrote:
 
  The code for MontaVista with kernel 2.4:
 
  static int nicGetMacAddress(u8* macaddr)
  {
 [...]
endptr = fw_getenv(sf, ethaddr);
 [...]
  }
 
  Hope you can easily adapt it to your kernel!

 So the library fucntion to retrieve the value of a u-boot environment
 variable is 'fw_getenv'.  I do not have that function in my linux sources.

 It's a tool in the U-boot source tree.

 Philippe

regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-19 Thread Philippe De Muyter
Hello

I have a problem : my (coldfire) linux kernel does not reuse the mac
addresses known by u-boot as ethaddr and eth1addr.

I have read doc/README.enetaddr, that states :

struct bd_info [...]
are temporary copies of the MAC address only for the
purpose of passing this information to an OS kernel we are about
to boot.

but I see no field in bd_info that could be set before booting linux.

I thought that the address of the environment zone could be given
to linux, but I do not see where either.

So what's the recommended/supported way to inform the kernel of the mac
addresses of all the ethernet interfaces ?

Philippe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] what's the uboot way to pass eth*addr to linux ?

2010-02-19 Thread Maxim Podbereznyi
Hi Philippe!

May be it is a little bit tricky but you can just read the u-boot
environment from you Linux driver and use the ethaddr variable. I did the
same for osk5912

2010/2/19 Philippe De Muyter p...@macqel.be

 Hello

 I have a problem : my (coldfire) linux kernel does not reuse the mac
 addresses known by u-boot as ethaddr and eth1addr.

 I have read doc/README.enetaddr, that states :

struct bd_info [...]
are temporary copies of the MAC address only for the
purpose of passing this information to an OS kernel we are about
to boot.

 but I see no field in bd_info that could be set before booting linux.

 I thought that the address of the environment zone could be given
 to linux, but I do not see where either.

 So what's the recommended/supported way to inform the kernel of the mac
 addresses of all the ethernet interfaces ?

 Philippe
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot