]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Support Intel FSP initialization path in start.S
authorBin Meng <bmeng.cn@gmail.com>
Fri, 12 Dec 2014 13:05:31 +0000 (21:05 +0800)
committerSimon Glass <sjg@chromium.org>
Sun, 14 Dec 2014 05:32:05 +0000 (22:32 -0700)
Per Intel FSP architecture specification, FSP provides 3 routines
for bootloader to call. The first one is the TempRamInit (aka
Cache-As-Ram initialization) and the second one is the FspInit
which does the memory bring up (like MRC for other x86 targets)
and chipset initialization. Those two routines have to be called
before U-Boot jumping to board_init_f in start.S.

The FspInit() will return several memory blocks called Hand Off
Blocks (HOBs) whose format is described in Platform Initialization
(PI) specification (part of the UEFI specication) to the bootloader.
Save this HOB address to the U-Boot global data for later use.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
arch/x86/cpu/start.S
arch/x86/include/asm/global_data.h
arch/x86/lib/asm-offsets.c

index f9662fb20345731311628ac84501297bead08ae6..125782cf2796768bf281dc204f75355686b7827c 100644 (file)
@@ -75,6 +75,7 @@ early_board_init_ret:
        jmp     car_init
 .globl car_init_ret
 car_init_ret:
+#ifndef CONFIG_HAVE_FSP
        /*
         * We now have CONFIG_SYS_CAR_SIZE bytes of Cache-As-RAM (or SRAM,
         * or fully initialised SDRAM - we really don't care which)
@@ -95,6 +96,12 @@ car_init_ret:
 #ifdef CONFIG_DCACHE_RAM_MRC_VAR_SIZE
        subl    $CONFIG_DCACHE_RAM_MRC_VAR_SIZE, %esp
 #endif
+#else
+       /*
+        * When we get here after car_init, esp points to a temporary stack
+        * and esi holds the HOB list address returned by the FSP.
+        */
+#endif
 
        /* Reserve space on stack for global data */
        subl    $GENERATED_GBL_DATA_SIZE, %esp
@@ -109,6 +116,13 @@ car_init_ret:
        movl    %esp, %edi
        rep     stosb
 
+#ifdef CONFIG_HAVE_FSP
+       /* Store HOB list */
+       movl    %esp, %edx
+       addl    $GD_HOB_LIST, %edx
+       movl    %esi, (%edx)
+#endif
+
        /* Setup first parameter to setup_gdt, pointer to global_data */
        movl    %esp, %eax
 
index 48bbd1ae43e52c80f0971e860345aaf23711f8c1..03d491a17f786e5094a5aba016a12aac158b0f7e 100644 (file)
@@ -47,6 +47,9 @@ struct arch_global_data {
        enum pei_boot_mode_t pei_boot_mode;
        const struct pch_gpio_map *gpio_map;    /* board GPIO map */
        struct memory_info meminfo;     /* Memory information */
+#ifdef CONFIG_HAVE_FSP
+       void    *hob_list;              /* FSP HOB list */
+#endif
 };
 
 #endif
index 50a488f4f189bae93063de17fde96eb8c4dd9d73..70ccf1b0b041cb2afd17adce8bfc7beab8501629 100644 (file)
@@ -18,5 +18,8 @@
 int main(void)
 {
        DEFINE(GD_BIST, offsetof(gd_t, arch.bist));
+#ifdef CONFIG_HAVE_FSP
+       DEFINE(GD_HOB_LIST, offsetof(gd_t, arch.hob_list));
+#endif
        return 0;
 }