Dates and Events:
|
OSADL Articles:
2023-11-12 12:00
Open Source License Obligations Checklists even better nowImport the checklists to other tools, create context diffs and merged lists
2022-07-11 12:00
Call for participation in phase #4 of Open Source OPC UA open62541 support projectLetter of Intent fulfills wish list from recent survey
2022-01-13 12:00
Phase #3 of OSADL project on OPC UA PubSub over TSN successfully completedAnother important milestone on the way to interoperable Open Source real-time Ethernet has been reached
2021-02-09 12:00
Open Source OPC UA PubSub over TSN project phase #3 launchedLetter of Intent with call for participation is now available |
Help, my bootloader has no device tree support.
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
CONFIG_ARM_APPENDED_DTB
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.