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 <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-11-15 18:43:56 -07:00
committed by Tom Rini
parent 2d424eb0cd
commit d633006463
3 changed files with 29 additions and 13 deletions

View File

@@ -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;