Skip to contentSkip to conversation

DTB /OF_TREE Newbie and U-boot

U-Boot-Users Russell McGuire 3 participants 3 messages Jan 18, 2007

lore
Share & tools
lore
#0 lore raw

All,

Now that I have u-boot up and running on my MPC8360E I am going to begin trying to boot Linux 2.6.15 or newer.

However, I keep seeing mention of these Device Tree Blobs and OF_TREE's throughout the code.

I realize now that for SOC chips such as a MPC8360E that passing a DTB structure into the bootm command is probably a required step??? Is this True?

If so I see in some cases that this structure might be partly constructed within the U-boot code, at least I see code doing something with OF_TREE's.

1) Is the U-boot compilation process generating a .dtb structure that
we can burn into firmware, at least or certain CPU architectures?

2) Is this a manual process that requires an outside dtb compiler, and
if so why is U-boot code dealing with this?

3) Is this built into the bd_info structure?

Or I guess if somebody just has a documentation link I can just read, I didn't see anything about OF_TREE's in the DULG manual.

Thanks,

-Russ

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070118/65eecfba/attachment.htm

#1 lore raw
Quoted 3 lines · Russell McGuire

I realize now that for SOC chips such as a MPC8360E that passing a DTB structure into the bootm command is probably a required step??? Is this True?

Yes.

Quoted 3 lines

If so I see in some cases that this structure might be partly constructed within the U-boot code, at least I see code doing something with OF_TREE?s.

Yes, U-Boot updates the tree with its own values.

Quoted 2 lines

1) Is the U-boot compilation process generating a .dtb structure
that we can burn into firmware, at least or certain CPU architectures?

No. You need to use the DTC compiler, which is available here:
http://www.jdl.com/git_repos/?p=dtc.git

Quoted 1 line

2) Is this a manual process that requires an outside dtb compiler,

Yes.

Quoted 1 line

and if so why is U-boot code dealing with this?

Because the Linux kernel is currently coded such that the boot loader must pass the DTB to it. To reduce the amount of dual-maintenance, U-Boot can take some of the data that it knows about, and put that into the tree.

Quoted 1 line

3) Is this built into the bd_info structure?

I'm not sure I understand. The DTB itself is not part of U-Boot, but U-Boot can parse the tree and modify it.

Signature · 2 lines
Timur Tabi
Linux Kernel Developer @ Freescale
#2 lore raw
Quoted 1 line · Timur Tabi

Russell McGuire wrote:

[snip]

Quoted 4 lines
Quoted 1 line

3) Is this built into the bd_info structure?

I'm not sure I understand. The DTB itself is not part of U-Boot, but U-Boot can parse the tree and modify it.

The dtb obsoletes the bd_info structure (but that is directly or indirectly the source of some of the added information that bootm puts into the dtb). Instead of passing a pointer to a C struct that is defined both in u-boot and the kernel (which must be identical or literally nothing happens), the dtb is structured as a searchable key/value data structure that is well defined. If the necessary key/value is in there, it will be found an used. If not, that will be reported if possible (some errors, e.g. bad console port definitions, are obviously not recoverable).

HTH,
gvb