board_init: Convert CONFIG_MALLOC_F_ADDR to Kconfig
PATCH 1/1 board_init: Convert CONFIG_MALLOC_F_ADDR to Kconfig
Convert CONFIG_MALLOC_F_ADDR to Kconfig.
The CL IoT gate board used MALLOC_F_ADDR 0x912000 on i.MX8M Mini unlike all the other platforms which use 0x930000 . This has been aligned with the other i.MX8M Mini platforms.
--- Kconfig | 44 +++++++++++++++++++++ arch/sandbox/cpu/start.c | 4 +- common/init/board_init.c | 4 +- common/spl/spl.c | 4 +- include/configs/capricorn-common.h | 2 - include/configs/cgtqmx8.h | 1 - include/configs/imx8mm-cl-iot-gate.h | 7 ---- include/configs/imx8mm_beacon.h | 7 ---- include/configs/imx8mm_data_modul_edm_sbc.h | 7 ---- include/configs/imx8mm_evk.h | 7 ---- include/configs/imx8mm_icore_mx8mm.h | 6 --- include/configs/imx8mm_venice.h | 7 ---- include/configs/imx8mn_beacon.h | 8 ---- include/configs/imx8mp_rsb3720.h | 5 --- include/configs/imx8mq_cm.h | 5 --- include/configs/imx8mq_evk.h | 4 -- include/configs/imx8mq_phanbell.h | 4 -- include/configs/imx8qm_mek.h | 1 - include/configs/imx8qxp_mek.h | 1 - include/configs/imx8ulp_evk.h | 6 --- include/configs/kontron-sl-mx8mm.h | 5 --- include/configs/kontron_pitx_imx8m.h | 5 --- include/configs/kontron_sl28.h | 5 --- include/configs/phycore_imx8mm.h | 6 --- include/configs/pico-imx8mq.h | 4 -- include/configs/sandbox.h | 2 - include/configs/verdin-imx8mm.h | 6 --- include/configs/verdin-imx8mp.h | 6 --- scripts/config_whitelist.txt | 1 - 29 files changed, 47 insertions(+), 127 deletions(-)
Kconfig +44 -0
@@ -286,6 +286,23 @@ config SYS_MALLOC_F particular needs this to operate, so that it can allocate the initial serial device and any others that are needed. +config MALLOC_F_ADDR + hex "Address of malloc() pool before relocation" + depends on SYS_MALLOC_F + default 0x120000 if ARCH_IMX8 + default 0x182000 if ARCH_IMX8M && IMX8MQ + default 0x930000 if ARCH_IMX8M && IMX8MM + default 0x184000 if ARCH_IMX8M && IMX8MN + default 0x184000 if ARCH_IMX8M && IMX8MP + default 0x22040000 if ARCH_IMX8ULP + default 0x18000000 if ARCH_LS1028A + default 0x10000 if SANDBOX + default 0x0 + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. This option selects + placement of early malloc pool. + config SYS_MALLOC_F_LEN hex "Size of malloc() pool before relocation" depends on SYS_MALLOC_F
@@ -320,6 +337,15 @@ config SYS_MALLOC_LEN This defines memory to be allocated for Dynamic allocation TODO: Use for other architectures +config SPL_MALLOC_F_ADDR + hex "Address of malloc() pool before relocation in SPL" + depends on SYS_MALLOC_F && SPL + default MALLOC_F_ADDR + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. This option selects + placement of early malloc pool in SPL. + config SPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in SPL" depends on SYS_MALLOC_F && SPL
@@ -335,6 +361,15 @@ config SPL_SYS_MALLOC_F_LEN It is possible to enable CONFIG_SYS_SPL_MALLOC_START to start a new malloc() region in SDRAM once it is inited. +config TPL_MALLOC_F_ADDR + hex "Address of malloc() pool before relocation in TPL" + depends on SYS_MALLOC_F && TPL + default SPL_MALLOC_F_ADDR + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. This option selects + placement of early malloc pool in TPL. + config TPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in TPL" depends on SYS_MALLOC_F && TPL
@@ -360,6 +395,15 @@ config VALGRIND it can be handled accurately by Valgrind. If you aren't planning on using valgrind to debug U-Boot, say 'n'. +config VPL_MALLOC_F_ADDR + hex "Address of malloc() pool before relocation in VPL" + depends on SYS_MALLOC_F && VPL + default MALLOC_F_ADDR + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. This option selects + placement of early malloc pool in VPL. + config VPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in VPL before relocation" depends on SYS_MALLOC_F && VPL
arch/sandbox/cpu/start.c +1 -3
@@ -506,9 +506,7 @@ int sandbox_main(int argc, char *argv[]) goto err; } -#if CONFIG_VAL (SYS_MALLOC_F_LEN ) - gd->malloc_base =CONFIG_MALLOC_F_ADDR ; -#endif + gd->malloc_base =CONFIG_VAL (MALLOC_F_ADDR );#if CONFIG_IS_ENABLED (LOG ) gd->default_log_level = state->default_log_level;#endif
common/init/board_init.c +1 -3
@@ -78,10 +78,8 @@ __weak void board_init_f_init_stack_protection(void)ulong board_init_f_alloc_reserve (ulong top) {/* Reserve early malloc arena */ -#ifndef CONFIG_MALLOC_F_ADDR -#if CONFIG_VAL (SYS_MALLOC_F_LEN ) +#if CONFIG_VAL (MALLOC_F_ADDR ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) top -=CONFIG_VAL (SYS_MALLOC_F_LEN ); -#endif #endif /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */ top =rounddown (top-sizeof (struct global_data ),16 );
common/spl/spl.c +1 -3
@@ -503,9 +503,7 @@ static int spl_common_init(bool setup_malloc)#if CONFIG_VAL (SYS_MALLOC_F_LEN )if (setup_malloc) { -#ifdef CONFIG_MALLOC_F_ADDR - gd->malloc_base =CONFIG_MALLOC_F_ADDR ; -#endif + gd->malloc_base =CONFIG_VAL (MALLOC_F_ADDR ); gd->malloc_limit =CONFIG_VAL (SYS_MALLOC_F_LEN ); gd->malloc_ptr =0 ; }
include/configs/capricorn-common.h +0 -2
@@ -17,8 +17,6 @@#define CONFIG_SYS_MONITOR_LEN (1024 * 1024) -#define CONFIG_MALLOC_F_ADDR 0x00120000 -#endif /* CONFIG_SPL_BUILD */ /* ENET1 connects to base board and MUX with ESAI */
include/configs/cgtqmx8.h +0 -1
@@ -15,7 +15,6 @@#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)#define CONFIG_SERIAL_LPUART_BASE 0x5a060000 -#define CONFIG_MALLOC_F_ADDR 0x00120000#endif
include/configs/imx8mm-cl-iot-gate.h +0 -7
@@ -15,13 +15,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x912000 -/* For RAW image gives a error info not panic */ - -#endif -/* GUIDs for capsule updatable firmware images */ #define IMX8MM_CL_IOT_GATE_FIT_IMAGE_GUID \ EFI_GUID(0x7a32a939, 0xab92, 0x467b, 0x91, 0x52, \
include/configs/imx8mm_beacon.h +0 -7
@@ -13,13 +13,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ - -#endif -/* Initial environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \
include/configs/imx8mm_data_modul_edm_sbc.h +0 -7
@@ -12,13 +12,6 @@#define CONFIG_SYS_MONITOR_LEN SZ_1M -#ifdef CONFIG_SPL_BUILD -#define CONFIG_MALLOC_F_ADDR 0x930000 - -/* For RAW image gives a error info not panic */ - -#endif -/* Link Definitions */ #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000#define CONFIG_SYS_INIT_RAM_SIZE 0x200000
include/configs/imx8mm_evk.h +0 -7
@@ -14,13 +14,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ - -#endif -#define BOOT_TARGET_DEVICES (func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \
include/configs/imx8mm_icore_mx8mm.h +0 -6
@@ -14,12 +14,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -# define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ -#endif /* CONFIG_SPL_BUILD */ -#define BOOT_TARGET_DEVICES (func) \ func(MMC, mmc, 2) \ func(MMC, mmc, 0)
include/configs/imx8mm_venice.h +0 -7
@@ -13,13 +13,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ - -#endif -#define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "fdt_addr_r=0x50200000\0" \
include/configs/imx8mn_beacon.h +0 -8
@@ -13,14 +13,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x184000 - -/* For RAW image gives a error info not panic */ - -#endif /* CONFIG_SPL_BUILD */ -/* Initial environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \
include/configs/imx8mp_rsb3720.h +0 -5
@@ -25,11 +25,6 @@ 0x5f, 0xd3, 0x6b, 0x9b, 0xe5, 0xb9)#ifdef CONFIG_SPL_BUILD -#define CONFIG_MALLOC_F_ADDR 0x184000/* malloc f used before \ -* GD_FLG_FULL_MALLOC_INIT \ -* set \ -*/ -#if defined(CONFIG_NAND_BOOT )#define CONFIG_SPL_NAND_MXS
include/configs/imx8mq_cm.h +0 -5
@@ -14,11 +14,6 @@#ifdef CONFIG_SPL_BUILD #define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ -#endif /* ENET Config */
include/configs/imx8mq_evk.h +0 -4
@@ -16,10 +16,6 @@/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ #define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ -#define CONFIG_POWER_PFUZE100 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08#endif
include/configs/imx8mq_phanbell.h +0 -4
@@ -14,10 +14,6 @@#ifdef CONFIG_SPL_BUILD /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ #define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ #endif /* ENET Config */
include/configs/imx8qm_mek.h +0 -1
@@ -14,7 +14,6 @@#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)#define CONFIG_SERIAL_LPUART_BASE 0x5a060000 -#define CONFIG_MALLOC_F_ADDR 0x00120000#endif
include/configs/imx8qxp_mek.h +0 -1
@@ -14,7 +14,6 @@#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)#define CONFIG_SERIAL_LPUART_BASE 0x5a060000 -#define CONFIG_MALLOC_F_ADDR 0x00120000#endif
include/configs/imx8ulp_evk.h +0 -6
@@ -12,12 +12,6 @@#define CONFIG_SYS_MONITOR_LEN (512 * 1024)#define CONFIG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -#define CONFIG_MALLOC_F_ADDR 0x22040000 - - -#endif -/* ENET Config */ #if defined(CONFIG_FEC_MXC )#define PHY_ANEG_TIMEOUT 20000
include/configs/kontron-sl-mx8mm.h +0 -5
@@ -45,11 +45,6 @@#undef BOOTENV_RUN_NET_USB_START#define BOOTENV_RUN_NET_USB_START -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -#endif -#define ENV_MEM_LAYOUT_SETTINGS \ "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "kernel_addr_r=0x42000000\0" \
include/configs/kontron_pitx_imx8m.h +0 -5
@@ -17,11 +17,6 @@#ifdef CONFIG_SPL_BUILD #define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ - -#define CONFIG_POWER_PFUZE100 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08#endif
include/configs/kontron_sl28.h +0 -5
@@ -30,11 +30,6 @@/* SMP */ #define CPU_RELEASE_ADDR secondary_boot_addr -/* generic timer */ - -/* early heap for SPL DM */ -#define CONFIG_MALLOC_F_ADDR CONFIG_SYS_FSL_OCRAM_BASE -/* serial port */ #define CONFIG_SYS_NS16550_CLK (get_bus_freq(0) / 2)
include/configs/phycore_imx8mm.h +0 -6
@@ -15,12 +15,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ -#endif -#define CONFIG_EXTRA_ENV_SETTINGS \ "image=Image\0" \ "console=ttymxc2,115200\0" \
include/configs/pico-imx8mq.h +0 -4
@@ -14,10 +14,6 @@#ifdef CONFIG_SPL_BUILD /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ #define CONFIG_SYS_SPL_PTE_RAM_BASE 0x41580000 - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x182000 -/* For RAW image gives a error info not panic */ #endif /* ENET Config */
include/configs/sandbox.h +0 -2
@@ -8,8 +8,6 @@#define CONFIG_IO_TRACE -#define CONFIG_MALLOC_F_ADDR 0x0010000 -/* GUIDs for capsule updatable firmware images */ #define SANDBOX_UBOOT_IMAGE_GUID \ EFI_GUID(0x09d7cf52, 0x0720, 0x4710, 0x91, 0xd1, \
include/configs/verdin-imx8mm.h +0 -6
@@ -13,12 +13,6 @@#define CONFIG_SYS_UBOOT_BASE \ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#ifdef CONFIG_SPL_BUILD -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x930000 -/* For RAW image gives a error info not panic */ -#endif -#define MEM_LAYOUT_ENV_SETTINGS \ "fdt_addr_r=0x44000000\0" \ "kernel_addr_r=0x42000000\0" \
include/configs/verdin-imx8mp.h +0 -6
@@ -14,12 +14,6 @@ (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)#ifdef CONFIG_SPL_BUILD -/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/ - -/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ -#define CONFIG_MALLOC_F_ADDR 0x184000 -/* For RAW image gives a error info not panic */ -#define CONFIG_POWER_PCA9450 #define CONFIG_SYS_I2C
scripts/config_whitelist.txt +0 -1
@@ -298,7 +298,6 @@ CONFIG_LPC32XX_NAND_SLC_WSETUP CONFIG_LPC32XX_NAND_SLC_WWIDTH CONFIG_LS102XA_STREAM_ID CONFIG_MACB_SEARCH_PHY -CONFIG_MALLOC_F_ADDR CONFIG_MALTA CONFIG_MAX_DSP_CPUS CONFIG_MAX_MEM_MAPPED
Signature · 1 line
2.35.1
Quoted 41 lines · Marek Vasut
Convert
CONFIG_MALLOC_F_ADDRtoKconfig.The CL IoT gate board used
MALLOC_F_ADDR0x912000on i.MX8M Mini unlike all the other platforms which use0x930000. This has been aligned with the other i.MX8M Mini platforms.Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Kirill Kapranov <[email protected]>Cc Peng Fan <[email protected]>Cc Peter Robinson <[email protected]>Cc Simon Glass <[email protected]>Cc Stefano Babic <[email protected]>Cc Tom Rini <[email protected]>Cc Uri Mashiach <[email protected]>Cc Valentin Raevsky <[email protected]>Cc Ying-Chun Liu (PaulLiu) <[email protected]>--- Kconfig | 44 +++++++++++++++++++++ arch/sandbox/cpu/start.c | 4 +- common/init/board_init.c | 4 +- common/spl/spl.c | 4 +- include/configs/capricorn-common.h | 2 - include/configs/cgtqmx8.h | 1 - include/configs/imx8mm-cl-iot-gate.h | 7 ---- include/configs/imx8mm_beacon.h | 7 ---- include/configs/imx8mm_data_modul_edm_sbc.h | 7 ---- include/configs/imx8mm_evk.h | 7 ---- include/configs/imx8mm_icore_mx8mm.h | 6 --- include/configs/imx8mm_venice.h | 7 ---- include/configs/imx8mn_beacon.h | 8 ---- include/configs/imx8mp_rsb3720.h | 5 --- include/configs/imx8mq_cm.h | 5 --- include/configs/imx8mq_evk.h | 4 -- include/configs/imx8mq_phanbell.h | 4 -- include/configs/imx8qm_mek.h | 1 - include/configs/imx8qxp_mek.h | 1 - include/configs/imx8ulp_evk.h | 6 --- include/configs/kontron-sl-mx8mm.h | 5 --- include/configs/kontron_pitx_imx8m.h | 5 ---
Quoted 8 lines
include/configs/kontron_sl28.h | 5 --- include/configs/phycore_imx8mm.h | 6 --- include/configs/pico-imx8mq.h | 4 -- include/configs/sandbox.h | 2 - include/configs/verdin-imx8mm.h | 6 --- include/configs/verdin-imx8mp.h | 6 --- scripts/config_whitelist.txt | 1 - 29 files changed, 47 insertions(+), 127 deletions(-)
Quoted 7 lines · Marek Vasut
Convert
CONFIG_MALLOC_F_ADDRtoKconfig.The CL IoT gate board used
MALLOC_F_ADDR0x912000on i.MX8M Mini unlike all the other platforms which use0x930000. This has been aligned with the other i.MX8M Mini platforms.Signed-off-by Marek Vasut <[email protected]>
[snip]
Quoted 6 lines
common/init/board_init.c +0
-0@@ -78,10 +78,8 @@ __weak void board_init_f_init_stack_protection(void)ulong board_init_f_alloc_reserve (ulong top)
common/init/board_init.c __weak void board_init_f_init_stack_protection(void) · line 85
Quoted 10 lines
common/init/board_init.c +1
-3{/* Reserve early malloc arena */ -#ifndef CONFIG_MALLOC_F_ADDR -#if CONFIG_VAL (SYS_MALLOC_F_LEN ) +#if CONFIG_VAL (MALLOC_F_ADDR ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) top -=CONFIG_VAL (SYS_MALLOC_F_LEN ); -#endif #endif /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */ top =rounddown (top-sizeof (struct global_data ),16 );
This isn't equivalent. It was "if we don't have MALLOC_F_ADDR but do have SYS_MALLOC_F_LEN ..." and now is "if we have MALLOC_F_ADDR and SYS_MALLOC_F_LEN ...". I changed this, and then nokia_rx51 passed in CI again (it was failing to boot at all). But still riscv and qemux86-64 and evb-ast2600 still fail to boot:
https://source.denx.de/u-boot/u-boot/-/pipelines/13296
Please re-check the migration, thanks.
Signature · 1 line
Tom
Quoted 22 lines · Tom Rini
Quoted 7 lines · Marek Vasut
Convert
CONFIG_MALLOC_F_ADDRtoKconfig.The CL IoT gate board used
MALLOC_F_ADDR0x912000on i.MX8M Mini unlike all the other platforms which use0x930000. This has been aligned with the other i.MX8M Mini platforms.Signed-off-by Marek Vasut <[email protected]>[snip]
Quoted 12 lines
common/init/board_init.c +1
-2@@ -78,10 +78,8 @@ __weak void board_init_f_init_stack_protection(void)ulong board_init_f_alloc_reserve (ulong top) {/* Reserve early malloc arena */ -#ifndef CONFIG_MALLOC_F_ADDR -#if CONFIG_VAL (SYS_MALLOC_F_LEN ) +#if CONFIG_VAL (MALLOC_F_ADDR ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) top -=CONFIG_VAL (SYS_MALLOC_F_LEN );
Quoted 8 lines
common/init/board_init.c __weak void board_init_f_init_stack_protection(void) · line 85
Quoted 4 lines
common/init/board_init.c +0
-1-#endif #endif /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */ top =rounddown (top-sizeof (struct global_data ),16 );This isn't equivalent. It was "if we don't have
MALLOC_F_ADDRbut do haveSYS_MALLOC_F_LEN..." and now is "if we haveMALLOC_F_ADDRandSYS_MALLOC_F_LEN...".
But this is not correct. It was
ifCONFIG_MALLOC_F_ADDR is not declared
and
CONFIG_{SPL,TPL,...}SYS_MALLOC_F_LEN is non-zero
With the switch to Kconfig, the MALLOC_F_ADDR is always declared, except for the cases where it was not declared before, it is set to 0. So the change to:
if
CONFIG_{SPL,TPL,...}MALLOC_F_ADDR is non-zero
and
CONFIG_{SPL,TPL,...}SYS_MALLOC_F_LEN is non-zero
seems equivalent to me, except of course for the handling of SPL/TPL part, which is done in the Kconfig
[...]
Quoted 43 lines · Marek Vasut
Quoted 22 lines · Tom Rini
Quoted 7 lines · Marek Vasut
Convert
CONFIG_MALLOC_F_ADDRtoKconfig.The CL IoT gate board used
MALLOC_F_ADDR0x912000on i.MX8M Mini unlike all the other platforms which use0x930000. This has been aligned with the other i.MX8M Mini platforms.Signed-off-by Marek Vasut <[email protected]>[snip]
Quoted 12 lines
common/init/board_init.c +1
-2@@ -78,10 +78,8 @@ __weak void board_init_f_init_stack_protection(void)ulong board_init_f_alloc_reserve (ulong top) {/* Reserve early malloc arena */ -#ifndef CONFIG_MALLOC_F_ADDR -#if CONFIG_VAL (SYS_MALLOC_F_LEN ) +#if CONFIG_VAL (MALLOC_F_ADDR ) &&CONFIG_VAL (SYS_MALLOC_F_LEN ) top -=CONFIG_VAL (SYS_MALLOC_F_LEN );Quoted 8 lines
common/init/board_init.c __weak void board_init_f_init_stack_protection(void) · line 85
Quoted 4 lines
common/init/board_init.c +0
-1-#endif #endif /* LAST : reserve GD (rounded up to a multiple of 16 bytes) */ top =rounddown (top-sizeof (struct global_data ),16 );This isn't equivalent. It was "if we don't have
MALLOC_F_ADDRbut do haveSYS_MALLOC_F_LEN..." and now is "if we haveMALLOC_F_ADDRandSYS_MALLOC_F_LEN...".But this is not correct. It was
if
CONFIG_MALLOC_F_ADDRis not declared
and
CONFIG_{SPL,TPL,...}SYS_MALLOC_F_LEN is non-zeroWith the switch to
Kconfig, theMALLOC_F_ADDRis always declared, except for the cases where it was not declared before, it is set to 0. So the change to:
Quoted 7 lines
if
CONFIG_{SPL,TPL,...}MALLOC_F_ADDR is non-zero
and
CONFIG_{SPL,TPL,...}SYS_MALLOC_F_LEN is non-zeroseems equivalent to me, except of course for the handling of SPL/TPL part, which is done in the
Kconfig
This is an annoying symbol to convert. With the exception of sandbox and kontron_sl28 (which I believe to be in error, no other imx boards do this, and it is an anti-pattern to set this symbol the way it's been set), this is only defined when CONFIG_SPL_BUILD is true. So we need to rename it to CONFIG_SPL_MALLOC_F_ADDR and then use it. And then yes, we need to switch to testing with CONFIG_VAL() and it being non-zero. I know I didn't take your original patch, and dug in more here because some platforms had binary size change here.
Signature · 1 line
Tom