Load a Device tree overlay at boot time with Uboot and pass it to Kernel #457
-
Hello, when compiling one of the reference image that includes the "dt-overlay-mchp" package, the 4 dtso files available in linux4microchip/dt-overlay-mchp repository are proper compiled and the dtbo files are placed in the /boot target folder, as expected. The FIT image is also created with all the overlays included. In general, they could be loaded at boot time using bootm command in Uboot, but it's not clear to me how to do it with the provided Uboot Env infrastructure. I see a "design_overlays" procedure that depends on "no_of_overlays" variable in Uboot Env, but I do not understand how to use it to select a specific overlay from one of the 4 included in the fit image. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @Alb7954 , The device tree overlays provided as part of the dt-overlays-mchp repository can be loaded by U-boot using the bootm command. This is particularly useful for adding Click boards or Raspberry Pi HATs without needing to recompile the entire device tree blob. We have a few examples of this in the BSP, specifically for loading the qspi nand and nor overlays. Please refer to this U-boot source script. As shown in the link provided you could edit the boot.cmd source script in meta-polarfire-soc-bsp/recipes-bsp/u-boot/files/boot.cmd and edit the bootm start command to append an overlay. For example:
The command above is an example of how you can use the bootm command in U-Boot to load a specific device tree overlay along with the primary device tree blob. The It is worth mentioning that the overlay must be part of the fitImage to use the command above. In Yocto images, the FitImage is located in the first partition of the MMC/SD. It is also possible to apply overlays located in the /boot directory at runtime from the kernel. For this method, please see this document. On the other hand, the design_overlays command in U-boot is meant for a different purpose. This functionality is used to load device tree overlays from the internal SPI flash. This method is used for loading overlays related to fabric content at boot. Hope this clarifies things. |
Beta Was this translation helpful? Give feedback.
Hello @Alb7954 ,
The device tree overlays provided as part of the dt-overlays-mchp repository can be loaded by U-boot using the bootm command. This is particularly useful for adding Click boards or Raspberry Pi HATs without needing to recompile the entire device tree blob.
We have a few examples of this in the BSP, specifically for loading the qspi nand and nor overlays. Please refer to this U-boot source script.
As shown in the link provided you could edit the boot.cmd source script in meta-polarfire-soc-bsp/recipes-bsp/u-boot/files/boot.cmd and edit the bootm start command to append an overlay. For example: