All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in
@ 2021-06-21  6:41 Joel Stanley
  2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 1/2] Makefile: Conditionally add defaultenv_h to envtools target Joel Stanley
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joel Stanley @ 2021-06-21  6:41 UTC (permalink / raw)
  To: openbmc, Eddie James, Adriana Kobylak; +Cc: Andrew Jeffery


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

-- 
2.32.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH u-boot v2019.04-aspeed-openbmc v2 1/2] Makefile: Conditionally add defaultenv_h to envtools target
  2021-06-21  6:41 [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Joel Stanley
@ 2021-06-21  6:41 ` Joel Stanley
  2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 2/2] ast2600: Add environment for booting from mmc Joel Stanley
  2021-07-08 10:26 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Graeme Gregory
  2 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2021-06-21  6:41 UTC (permalink / raw)
  To: openbmc, Eddie James, Adriana Kobylak; +Cc: Andrew Jeffery

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"
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link: https://lore.kernel.org/u-boot/20210618020559.891395-1-joel@jms.id.au/
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index be0d9ea5c5bc..e1fa881b2aa4 100644
--- a/Makefile
+++ b/Makefile
@@ -1581,6 +1581,8 @@ endif
 
 ifeq ($(CONFIG_USE_DEFAULT_ENV_FILE),y)
 prepare1: $(defaultenv_h)
+
+envtools: $(defaultenv_h)
 endif
 
 archprepare: prepare1 scripts_basic
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH u-boot v2019.04-aspeed-openbmc v2 2/2] ast2600: Add environment for booting from mmc
  2021-06-21  6:41 [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Joel Stanley
  2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 1/2] Makefile: Conditionally add defaultenv_h to envtools target Joel Stanley
@ 2021-06-21  6:41 ` Joel Stanley
  2021-07-08 10:26 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Graeme Gregory
  2 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2021-06-21  6:41 UTC (permalink / raw)
  To: openbmc, Eddie James, Adriana Kobylak; +Cc: Andrew Jeffery

This adds the default environment from the OpenBMC project.

Reviewed-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
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

diff --git a/board/aspeed/ast2600_openbmc_mmc.txt b/board/aspeed/ast2600_openbmc_mmc.txt
new file mode 100644
index 000000000000..15dd2f5227ee
--- /dev/null
+++ b/board/aspeed/ast2600_openbmc_mmc.txt
@@ -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}
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in
  2021-06-21  6:41 [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Joel Stanley
  2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 1/2] Makefile: Conditionally add defaultenv_h to envtools target Joel Stanley
  2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 2/2] ast2600: Add environment for booting from mmc Joel Stanley
@ 2021-07-08 10:26 ` Graeme Gregory
  2 siblings, 0 replies; 4+ messages in thread
From: Graeme Gregory @ 2021-07-08 10:26 UTC (permalink / raw)
  To: Joel Stanley; +Cc: Andrew Jeffery, openbmc, Adriana Kobylak, Eddie James

On Mon, Jun 21, 2021 at 04:11:00PM +0930, Joel Stanley wrote:
> 
> 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.
> 

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

> 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
> 
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-08 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  6:41 [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Joel Stanley
2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 1/2] Makefile: Conditionally add defaultenv_h to envtools target Joel Stanley
2021-06-21  6:41 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 2/2] ast2600: Add environment for booting from mmc Joel Stanley
2021-07-08 10:26 ` [PATCH u-boot v2019.04-aspeed-openbmc v2 0/2] Store default u-boot env in Graeme Gregory

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.