diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-22 05:05:35 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-06-05 14:13:08 -0400 |
commit | 824bb1b45371efcb10561456e894d7c2fa1a4b88 (patch) | |
tree | ff61ce00e99cfac753c17891640f87dbe184524b /common/spl/spl.c | |
parent | 9d2542d062da9e1e3934f504b4d769998a76c991 (diff) |
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/spl/spl.c')
-rw-r--r-- | common/spl/spl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 0a49766f21..f493a3ad49 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -232,6 +232,13 @@ static int spl_common_init(bool setup_malloc) gd->malloc_ptr = 0; } #endif + ret = bootstage_init(true); + if (ret) { + debug("%s: Failed to set up bootstage: ret=%d\n", __func__, + ret); + return ret; + } + bootstage_mark_name(BOOTSTAGE_ID_START_SPL, "spl"); if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { ret = fdtdec_setup(); if (ret) { @@ -240,8 +247,10 @@ static int spl_common_init(bool setup_malloc) } } if (IS_ENABLED(CONFIG_SPL_DM)) { + bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL, "dm_spl"); /* With CONFIG_SPL_OF_PLATDATA, bring in all devices */ ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA)); + bootstage_accum(BOOTSTATE_ID_ACCUM_DM_SPL); if (ret) { debug("dm_init_and_scan() returned error %d\n", ret); return ret; @@ -421,6 +430,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } debug("loaded - jumping to U-Boot...\n"); +#ifdef CONFIG_BOOTSTAGE_STASH + int ret; + + bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl"); + ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR, + CONFIG_BOOTSTAGE_STASH_SIZE); + if (ret) + debug("Failed to stash bootstage: err=%d\n", ret); +#endif spl_board_prepare_for_boot(); jump_to_image_no_args(&spl_image); } |