aboutsummaryrefslogtreecommitdiff
path: root/include/bootstage.h
diff options
context:
space:
mode:
authorSimon Glass2023-09-26 08:14:32 -0600
committerTom Rini2023-10-06 14:38:12 -0400
commit17ba50106efe04ca5249ce33a8ef8374b584ee8d (patch)
tree9b563c2a670a0bb7da9bfd66d72478aaf2cef185 /include/bootstage.h
parent2003a83cc8b3937cda09e712c75f50f579eed3fa (diff)
spl: Remove #ifdefs with BOOTSTAGE
This feature has some helpers in its header file so that its functions resolve to nothing when the feature is disabled. Add a few more and use these to simplify the code. With this there are no more #ifdefs in board_init_r() Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bootstage.h')
-rw-r--r--include/bootstage.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/bootstage.h b/include/bootstage.h
index 685939ccffc..f9376c320c9 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -244,6 +244,8 @@ void show_boot_progress(int val);
#ifdef ENABLE_BOOTSTAGE
+#include <mapmem.h>
+
/* This is the full bootstage implementation */
/**
@@ -452,6 +454,26 @@ static inline int bootstage_init(bool first)
#endif /* ENABLE_BOOTSTAGE */
+/* helpers for SPL */
+int _bootstage_stash_default(void);
+int _bootstage_unstash_default(void);
+
+static inline int bootstage_stash_default(void)
+{
+ if (CONFIG_IS_ENABLED(BOOTSTAGE) && IS_ENABLED(CONFIG_BOOTSTAGE_STASH))
+ return _bootstage_stash_default();
+
+ return 0;
+}
+
+static inline int bootstage_unstash_default(void)
+{
+ if (CONFIG_IS_ENABLED(BOOTSTAGE) && IS_ENABLED(CONFIG_BOOTSTAGE_STASH))
+ return _bootstage_unstash_default();
+
+ return 0;
+}
+
/* Helper macro for adding a bootstage to a line of code */
#define BOOTSTAGE_MARKER() \
bootstage_mark_code(__FILE__, __func__, __LINE__)