diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-01 09:34:35 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-01 09:34:35 -0400 |
commit | bb1bb4bb5df9df4d3f07e39a632daaff79e4b77e (patch) | |
tree | 1ed8d0b3622961997a32cd648d5d1bd3de7a855a /common/spl | |
parent | 82679624f9aa6d1be733c46f3555d5166b6f5b72 (diff) | |
parent | d60ae4c59df55c08dc96202ff58fed21ab3afb7d (diff) | |
download | u-boot-bb1bb4bb5df9df4d3f07e39a632daaff79e4b77e.tar.gz |
Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dm
- Fix for patman with email addresses containing commas
- Bootstage improvements for TPL, SPL
- Various sandbox and dm improvements and fixes
Diffstat (limited to 'common/spl')
-rw-r--r-- | common/spl/spl.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index a9d3e847af..f1ad8dc9da 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -18,6 +18,7 @@ #include <version.h> #include <image.h> #include <malloc.h> +#include <mapmem.h> #include <dm/root.h> #include <linux/compiler.h> #include <fdt_support.h> @@ -396,13 +397,25 @@ static int spl_common_init(bool setup_malloc) gd->malloc_ptr = 0; } #endif - ret = bootstage_init(true); + ret = bootstage_init(u_boot_first_phase()); if (ret) { debug("%s: Failed to set up bootstage: ret=%d\n", __func__, ret); return ret; } - bootstage_mark_name(BOOTSTAGE_ID_START_SPL, "spl"); +#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); + if (ret) + debug("%s: Failed to unstash bootstage: ret=%d\n", + __func__, ret); + } +#endif /* CONFIG_BOOTSTAGE_STASH */ + bootstage_mark_name(spl_phase() == PHASE_TPL ? BOOTSTAGE_ID_START_TPL : + BOOTSTAGE_ID_START_SPL, SPL_TPL_NAME); #if CONFIG_IS_ENABLED(LOG) ret = log_init(); if (ret) { @@ -418,7 +431,8 @@ static int spl_common_init(bool setup_malloc) } } if (CONFIG_IS_ENABLED(DM)) { - bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL, "dm_spl"); + bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL, + spl_phase() == PHASE_TPL ? "dm tpl" : "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); @@ -704,8 +718,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr, gd->malloc_ptr / 1024); #endif + bootstage_mark_name(spl_phase() == PHASE_TPL ? BOOTSTAGE_ID_END_TPL : + BOOTSTAGE_ID_END_SPL, "end " SPL_TPL_NAME); #ifdef CONFIG_BOOTSTAGE_STASH - bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl"); ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR, CONFIG_BOOTSTAGE_STASH_SIZE); if (ret) |