]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
x86: fsp: Load GDT before calling FspInitEntry
authorBin Meng <bmeng.cn@gmail.com>
Sun, 7 Jun 2015 03:33:13 +0000 (11:33 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:29:21 +0000 (13:29 +0200)
commitd4cc812b34c8c05abc51431f6432810998e34ae9
treecb8380a65770528f719fcd65b56b1ba63d38e7a4
parent02384e8adab3aa8f5b8a8494f83392cefaefd2b6
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>
arch/x86/cpu/cpu.c
arch/x86/cpu/start16.S
arch/x86/include/asm/u-boot-x86.h
arch/x86/lib/fsp/fsp_support.c