From: Aaron Williams <Aaron.Williams@cavium.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/6] fdt: add decode helper library
Date: Fri, 14 Oct 2011 18:42:04 -0700 [thread overview]
Message-ID: <201110141842.04867.Aaron.Williams@cavium.com> (raw)
In-Reply-To: <CAPnjgZ1pHwmrx3HUHpY+XwPhzAH3++dyz4V2Jh409gOjJ+Jp7Q@mail.gmail.com>
Hi,
On Friday, October 14, 2011 11:21:54 AM Simon Glass wrote:
> Hi Kumar,
>
> On Fri, Oct 14, 2011 at 11:12 AM, Kumar Gala <galak@kernel.crashing.org>
wrote:
> > On Oct 11, 2011, at 5:26 PM, Simon Glass wrote:
> >> This library provides useful functions to drivers which want to use
> >> the fdt to control their operation. Functions are provided to:
> >>
> >> - look up and enumerate a device type (for example assigning i2c bus 0,
> >> i2c bus 1, etc.)
> >> - decode basic types from the fdt, like addresses and integers
> >>
> >> While this library is not strictly necessary, it helps to minimise the
> >> changes to a driver, in order to make it work under fdt control. Less
> >> code is required, and so the barrier to switch drivers over is lower.
> >>
> >> Additional functions to read arrays and GPIOs could be made available
> >> here also.
> >>
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> >> ---
> >> Changes in v2:
> >> - Add example proposed decode helper library
> >>
> >> Changes in v3:
> >> - Simplify decode library to remove provide only primitive functions
> >> - Remove i2c decode function
> >> - Rename fdt_decode to fdtdec, since it will be used a lot
> >> - Moved fdt_decode.c to /lib
> >> - Export almost all functions from fdtdec, to allow widespread use
> >> - Remove use of FDT_ERR_MISSING which is not strictly needed now
> >>
> >> include/fdtdec.h | 122
> >> ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/Makefile |
> >> 1 +
> >> lib/fdtdec.c | 131
> >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed,
> >> 254 insertions(+), 0 deletions(-)
> >> create mode 100644 include/fdtdec.h
> >> create mode 100644 lib/fdtdec.c
> >
> > I think this is the wrong approach. If we intend to go down the path of
> > embedded a device tree we should look at produce a live tree structure
> > that can be used like Linux has.
>
> The intent of this patch set is to provide U-Boot with a simple
> run-time configuration system.
>
> Can you please explain why you want a live tree for use by U-Boot?
> U-Boot already has one that it passes on to Linux, and this is under
> control of scripts, etc., quite separate from this.
>
> This fdt is for configuration of devices used by U-Boot itself.
>
> What can U-Boot find out that it would want to put into this private
> fdt? Are you thinking of probing for devices early on and then using
> them later in U-Boot? If so, surely no code can exist which does this
> now, since this patch set is new.
>
> > There are a lot of places we are manipulate device tree blobs that would
> > be more efficient if we had a live tree structure in place.
>
> Please can you point to these? Are you sure you are not referring to
> the working_fdt? As I understand it this is already a live structure.
>
> > I think that will only get worse with the addition of embedding a tree.
>
> I need a bit more info / understanding before I can respond to this
> email properly.
>
> Regards,
> Simon
>
> > - k
>
This would actually be helpful for us. We have switched our bootloader to make
use of the FDT and use it both within our common SOC code which is linked to
our U-Boot image as well as what we pass to the Linux kernel.
We use a single FDT image for both.
We currently have our FDT for each board contain all possible options and then
at runtime trim the parts that are not detected at runtime. Many of our boards
have pluggable networking modules for example which are supported by our U-
Boot image.
-Aaron
--
Aaron Williams <Aaron.Williams@cavium.com>
(408) 943-7198
next prev parent reply other threads:[~2011-10-15 1:42 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 22:26 [U-Boot] [PATCH v3 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL) Simon Glass
2011-10-11 23:39 ` Stephen Warren
2011-10-11 22:26 ` [U-Boot] [PATCH v3 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon Glass
2011-10-13 21:13 ` Stephen Warren
2011-10-13 21:22 ` Simon Glass
2011-10-13 21:21 ` Stephen Warren
2011-10-13 21:25 ` Simon Glass
2011-10-13 21:50 ` Stephen Warren
2011-10-15 5:21 ` Simon Glass
2011-10-15 5:46 ` Grant Likely
2011-10-15 14:51 ` Simon Glass
2011-10-13 22:58 ` Mike Frysinger
2011-10-11 22:26 ` [U-Boot] [PATCH v3 3/6] fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE) Simon Glass
2011-10-13 21:36 ` Stephen Warren
2011-10-15 15:12 ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 4/6] fdt: ARM: Implement embedded and separate device tree Simon Glass
2011-10-13 21:39 ` Stephen Warren
2011-10-15 15:15 ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 5/6] fdt: ARM: Add fdtcontroladdr to set device tree address in environment Simon Glass
2011-10-13 20:27 ` Mike Frysinger
2011-10-13 21:08 ` Simon Glass
2011-10-15 15:18 ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 6/6] fdt: add decode helper library Simon Glass
2011-10-13 20:33 ` Mike Frysinger
2011-10-13 21:28 ` Simon Glass
2011-10-13 23:01 ` Mike Frysinger
2011-10-13 23:16 ` Simon Glass
2011-10-13 23:32 ` Mike Frysinger
2011-10-14 18:12 ` Kumar Gala
2011-10-14 18:21 ` Simon Glass
2011-10-15 1:42 ` Aaron Williams [this message]
2011-10-15 2:16 ` Simon Glass
2011-10-11 23:37 ` [U-Boot] [PATCH v3 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Stephen Warren
2011-10-11 23:54 ` Simon Glass
2011-10-12 1:00 ` Jason
2011-10-12 1:07 ` Simon Glass
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=201110141842.04867.Aaron.Williams@cavium.com \
--to=aaron.williams@cavium.com \
--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.