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

Jason
2011-09-14T16:11:31Z

Simon,

On Wed, Sep 14, 2011 at 08:47:25AM -0700, Simon Glass wrote:
> On Wed, Sep 14, 2011 at 6:47 AM, Jason <u-boot@lakedaemon.net> wrote:
> > On Tue, Sep 13, 2011 at 02:06:56PM -0700, Simon Glass wrote:
> >> On Tue, Sep 13, 2011 at 7:37 AM, Jason <u-boot@lakedaemon.net> wrote:
> >> > Added the remote, thanks. ?Once we figure out the mach-types thing, I'll
> >> > try using the Marvell integrated RTC driver as a real-world example of a
> >> > conversion to fdt. ?I'll probably have questions ;-)
> >>
> >> That sounds great. I've tried to make it fair straightforward - with
> >> an option for building an fdt into U-Boot itself (i.e. don't define
> >> CONFIG_OF_SEPARATE). This should allow you to use your current dev
> >> flow.
> >
> > Okay, I have an initial version that compiles, but doesn't work. ?Which,
> > surprisingly, is progress. ?;-) ?I'll post the patch a little bit later
> > after I make sure I'm not missing something dumb.
>
> A few hints:
>
> - define CONFIG_OF_EMBED to start with, since it will embed the fdt
> inside U-Boot which is a good check that all is well. You can move to
> the more useful CONFIG_OF_SEPARATE when you get that working
> - there is a check in board.c that the fdt is accessible - if it is
> dying early then it might be that (early board panic patch is still in
> flight)

Frustrating morning. Mainly due to the fact that I've been working with
device trees all of two days.

Here's what I did:
1.) applied your patches against v2011.09-rc1 (to get mvrtc.c)
2.) applied my dreamplug support patch
3.) modified drivers/rtc/mvrtc.c for OF support
4.) compile
5.) run, then 'date' fails like so:

find_alias_node: rtc0
fdt_decode_next_alias failed.
Error decoding fdt for mvrtc.
## Get date failed

Obviously, I've hacked it up abit to get more error reporting out.
Here's my kirkwood-dreamplug.dts:

##### kirkwood-dreamplug.dts ####
/dts-v1/;

/include/ "kirkwood.dtsi"

/ {
model = "Marvell Dreamplug";
compatible = "marvell,dreamplug", "marvell,kirkwood";

rtc at 0xf1010300 {
status = "ok";
};
};
#################################

And the kirkwood.dtsi

#### kirkwood.dtsi ####
/ {
model = "Marvell Kirkwood";
compatible = "marvell,kirkwood";
#address-cells = <1>;
#size-cells = <1>;

cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu at 0 {
compatible = "arm,arm926ejs";
reg = <0>;
};
};

rtc at 0xf1010300 {
compatible = "marvell,kirkwood-rtc";
reg = <0xf1010300 0x02>;
status = "disabled";
};
};
#######################

I'd like to make sure my dts files are correct before I get to debugging
code. ;-)

A few notes:

If I compile with '#define DEBUG' in my board config, it builds, but
doesn't run, or at least, there's no output on the serial port.

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.

thx,

Jason.