Revert "global_data: Drop spl_handoff"

This breaks chromebook_coral which says:

   Video: No video mode configured in FSP!

This reverts commit 2e9313179a.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2024-12-01 07:42:35 -07:00
committed by Tom Rini
parent 03e57244bc
commit 924a5e4e41
8 changed files with 26 additions and 28 deletions

View File

@@ -24,7 +24,9 @@ int arch_cpu_init(void)
int ret; int ret;
#if CONFIG_IS_ENABLED(HANDOFF) && IS_ENABLED(CONFIG_USE_HOB) #if CONFIG_IS_ENABLED(HANDOFF) && IS_ENABLED(CONFIG_USE_HOB)
gd->arch.hob_list = handoff_get(); struct spl_handoff *ho = gd->spl_handoff;
gd->arch.hob_list = ho->arch.hob_list;
#endif #endif
ret = x86_cpu_reinit_f(); ret = x86_cpu_reinit_f();

View File

@@ -59,7 +59,7 @@ int dram_init(void)
#endif #endif
} else { } else {
#if CONFIG_IS_ENABLED(HANDOFF) #if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *ho = handoff_get(); struct spl_handoff *ho = gd->spl_handoff;
if (!ho) { if (!ho) {
log_debug("No SPL handoff found\n"); log_debug("No SPL handoff found\n");
@@ -82,7 +82,7 @@ phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
return gd->ram_size; return gd->ram_size;
#if CONFIG_IS_ENABLED(HANDOFF) #if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *ho = handoff_get(); struct spl_handoff *ho = gd->spl_handoff;
log_debug("usable_ram_top = %lx\n", ho->arch.usable_ram_top); log_debug("usable_ram_top = %lx\n", ho->arch.usable_ram_top);

View File

@@ -15,10 +15,8 @@ static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[]) char *const argv[])
{ {
#if CONFIG_IS_ENABLED(HANDOFF) #if CONFIG_IS_ENABLED(HANDOFF)
struct spl_handoff *handoff = handoff_get(); if (gd->spl_handoff)
printf("SPL handoff magic %lx\n", gd->spl_handoff->arch.magic);
if (handoff)
printf("SPL handoff magic %lx\n", handoff->arch.magic);
else else
printf("SPL handoff info not received\n"); printf("SPL handoff info not received\n");

View File

@@ -305,6 +305,17 @@ static int setup_mon_len(void)
return 0; return 0;
} }
static int setup_spl_handoff(void)
{
#if CONFIG_IS_ENABLED(HANDOFF)
gd->spl_handoff = bloblist_find(BLOBLISTT_U_BOOT_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) __weak int arch_cpu_init(void)
{ {
return 0; return 0;
@@ -880,6 +891,7 @@ static const init_fnc_t init_sequence_f[] = {
initf_bootstage, /* uses its own timer, so does not need DM */ initf_bootstage, /* uses its own timer, so does not need DM */
event_init, event_init,
bloblist_maybe_init, bloblist_maybe_init,
setup_spl_handoff,
#if defined(CONFIG_CONSOLE_RECORD_INIT_F) #if defined(CONFIG_CONSOLE_RECORD_INIT_F)
console_record_init, console_record_init,
#endif #endif

View File

@@ -5,7 +5,6 @@
* Copyright 2018 Google, Inc * Copyright 2018 Google, Inc
*/ */
#include <bloblist.h>
#include <handoff.h> #include <handoff.h>
#include <asm/global_data.h> #include <asm/global_data.h>
@@ -39,14 +38,3 @@ void handoff_load_dram_banks(struct spl_handoff *ho)
bd->bi_dram[i].size = ho->ram_bank[i].size; bd->bi_dram[i].size = ho->ram_bank[i].size;
} }
} }
struct spl_handoff *handoff_get(void)
{
struct spl_handoff *handoff;
handoff = bloblist_find(BLOBLISTT_U_BOOT_SPL_HANDOFF,
sizeof(struct spl_handoff));
debug("Found SPL hand-off info %p\n", handoff);
return handoff;
}

View File

@@ -8,7 +8,6 @@
#include <dm.h> #include <dm.h>
#include <dt-structs.h> #include <dt-structs.h>
#include <errno.h> #include <errno.h>
#include <handoff.h>
#include <log.h> #include <log.h>
#include <malloc.h> #include <malloc.h>
#include <mapmem.h> #include <mapmem.h>
@@ -1468,7 +1467,7 @@ static int rk3399_clk_probe(struct udevice *dev)
init_clocks = true; init_clocks = true;
#elif CONFIG_IS_ENABLED(HANDOFF) #elif CONFIG_IS_ENABLED(HANDOFF)
if (!(gd->flags & GD_FLG_RELOC)) { if (!(gd->flags & GD_FLG_RELOC)) {
if (!handoff_get()) if (!(gd->spl_handoff))
init_clocks = true; init_clocks = true;
} }
#endif #endif

View File

@@ -400,6 +400,12 @@ struct global_data {
*/ */
struct bloblist_hdr *bloblist; struct bloblist_hdr *bloblist;
#endif #endif
#if CONFIG_IS_ENABLED(HANDOFF)
/**
* @spl_handoff: SPL hand-off information
*/
struct spl_handoff *spl_handoff;
#endif
#if defined(CONFIG_TRANSLATION_OFFSET) #if defined(CONFIG_TRANSLATION_OFFSET)
/** /**
* @translation_offset: optional translation offset * @translation_offset: optional translation offset

View File

@@ -31,13 +31,6 @@ void handoff_save_dram(struct spl_handoff *ho);
void handoff_load_dram_size(struct spl_handoff *ho); void handoff_load_dram_size(struct spl_handoff *ho);
void handoff_load_dram_banks(struct spl_handoff *ho); void handoff_load_dram_banks(struct spl_handoff *ho);
/**
* handoff_get() - Get the SPL handoff information
*
* Return: Pointer to SPL handoff if received, else NULL
*/
struct spl_handoff *handoff_get(void);
/** /**
* handoff_arch_save() - Save arch-specific info into the handoff area * handoff_arch_save() - Save arch-specific info into the handoff area
* *