[U-Boot] FDT howto

Simon Glass sjg at chromium.org
Sun Feb 24 16:54:56 CET 2013


Hi Jagan,

On Thu, Feb 21, 2013 at 9:03 AM, Jagan Teki <jagannadh.teki at gmail.com> wrote:
> Hi All,
>
> I am planning to use devicetree on u-boot.
> I have an experience to work with devicetree on Linux.
>
> For u-boot, I have read doc from doc/README.fdt-control.
> I see some dts usages on tegra boards.
>
> I have lot of confusions with the concept itself.
>
> Is Linux and u-boot devicetree concept and build system are same?

I don't really understand this question sorry. U-Boot and Linux use
the device tree mainly for run-time configuration of drivers, so that
the same driver code can operate on different boards.

>
> Suppose I have 4 boards J1, J2, J3 & J4 on my soc "emb".of vendor "vast"
>    For this requirement I have
>    board/vast/dts/J1.dts
>    board/vast/dts/J2.dts
>    board/vast/dts/J3.dts
>    board/vast/dts/J4.dts
>
>    include/configs/emb_common.h ==> single configuration of all SOC
> needed definitions
>    like defconfig in Linux.
>
>    do I need any more files?

That's enough for the basics I think.

>
>    In emb_common.h i am defining
>    CONFIG_OF_SEPARATE is it sufficient?

And CONFIG_OF_CONTROL

>
>    My plan is to build u-boot and then build the dtb with specific
> board and then combine.

That's fine, and is how we do things on Chromium also. U-Boot tries to
build an FDT even with CONFIG_OF_SEPARATE, so you need to put a
default device tree file in your emb_common.h file that it can find.
But you can ignore it, and for flashing your boards just use
u-boot.bin plus whatever .dtb you want to select.

>
> I saw that all tegra boards config files are defining
> CONFIG_DEFAULT_DEVICE_TREE if ie. the case dts is a compile time
> option right.
> am i correct?

Yes - see above. This is convenient for testing and development.

>
> Please let me know your inputs.

Regards,
Simon

>
> --
> Thanks,
> Jagan.


More information about the U-Boot mailing list