All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Design principles
Date: Fri, 26 Mar 2010 12:47:18 +0100	[thread overview]
Message-ID: <m2sk7ngv95.fsf@ohwell.denx.de> (raw)
In-Reply-To: <20100326104030.ADE14E8E722@gemini.denx.de> (Wolfgang Denk's message of "Fri, 26 Mar 2010 11:40:30 +0100")

Hi Wolfgang,

>> > 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.

Exactly, it is the essence of these ultimate goals and not a credo in
itself.

> 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.

Full ACK and I really _never_ questioned this.

> 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.

And this is a good thing in full accordance with my previous statements.

> 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.

I agree to the design principle but for the value it brings and not for
the words it is formulated in.

>> 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?

This is getting philosophical, really and I can find good arguments for
both views: If you consider the mac sram cells to be part of the state
of the device, you _do_ change the state.  On the other hand, the
ethernet controller ip block very likely has no idea whatsoever if those
sram was touched, so in this view you _do not_ change the state.

So if this is getting philosophical, why not ask the question "under
what circumstances could this writing into sram have negative
effects?".  I for myself cannot find any point to raise here.

> 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.

Yes, it solves a problem.  Also it is a static initialization which I
feel is something the bootloader should do.  U-Boot knows ethaddr, so
again I see no negative, only positive consequences of doing such a
thing

> 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.

So it seems I did not understand your "please include in your fix"
statement.  Can you tell me exactly what you meant by this?

Cheers
  Detlev

-- 
A change in language can transform our appreciation of the cosmos
                       -- Benjamin Lee Whorf
--
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-26 11:47 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
2010-03-26 11:47               ` Detlev Zundel [this message]
2010-03-26 12:38                 ` [U-Boot] Design principles 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=m2sk7ngv95.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.