[U-Boot] [RFC PATCH v2 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED)

Jason u-boot at lakedaemon.net
Wed Sep 14 22:16:23 CEST 2011


On Wed, Sep 14, 2011 at 01:05:58PM -0700, Simon Glass wrote:
> On Wed, Sep 14, 2011 at 12:50 PM, Jason <u-boot at lakedaemon.net> wrote:
> > On Wed, Sep 14, 2011 at 10:45:59AM -0700, Simon Glass wrote:
> 
> [snip]
> >> > 5.) run, then 'date' fails like so:
> >> >
> >> > find_alias_node: rtc0
> >> > fdt_decode_next_alias failed.
> >> > Error decoding fdt for mvrtc.
> >> > ## Get date failed
> >>
> >> I don't actually see an alias in your fdt. And actually I left it out
> >> of mine, so that is understandable. For i2c I have:
> >>
> >> ...
> >>       aliases {
> >>               i2c0 = "/i2c at 0x7000d000";
> >>               i2c1 = "/i2c at 0x7000c000";
> >>               i2c2 = "/i2c at 0x7000c400";
> >>               i2c3 = "/i2c at 0x7000c500";
> >>       };
> >
> > That worked!
> >
> > Marvell>> date
> > find_alias_node: rtc0
> > Date: 2011-09-14 (Wednesday)    Time: 14:04:54
> > Marvell>>
> >
> 
> Great!
> 
> >> So I think you need to add a /alias node and try again. I can submit a
> >> new patch set with this and a couple of other things I want to change,
> >> but it would be good if you can get to the end first, in case you find
> >> other problems.
> >
> > I'll clean up what I have and post it RFC.
> 
> OK good
> 
> >> > I had the remove your fdt_decode_i2c() and clock.h include.  The clock.h
> >> > include seems to be specific to the tegra2 and doesn't exist for
> >> > kirkwood.
> >>
> >> Yes that's right, it is just an example at this stage, and the idea of
> >> a periph_id is specific to Tegra at present. Patches 5 and 6 are just
> >> an example to show how to use it in code.
> >
> > Ok, I'll drop those from my branch to make a cleaner example.
> 
> Yes, ideally I would like to keep SOC-specific things out of it at
> this stage, but I was asked for an example and had to choose
> something! My hope is that we can have the base patch and then a
> couple of architecture patches.

Yes, I don't like putting fdt_decode_i2c() or fdt_decode_rtc() in
common/fdt_decode.c ...  The current implementation of fdt...i2c() is
arch specific, and fdt...rtc() I know will only work for the simple
integrated rtc with two registers.

Let me rework it to the appropriate place and then I'll post.  I'll also
remove the fdt...i2c().

thx,

Jason.


More information about the U-Boot mailing list