public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Design principles (was: Re:  [PATCH] net, fec_mxc: use mac address stored in env before looking in eeprom)
Date: Fri, 26 Mar 2010 11:40:30 +0100	[thread overview]
Message-ID: <20100326104030.ADE14E8E722@gemini.denx.de> (raw)
In-Reply-To: <m2hbo3jx28.fsf_-_@ohwell.denx.de>

Dear Detlev,

In message <m2hbo3jx28.fsf_-_@ohwell.denx.de> you wrote:
> 
> > We do not want to touch interfaces that we don't use. If we don't use
> > Ethernet in U-Boot, there is no need to probe or initialize it.
> 
> Ok, I still don't get it.  Is this "we do not touch interfaces" a truth
> not to be questioned or is it the essence of other goals we want to
> achieve summed up in a nice fashion?

You know pretty well that this a design principle which is intended to
keep U-Boot small, fast, and flexible.

To me it makes little sense to initialize for example a network port
(and wait hundrets of millisecods, or even seconds) for the link to
come up and (auto-) negotiation to complete, when we do not use the
network in U-Boot ourself, and when he have no knowledge if Linux
will use the network interface (and if it does, it will usually
re-initialize the PHY, thus waiting again). The same goes for the
initialization of USB, IDE, or similar interfaces.

I am well aware that not all code is working like this. Board ports
that origin from earlier versions of U-Boot (or even from PPCBoot)
behave differently.  This is a lesson we learned over time.

But now it's written down.

I am not sure at the moment if you question this design principle in
general, or if you accept it as base for the ongoing discussion.
Please say so, if you disagree here, so we can try to find a
compromize to be used as base for this discussion.

> Because what I still fail to see is how writing 6 bytes into an SRAM
> area is "touching a device".  Yet the absence of this code means that
> there is no working solution at all to the problem at hand as you may
> well know.
> 
> So can you please enlighten me why as to how initializing SRAM is
> "touching a device" - or why exactly you oppose this so strict.

I cannot understand how you might think that writing some data to
registers or internal RAM of a device could be NOT considered as
"touching" this device. You modify the state of this device, ergo you
are touching it. Or not?


I guess what you really want to tell us is that this initializing is
not such a bad thing - it is quick and does not add any real delay to
the boot process, and it solves a problem that otherwise needs to be
solved elsewhere (in the Linux Ethernet driver, or the Linux boot
API), where more effort is needed.

If you re-read my previous postings in this thread you might even see
that I tend to take a pretty pragmatic position here and support  the
suggested fix for the exiting (obviously incorrect) behaviour.


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: wd at denx.de
Where people stand is not as important as which way they face.
        - Terry Pratchett & Stephen Briggs, _The Discworld Companion_

  reply	other threads:[~2010-03-26 10:40 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
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 [this message]
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=20100326104030.ADE14E8E722@gemini.denx.de \
    --to=wd@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