diff options
Diffstat (limited to 'include/spl.h')
-rw-r--r-- | include/spl.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/spl.h b/include/spl.h index c643943482..74a1939452 100644 --- a/include/spl.h +++ b/include/spl.h @@ -176,6 +176,27 @@ static inline const char *spl_phase_name(enum u_boot_phase phase) } } +/** + * spl_phase_prefix() - Get the prefix of the current phase + * + * @phase: Phase to look up + * @return phase prefix ("spl", "tpl", etc.) + */ +static inline const char *spl_phase_prefix(enum u_boot_phase phase) +{ + switch (phase) { + case PHASE_TPL: + return "tpl"; + case PHASE_SPL: + return "spl"; + case PHASE_BOARD_F: + case PHASE_BOARD_R: + return ""; + default: + return "phase?"; + } +} + /* A string name for SPL or TPL */ #ifdef CONFIG_SPL_BUILD # ifdef CONFIG_TPL_BUILD @@ -484,6 +505,16 @@ struct spl_image_loader { struct spl_boot_device *bootdev); }; +/* Helper function for accessing the name */ +static inline const char *spl_loader_name(const struct spl_image_loader *loader) +{ +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT + return loader->name; +#else + return NULL; +#endif +} + /* Declare an SPL image loader */ #define SPL_LOAD_IMAGE(__name) \ ll_entry_declare(struct spl_image_loader, __name, spl_image_loader) |