mbox series

[u-boot,v2019.04-aspeed-openbmc,0/2] Store default u-boot env in

Message ID 20210618024758.892642-1-joel@jms.id.au
Headers show
Series Store default u-boot env in | expand

Message

Joel Stanley June 18, 2021, 2:47 a.m. UTC
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.

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.

The downside of this approach is we would need to keep the files in
sync, or change the yocto tooling so the in-flash environment is
generated from this copy.

Please respond with your thoughts on this approach.

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       | 9 +++++++++
 configs/ast2600_openbmc_spl_emmc_defconfig | 2 ++
 3 files changed, 13 insertions(+)
 create mode 100644 board/aspeed/ast2600_openbmc_mmc.txt

Comments

Andrew Jeffery June 18, 2021, 4:12 a.m. UTC | #1
On Fri, 18 Jun 2021, at 12:17, 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.
> 
> 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.
> 
> The downside of this approach is we would need to keep the files in
> sync, or change the yocto tooling so the in-flash environment is
> generated from this copy.

I think we just go ahead with your approach here until such time that we get sick of having to manually fix things up. When we get sick of it we figure out how we want to solve the synchronisation problem. What you have here is at least a step in the right direction.

Andrew
Adriana Kobylak June 18, 2021, 3:56 p.m. UTC | #2
> On Jun 17, 2021, at 11:12 PM, Andrew Jeffery <andrew@aj.id.au> wrote:
> 
> 
> 
> On Fri, 18 Jun 2021, at 12:17, 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.
>> 
>> 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.
>> 
>> The downside of this approach is we would need to keep the files in
>> sync, or change the yocto tooling so the in-flash environment is
>> generated from this copy.
> 
> I think we just go ahead with your approach here until such time that we get sick of having to manually fix things up. When we get sick of it we figure out how we want to solve the synchronisation problem. What you have here is at least a step in the right direction.

Agree we should get this change in, maintaining two files is a small price for being able to boot the BMC if the environment gets corrupted.
The u—boot recipe u-boot-aspeed-sdk_2019.04.bb is the one that installs the txt file into the environment partition, so I’d think it could grab the txt file from the u-boot source code instead. I’ll look at that after the u-boot changes are merged.


> 
> Andrew