DENX . DULG . LinuxFDTBlob

7.2. Flattened Device Tree Blob

Linux kernel expects certain information on the hardware that it runs on. For kernels compiled with fdt support, this information has the form of a device tree, which is based on the Open Firmware specification. Bootloaders like U-Boot that do not implement the Open Firmware API, are expected to pass to the kernel a binary form of the flattened device tree, commonly referred to as FDT blob or simply the blob.

Device trees are defined in human-readable text files, which are part of the Linux 2.6 source tree. Device tree source for the canyonlands board is found in arch/powerpc/boot/dts/canyonlands.dts file. Before the device tree can be passed to the kernel, it has to be compiled to the binary form by the dtc compiler. The dtc compiler is included with the Linux kernel since 2.6.25. Since 2.6.26 there is also a simple makefile rule to generate the blob:

make ARCH=powerpc CROSS_COMPILE=ppc_4xxFP- canyonlands.dtb

After the blob has been compiled, it has to be transferred from where it was built ("arch/powerpc/boot/canyonlands.dtb") to target's memory, for example over the TFTP protocol using U-Boot's tftp command. Then, the blob is passed to the kernel by the bootm command, and its address in memory is one of the arguments to bootm - refer to the description of this command in UBootCmdGroupExec for more details.

Note that U-Boot makes some automatic modifications to the blob before passing it to the kernel - mainly adding and modifying information that is learnt at run-time. See the board-specific function ft_board_setup() and related routines.

U-Boot also has provisions to alter a flattened device tree in arbitrary ways from the command line, refer to the description of the fdt commands found in UBootCmdFDT.


----- Revision r1.11 - 03 May 2012 - 12:08 - NickLeverton
Copyright © 2002-2020 by DENX Software Engineering