[U-Boot] Selecting from multiple device trees at runtime

Stephen Warren swarren at wwwdotorg.org
Mon Jan 7 19:36:54 CET 2013


On 01/07/2013 11:01 AM, Curt Brune wrote:
> Hello,
> 
> I am following up on this thread:
> "Merging device trees at runtime for module-based systems"
> http://lists.denx.de/pipermail/u-boot/2012-November/139618.html
> 
> I do not have a modular based system, so I do not need the full
> flexibility of merging DT fragments at runtime.  However, I am very
> interested in being able to select a full DT from a list of DT's at
> runtime.  I believe this is a degenerate case of the more general N x M
> modular case.
> 
> The background:  I have a number of different platforms running u-boot.
>  They all use the same Linux kernel and initramfs, but different DT.
> 
> What I would love is to have a single multi-file uImage I could use on
> all my platforms.  The idea is to introduce a new image type that is a
> list of device tree blobs.
> 
> The uImage would contain a list of dtb's and u-boot would select the
> correct one at runtime.  u-boot could iterate through the list
> inspecting the "model" property of the  root node.

For this scenario, why not just put each DTB file into the file-system
under a separate name, and use U-Boot's board variable to select the
correct one at run-time, e.g.:

ext2load ${devtype} ${devnum}:${rootpart} ${kernel_addr_r} /boot/zImage
ext2load ${devtype} ${devnum}:${rootpart} ${fdt_addr_r} \
	/boot/${soc}-${board}.dtb
bootz ${kernel_addr_r} - ${fdt_addr_r}



More information about the U-Boot mailing list