diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/global_data.h | 1 | ||||
-rw-r--r-- | include/spl.h | 24 |
2 files changed, 22 insertions, 3 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index e02863dc03..5b356dd231 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 */ diff --git a/include/spl.h b/include/spl.h index bde44374ea..cdd196d187 100644 --- a/include/spl.h +++ b/include/spl.h @@ -213,11 +213,29 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image, struct blk_desc *block_dev, int partition); /** - * spl_init() - Set up device tree and driver model in SPL if enabled + * spl_early_init() - Set up device tree and driver model in SPL if enabled * * Call this function in board_init_f() if you want to use device tree and - * driver model early, before board_init_r() is called. This function will - * be called from board_init_r() if not called earlier. + * driver model early, before board_init_r() is called. + * + * If this is not called, then driver model will be inactive in SPL's + * board_init_f(), and no device tree will be available. + */ +int spl_early_init(void); + +/** + * spl_init() - Set up device tree and driver model in SPL if enabled + * + * You can optionally call spl_early_init(), then optionally call spl_init(). + * This function will be called from board_init_r() if not called earlier. + * + * Both spl_early_init() and spl_init() perform a similar function except that + * the latter will not set up the malloc() area if + * CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN is enabled, since it is assumed to + * already be done by a calll to spl_relocate_stack_gd() before board_init_r() + * is reached. + * + * This function will be called from board_init_r() if not called earlier. * * If this is not called, then driver model will be inactive in SPL's * board_init_f(), and no device tree will be available. |