Store default u-boot env in
Subsystems (2)
Joel Stanley
maintainerv2 cover Store default u-boot env in
This patch adds the u-boot environment to the u-boot binary, and a build fix for the new configuration that I have also sent upstream.
v2 uses the latest boot commands from openbmc.
We currently rely on the default environment being populated in the image. This has the downside that if something corrupts the environment, the system won't know how to boot itself.
The ast2600_openbmc_mmc.txt is copied from meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt.
Adriana has indicated she will update openbmc to use the .txt from the u-boot tree to generate the filesystem image (or we could stop doing that, and simply use the default?).
Joel Stanley (2):
Makefile: Conditionally add defaultenv_h to envtools target
ast2600: Add environment for booting from mmc
Makefile | 2 ++ board/aspeed/ast2600_openbmc_mmc.txt | 11 +++++++++++ configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt
Signature · 1 line
2.32.0
Joel Stanley
maintainerPATCH v2 1/2 Makefile: Conditionally add defaultenv_h to envtools target
When building the envtools target with CONFIG_USE_DEFAULT_ENV_FILE=y, the tools require generated/defaultenv_autogenerated.h.
In file included from tools/env/fw_env.c:126:
include/env_default.h:115:10: fatal error: generated/defaultenv_autogenerated.h: No such file or directory
115 | #include "generated/defaultenv_autogenerated.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- Makefile | 2 ++ 1 file changed, 2 insertions(+)
Makefile +2 -0
@@ -1581,6 +1581,8 @@ endif ifeq ($(CONFIG_USE_DEFAULT_ENV_FILE),y) prepare1: $(defaultenv_h) + +envtools: $(defaultenv_h) endif archprepare: prepare1 scripts_basic
Signature · 1 line
2.32.0
Joel Stanley
maintainerPATCH v2 2/2 ast2600: Add environment for booting from mmc
In reply to Joel StanleyThis adds the default environment from the OpenBMC project.
---
v2: Add latest environment from openbmc
--- board/aspeed/ast2600_openbmc_mmc.txt | 11 +++++++++++ configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt
board/aspeed/ast2600_openbmc_mmc.txt new file +11 -0
@@ -0,0 +1,11 @@ +bootargs=console=ttyS4,115200n8 +boota=setenv bootpart 2; setenv rootfs rofs-a; run bootmmc +bootb=setenv bootpart 3; setenv rootfs rofs-b; run bootmmc +bootcmd=setenv origbootargs ${bootargs}; run bootconfcmd; run bootsidecmd +bootconfcmd=if test ${fitconfig} -n; then setenv bootmconf "#${fitconfig}"; fi +bootdelay=2 +bootmmc=run setmmcargs; ext4load mmc 0:${bootpart} ${loadaddr} fitImage && bootm ${loadaddr}${bootmconf}; echo Error loading kernel FIT image with fitconfig ${fitconfig}; bootm ${loadaddr}; echo Error loading kernel FIT image +bootside=a +bootsidecmd=if test ${bootside} = b; then run bootb; run boota; else run boota; run bootb; fi +loadaddr=0x83000000 +setmmcargs=setenv bootargs ${origbootargs} rootwait root=PARTLABEL=${rootfs}
configs/ast2600_openbmc_spl_emmc_defconfig +2 -0
@@ -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
Signature · 1 line
2.32.0
Quoted 4 lines · Joel Stanley
This patch adds the u-boot environment to the u-boot binary, and a build fix for the new configuration that I have also sent upstream.
Quoted 9 lines
v2 uses the latest boot commands from openbmc.
We currently rely on the default environment being populated in the image. This has the downside that if something corrupts the environment, the system won't know how to boot itself.
The ast2600_openbmc_mmc.txt is copied from
meta-aspeed/recipes-bsp/u-boot/files/u-boot-env-ast2600.txt.
Just a note because I just stumbled on this, when these commits hit OpenBMC there will need to be an xxd-native package added as xxd is a build requirement for this.
Graeme
Quoted 17 lines
Adriana has indicated she will update openbmc to use the .txt from the u-boot tree to generate the filesystem image (or we could stop doing that, and simply use the default?).
Joel Stanley (2):
Makefile: Conditionally adddefaultenv_hto envtools target
ast2600: Add environment for booting from mmcMakefile | 2 ++ board/aspeed/ast2600_openbmc_mmc.txt | 11 +++++++++++ configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 board/aspeed/ast2600_openbmc_mmc.txtSignature · 1 line
2.32.0