This page outlines how to build and deploy a device tree capable system based on a Linaro u-boot and kernel. This specific example is for an Overo COM. However, the values can be changed to target other devices.

Pre-req Reading

You may want to familiarize yourself with U-Boot and Kernel Deploy topics to help you through this document:

Building U-Boot

Grab the latest stable u-boot from Linaro and build it.

# Grab the code
$ git clone git://git.linaro.org/boot/u-boot-linaro-stable.git
$ cd u-boot-linaro-stable

# create the config (Overo COM specfic)
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=out omap3_overo_config

# build
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=out

You'll now have a device-tree capable binary under out/u-boot.bin

Building Kernel

Grab the latest stable kernel from Linaro:

$ git clone git://git.linaro.org/kernel/linux-linaro-2.6.38.git
$ cd linux-linaro-2.6.38

Create a default Linaro kernel config. Please see Kernel Deploy for how to generate your config file.

You'll now need to add device-tree configuration options to this file. Append these values to your .config file:

CONFIG_USE_OF=y
CONFIG_DTC=y
CONFIG_OF=y
CONFIG_PROC_DEVICETREE=y

At this point you can build a device-tree enabled kernel. You'll also need to generate the flattened device tree that U-Boot will pass to the kernel. You can generate this file with:

#NOTE: this is Overo COM specific
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=out omap3-overo.dtb

U-Boot Configuration

The boot.scr file used by U-Boot by Linaro builds will need to be updated to support your device tree. See the boot script how-to for instructions on converting between the boot.scr file and an editable text file.

The boot script will need to be updated with steps to load the device tree into memory and pass it to the bootm command. Here's an example used for Overo:

setenv dtbaddr 0x81600000
setenv bootcmd 'fatload mmc 0:1 0x80000000 uImage; fatload mmc 0:1 0x81700000 uInitrd; fatload mmc 0:1 ${dtbaddr} overo.dtb; fdt addr ${dtbaddr}; fdt resize; bootm 0x80000000 0x81700000 ${dtbaddr}'
setenv bootargs ' console=tty0 console=ttyO2,115200n8 root=/dev/mmcblk0p2 rootwait ro earlyprintk'
boot

NOTE: The DTB file copied from the kernel build was renamed to fit the 8.3 filename conventions of the FAT file-system.

Validating

At this point you should be able to copy your uImage, u-boot.bin, boot.scr and DTB file to your SD card. If all goes well the system should boot, and you should have some entries under /proc/device-tree like:

$ cat /proc/device-tree/compatible 
gumstix,omap3-overo


CategoryHowTo

Resources/HowTo/KernelDeviceTree (last modified 2011-04-05 19:19:52)