Skip to contentSkip to conversation

Uboot - verified boot - CONFIG_OF_SEPARATE

U-Boot Thilo Cestonaro 2 participants 2 messages Mar 11, 2014 – Sep 4, 2014

lore
Share & tools
lore
#0 lore raw

Hey!

When I build my Uboot with the CONFIG_OF_SEPARATE set to gain access to the compiled dtb, Uboot can't find my concatenated dtb during the boot. After injecting the pulbic keys for the verified boot, I cat the u-boot.dtb behind the u-boot.bin. After that I mkimage the u-boot.img as usuall.

I found, that if I change the offset where the fdt_blob is searched for by +300, it finds the dtb correctly.
Like this:
-------------------
#elif defined CONFIG_OF_SEPARATE

         /* FDT is at end of image */

- gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+ gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE + 300);
#endif
-------------------

But I can't explain why this might be. The 300 isn't a random value! I calculated it via some debug output and it works reliably. But like it is with these workarounds, I don't like them! So I'm searching for an answer.

Any ideas, why the offset is not _end_ofs + _TEXT_BASE, like it should be?

Cheers,
Thilo

#1 lore raw

Hi,

Quoted 18 lines · Thilo Cestonaro

Hey!

When I build my Uboot with the CONFIG_OF_SEPARATE set to gain access to the compiled dtb, Uboot can't find my concatenated dtb during the boot. After injecting the pulbic keys for the verified boot, I cat the u-boot.dtb behind the u-boot.bin. After that I mkimage the u-boot.img as usuall.

I found, that if I change the offset where the fdt_blob is searched for by +300, it finds the dtb correctly.
Like this:
-------------------
#elif defined CONFIG_OF_SEPARATE

        /* FDT is at end of image */
(quoted diff) +1 -2
-       gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+       gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE + 300);
 #endif
-------------------
Quoted 6 lines

But I can't explain why this might be. The 300 isn't a random value! I calculated it via some debug output and it works reliably. But like it is with these workarounds, I don't like them! So I'm searching for an answer.

Any ideas, why the offset is not _end_ofs + _TEXT_BASE, like it should be?

I just saw this now. You probably already know the outcome, but for the record, commit 8974292 added a check for this problem, and it was fixed for TI boards. Specifically for the Beaglebone, see doc/uImage.FIT/beaglebone_vboot.txt for a walk-through.

Regards,
Simon