]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Add support for passing tables into U-Boot
authorSimon Glass <sjg@chromium.org>
Tue, 4 Aug 2015 18:33:57 +0000 (12:33 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:00:56 +0000 (08:00 +0200)
The EFI stub provides information to U-Boot in a table. This includes the
memory map which is needed to decide where to relocate U-Boot. Collect this
information in the early init code and store it in global_data.

Fix up the BIST code at the same time since we don't have it when booting
from EFI and can assume it is 0.

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

index a0dec39abeaabbd66cb439418e5a0e9ab9ae44c0..e5c1733e594b0a4b2be7ae7f0f1849433382aedd 100644 (file)
@@ -42,6 +42,13 @@ _x86boot_start:
 
        /* Tell 32-bit code it is being entered from an in-RAM copy */
        movl    $GD_FLG_WARM_BOOT, %ebx
+
+       /*
+        * Zero the BIST (Built-In Self Test) value since we don't have it.
+        * It must be 0 or the previous loader would have reported an error.
+        */
+       movl    $0, %ebp
+
        jmp     1f
 
        /* Add a way for tools to discover the _start entry point */
@@ -53,9 +60,13 @@ _start:
         * Set %ebx to GD_FLG_COLD_BOOT to indicate this.
         */
        movl    $GD_FLG_COLD_BOOT, %ebx
-1:
+
        /* Save BIST */
        movl    %eax, %ebp
+1:
+
+       /* Save table pointer */
+       movl    %ecx, %esi
 
        /* Load the segement registers to match the GDT loaded in start16.S */
        movl    $(X86_GDT_ENTRY_32BIT_DS * X86_GDT_ENTRY_SIZE), %eax
@@ -133,7 +144,13 @@ car_init_ret:
        movl    %esi, (%edx)
 
 skip_hob:
+#else
+       /* Store table pointer */
+       movl    %esp, %edx
+       addl    $GD_TABLE, %edx
+       movl    %esi, (%edx)
 #endif
+
        /* Setup first parameter to setup_gdt, pointer to global_data */
        movl    %esp, %eax
 
index 80ebe3eb7bc26849924aa4305825f0fcb5f4d557..f7e3889df07ef4a25181675bb5b3dd14b0dbe79b 100644 (file)
@@ -69,6 +69,7 @@ struct arch_global_data {
        char *mrc_output;
        unsigned int mrc_output_len;
        void *gdt;                      /* Global descriptor table */
+       ulong table;                    /* Table pointer from previous loader */
 };
 
 #endif
index 70ccf1b0b041cb2afd17adce8bfc7beab8501629..9da04dd875927deedbd940330ca636991f7cd516 100644 (file)
@@ -21,5 +21,6 @@ int main(void)
 #ifdef CONFIG_HAVE_FSP
        DEFINE(GD_HOB_LIST, offsetof(gd_t, arch.hob_list));
 #endif
+       DEFINE(GD_TABLE, offsetof(gd_t, arch.table));
        return 0;
 }