summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-06-19 19:43:04 -0600
committerTom Rini <trini@konsulko.com>2016-07-14 18:33:11 -0400
commit982868264e7c61964bd392b10b2370f6757b14dc (patch)
tree000ca1498c874da8f84747fc05e81ca0499f691f /include/common.h
parent5e7f74332465f0addc05634d351df8eeaa2015d2 (diff)
Add warn_non_spl() to show a message in U-Boot proper
SPL tends to be more space-constrained that U-Boot proper. Some error messages are best suppressed in SPL. Add a macros to make this easy. warn_non_spl() does nothing when built in SPL code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index 1bb8a7956b..e9f0dea308 100644
--- a/include/common.h
+++ b/include/common.h
@@ -101,6 +101,12 @@ typedef volatile unsigned char vu_char;
#define _DEBUG 0
#endif
+#ifdef CONFIG_SPL_BUILD
+#define _SPL_BUILD 1
+#else
+#define _SPL_BUILD 0
+#endif
+
/* Define this at the top of a file to add a prefix to debug messages */
#ifndef pr_fmt
#define pr_fmt(fmt) fmt
@@ -121,6 +127,10 @@ typedef volatile unsigned char vu_char;
#define debug(fmt, args...) \
debug_cond(_DEBUG, fmt, ##args)
+/* Show a message if not in SPL */
+#define warn_non_spl(fmt, args...) \
+ debug_cond(!_SPL_BUILD, fmt, ##args)
+
/*
* An assertion is run-time check done in debug mode only. If DEBUG is not
* defined then it is skipped. If DEBUG is defined and the assertion fails,