How to patch Device Tree Blob in U-boot using Overlays
How it works
How to patch Device Tree Blob in U-boot using Overlays
Starting from U-boot 2018.07 released in Linux4SAM6.0, we can use the feature of patching the Device Tree Blob (DTB) with additional Device Tree Overlays (DTBO).
Traditional way of kernel booting
So far, to boot kernel with zImage and normal DTB, we would use a command like this:</br>
We can see the DTB is passed as the third argument to the command.
Loading overlays and applying them on top of the DTB
To apply the DTBO on top of the DTB, we need following commands:</br> This will load the original DTB.</br>
fatload mmc 0:1 ${fdtaddr} board.dtb
This will load the DTBO into memory</br>
fatload mmc 0:1 ${fdtovaddr} someoverlay.dtbo;
This will configure the address for fdt operations (we set it to the DRAM address where we loaded the base DTB)</br>
This will resize the original DTB to accommodate more space for the overlay</br>
This will apply the DTBO loaded at _fdtovaddr_ on top of the DTB at the address we configured with fdt addr </br>
This will boot the kernel with the DTB at _fdtaddr_ which now includes both the original DTB and the applied DTBO
Related Topics
Boards
Sama5d29Curiosity
Sam9x75Curiosity
Sam9x60Curiosity
Sama7g5-ek
Sama5d2icp
Sam9x60EK
Sama5d27WLSom1EK
Sama5d27Som1EK
Sama5d2PtcEK
Sama5d2Xplained
Sama5d4Xplained
Components
Summary
How to apply DTBOs in U-boot