Open Source Automation Development Lab
You are here: Home / OSADL / News / 
2016-02-14 - 11:00

Next OSADL Events:

Breaking News:

2014-11-18 00:00

Linux real-time: New stable release available -

but next one depends on more support from industrial users

2014-04-09 12:00

First LCA certificate issued

Major automation provider passed OSADL License Compliance Audit

2014-06-15 12:00 Age: 2 Years

Help, my bootloader has no device tree support.

By: Carsten Emde

How can I boot a recent kernel?

Yes, some vendors still ship bootloaders without device tree support, since their vendor kernel does not know what a device tree is and, thus, the bootloader neither does. But, fortunately, kernel developers are aware of it and implemented the


feature. What is this?

Append the device tree to the kernel

Since the bootloader loads the kernel into memory without asking any questions, we can fool the bootloader by making the kernel a little larger and append the device tree at its end. During the first steps of kernel initialization, the device tree is searched for at the end of the regular kernel code and used as if it had been loaded separately.

How do I prepare the kernel for this procedure?

In any case, CONFIG_ARM_APPENDED_DTB=y must be configured. If zImage is used to boot, simply execute

cd /usr/src/kernels/your-linux-tree
cd arch/your-arch/boot
cat zImage dts/your-device-tree.dtb >zImage-with-dtb

after having compiled the kernel as usual. If the uImage format is needed, you still have to execute the above commands. In addition, create a uImage file based on the combined zImage kernel as follows

cp zImage zImage-without-dtb
cp zImage-with-dtb zImage
cd -
make LOADADDR=$YOUR_LOADADDR ARCH=your-arch uImage
cd -
cp zImage-without-dtb zImage

and let the bootloader load the uImage file that now contains both the kernel and device tree.

Check for the correct model string

If everything worked correctly, you should see a line

Machine: Your generic board (Flattened Device Tree), model: your model string

that corresponds to the related setting in your device tree. This line is one of the first output lines after the kernel started execution.