summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-22 05:05:25 -0600
committerTom Rini <trini@konsulko.com>2017-06-05 14:13:04 -0400
commitb383d6c05e2587a7b3ea13855e4161bacb64feb9 (patch)
tree80f2498137f15567794d49c65deca346817fbb61 /common/board_f.c
parent5a0e275cbbc4f462495e9a7e04acf0f6bfbd13c5 (diff)
bootstage: Convert to use malloc()
At present bootstage uses the data section of the image to store its information. There are a few problems with this: - It does not work on all boards (e.g. those which run from flash before relocation) - Allocated strings still point back to the pre-relocation data after relocation Now that U-Boot has a pre-relocation malloc() we can use this instead, with a pointer to the data in global_data. Update bootstage to do this and set up an init routine to allocate the memory. Now that we have a real init function, we can drop the fake 'reset' record and add a normal one instead. Note that part of the problem with allocated strings remains. They are reallocated but this will only work where pre-relocation memory is accessible after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/board_f.c b/common/board_f.c
index fe90faf3090..783c51a6857 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -673,8 +673,14 @@ static int jump_to_copy(void)
#endif
/* Record the board_init_f() bootstage (after arch_cpu_init()) */
-static int mark_bootstage(void)
+static int initf_bootstage(void)
{
+ int ret;
+
+ ret = bootstage_init(true);
+ if (ret)
+ return ret;
+
bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f");
return 0;
@@ -735,7 +741,7 @@ static const init_fnc_t init_sequence_f[] = {
mach_cpu_init, /* SoC/machine dependent CPU setup */
initf_dm,
arch_cpu_init_dm,
- mark_bootstage, /* need timer, go after init dm */
+ initf_bootstage, /* need timer, go after init dm */
#if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
#endif