From: Andre Przywara Date: Tue, 11 Jan 2022 12:46:03 +0000 (+0000) Subject: env: sunxi: Define location in SPI flash X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=2bdf213f915e29659b23844a2ef8105fbebd9566;p=u-boot.git env: sunxi: Define location in SPI flash To allow loading and storing the environment from SPI flash, adjust the raw offset variables for Allwinner boards to make sense there. U-Boot (including SPL and other blobs) is loaded from the beginning of SPI flash, so move the environment location as far back as possible, to not create unnecessary limits. As those offsets are shared with (now mostly unused) raw MMC environment, we should respect the common one megabyte limit, which also makes sense on SPI flash. So limit the environment for those raw locations to 64KB, and place it just below 1MB (@960KB). Those values are currently unused, unless someone forcibly enables the raw MMC environment. In this case it would break as of now, as the current offset of 544KB is far too low for the current (arm64) U-Boot proper. Signed-off-by: Andre Przywara Reviewed-by: Jagan Teki --- diff --git a/env/Kconfig b/env/Kconfig index 6dc8d8d860..45b7895047 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -536,7 +536,7 @@ config ENV_OFFSET ENV_IS_IN_SPI_FLASH default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH - default 0x88000 if ARCH_SUNXI + default 0xF0000 if ARCH_SUNXI default 0xE0000 if ARCH_ZYNQ default 0x1E00000 if ARCH_ZYNQMP default 0x7F40000 if ARCH_VERSAL @@ -559,7 +559,8 @@ config ENV_OFFSET_REDUND config ENV_SIZE hex "Environment Size" default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP - default 0x20000 if ARCH_SUNXI || ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 + default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 + default 0x10000 if ARCH_SUNXI default 0x8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL @@ -575,6 +576,7 @@ config ENV_SECT_SIZE default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 default 0x20000 if MICROBLAZE && ENV_IS_IN_SPI_FLASH + default 0x10000 if ARCH_SUNXI && ENV_IS_IN_SPI_FLASH help Size of the sector containing the environment.