(Aspeed2600) Booting with a SPL loading U-boot fitImage

Dan Zhang dz4list at gmail.com
Wed Mar 3 04:12:53 AEDT 2021


FB/Verified-boot uses u-boot proper fit-image to reuse the fit sign and
verification code to load and verify u-boot and subordinate keys.
the booting and verify process is:
SPL :
 1. verify subordinate-keys within the u-boot proper fitimage.
 2. use the verified subordinate-keys to verify the u-boot and load it.
U-boot proper:
  1. use subordinate-keys verify os ( kernel, rootfs and fdt).

Refer to code below for how to create the u-boot proper fit-image.
https://github.com/facebook/openbmc/blob/helium/meta-aspeed/classes/kernel_fitimage.bbclass

Refer to code below for SPL verify and load u-boot proper fit. This is
quite a hack, not using the SPL image loading framework.
https://github.com/facebook/openbmc-uboot/blob/2fcac0176e5542a47e06e15d5052e6fb78c7432e/board/aspeed/ast-g5/ast-g5-spl.c#L483

BRs
Dan

On Tue, Mar 2, 2021 at 5:21 AM Klaus Heinrich Kiwi <klaus at linux.vnet.ibm.com>
wrote:

>
>
> On 3/2/2021 4:54 AM, Dan Zhang wrote:
>
> > I think within A FIT image, the u-boot binary is not located at your
> entry point 0x81000000,
> > it is behind the fit header, somewhere. This means the entry_point and
> load_addr is not the same as spl_boot.c defined.
> > spl_image->entry_point= CONFIG_ASPEED_UBOOT_DRAM_BASE;
> > spl_image->load_addr= CONFIG_ASPEED_UBOOT_DRAM_BASE;
> > Also, the u-boot code itself before relocation is position aware (
> SYS_TEXT_BASE must be set to 0x81000000, as your second try works). This
> means the entry_point shall be the same as SYS_TEXT_BASE.
>
> I think it's not that simple. See my answer (to myself) in this same
> thread with new information.
>
> > In fb/OpenBMC, verified boot implementation, use mkimage option:
> >    -p => place external data at a static position,
> > thus we specify the somewhere to a static offset , then you can set the
> entry_point = load_addr + offset.
>
> Verified boot should work if you are having u-boot proper validating the
> Linux Kernel fitimage, but I don't see how the Aspeed 2600 SPL would be
> able to load and verify the u-boot proper fitimage - the code simply isn't
> there..
>
> It seems to me that the SPL_LOAD_FIT code should handle recognizing the
> fitimage, moving it's 'loadables' images into memory and setting the entry
> point accordingly.
>
>   -Klaus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210302/ddbcf886/attachment.htm>


More information about the openbmc mailing list