public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2 v2] net, fec_mxc: only setup the device  enetaddr with eeprom value, if ethaddr is not setup
Date: Wed, 31 Mar 2010 16:46:25 +0200	[thread overview]
Message-ID: <m2634cpn0e.fsf@ohwell.denx.de> (raw)
In-Reply-To: <z2uf8328f7c1003310658t4638d5c3v864ac5d0c3101a2a@mail.gmail.com> (Ben Warren's message of "Wed, 31 Mar 2010 06:58:01 -0700")

Hi Ben,

> Hi Detlev,
>
> On Wed, Mar 31, 2010 at 6:44 AM, Detlev Zundel <dzu@denx.de> wrote:
>
>     Hi Ben,
>
>     > Hold on a second. ?This patch is wrong. ?As Mike has pointed out, the
>     > net library already gets the MAC address from the environment. ?The
>     > correct flow is:
>     >
>     > 1. Read from hardware in initialize() function
>     > 2. Read from environment in net/eth.c after initialize()
>     > 3. Give priority to the value in the environment if a conflict
>     > 4. Program hardware in the device's init() function.
>     >
>     > If somebody wants to subvert the 'design philosophy', the right way is
>     > to call eth_dev->init() in board code.
>
>     This would mean that for the real problem of a missing mac address, the
>     device then is initialized completely adding the autonegotation timeout
>     to every bootup sequence, correct?
>
>
> My suggestion here is a crude hack, and definitely does more than needed. ?It
> has the advantage of having narrow scope (is limited to the board in
> question).?

This specific problem in the meantime hit me on multiple arm boards with
different network interfaces so I think it has a broader audience than a
single board.

>     If it is, then it doesn't solve my problem in an acceptable way. ?On the
>     other hand a different route occured to Wolfgang and me in a lengthy
>     discussion. ?This will need a little broader interpretation of the
>     design guidelines, but as I still cannot see any downside to this and it
>     will also fix some inconsistent behaviour _that we currently have_
>     ("setenv ethaddr ...", do not do any network transfer and boot linux), I
>     want to follow this route.
>
>     I will try to implement this in form of a patch in order to keep the
>     discussion close to the effects on the code base.
>
>
> I'm looking forward to seeing what you come up with. ?I personally don't have a
> problem with adding the few ns to boot-up time that programming an SOC's MAC
> would take, but dislike the piece-meal approach that's been done so far.?

I fully agree.  Previously I was under the impression that we already
have a "fast initialization" (probe) and a "full initialization" (init)
of the network interfaces, where programming the mac would (on a first
stab) fit into the probe part (and some drivers obviously do/did this).

In the meantime it seems like it is a broader problem of keeping
"ethaddr" and friends in sync with the real hardware.  Although this is
something I personally always took for granted, it currently is most of
the time but not always correct.

If we solve the latter problem in a nice way, the initial problem will
simply disappear (or so I hope) ;)

Cheers
  Detlev

-- 
You live and learn
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  reply	other threads:[~2010-03-31 14:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 17:46 [U-Boot] [PATCH 1/2 v2] net, fec_mxc: only setup the device enetaddr with eeprom value, if ethaddr is not setup Heiko Schocher
2010-03-30 20:34 ` Wolfgang Denk
2010-03-30 21:57   ` Ben Warren
2010-03-30 21:59   ` Mike Frysinger
2010-03-30 22:16   ` Ben Warren
2010-03-31  5:56     ` Heiko Schocher
2010-03-31  6:07       ` Mike Frysinger
2010-03-31  6:34         ` [U-Boot] [PATCH 1/2 v3] net, fec_mxc: only setup the device enetaddr with eeprom value Heiko Schocher
2010-03-31  6:50           ` Ben Warren
2010-03-31  8:34             ` Wolfgang Denk
2010-03-31  8:41           ` Wolfgang Denk
2010-05-03  2:38       ` [U-Boot] Toggling pins using the BDI3000 Can Aydin
2010-03-31  6:34     ` [U-Boot] [PATCH] net, doc: how to setup mac address correct Heiko Schocher
2010-03-31  8:50       ` Wolfgang Denk
2010-03-31 13:44     ` [U-Boot] [PATCH 1/2 v2] net, fec_mxc: only setup the device enetaddr with eeprom value, if ethaddr is not setup Detlev Zundel
2010-03-31 13:58       ` Ben Warren
2010-03-31 14:46         ` Detlev Zundel [this message]
2010-03-31 19:59           ` Mike Frysinger
2010-03-31 20:04             ` Ben Warren
2010-03-31  9:18 ` 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=m2634cpn0e.fsf@ohwell.denx.de \
    --to=dzu@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