]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Revert "global_data: Drop spl_handoff"
authorSimon Glass <sjg@chromium.org>
Sun, 1 Dec 2024 14:42:35 +0000 (07:42 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2024 13:40:39 +0000 (07:40 -0600)
This breaks chromebook_coral which says:

   Video: No video mode configured in FSP!

This reverts commit 2e9313179a846b581c0fc3f6a49e19f3d343efa8.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/cpu/intel_common/cpu_from_spl.c
arch/x86/lib/fsp2/fsp_dram.c
cmd/sb.c
common/board_f.c
common/init/handoff.c
drivers/clk/rockchip/clk_rk3399.c
include/asm-generic/global_data.h
include/handoff.h

index 5aad2ae7309e808a17e7a1b5c41c3c2ecdcf968b..48b2ef253cbd23abb942a884c38548dfa2fca859 100644 (file)
@@ -24,7 +24,9 @@ int arch_cpu_init(void)
        int ret;
 
 #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
        ret = x86_cpu_reinit_f();
 
index 4c4c8334bdb9b198498e0255cc816a0538c4ff79..75fa8f9de7a1d9d8c2b632f2b920c4dc4a386e0c 100644 (file)
@@ -59,7 +59,7 @@ int dram_init(void)
 #endif
        } else {
 #if CONFIG_IS_ENABLED(HANDOFF)
-               struct spl_handoff *ho = handoff_get();
+               struct spl_handoff *ho = gd->spl_handoff;
 
                if (!ho) {
                        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;
 
 #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);
 
index 9245052492e2debf1c0f94debeb8851d653d3a3c..79f3fb0aacd4ea091f0182ee78e8f93b01e4196f 100644 (file)
--- a/cmd/sb.c
+++ b/cmd/sb.c
@@ -15,10 +15,8 @@ static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
                         char *const argv[])
 {
 #if CONFIG_IS_ENABLED(HANDOFF)
-       struct spl_handoff *handoff = handoff_get();
-
-       if (handoff)
-               printf("SPL handoff magic %lx\n", handoff->arch.magic);
+       if (gd->spl_handoff)
+               printf("SPL handoff magic %lx\n", gd->spl_handoff->arch.magic);
        else
                printf("SPL handoff info not received\n");
 
index 98dc2591e1d0a8846bca27f20c1eda97c518996e..939697d13d83530a1d250e598c8a2e64bf93bc2f 100644 (file)
@@ -305,6 +305,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_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)
 {
        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 */
        event_init,
        bloblist_maybe_init,
+       setup_spl_handoff,
 #if defined(CONFIG_CONSOLE_RECORD_INIT_F)
        console_record_init,
 #endif
index 86c020ee0b93d78faee661bfdb5768c5d14c5803..a7cd065fb385cb05089d059038dd987e5e83fd23 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright 2018 Google, Inc
  */
 
-#include <bloblist.h>
 #include <handoff.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;
        }
 }
-
-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;
-}
index 155ea8d63535bac421cb0bfda70c656edd2d5eda..6e87db18be075d519d097d31a51a3398d389d45d 100644 (file)
@@ -8,7 +8,6 @@
 #include <dm.h>
 #include <dt-structs.h>
 #include <errno.h>
-#include <handoff.h>
 #include <log.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -1468,7 +1467,7 @@ static int rk3399_clk_probe(struct udevice *dev)
        init_clocks = true;
 #elif CONFIG_IS_ENABLED(HANDOFF)
        if (!(gd->flags & GD_FLG_RELOC)) {
-               if (!handoff_get())
+               if (!(gd->spl_handoff))
                        init_clocks = true;
        }
 #endif
index 26277b93976b24b060b88ad3cc284fa7a7f22d3b..789adf2c3f9d71460dd0b9f7d1256f4f82586554 100644 (file)
@@ -400,6 +400,12 @@ struct global_data {
         */
        struct bloblist_hdr *bloblist;
 #endif
+#if CONFIG_IS_ENABLED(HANDOFF)
+       /**
+        * @spl_handoff: SPL hand-off information
+        */
+       struct spl_handoff *spl_handoff;
+#endif
 #if defined(CONFIG_TRANSLATION_OFFSET)
        /**
         * @translation_offset: optional translation offset
index 0072ea832f83828de3a1a5bc2749cabe83f422c6..c0ae7b19a75949ebfec5109131486d7bd1ef7041 100644 (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_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
  *