Message ID | 20210618024758.892642-3-joel@jms.id.au |
---|---|
State | New |
Headers | show |
Series | Store default u-boot env in | expand |
On Fri, Jun 18, 2021 at 10:49 AM Joel Stanley <joel@jms.id.au> wrote: > > This adds the default environment from the OpenBMC project. > > Signed-off-by: Joel Stanley <joel@jms.id.au> > --- > board/aspeed/ast2600_openbmc_mmc.txt | 9 +++++++++ > configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ > 2 files changed, 11 insertions(+) > create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt > > diff --git a/board/aspeed/ast2600_openbmc_mmc.txt b/board/aspeed/ast2600_openbmc_mmc.txt > new file mode 100644 > index 000000000000..47a474c92d70 > --- /dev/null > +++ b/board/aspeed/ast2600_openbmc_mmc.txt > @@ -0,0 +1,9 @@ > +bootargs=console=ttyS4,115200n8 > +boota=setenv bootpart 2; setenv rootfs rofs-a; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image > +bootb=setenv bootpart 3; setenv rootfs rofs-b; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image > +bootcmd=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi > +bootdelay=2 > +bootside=a > +loadaddr=0x83000000 > +rootfs=rofs-a > +setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs} > diff --git a/configs/ast2600_openbmc_spl_emmc_defconfig b/configs/ast2600_openbmc_spl_emmc_defconfig > index c5d03721c97a..344a4d8f9c96 100644 > --- a/configs/ast2600_openbmc_spl_emmc_defconfig > +++ b/configs/ast2600_openbmc_spl_emmc_defconfig > @@ -83,6 +83,8 @@ CONFIG_CMD_MTDPARTS=y > # CONFIG_SPL_EFI_PARTITION is not set > CONFIG_SPL_OF_CONTROL=y > CONFIG_ENV_IS_IN_MMC=y > +CONFIG_USE_DEFAULT_ENV_FILE=y > +CONFIG_DEFAULT_ENV_FILE="board/aspeed/ast2600_openbmc_mmc.txt" This is good, we hit an issue before that is related to the default env not in the flash. Could you kindly help to make the same change for other configs? E.g. for ast2500/ast2600 evb config. > CONFIG_NET_RANDOM_ETHADDR=y > CONFIG_SPL_DM=y > CONFIG_REGMAP=y > -- > 2.32.0 >
Thanks Joel! There are some improvements to the boot command proposed here: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/41778 <https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/41778> Maybe we pick those changes up in this initial commit so the two environment files are in sync? Otherwise we can submit a follow-up patch latest to update this .txt file. > On Jun 17, 2021, at 9:47 PM, Joel Stanley <joel@jms.id.au> wrote: > > This adds the default environment from the OpenBMC project. > > Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Adriana Kobylak <anoo@us.ibm.com> > --- > board/aspeed/ast2600_openbmc_mmc.txt | 9 +++++++++ > configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ > 2 files changed, 11 insertions(+) > create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt > > diff --git a/board/aspeed/ast2600_openbmc_mmc.txt b/board/aspeed/ast2600_openbmc_mmc.txt > new file mode 100644 > index 000000000000..47a474c92d70 > --- /dev/null > +++ b/board/aspeed/ast2600_openbmc_mmc.txt > @@ -0,0 +1,9 @@ > +bootargs=console=ttyS4,115200n8 > +boota=setenv bootpart 2; setenv rootfs rofs-a; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image > +bootb=setenv bootpart 3; setenv rootfs rofs-b; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image > +bootcmd=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi > +bootdelay=2 > +bootside=a > +loadaddr=0x83000000 > +rootfs=rofs-a > +setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs} > diff --git a/configs/ast2600_openbmc_spl_emmc_defconfig b/configs/ast2600_openbmc_spl_emmc_defconfig > index c5d03721c97a..344a4d8f9c96 100644 > --- a/configs/ast2600_openbmc_spl_emmc_defconfig > +++ b/configs/ast2600_openbmc_spl_emmc_defconfig > @@ -83,6 +83,8 @@ CONFIG_CMD_MTDPARTS=y > # CONFIG_SPL_EFI_PARTITION is not set > CONFIG_SPL_OF_CONTROL=y > CONFIG_ENV_IS_IN_MMC=y > +CONFIG_USE_DEFAULT_ENV_FILE=y > +CONFIG_DEFAULT_ENV_FILE="board/aspeed/ast2600_openbmc_mmc.txt" > CONFIG_NET_RANDOM_ETHADDR=y > CONFIG_SPL_DM=y > CONFIG_REGMAP=y > -- > 2.32.0 >
On Fri, 18 Jun 2021 at 03:12, Lei Yu <yulei.sh@bytedance.com> wrote: > > On Fri, Jun 18, 2021 at 10:49 AM Joel Stanley <joel@jms.id.au> wrote: > > > > This adds the default environment from the OpenBMC project. > > +CONFIG_DEFAULT_ENV_FILE="board/aspeed/ast2600_openbmc_mmc.txt" > > This is good, we hit an issue before that is related to the default > env not in the flash. > Could you kindly help to make the same change for other configs? > E.g. for ast2500/ast2600 evb config. That's a good idea. Do you use the mmc or nor flash to boot the ast2600 evb? For the ast2500, the existing built-in config should work, as long as it's pointing to the correct flash offset. If it's not, then we can either update the existing bootcmd, or add a .txt with the desired config.
On Fri, 18 Jun 2021 at 15:52, Adriana Kobylak <anoo@linux.ibm.com> wrote: > > Thanks Joel! There are some improvements to the boot command proposed here: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/41778 > Maybe we pick those changes up in this initial commit so the two environment files are in sync? Otherwise we can submit a follow-up patch latest to update this .txt file. I didn't want to merge that change as it adds yet another command to the environment. However, I don't have a suggestion on how to change it, so I have merged it. I'll send a v2 of this patch set with the latest commands.
On Mon, Jun 21, 2021 at 2:17 PM Joel Stanley <joel@jms.id.au> wrote: > > On Fri, 18 Jun 2021 at 03:12, Lei Yu <yulei.sh@bytedance.com> wrote: > > > > On Fri, Jun 18, 2021 at 10:49 AM Joel Stanley <joel@jms.id.au> wrote: > > > > > > This adds the default environment from the OpenBMC project. > > > > +CONFIG_DEFAULT_ENV_FILE="board/aspeed/ast2600_openbmc_mmc.txt" > > > > This is good, we hit an issue before that is related to the default > > env not in the flash. > > Could you kindly help to make the same change for other configs? > > E.g. for ast2500/ast2600 evb config. > > That's a good idea. > > Do you use the mmc or nor flash to boot the ast2600 evb? We use 64M nor flash on ast2600 > > For the ast2500, the existing built-in config should work, as long as > it's pointing to the correct flash offset. If it's not, then we can > either update the existing bootcmd, or add a .txt with the desired > config. On ast2500, we hit an issue that is described in the below Discord thread. https://discord.com/channels/775381525260664832/775381525260664836/847735311290073108 Basically it's related to the default env in the u-boot code is not sync with the u-boot-env partition.
diff --git a/board/aspeed/ast2600_openbmc_mmc.txt b/board/aspeed/ast2600_openbmc_mmc.txt new file mode 100644 index 000000000000..47a474c92d70 --- /dev/null +++ b/board/aspeed/ast2600_openbmc_mmc.txt @@ -0,0 +1,9 @@ +bootargs=console=ttyS4,115200n8 +boota=setenv bootpart 2; setenv rootfs rofs-a; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootb=setenv bootpart 3; setenv rootfs rofs-b; run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm; echo Error loading kernel FIT image +bootcmd=if test "${bootside}" = "b"; then run bootb; run boota; else run boota; run bootb; fi +bootdelay=2 +bootside=a +loadaddr=0x83000000 +rootfs=rofs-a +setmmcargs=setenv bootargs ${bootargs} rootwait root=PARTLABEL=${rootfs} diff --git a/configs/ast2600_openbmc_spl_emmc_defconfig b/configs/ast2600_openbmc_spl_emmc_defconfig index c5d03721c97a..344a4d8f9c96 100644 --- a/configs/ast2600_openbmc_spl_emmc_defconfig +++ b/configs/ast2600_openbmc_spl_emmc_defconfig @@ -83,6 +83,8 @@ CONFIG_CMD_MTDPARTS=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SPL_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_USE_DEFAULT_ENV_FILE=y +CONFIG_DEFAULT_ENV_FILE="board/aspeed/ast2600_openbmc_mmc.txt" CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM=y CONFIG_REGMAP=y
This adds the default environment from the OpenBMC project. Signed-off-by: Joel Stanley <joel@jms.id.au> --- board/aspeed/ast2600_openbmc_mmc.txt | 9 +++++++++ configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt