diff options
| author | Tom Rini <[email protected]> | 2023-10-06 17:23:47 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-10-06 17:23:47 -0400 |
| commit | 83aa0ed1e93e1ffac24888d98d37a5b04ed3fb07 (patch) | |
| tree | fcabaf4a86164f385ede03b654bc69cbffb2a3ee /include/spl.h | |
| parent | be2abe73df58a35da9e8d5afb13fccdf1b0faa8e (diff) | |
| parent | f69d3d6d10b15872a279aeb10b7c522627aff6c2 (diff) | |
Merge branch '2023-10-06-spl-prepare-for-universal-payload'
To quote the author:
This series tidies up SPL a little and adds some core ofnode functions
needed to support Universal Payload. It also includes a few minor
fix-ups for sandbox.
For SPL the changes include CONFIG naming, removing various #ifdefs and
tidying up the FIT code.
One notable piece of the ofnode improvements is support for flattening a
livetree. This should be useful in future as we move FDT fixups to use
the ofnode API.
Diffstat (limited to 'include/spl.h')
| -rw-r--r-- | include/spl.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/include/spl.h b/include/spl.h index 0fedddd00ef..a222db9c559 100644 --- a/include/spl.h +++ b/include/spl.h @@ -132,6 +132,16 @@ static inline enum u_boot_phase spl_phase(void) #endif } +/* returns true if in U-Boot proper, false if in SPL */ +static inline bool spl_in_proper(void) +{ +#ifdef CONFIG_SPL_BUILD + return false; +#endif + + return true; +} + /** * spl_prev_phase() - Figure out the previous U-Boot phase * @@ -263,6 +273,15 @@ struct spl_image_info { #endif }; +static inline void *spl_image_fdt_addr(struct spl_image_info *info) +{ +#if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL) + return info->fdt_addr; +#else + return 0; +#endif +} + /** * Information required to load data from a device * @@ -707,9 +726,13 @@ int spl_early_init(void); */ int spl_init(void); -#ifdef CONFIG_SPL_BOARD_INIT +/* + * spl_board_init() - Do board-specific init in SPL + * + * If xPL_BOARD_INIT is enabled, this is called from board_init_r() before + * jumping to the next phase. + */ void spl_board_init(void); -#endif /** * spl_was_boot_source() - check if U-Boot booted from SPL @@ -897,4 +920,15 @@ struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size); void board_boot_order(u32 *spl_boot_list); void spl_save_restore_data(void); + +/** + * spl_load_fit_image() - Fully parse and a FIT image in SPL + * + * @spl_image: SPL Image data to fill in + * @header: Pointer to FIT image + * Return 0 if OK, -ve on error + */ +int spl_load_fit_image(struct spl_image_info *spl_image, + const struct legacy_img_hdr *header); + #endif |
