
On 06/26/2017 12:13 AM, Rob Clark wrote:
(the whole idea of a single static dtb for a SoC is nice in theory until you realize that complex SoC's like snapdragon are still pushing the boundaries of what we have figured out how to model in dt)
BR, -R
Have a look at Debian/Ubuntu package flash-kernel.
After installing a new kernel update-initramfs triggers flash-kernel. flash-kernel looks up the value provided by file /proc/device-tree/model in a database file to find the correct dtb and installs it in /boot. It further sets a symbolic link /boot/dtb to the dtb. So u-boot can simply load /boot/dtb and pass it to grub.
but this doesn't work if you want to be able to (for example) unplug a disk from device A and plug it in to device B, does it?
If static dtbs are not enough for your requirements look at device overlay trees.
I do have some interest in overlays, mostly because currently the firmware generates psuedo-random eth/wifi/bt MAC addrs based on some board specific info (like emmc part serial #, for example).. which we currently loose out from if not using the qcom specific lk->kernel boot chain. But I guess that is a bit of a different topic.
BR, -R
U-Boot can load device tree overlays. Here is what worked for me:
=> load mmc 0:1 0x01000000 dtb 29830 bytes read in 14 ms (2 MiB/s) => fdt addr 0x01000000 0x80000 => load mmc 0:1 0x01080000 rtc.dtbo 529 bytes read in 8 ms (64.5 KiB/s) => fdt apply 0x01080000 => load mmc 0:4 0x13000000 efi/debian/grubaa64.efi reading efi/debian/grubaa64.efi 120832 bytes read in 7 ms (16.5 MiB/s) => bootefi 0x13000000 0x01000000
U-Boot must be configured with CONFIG_OF_LIBFDT_OVERLAY to support device tree overlays.
Best regards
Heinrich Schuchardt