aboutsummaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-26 08:14:32 -0600
committerTom Rini <trini@konsulko.com>2023-10-06 14:38:12 -0400
commit17ba50106efe04ca5249ce33a8ef8374b584ee8d (patch)
tree9b563c2a670a0bb7da9bfd66d72478aaf2cef185 /common/spl
parent2003a83cc8b3937cda09e712c75f50f579eed3fa (diff)
downloadu-boot-17ba50106efe04ca5249ce33a8ef8374b584ee8d.zip
u-boot-17ba50106efe04ca5249ce33a8ef8374b584ee8d.tar.gz
u-boot-17ba50106efe04ca5249ce33a8ef8374b584ee8d.tar.bz2
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 'common/spl')
-rw-r--r--common/spl/spl.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index d676a03..2239ee9 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -538,17 +538,11 @@ static int spl_common_init(bool setup_malloc)
ret);
return ret;
}
-#ifdef CONFIG_BOOTSTAGE_STASH
if (!u_boot_first_phase()) {
- const void *stash = map_sysmem(CONFIG_BOOTSTAGE_STASH_ADDR,
- CONFIG_BOOTSTAGE_STASH_SIZE);
-
- ret = bootstage_unstash(stash, CONFIG_BOOTSTAGE_STASH_SIZE);
+ ret = bootstage_unstash_default();
if (ret)
- debug("%s: Failed to unstash bootstage: ret=%d\n",
- __func__, ret);
+ log_debug("Failed to unstash bootstage: ret=%d\n", ret);
}
-#endif /* CONFIG_BOOTSTAGE_STASH */
bootstage_mark_name(get_bootstage_id(true),
spl_phase_name(spl_phase()));
#if CONFIG_IS_ENABLED(LOG)
@@ -866,12 +860,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
gd_malloc_ptr(), gd_malloc_ptr() / 1024);
bootstage_mark_name(get_bootstage_id(false), "end phase");
-#ifdef CONFIG_BOOTSTAGE_STASH
- ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
- CONFIG_BOOTSTAGE_STASH_SIZE);
+ ret = bootstage_stash_default();
if (ret)
debug("Failed to stash bootstage: err=%d\n", ret);
-#endif
if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)) {
struct udevice *dev;