[PATCH v3 14/20] apalis-imx8: update env memory layout

Francesco Dolcini
2023-01-16T19:08:46Z

From: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Update the distro config env memory layout for the Apalis iMX8 aka
QuadMax:

- kernel_comp_addr_r=0xf0000000 temporary area for uncompressing (ie FIT
images or Image.gz booted using booti)
- kernel_comp_size=0x08000000
- loadaddr=0x95400000 avoiding any reserved areas located before that
- fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
- scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
- ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script

Basic idea of memory layout taken from commit fd5c7173ade4
("imx8m{m,n}_venice: update env memory layout"). However, moved past
any reserved areas to avoid any kind of conflicts.

Note that for our regular BSP Layers and Reference Images for Yocto
Project an updated distro boot script is required (see
meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
---
v3: added Reviewed-by: Fabio
v2: no changes
---
configs/apalis-imx8_defconfig | 2 +-
include/configs/apalis-imx8.h | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig
index ed5ea51d3398..e7f0cc9943a9 100644
--- a/configs/apalis-imx8_defconfig
+++ b/configs/apalis-imx8_defconfig
@@ -10,7 +10,7 @@ CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
CONFIG_TARGET_APALIS_IMX8=y
CONFIG_SYS_PROMPT="Apalis iMX8 # "
-CONFIG_SYS_LOAD_ADDR=0x80280000
+CONFIG_SYS_LOAD_ADDR=0x95400000
CONFIG_SYS_MEMTEST_START=0x88000000
CONFIG_SYS_MEMTEST_END=0x89000000
CONFIG_DISTRO_DEFAULTS=y
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index db4482786077..83050980eae6 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -15,10 +15,12 @@
#define CONFIG_SERVERIP 192.168.10.1

#define MEM_LAYOUT_ENV_SETTINGS \
- "fdt_addr_r=0x84000000\0" \
- "kernel_addr_r=0x82000000\0" \
- "ramdisk_addr_r=0x94400000\0" \
- "scriptaddr=0x87000000\0"
+ "fdt_addr_r=0x9d400000\0" \
+ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+ "kernel_comp_addr_r=0xf0000000\0" \
+ "kernel_comp_size=0x08000000\0" \
+ "ramdisk_addr_r=0x9d500000\0" \
+ "scriptaddr=0x9d480000\0"

/* Enable Distro Boot */
#define BOOT_TARGET_DEVICES(func) \
--
2.25.1