MLK-21848-9 imx8qxp_mek: Update SPL base and SPL relevant configurations
authorYe Li <ye.li@nxp.com>
Fri, 26 Apr 2019 06:15:07 +0000 (23:15 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 10:38:55 +0000 (03:38 -0700)
Change the SPL base from OCRAM alias 0 to OCRAM 0x100000. We will jump
to OCRAM at early SPL init.

Also update the runtime memory address like: stack, BSS, malloc.
since the stack size includes a early malloc area which is increased
after using DM. In the new settings, We overlay the early malloc area
with real malloc area, so this can save 32KB size.

After container parser is enabled, need change SPL load offset accordingly

Signed-off-by: Ye Li <ye.li@nxp.com>
include/configs/imx8qxp_mek.h

index 0c875db..8366ffe 100644 (file)
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_PARSE_CONTAINER
-#define CONFIG_SPL_TEXT_BASE                           0x0
-#define CONFIG_SPL_MAX_SIZE                            (124 * 1024)
+#define CONFIG_SPL_TEXT_BASE                           0x100000
+#define CONFIG_SPL_MAX_SIZE                            (128 * 1024)
 #define CONFIG_SYS_MONITOR_LEN                         (1024 * 1024)
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0x250
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0x1040 /* (32K + 2Mb)/sector_size */
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x200000
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION             0
 
 #define CONFIG_SPL_LDSCRIPT            "arch/arm/cpu/armv8/u-boot-spl.lds"
-#define CONFIG_SPL_STACK               0x013E000
-#define CONFIG_SPL_BSS_START_ADDR      0x00128000
+/*
+ * The memory layout on stack:  DATA section save + gd + early malloc
+ * the idea is re-use the early malloc (CONFIG_SYS_MALLOC_F_LEN) with
+ * CONFIG_SYS_SPL_MALLOC_START
+ */
+#define CONFIG_SPL_STACK               0x0130000
+#define CONFIG_SPL_BSS_START_ADDR      0x00120000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x1000  /* 4 KB */
-#define CONFIG_SYS_SPL_MALLOC_START    0x00120000
-#define CONFIG_SYS_SPL_MALLOC_SIZE     0x3000  /* 12 KB */
+#define CONFIG_SYS_SPL_MALLOC_START    0x00128000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x18000 /* 96 KB */
 #define CONFIG_SERIAL_LPUART_BASE      0x5a060000
 #define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_MALLOC_F_ADDR           0x00120000
+#define CONFIG_MALLOC_F_ADDR           0x00128000
 
 #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE