summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/start16.S
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-06-07 03:33:13 (GMT)
committerSimon Glass <sjg@chromium.org>2015-07-15 00:03:15 (GMT)
commit002610f620553bec06e5724052fc5cc5f34eb1e8 (patch)
tree2674fe7f1273d31a569651dd947850c89c266c77 /arch/x86/cpu/start16.S
parent343fb990646cc3d552711bff30bda743de392f08 (diff)
downloadu-boot-002610f620553bec06e5724052fc5cc5f34eb1e8.tar.xz
x86: fsp: Load GDT before calling FspInitEntry
Currently the FSP execution environment GDT is setup by U-Boot in arch/x86/cpu/start16.S, which works pretty well. But if we try to move the FspInitEntry call a little bit later to better fit into U-Boot's initialization sequence, FSP will fail to bring up the AP due to #GP fault as AP's GDT is duplicated from BSP whose GDT is now moved into CAR, and unfortunately FSP calls AP initialization after it disables the CAR. So basically the BSP's GDT still refers to the one in the CAR, whose content is no longer available, so when AP starts up and loads its segment register, it blows up. To resolve this, we load GDT before calling into FspInitEntry. The GDT is the same one used in arch/x86/cpu/start16.S, which is in the ROM and exists forever. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Tested-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/start16.S')
-rw-r--r--arch/x86/cpu/start16.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
index 826e2b4..5eb17f1 100644
--- a/arch/x86/cpu/start16.S
+++ b/arch/x86/cpu/start16.S
@@ -71,11 +71,12 @@ idt_ptr:
*/
gdt_ptr:
.word 0x1f /* limit (31 bytes = 4 GDT entries - 1) */
- .long BOOT_SEG + gdt /* base */
+ .long BOOT_SEG + gdt_rom /* base */
/* Some CPUs are picky about GDT alignment... */
.align 16
-gdt:
+.globl gdt_rom
+gdt_rom:
/*
* The GDT table ...
*