diff mbox series

[v4,7/9] x86: Add a way to detect running from coreboot

Message ID 20200426151302.93418-7-sjg@chromium.org
State Accepted
Commit cfe7a1068b4b84768dca82e81118d8bac9c4b8d5
Headers show
Series x86: Improve support for chain-loading U-Boot | expand

Commit Message

Simon Glass April 26, 2020, 3:12 p.m. UTC
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 at chromium.org>
---

Changes in v4:
- Rename flag to GD_FLG_SKIP_LL_INIT
- Split this patch into two

Changes in v3:
- Add new patch to detect running from coreboot

Changes in v2: None

 arch/x86/cpu/i386/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bin Meng April 30, 2020, 9:33 a.m. UTC | #1
On Sun, Apr 26, 2020 at 11:13 PM Simon Glass <sjg at chromium.org> wrote:
>
> 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 at chromium.org>
> ---
>
> Changes in v4:
> - Rename flag to GD_FLG_SKIP_LL_INIT
> - Split this patch into two
>
> Changes in v3:
> - Add new patch to detect running from coreboot
>
> Changes in v2: None
>
>  arch/x86/cpu/i386/cpu.c | 2 ++
>  1 file changed, 2 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index e52fd686d9..8a458bb5ff 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;
 }