From d6330064634aa698c0a686002ceeb19b3de0d71f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 15 Nov 2018 18:43:56 -0700 Subject: spl: Add a define for SPL_TPL_PROMPT We should use a macro rather than hard-coding the SPL prompt to 'spl' since the code can be used by TPL too. Add a macro that works for both and use it in various places. This allows TPL to use the same code without printing confusing messages. Note that the string is lower case ('spl', 'tpl') which is a change from previously. Reviewed-by: Tom Rini Signed-off-by: Simon Glass --- include/spl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/spl.h') diff --git a/include/spl.h b/include/spl.h index a56032ae3e..205aaff4b9 100644 --- a/include/spl.h +++ b/include/spl.h @@ -48,6 +48,19 @@ static inline bool u_boot_first_phase(void) return false; } +/* A string name for SPL or TPL */ +#ifdef CONFIG_SPL_BUILD +# ifdef CONFIG_TPL_BUILD +# define SPL_TPL_NAME "tpl" +# else +# define SPL_TPL_NAME "spl" +# endif +# define SPL_TPL_PROMPT SPL_TPL_NAME ": " +#else +# define SPL_TPL_NAME "" +# define SPL_TPL_PROMPT "" +#endif + struct spl_image_info { const char *name; u8 os; -- cgit v1.2.3