From 08574ed339fb474e7d984a2e48160615286e4515 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 28 Oct 2022 20:27:07 -0400 Subject: Convert CONFIG_SYS_MONITOR_LEN to Kconfig This converts the following to Kconfig: CONFIG_SYS_MONITOR_LEN To do this, we set a default of 0 for everyone because there are a number of cases where we define CONFIG_SYS_MONITOR_LEN but the only impact is that we set TOTAL_MALLOC_LEN to be CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE, so we must continue to allow all boards to set this value. Update the SPL code to use 200 KB as the default raw U-Boot size directly, if we don't have a real CONFIG_SYS_MONITOR_LEN value. Signed-off-by: Tom Rini Reviewed-by: Simon Glass --- common/spl/spl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'common/spl/spl.c') diff --git a/common/spl/spl.c b/common/spl/spl.c index 6f2014b0e2..22d2a0621e 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -46,10 +46,6 @@ DECLARE_BINMAN_MAGIC_SYM; #ifndef CONFIG_SYS_UBOOT_START #define CONFIG_SYS_UBOOT_START CONFIG_TEXT_BASE #endif -#ifndef CONFIG_SYS_MONITOR_LEN -/* Unknown U-Boot size, let's assume it will not be more than 200 KB */ -#define CONFIG_SYS_MONITOR_LEN (200 * 1024) -#endif u32 *boot_params_ptr = NULL; @@ -232,11 +228,17 @@ __weak struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size) return map_sysmem(CONFIG_TEXT_BASE + offset, 0); } +#ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT void spl_set_header_raw_uboot(struct spl_image_info *spl_image) { ulong u_boot_pos = spl_get_image_pos(); +#if CONFIG_SYS_MONITOR_LEN != 0 spl_image->size = CONFIG_SYS_MONITOR_LEN; +#else + /* Unknown U-Boot size, let's assume it will not be more than 200 KB */ + spl_image->size = 200 * 1024; +#endif /* * Binman error cases: address of the end of the previous region or the @@ -254,6 +256,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) spl_image->os = IH_OS_U_BOOT; spl_image->name = "U-Boot"; } +#endif #if CONFIG_IS_ENABLED(LOAD_FIT_FULL) /* Parse and load full fitImage in SPL */ -- cgit v1.2.3