summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index f1a1432d86..835b7247c5 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <bloblist.h>
#include <console.h>
#include <cpu.h>
#include <dm.h>
@@ -24,6 +25,9 @@
#include <post.h>
#include <relocate.h>
#include <spi.h>
+#ifdef CONFIG_SPL
+#include <spl.h>
+#endif
#include <status_led.h>
#include <sysreset.h>
#include <timer.h>
@@ -285,6 +289,17 @@ static int setup_mon_len(void)
return 0;
}
+static int setup_spl_handoff(void)
+{
+#if CONFIG_IS_ENABLED(HANDOFF)
+ gd->spl_handoff = bloblist_find(BLOBLISTT_SPL_HANDOFF,
+ sizeof(struct spl_handoff));
+ debug("Found SPL hand-off info %p\n", gd->spl_handoff);
+#endif
+
+ return 0;
+}
+
__weak int arch_cpu_init(void)
{
return 0;
@@ -560,6 +575,16 @@ static int reserve_stacks(void)
return arch_reserve_stacks();
}
+static int reserve_bloblist(void)
+{
+#ifdef CONFIG_BLOBLIST
+ gd->start_addr_sp -= CONFIG_BLOBLIST_SIZE;
+ gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE);
+#endif
+
+ return 0;
+}
+
static int display_new_sp(void)
{
debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp);
@@ -666,6 +691,24 @@ static int reloc_bootstage(void)
return 0;
}
+static int reloc_bloblist(void)
+{
+#ifdef CONFIG_BLOBLIST
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ return 0;
+ if (gd->new_bloblist) {
+ int size = CONFIG_BLOBLIST_SIZE;
+
+ debug("Copying bloblist from %p to %p, size %x\n",
+ gd->bloblist, gd->new_bloblist, size);
+ memcpy(gd->new_bloblist, gd->bloblist, size);
+ gd->bloblist = gd->new_bloblist;
+ }
+#endif
+
+ return 0;
+}
+
static int setup_reloc(void)
{
if (gd->flags & GD_FLG_SKIP_RELOC) {
@@ -813,6 +856,10 @@ static const init_fnc_t init_sequence_f[] = {
initf_malloc,
log_init,
initf_bootstage, /* uses its own timer, so does not need DM */
+#ifdef CONFIG_BLOBLIST
+ bloblist_init,
+#endif
+ setup_spl_handoff,
initf_console_record,
#if defined(CONFIG_HAVE_FSP)
arch_fsp_init,
@@ -913,6 +960,7 @@ static const init_fnc_t init_sequence_f[] = {
reserve_global_data,
reserve_fdt,
reserve_bootstage,
+ reserve_bloblist,
reserve_arch,
reserve_stacks,
dram_init_banksize,
@@ -932,6 +980,7 @@ static const init_fnc_t init_sequence_f[] = {
INIT_FUNC_WATCHDOG_RESET
reloc_fdt,
reloc_bootstage,
+ reloc_bloblist,
setup_reloc,
#if defined(CONFIG_X86) || defined(CONFIG_ARC)
copy_uboot_to_ram,