From 851a10e54604704eabed9f565f29e98627521fc6 Mon Sep 17 00:00:00 2001 From: zhanghaicheng Date: Thu, 23 Dec 2021 09:44:26 +0800 Subject: Fix the config error of u-boot-env When using 64M flash, the config of u-boot CONFIG_ENV_SIZE and CONFIG_ENV_OFFSET is wrong. The config file fw_env.config is wrong, too. Modify them according to the 64M flash dts file. Before correcting these errors, when we used setenv to set environment variables in u-boot, we could not use fw_printenv to get them. The reverse is also the same. Because they set different offset and size. Tested: 1. Use commands in u-boot: setenv test value saveenv After BMC starts, use fw_printenv can get "test=value" 2. Use the command to change the value of "test" fw_setenv test v We can get "test=v" in u-boot by printenv. Signed-off-by: zhanghaicheng Change-Id: I9eccf6abe743253b6f8c344a8b8648e68ab52019 --- meta-aspeed/conf/machine/distro/include/uboot-distrovars.inc | 1 + meta-aspeed/recipes-bsp/u-boot/files/fw_env_flash_64M_nor.config | 2 ++ meta-aspeed/recipes-bsp/u-boot/files/u-boot_flash_64M.cfg | 2 ++ meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb | 2 ++ meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb | 3 +++ 5 files changed, 10 insertions(+) create mode 100644 meta-aspeed/conf/machine/distro/include/uboot-distrovars.inc create mode 100644 meta-aspeed/recipes-bsp/u-boot/files/fw_env_flash_64M_nor.config create mode 100644 meta-aspeed/recipes-bsp/u-boot/files/u-boot_flash_64M.cfg (limited to 'meta-aspeed') diff --git a/meta-aspeed/conf/machine/distro/include/uboot-distrovars.inc b/meta-aspeed/conf/machine/distro/include/uboot-distrovars.inc new file mode 100644 index 000000000..81dcd3e5a --- /dev/null +++ b/meta-aspeed/conf/machine/distro/include/uboot-distrovars.inc @@ -0,0 +1 @@ +OVERRIDES .= ":uboot-flash-${FLASH_SIZE}" diff --git a/meta-aspeed/recipes-bsp/u-boot/files/fw_env_flash_64M_nor.config b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_flash_64M_nor.config new file mode 100644 index 000000000..52d088266 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/fw_env_flash_64M_nor.config @@ -0,0 +1,2 @@ +# MTD device name Device offset Env. size Flash sector size Number of sectors +/dev/mtd/u-boot-env 0x0000 0x20000 0x1000 diff --git a/meta-aspeed/recipes-bsp/u-boot/files/u-boot_flash_64M.cfg b/meta-aspeed/recipes-bsp/u-boot/files/u-boot_flash_64M.cfg new file mode 100644 index 000000000..b0f3f2891 --- /dev/null +++ b/meta-aspeed/recipes-bsp/u-boot/files/u-boot_flash_64M.cfg @@ -0,0 +1,2 @@ +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0xE0000 diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb index 8cf4a19fb..1b2820cb5 100644 --- a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb +++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb @@ -1,4 +1,5 @@ require u-boot-common-aspeed-sdk_${PV}.inc +require conf/machine/distro/include/uboot-distrovars.inc UBOOT_MAKE_TARGET ?= "DEVICE_TREE=${UBOOT_DEVICETREE}" @@ -7,6 +8,7 @@ require recipes-bsp/u-boot/u-boot.inc PROVIDES += "u-boot" DEPENDS += "bc-native dtc-native" +SRC_URI:append:uboot-flash-65536 = "file://u-boot_flash_64M.cfg" SRC_URI:append:df-phosphor-mmc = " file://u-boot-env-ast2600.txt" SRC_URI += " \ file://rsa_oem_dss_key.pem;sha256sum=64a379979200d39949d3e5b0038e3fdd5548600b2f7077a17e35422336075ad4 \ diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb index 90e120677..2708ae081 100644 --- a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb +++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb @@ -1,4 +1,5 @@ require u-boot-common-aspeed-sdk_${PV}.inc +require conf/machine/distro/include/uboot-distrovars.inc SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" DEPENDS += "mtd-utils" @@ -8,9 +9,11 @@ RPROVIDES:${PN} += "u-boot-fw-utils" SRC_URI += "file://fw_env_ast2600_nor.config" SRC_URI += "file://fw_env_ast2600_mmc.config" +SRC_URI += "file://fw_env_flash_64M_nor.config" ENV_CONFIG_FILE = "fw_env_ast2600_nor.config" ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config" +ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config" INSANE_SKIP:${PN} = "already-stripped" EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1' -- cgit v1.2.3