From 340f418acd1159588b2f0fb50561053212c4247d Mon Sep 17 00:00:00 2001 From: Eddie Cai Date: Wed, 15 Mar 2017 08:43:28 -0600 Subject: spl: Add spl_early_init() At present malloc_base/_limit/_ptr are not initialised in spl_init() when we call spl_init() in board_init_f(). This is due to a recent change aimed at avoiding overwriting the malloc area set up on some boards by spl_relocate_stack_gd(). However if CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN is not defined, we now skip setting up the memory area in spl_init() which is obviously wrong. To fix this, add a new function spl_early_init() which can be called in board_init_f(). Fixes: b3d2861e (spl: Remove overwrite of relocated malloc limit) Signed-off-by: Eddie Cai Rewrote spl_{,early_}init() to avoid duplicate code: Rewrite/expand commit message: Signed-off-by: Simon Glass Reviewed-by: Eddie Cai --- include/asm-generic/global_data.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/asm-generic') diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index e02863dc031..5b356dd231e 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -127,5 +127,6 @@ typedef struct global_data { #define GD_FLG_SKIP_RELOC 0x00800 /* Don't relocate */ #define GD_FLG_RECORD 0x01000 /* Record console */ #define GD_FLG_ENV_DEFAULT 0x02000 /* Default variable flag */ +#define GD_FLG_SPL_EARLY_INIT 0x04000 /* Early SPL init is done */ #endif /* __ASM_GENERIC_GBL_DATA_H */ -- cgit v1.2.3