All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL)
Date: Tue, 13 Sep 2011 04:44:58 -0700	[thread overview]
Message-ID: <CAPnjgZ1y+i0FdawcbBuOi0+SC+Xq3AS=ZZtTi1tVjv8CcNw6Og@mail.gmail.com> (raw)
In-Reply-To: <20110913094734.E595A1408E93@gemini.denx.de>

Hi Wolfgang,

On Tue, Sep 13, 2011 at 2:47 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Simon Glass,
>
> In message <CAPnjgZ3kZJoAGJFkPkxQp+-jnztYECUaEtLZ0nvgzV1f-xUQgQ@mail.gmail.com> you wrote:
>>
>> I would love to, yes. To some extent there is a bit of this already,
>> at least for specific subsystems. Clearly the fdt would work better if
>> we could just hand U-Boot the fdt and say 'init yourself'. It would
>> then scan the tree and init all the drivers for all active devices.
>
> No, it would definitely not do that.
>
> U-Boot shall not initialize all possible available devices, but always
> only those that it needs itself to perform it's task, which usually is
> just to load and start an OS. ?It makes no sense to initialize all
> network interfaces (and eventually wait for the link to come up), to
> initialize all attached disk drives (and wait for them to spin up) or
> to scan the whole USB bus and initialize all attached devices when we
> don't need any of these to boot the OS.
>
> Suchinitializations shall always be done on demand only, i. e. when a
> command is run that accesses any such device.

Yes thanks for pointing that out. I am really thinking of the init
sequence in board_init_r() where we init NAND, MMC and the like. So
yes it makes no sense to blindly init everything we can find. The fdt
can provide a list of available options for each device type (although
in practice often it will provide only one option, perhaps with
multiple instances).

>
>> However, we can achieve most of the aims using something along the
>> lines of what I have proposed, where the existing call (say to
>> nand_init()) can look up the fdt for its node, and then get the
>> information it needs. The only really difference is the explicit
>> hard-coded call to nand_init, rather than a general purpose routine to
>> find a nand node and then locate a driver for it.
>
> I can;t parse that. ?Why cannot nand_init() do exactly what you
> suggest, i. e. find a nand node and then locate a driver for it?
> OK, by then it will probably be something like driver_init("nand") or
> the like, but that's just a detail.

That's certainly the current approach, yes. It does work well I think,
and has the virtue of being simple, with minimal changes required to
code.

>
>> To some extent that way of doing things would invert the way U-Boot
>> currently works. It would also introduce questions about dealing with
>> multiple devices of the same type (e.g. two different i2c controllers
>> (not just instances) or driving two displays. These sorts of things
>> are tricky in U-Boot at the moment.
>
> Keep in mind that devices are always accessedonly on demand, so you
> will have the needed information which device needs to be opened.

Yes, that's true and we mustn't do anything which blurs or weakens
that link. When I think of multiple LCD support for example, while
there is hardware support for it, do we have a need for it? Sometimes
this sort of thing is a solution looking for a problem. Yes it would
be easier to implement this feature with a unified driver model,
but...

On the other hand I think serial could benefit from a unified driver
model quite nicely :-)

>
>> So overall I think a unified driver model is a separate problem, and
>> one that we should discuss and perhaps move forward on separately.
>
> Agreed.

OK good. There seem to be a lot of different activities going on, as
Graeme says in the other thread.

Regards,
Simon

>
> 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
> If you want strict real-time behavior, run in the real ?time ?schedu-
> ling class. ?But there are no seatbelts or airbags; ?main(){for(;;);}
> can hard hang your system. ? ? ? ? ? ? ? ? ? ? ? ? ?-- Bart Smaalders
>

  reply	other threads:[~2011-09-13 11:44 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 22:04 [U-Boot] [RFC PATCH v2 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL) Simon Glass
2011-09-13  3:10   ` Marek Vasut
2011-09-13  4:52     ` Simon Glass
2011-09-13  5:18       ` Marek Vasut
2011-09-13  9:47       ` Wolfgang Denk
2011-09-13 11:44         ` Simon Glass [this message]
2011-09-13 11:57           ` Wolfgang Denk
2011-09-13 12:14             ` Simon Glass
2011-09-13 13:12               ` Wolfgang Denk
2011-09-13 18:16   ` Mike Frysinger
2011-09-13 18:24     ` Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon Glass
2011-09-12 23:37   ` Jason
2011-09-13  0:12     ` Simon Glass
2011-09-13 14:37       ` Jason
2011-09-13 21:06         ` Simon Glass
2011-09-14 13:47           ` Jason
2011-09-14 15:47             ` Simon Glass
2011-09-14 16:11               ` Jason
2011-09-14 17:45                 ` Simon Glass
2011-09-14 19:50                   ` Jason
2011-09-14 20:05                     ` Simon Glass
2011-09-14 20:16                       ` Jason
2011-09-14 20:24                         ` Simon Glass
2011-09-14 20:35                           ` Jason
2011-09-14 16:45   ` Grant Likely
2011-09-14 18:03     ` Simon Glass
2011-09-14 19:17       ` Grant Likely
2011-09-14 19:22         ` Simon Glass
2011-09-14 20:11     ` Wolfgang Denk
2011-09-14 20:32       ` Simon Glass
2011-09-14 21:09       ` Grant Likely
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 3/6] fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE) Simon Glass
2011-09-14 16:48   ` Grant Likely
2011-09-14 18:25     ` Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 4/6] fdt: ARM: Implement embedded and separate device tree Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 5/6] fdt: add decode helper library Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 6/6] fdt: example modification of i2c driver for fdt control Simon Glass
2011-09-13 18:28 ` [U-Boot] [RFC PATCH v2 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-09-15 13:54 ` [U-Boot] [RFC PATCH 0/4 v1] Use fdt to init mvrtc driver for dreamplug Jason Cooper
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 1/4 v1] fdt: remove i2c example code Jason Cooper
2011-09-16  7:31     ` Kumar Gala
2011-09-16 12:00       ` Jason
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 2/4 v1] fdt_decode: make more available Jason Cooper
2011-09-15 19:18     ` Simon Glass
2011-09-15 19:48       ` Jason
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 3/4 v1] mvrtc: add fdt support Jason Cooper
2011-09-15 19:23     ` Simon Glass
2011-09-15 20:01       ` Jason
2011-10-06 21:31     ` Wolfgang Denk
2011-10-06 21:42       ` Simon Glass
2011-10-12  0:16         ` Simon Glass
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 4/4 v1] dreamplug: enable fdt Jason Cooper
2011-09-15 19:25     ` Simon Glass
2011-09-15 19:50       ` Jason
2011-09-15 19:16   ` [U-Boot] [RFC PATCH 0/4 v1] Use fdt to init mvrtc driver for dreamplug Simon Glass
2011-09-15 19:46     ` Jason

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='CAPnjgZ1y+i0FdawcbBuOi0+SC+Xq3AS=ZZtTi1tVjv8CcNw6Og@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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.