From: Daniel Mack <zonque@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Merging device trees at runtime for module-based systems
Date: Thu, 01 Nov 2012 10:24:06 +0100 [thread overview]
Message-ID: <50923FB6.6020708@gmail.com> (raw)
In-Reply-To: <20121101032644.GE27695@truffula.fritz.box>
On 01.11.2012 04:26, David Gibson wrote:
> On Fri, Oct 26, 2012 at 09:24:11AM +0200, Daniel Mack wrote:
>> I would especially like to know where such a new functionality should
>> live, which data types it should operate on and what would be an
>> appropriate name for it.
>
> So.. the first thought I have reading the original mail in the thread
> is that it's arguable that you really want a more heavyweight firmware
> for this setup, that actively maintains a live device tree as OF does,
> rather than u-boot which is pretty oriented towards a close-to-static
> device setup. That's just a thought though, I'm not saying that at
> least some of this functionality doesn't belong in libfdt.
>
> So, my thought would be that stuff for manipulating big chunks of tree
> should go in a new .c file inside the libfdt tree. We already have
> del_node and nop_node of course, which can remove whole subtrees. I
> guess the big extra function you'd want would be something like:
>
> fdt_graft(void *fdt, int offset, void *subtree);
>
> Which would graft the tree blob give by subtree into the "master" tree
> (fdt) at node 'offset'. Actually that might need to take a name for
> the top-level of the subtree to take in the new tree too.
I called the function fdt_overlay, but I guess the implementation is
similar to what you thought of. I pushed it here, see the topmost 3 commits:
https://github.com/zonque/dtc/commits/overlay
> Things get trickier when you consider what might need to be tweaked in
> the subtree to make it fit into the master tree. If it requires
> widespread alterations through the subtree that's going to get really
> ugly and I think you would be better off with a firmware with a fuller
> handling of a "live" device tree. But I think that can probably be
> avoided with proper design of the bindings.
>
> To get that to work you'll need to make sure you use some sort of
> local addressing within the subtree. Then it should only be necessary
> to insert/alter a "ranges" property at the top level of the subtree
> (or possibly its parent) to map that correctly into the global address
> space. Likewise interrupts within the subtree probably shouldn't
> address an external interrupt controller but rather the root of the
> tree. You can then insert an "interrupt-map" property which will
> wire those into the global interrupt tree.
As pointed out on another end of this thread, the use of my simple
implementation is rather limited. I need to think about something more
sophisticated, or abadon the idea alltogether.
Thanks,
Daniel
next prev parent reply other threads:[~2012-11-01 9:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 9:47 [U-Boot] Merging device trees at runtime for module-based systems Daniel Mack
2012-10-25 12:44 ` Wolfgang Denk
2012-10-25 12:53 ` Daniel Mack
2012-10-25 20:46 ` Wolfgang Denk
2012-10-26 0:53 ` David Gibson
2012-10-26 7:24 ` Daniel Mack
2012-10-26 18:21 ` Simon Glass
2012-11-01 3:26 ` David Gibson
2012-11-01 9:24 ` Daniel Mack [this message]
2012-11-03 15:25 ` David Gibson
2012-11-03 15:35 ` Daniel Mack
2012-10-26 18:39 ` Stephen Warren
2012-10-26 20:06 ` Wolfgang Denk
2012-10-31 23:00 ` Daniel Mack
2012-10-31 23:13 ` Stephen Warren
2012-10-31 23:21 ` Daniel Mack
2012-10-31 23:56 ` Mitch Bradley
2012-11-01 4:36 ` Stephen Warren
2012-11-01 5:02 ` Mitch Bradley
2012-11-02 4:53 ` David Gibson
2012-11-06 23:05 ` Grant Likely
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=50923FB6.6020708@gmail.com \
--to=zonque@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox