From: Simon Glass <sjg@chromium.org>
Date: Sun, 26 Apr 2020 15:12:59 +0000 (-0600)
Subject: x86: Add a way to detect running from coreboot
X-Git-Tag: v2025.01-rc5-pxa1908~2438^2~2
X-Git-Url: http://git.dujemihanovic.xyz/img/html/index.html?a=commitdiff_plain;h=cfe7a1068b4b84768dca82e81118d8bac9c4b8d5;p=u-boot.git

x86: Add a way to detect running from coreboot

If U-Boot is running from coreboot we need to skip low-level init. Add
an way to detect this and to set the gd flag.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index cc20456c89..0312a26bbb 100644
--- a/arch/x86/cpu/i386/cpu.c
+++ b/arch/x86/cpu/i386/cpu.c
@@ -476,6 +476,8 @@ int x86_cpu_reinit_f(void)
 {
 	setup_identity();
 	setup_pci_ram_top();
+	if (locate_coreboot_table() >= 0)
+		gd->flags |= GD_FLG_SKIP_LL_INIT;
 
 	return 0;
 }