public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net, fec_mxc: use mac address stored in env before looking in eeprom
Date: Thu, 25 Mar 2010 07:31:51 +0100	[thread overview]
Message-ID: <4BAB0357.60309@denx.de> (raw)
In-Reply-To: <201003241635.58377.vapier@gentoo.org>

Hello Mike,

Mike Frysinger wrote:
> On Wednesday 24 March 2010 07:56:28 Heiko Schocher wrote:
>> doc/README.enetaddr prescribes, to use a mac address stored in
>> environment, before using a mac address stored in some special
>> place.
> 
> you're reading things incorrectly, or you didnt read the whole thing.  the 
> fec_mxc driver is correct today.  its initialize function seeds eth_device-
>> enetaddr with the hardware storage.  it is up to the common networking code 
> to sync the environment to eth_device before calling the driver init function 
> (which it does).  then the driver always uses eth_device->enetaddr.

Ok, but this driver initialize in fec_probe() (which gets called
through fecmxc_initialize() on uboot startup) always the fec mac
address registers with eeprom mac address. So, if uboot not uses
network interface, linux uses this mac address (and if no valid
mac address is in eeprom, linux has no valid mac address). But,
if uboot uses network, before booting linux, linux gets the
network address stored in ethaddr, because this driver sets
again in fec_init the mac address (at this point the content
from ethaddr) -> 2 different mac addresses used on this
plattform ... I think this could not be correct, and should be
fixed ...

So, if not changing something in the driver, how is this intended
to solve? (I know, it would be great to have a standard to pass
the mac address to linux on arm based plattforms, but as Detlev
wrote, such attempts failed ...)

I don;t want to make this through board specific code ...

While writing this, and realizing that this behaviour is a feature,
maybe this problem occur on other network drivers on arm plattforms
too ... hah, found one:

drivers/net/kirkwood_egiga.c

did it in the same way as drivers/net/fec_mxc.c ... Ok, it is
in line with uboot standard, but arm plattforms which booting
linux without doing network trafic under uboot tend to have
different mac addresses ...

This should be solved!

(Actual I don;t know, if arm linux prescribes something about
how to setup the mac address before it ...)

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2010-03-25  6:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24 11:56 [U-Boot] [PATCH] net, fec_mxc: use mac address stored in env before looking in eeprom Heiko Schocher
2010-03-24 12:35 ` Stefano Babic
2010-03-24 12:52   ` Detlev Zundel
2010-03-24 20:39     ` Mike Frysinger
2010-03-24 13:07   ` Heiko Schocher
2010-03-24 20:35 ` Mike Frysinger
2010-03-25  6:31   ` Heiko Schocher [this message]
2010-03-25  9:40     ` Wolfgang Denk
2010-03-25 13:16       ` Detlev Zundel
2010-03-25 14:02         ` Wolfgang Denk
2010-03-26  8:39           ` [U-Boot] Design principles (was: Re: [PATCH] net, fec_mxc: use mac address stored in env before looking in eeprom) Detlev Zundel
2010-03-26 10:40             ` Wolfgang Denk
2010-03-26 11:47               ` [U-Boot] Design principles Detlev Zundel
2010-03-26 12:38                 ` Wolfgang Denk
2010-03-26 13:02                   ` Detlev Zundel
2010-03-26 18:21                     ` Wolfgang Denk
2010-03-27  7:32                       ` Heiko Schocher
2010-03-27 10:21                         ` Wolfgang Denk
2010-03-25 17:49         ` [U-Boot] [PATCH] net, fec_mxc: use mac address stored in env before looking in eeprom Mike Frysinger
2010-03-25 17:38       ` Mike Frysinger
2010-03-25 19:11         ` Wolfgang Denk
2010-03-25 19:22           ` Mike Frysinger

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=4BAB0357.60309@denx.de \
    --to=hs@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