summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-22 11:05:35 (GMT)
committerTom Rini <trini@konsulko.com>2017-06-05 18:13:08 (GMT)
commit824bb1b45371efcb10561456e894d7c2fa1a4b88 (patch)
treeff61ce00e99cfac753c17891640f87dbe184524b /common/board_f.c
parent9d2542d062da9e1e3934f504b4d769998a76c991 (diff)
downloadu-boot-fsl-qoriq-824bb1b45371efcb10561456e894d7c2fa1a4b88.tar.xz
bootstage: Support SPL
At present bootstage only supports U-Boot proper. But SPL can also consume boot time so it is useful to have the record start there. Add bootstage support to SPL. Also support stashing the timing information when SPL finishes so that it can be picked up and reported by U-Boot proper. This provides a full boot time record, excluding only the time taken by the boot ROM. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/common/board_f.c b/common/board_f.c
index a8fc28c..46e5284 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -707,11 +707,26 @@ static int jump_to_copy(void)
/* Record the board_init_f() bootstage (after arch_cpu_init()) */
static int initf_bootstage(void)
{
+#if defined(CONFIG_SPL_BOOTSTAGE) && defined(CONFIG_BOOTSTAGE_STASH)
+ bool from_spl = true;
+#else
+ bool from_spl = false;
+#endif
int ret;
- ret = bootstage_init(true);
+ ret = bootstage_init(!from_spl);
if (ret)
return ret;
+ if (from_spl) {
+ const void *stash = map_sysmem(CONFIG_BOOTSTAGE_STASH_ADDR,
+ CONFIG_BOOTSTAGE_STASH_SIZE);
+
+ ret = bootstage_unstash(stash, CONFIG_BOOTSTAGE_STASH_SIZE);
+ if (ret && ret != -ENOENT) {
+ debug("Failed to unstash bootstage: err=%d\n", ret);
+ return ret;
+ }
+ }
bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f");