* Unify the 64MiB flash layout @ 2021-05-27 7:13 Lei Yu 2021-05-27 12:33 ` Patrick Williams 2021-06-03 5:59 ` Joel Stanley 0 siblings, 2 replies; 6+ messages in thread From: Lei Yu @ 2021-05-27 7:13 UTC (permalink / raw) To: openbmc 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. [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 [4]: https://github.com/openbmc/openbmc/blob/master/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb -- BRs, Lei YU ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Unify the 64MiB flash layout 2021-05-27 7:13 Unify the 64MiB flash layout Lei Yu @ 2021-05-27 12:33 ` Patrick Williams 2021-06-03 5:59 ` Joel Stanley 1 sibling, 0 replies; 6+ messages in thread From: Patrick Williams @ 2021-05-27 12:33 UTC (permalink / raw) To: Lei Yu; +Cc: openbmc [-- Attachment #1: Type: text/plain, Size: 911 bytes --] On Thu, May 27, 2021 at 03:13:44PM +0800, Lei Yu wrote: > With the above changes, g220a system works fine with the new u-boot > and the updated flash layout. Does it work for the flash0 u-boot to be able to boot flash1's system? Maybe this doesn't affect g220a but in general we've found issues with changing these kind of layouts and not updating both flash banks. Due to our secureboot implementation, we're not able to update the primary flash bank (since it is write-protected). This change doesn't currently affect us right now, but if we're making a breaking change anyhow should we increase the u-boot partition sufficiently that it won't become an issue later on as ast2600 systems go into production? We've found that over time the size tends to get bigger with newer (more optimizing?) compilers, so I think we should ensure there is some buffer there. -- Patrick Williams [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Unify the 64MiB flash layout 2021-05-27 7:13 Unify the 64MiB flash layout Lei Yu 2021-05-27 12:33 ` Patrick Williams @ 2021-06-03 5:59 ` Joel Stanley 2021-06-09 5:30 ` Troy Lee 1 sibling, 1 reply; 6+ messages in thread From: Joel Stanley @ 2021-06-03 5:59 UTC (permalink / raw) To: Lei Yu, Quan Nguyen; +Cc: openbmc On Thu, 27 May 2021 at 07:14, Lei Yu <yulei.sh@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 > [4]: https://github.com/openbmc/openbmc/blob/master/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb > > -- > BRs, > Lei YU ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Unify the 64MiB flash layout 2021-06-03 5:59 ` Joel Stanley @ 2021-06-09 5:30 ` Troy Lee 2021-06-09 6:43 ` Lei Yu 0 siblings, 1 reply; 6+ messages in thread From: Troy Lee @ 2021-06-09 5:30 UTC (permalink / raw) To: Joel Stanley; +Cc: openbmc, Lei Yu, Quan Nguyen Hi Team, On Thu, Jun 3, 2021 at 2:00 PM Joel Stanley <joel@jms.id.au> wrote: > > On Thu, 27 May 2021 at 07:14, Lei Yu <yulei.sh@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 ``` > > [4]: https://github.com/openbmc/openbmc/blob/master/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb > > > > -- > > BRs, > > Lei YU Thanks, Troy Lee ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Unify the 64MiB flash layout 2021-06-09 5:30 ` Troy Lee @ 2021-06-09 6:43 ` Lei Yu 2021-06-09 8:32 ` Troy Lee 0 siblings, 1 reply; 6+ messages in thread From: Lei Yu @ 2021-06-09 6:43 UTC (permalink / raw) To: Troy Lee; +Cc: openbmc, Quan Nguyen On Wed, Jun 9, 2021 at 1:30 PM Troy Lee <leetroy@gmail.com> wrote: > > Hi Team, > > On Thu, Jun 3, 2021 at 2:00 PM Joel Stanley <joel@jms.id.au> wrote: > > > > On Thu, 27 May 2021 at 07:14, Lei Yu <yulei.sh@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? @Joel Does OpenBMC has its own open-sourced u-boot-spl that does the verification of the u-boot-proper? -- BRs, Lei YU ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Unify the 64MiB flash layout 2021-06-09 6:43 ` Lei Yu @ 2021-06-09 8:32 ` Troy Lee 0 siblings, 0 replies; 6+ messages in thread From: Troy Lee @ 2021-06-09 8:32 UTC (permalink / raw) To: Lei Yu; +Cc: openbmc, Quan Nguyen Hi Lei, On Wed, Jun 9, 2021 at 2:43 PM Lei Yu <yulei.sh@bytedance.com> wrote: > > On Wed, Jun 9, 2021 at 1:30 PM Troy Lee <leetroy@gmail.com> wrote: > > > > Hi Team, > > > > On Thu, Jun 3, 2021 at 2:00 PM Joel Stanley <joel@jms.id.au> wrote: > > > > > > On Thu, 27 May 2021 at 07:14, Lei Yu <yulei.sh@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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-06-09 8:33 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-05-27 7:13 Unify the 64MiB flash layout Lei Yu 2021-05-27 12:33 ` Patrick Williams 2021-06-03 5:59 ` Joel Stanley 2021-06-09 5:30 ` Troy Lee 2021-06-09 6:43 ` Lei Yu 2021-06-09 8:32 ` Troy Lee
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.