summaryrefslogtreecommitdiffstats
path: root/include/spl.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-15 18:43:56 -0700
committerTom Rini <trini@konsulko.com>2018-11-26 08:25:34 -0500
commitd6330064634aa698c0a686002ceeb19b3de0d71f (patch)
tree0d23c8414619ad3b11504fc18c8dd340f96824ec /include/spl.h
parent2d424eb0cd6fc5c0060756e41feec3ec7e483678 (diff)
downloadu-boot-d6330064634aa698c0a686002ceeb19b3de0d71f.tar.gz
u-boot-d6330064634aa698c0a686002ceeb19b3de0d71f.tar.xz
u-boot-d6330064634aa698c0a686002ceeb19b3de0d71f.zip
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>
Diffstat (limited to 'include/spl.h')
-rw-r--r--include/spl.h13
1 files changed, 13 insertions, 0 deletions
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;