Solve the problem of bad CRC when using u-boot-aspeed-sdk

George Liu liuxiwei1013 at gmail.com
Wed Dec 22 19:04:34 AEDT 2021


Hi, everyone:

The 64M flash used by Inspur's fp5280g2 machine has recently found
that it cannot be saved when setting the u-boot environment variable,
and then a warning message appears when rebooting:

```
Loading Environment from SPI Flash... SF: Detected mx66l51235l with
page size 256 Bytes, erase size 64 KiB, total 64 MiB
*** Warning-bad CRC, using default environment
```

Since fp5280g2 includes `openbmc-flash-layout-64.dtsi`, the initial problem is:
1. The value of CONFIG_ENV_SIZE and CONFIG_ENV_OFFSET[1] of u-boot is
inconsistent with the size of u-boot env of Kernel's
openbmc-flash-layout-64.dtsi[2].
2. The `Env. size` of the fw_env_ast2600_nor.config[3] file also needs
to be updated

After modifying the above problem and test by:
1. Use `setenv` to add a new environment variable in u-boot and reboot
BMC, and then use `fw_printenv` to see this value synchronously.
2. Use `fw_setenv` to add a new environment variable in BMC and reboot
BMC into u-boot, and then use `printenv` to see this value
synchronously.

We pushed a new patch to meta-inspur and it worked fine.
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/49916

[1]: https://github.com/openbmc/u-boot/blob/v2019.04-aspeed-openbmc/configs/evb-ast2500_defconfig#L5-L6
[2]: https://github.com/openbmc/linux/blob/dev-5.15/arch/arm/boot/dts/openbmc-flash-layout-64.dtsi#L16-L19
[3]: https://github.com/openbmc/openbmc/blob/master/meta-aspeed/recipes-bsp/u-boot/files/fw_env_ast2600_nor.config#L2


More information about the openbmc mailing list