Unify the 64MiB flash layout
Troy Lee
leetroy at gmail.com
Wed Jun 9 18:32:15 AEST 2021
Hi Lei,
On Wed, Jun 9, 2021 at 2:43 PM Lei Yu <yulei.sh at bytedance.com> wrote:
>
> On Wed, Jun 9, 2021 at 1:30 PM Troy Lee <leetroy at gmail.com> wrote:
> >
> > Hi Team,
> >
> > On Thu, Jun 3, 2021 at 2:00 PM Joel Stanley <joel at jms.id.au> wrote:
> > >
> > > On Thu, 27 May 2021 at 07:14, Lei Yu <yulei.sh at bytedance.com> wrote:
> > > >
> > > > This email is to share some information about the OpenBMC 64MiB flash layout.
> > > >
> > > > In current Linux kernel, there is openbmc-flash-layout-64.dtsi that is
> > > > being used on meta-bytedance/meta-g220a system, there is on-going
> > > > change[1] for aspeed-bmc-ampere-mtjade.dts to use the layout as well.
> > > >
> > > > However, according to ast2600's change[2], the layout does not fit
> > > > ast2600's u-boot, so it updates the layout by changing the existing
> > > > one.
> > > >
> > > > On g220a system, we have tested the new layout and verifies that it
> > > > works fine, with below changes
> > > > 1. Pick the ast2600's change[2] in kernel;
> > > > 2. Pick the `image_types_phosphor.bbclass` change[3];
> > > > 3. Update the u-boot env to boot from the new location, or use the new
> > > > u-boot-aspeed-sdk_2019.04.bb[4]
> > > > On g220a, we use the new u-boot.
> > > >
> > > > With the above changes, g220a system works fine with the new u-boot
> > > > and the updated flash layout.
> > > >
> > > > To make it consistent for both ast2500 and ast2600, it's better to use
> > > > the same flash layout (and u-boot).
> > > > So I would suggest merge the changes of [1] and [3], for now g220a and
> > > > meta-ampere/meta-jade could be impacted.
> > >
> > > Thanks for the summary Lei. I will merge [2] for v5.14 and backport it
> > > to dev-5.10.
> > >
> > > Cheers,
> > >
> > > Joel
> > >
> > > >
> > > > [1]: https://lore.kernel.org/openbmc/20210517040036.13667-4-quan@os.amperecomputing.com/
> > > > [2]: https://lore.kernel.org/linux-arm-kernel/20210316085932.2601-1-troy_lee@aspeedtech.com/
> > > > [3]: https://gerrit.openbmc-project.xyz/c/openbmc/meta-phosphor/+/39343
> > Thanks for Lei and Joel's help. For change [3], I have resubmitted it
> > against openbmc/openbmc repository.
> > Please refer to: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/43876
> >
> > And the patch has been verified with evb-ast2600 machine running with
> > AST2600-A3 EVB. However, to run on A3 EVB, the machine has to enable
> > SPL for u-boot by the following patch:
> > ```
> > diff --git a/meta-aspeed/conf/machine/evb-ast2600.conf
> > b/meta-aspeed/conf/machine/evb-ast2600.conf
> > index e011045d2..2915b599f 100644
> > --- a/meta-aspeed/conf/machine/evb-ast2600.conf
> > +++ b/meta-aspeed/conf/machine/evb-ast2600.conf
> > @@ -1,6 +1,7 @@
> > KERNEL_DEVICETREE = "aspeed-ast2600-evb.dtb"
> > -UBOOT_MACHINE = "ast2600_openbmc_defconfig"
> > -UBOOT_DEVICETREE = "ast2600a1-evb"
> > +UBOOT_MACHINE = "ast2600_openbmc_spl_defconfig"
> > +UBOOT_DEVICETREE = "ast2600-evb"
> > +SPL_BINARY = "spl/u-boot-spl.bin"
> >
> > require conf/machine/include/ast2600.inc
> > ```
>
> Thanks for the information.
> @Troy May I ask what the "spl/u-boot-spl.bin" is and do we have source
> code of it?
SPL stands for Secondary Program Loader in u-boot, it can be seem as a
small boot loader which runs in SRAM and inits DRAM, then it loads
u-boot.bin from SPI Flash/eMMC into DRAM.
You could turn enable it by setting "CONFIG_SPL=y" in defconfig.
The source code can be found in
- arch/arm/mach-aspeed/ast2600/spl
- common/spl
The u-boot.bin can be built as a FIT image, so that the SPL can verify
u-boot to achieve chain of trust.
After enables the CONFIG_SPL, you also have to tell yocto to copy
u-boot-spl.bin to the very beginning of image-u-boot and u-boot.bin at
64KB offset.
By setting the SPL_BINARY variable in machine config,
obmc-phosphor-image will handle the feature.
https://github.com/openbmc/openbmc/blob/77a1904b1833cd3b70b0dfd68671745eaacc9b19/meta-phosphor/classes/image_types_phosphor.bbclass#L239-L244
Troy
>
> @Joel Does OpenBMC has its own open-sourced u-boot-spl that does the
> verification of the u-boot-proper?
>
>
>
> --
> BRs,
> Lei YU
More information about the openbmc
mailing list