aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/cpu/Makefile2
-rw-r--r--arch/x86/cpu/baytrail/Kconfig6
-rw-r--r--arch/x86/cpu/baytrail/valleyview.c3
-rw-r--r--arch/x86/cpu/efi/Kconfig (renamed from arch/x86/lib/efi/Kconfig)0
-rw-r--r--arch/x86/cpu/efi/Makefile9
-rw-r--r--arch/x86/cpu/efi/app.c (renamed from arch/x86/cpu/efi/efi.c)2
-rw-r--r--arch/x86/cpu/efi/car.S (renamed from arch/x86/lib/efi/car.S)0
-rw-r--r--arch/x86/cpu/efi/payload.c (renamed from arch/x86/lib/efi/efi.c)11
-rw-r--r--arch/x86/cpu/intel_common/Makefile2
-rw-r--r--arch/x86/cpu/qemu/Makefile2
-rw-r--r--arch/x86/cpu/qemu/qemu.c4
-rw-r--r--arch/x86/dts/Makefile3
-rw-r--r--arch/x86/dts/cherryhill.dts2
-rw-r--r--arch/x86/dts/efi-x86_app.dts (renamed from arch/x86/dts/efi.dts)4
-rw-r--r--arch/x86/dts/efi-x86_payload.dts40
-rw-r--r--arch/x86/lib/Makefile1
-rw-r--r--arch/x86/lib/crt0_x86_64_efi.S24
-rw-r--r--arch/x86/lib/efi/Makefile7
19 files changed, 80 insertions, 45 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 18c7fb2d49..a1c18d26e1 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -112,6 +112,7 @@ source "arch/x86/cpu/braswell/Kconfig"
source "arch/x86/cpu/broadwell/Kconfig"
source "arch/x86/cpu/coreboot/Kconfig"
source "arch/x86/cpu/ivybridge/Kconfig"
+source "arch/x86/cpu/efi/Kconfig"
source "arch/x86/cpu/qemu/Kconfig"
source "arch/x86/cpu/quark/Kconfig"
source "arch/x86/cpu/queensbay/Kconfig"
@@ -772,6 +773,4 @@ config HIGH_TABLE_SIZE
Increse it if the default size does not fit the board's needs.
This is most likely due to a large ACPI DSDT table is used.
-source "arch/x86/lib/efi/Kconfig"
-
endmenu
diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index af9e26caab..f862d8c071 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/
obj-$(CONFIG_INTEL_BRASWELL) += braswell/
obj-$(CONFIG_INTEL_BROADWELL) += broadwell/
obj-$(CONFIG_SYS_COREBOOT) += coreboot/
-obj-$(CONFIG_EFI_APP) += efi/
+obj-$(CONFIG_EFI) += efi/
obj-$(CONFIG_QEMU) += qemu/
obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/
obj-$(CONFIG_INTEL_QUARK) += quark/
diff --git a/arch/x86/cpu/baytrail/Kconfig b/arch/x86/cpu/baytrail/Kconfig
index 022a9f2e51..d2c3473d6a 100644
--- a/arch/x86/cpu/baytrail/Kconfig
+++ b/arch/x86/cpu/baytrail/Kconfig
@@ -4,10 +4,10 @@
config INTEL_BAYTRAIL
bool
- select HAVE_FSP if !EFI
- select ARCH_MISC_INIT if !EFI
+ select HAVE_FSP
+ select ARCH_MISC_INIT
select CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED
- imply HAVE_INTEL_ME if !EFI
+ imply HAVE_INTEL_ME
imply ENABLE_MRC_CACHE
imply AHCI_PCI
imply ICH_SPI
diff --git a/arch/x86/cpu/baytrail/valleyview.c b/arch/x86/cpu/baytrail/valleyview.c
index 3194f8c653..b7d481ac56 100644
--- a/arch/x86/cpu/baytrail/valleyview.c
+++ b/arch/x86/cpu/baytrail/valleyview.c
@@ -17,7 +17,6 @@
#define BYT_TRIG_LVL BIT(24)
#define BYT_TRIG_POS BIT(25)
-#ifndef CONFIG_EFI_APP
int arch_cpu_init(void)
{
post_code(POST_CPU_INIT);
@@ -57,8 +56,6 @@ int arch_misc_init(void)
return 0;
}
-#endif
-
void reset_cpu(ulong addr)
{
/* cold reset */
diff --git a/arch/x86/lib/efi/Kconfig b/arch/x86/cpu/efi/Kconfig
index e0975d34d3..e0975d34d3 100644
--- a/arch/x86/lib/efi/Kconfig
+++ b/arch/x86/cpu/efi/Kconfig
diff --git a/arch/x86/cpu/efi/Makefile b/arch/x86/cpu/efi/Makefile
index 06d0480440..9716a4ebe0 100644
--- a/arch/x86/cpu/efi/Makefile
+++ b/arch/x86/cpu/efi/Makefile
@@ -2,5 +2,12 @@
#
# Copyright (c) 2015 Google, Inc
-obj-y += efi.o
+ifdef CONFIG_EFI_APP
+obj-y += app.o
obj-y += sdram.o
+endif
+
+ifdef CONFIG_EFI_STUB
+obj-y += car.o
+obj-y += payload.o
+endif
diff --git a/arch/x86/cpu/efi/efi.c b/arch/x86/cpu/efi/app.c
index cda4fabe15..ba7c02bd7e 100644
--- a/arch/x86/cpu/efi/efi.c
+++ b/arch/x86/cpu/efi/app.c
@@ -9,7 +9,7 @@
int arch_cpu_init(void)
{
- return 0;
+ return x86_cpu_init_f();
}
int checkcpu(void)
diff --git a/arch/x86/lib/efi/car.S b/arch/x86/cpu/efi/car.S
index 488dcde66c..488dcde66c 100644
--- a/arch/x86/lib/efi/car.S
+++ b/arch/x86/cpu/efi/car.S
diff --git a/arch/x86/lib/efi/efi.c b/arch/x86/cpu/efi/payload.c
index 81fb8b5f72..9fd9f57776 100644
--- a/arch/x86/lib/efi/efi.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -5,11 +5,9 @@
*/
#include <common.h>
-#include <debug_uart.h>
#include <efi.h>
#include <errno.h>
-#include <linux/err.h>
-#include <linux/types.h>
+#include <asm/post.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -126,6 +124,13 @@ int dram_init_banksize(void)
return 0;
}
+int arch_cpu_init(void)
+{
+ post_code(POST_CPU_INIT);
+
+ return x86_cpu_init_f();
+}
+
int checkcpu(void)
{
return 0;
diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile
index c0fcf0ce78..bf798c287f 100644
--- a/arch/x86/cpu/intel_common/Makefile
+++ b/arch/x86/cpu/intel_common/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_$(SPL_)X86_32BIT_INIT) += mrc.o
endif
obj-y += cpu.o
obj-y += lpc.o
-ifndef CONFIG_TARGET_EFI
+ifndef CONFIG_TARGET_EFI_APP
obj-y += microcode.o
endif
obj-y += pch.o
diff --git a/arch/x86/cpu/qemu/Makefile b/arch/x86/cpu/qemu/Makefile
index e5ea92545e..1761244178 100644
--- a/arch/x86/cpu/qemu/Makefile
+++ b/arch/x86/cpu/qemu/Makefile
@@ -2,8 +2,6 @@
#
# Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
-ifndef CONFIG_EFI_STUB
obj-y += car.o dram.o
-endif
obj-y += qemu.o
obj-$(CONFIG_QFW) += cpu.o e820.o
diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c
index 1fdb11cc60..ca4b3f0833 100644
--- a/arch/x86/cpu/qemu/qemu.c
+++ b/arch/x86/cpu/qemu/qemu.c
@@ -143,10 +143,6 @@ int arch_cpu_init(void)
return x86_cpu_init_f();
}
-#endif
-
-#if !CONFIG_IS_ENABLED(EFI_STUB) && \
- !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
int checkcpu(void)
{
diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 73797746f8..37e4fdc760 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -10,7 +10,8 @@ dtb-y += bayleybay.dtb \
crownbay.dtb \
dfi-bt700-q7x-151.dtb \
edison.dtb \
- efi.dtb \
+ efi-x86_app.dtb \
+ efi-x86_payload.dtb \
galileo.dtb \
minnowmax.dtb \
qemu-x86_i440fx.dtb \
diff --git a/arch/x86/dts/cherryhill.dts b/arch/x86/dts/cherryhill.dts
index c3a6aad77b..3e29683bd9 100644
--- a/arch/x86/dts/cherryhill.dts
+++ b/arch/x86/dts/cherryhill.dts
@@ -75,8 +75,6 @@
pch@1f,0 {
reg = <0x0000f800 0 0 0 0>;
compatible = "intel,pch9";
- #address-cells = <1>;
- #size-cells = <1>;
irq-router {
compatible = "intel,irq-router";
diff --git a/arch/x86/dts/efi.dts b/arch/x86/dts/efi-x86_app.dts
index 62ae96a3f3..e70e351618 100644
--- a/arch/x86/dts/efi.dts
+++ b/arch/x86/dts/efi-x86_app.dts
@@ -9,8 +9,8 @@
/include/ "tsc_timer.dtsi"
/ {
- model = "EFI";
- compatible = "efi,app";
+ model = "EFI x86 Application";
+ compatible = "efi,x86-app";
chosen {
stdout-path = &serial;
diff --git a/arch/x86/dts/efi-x86_payload.dts b/arch/x86/dts/efi-x86_payload.dts
new file mode 100644
index 0000000000..148b5871aa
--- /dev/null
+++ b/arch/x86/dts/efi-x86_payload.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ *
+ * Generic EFI payload device tree for x86 targets
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+/include/ "serial.dtsi"
+/include/ "keyboard.dtsi"
+/include/ "rtc.dtsi"
+/include/ "tsc_timer.dtsi"
+
+/ {
+ model = "EFI x86 Payload";
+ compatible = "efi,x86-payload";
+
+ aliases {
+ serial0 = &serial;
+ };
+
+ config {
+ silent_console = <0>;
+ };
+
+ chosen {
+ stdout-path = "/serial";
+ };
+
+ pci {
+ compatible = "pci-x86";
+ u-boot,dm-pre-reloc;
+ };
+
+ efi-fb {
+ compatible = "efi-fb";
+ };
+};
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 0e054da1e9..ba07ac728f 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -14,7 +14,6 @@ endif
obj-y += cmd_boot.o
obj-$(CONFIG_SEABIOS) += coreboot_table.o
obj-y += early_cmos.o
-obj-$(CONFIG_EFI) += efi/
obj-y += e820.o
obj-y += init_helpers.o
obj-y += interrupts.o
diff --git a/arch/x86/lib/crt0_x86_64_efi.S b/arch/x86/lib/crt0_x86_64_efi.S
index 989799fb4a..bb8d3cf8a9 100644
--- a/arch/x86/lib/crt0_x86_64_efi.S
+++ b/arch/x86/lib/crt0_x86_64_efi.S
@@ -3,7 +3,7 @@
* crt0-efi-x86_64.S - x86_64 EFI startup code.
* Copyright (C) 1999 Hewlett-Packard Co.
* Contributed by David Mosberger <davidm@hpl.hp.com>.
- * Copyright (C) 2005 Intel Co.
+ * Copyright (C) 2005 Intel Corporation
* Contributed by Fenghua Yu <fenghua.yu@intel.com>.
*
* All rights reserved.
@@ -14,26 +14,28 @@
.globl _start
_start:
subq $8, %rsp
+
pushq %rcx
pushq %rdx
-0:
- lea image_base(%rip), %rdi
- lea _DYNAMIC(%rip), %rsi
+ mov %rcx, %r8
+ mov %rdx, %r9
+
+ lea image_base(%rip), %rcx
+ lea _DYNAMIC(%rip), %rdx
- popq %rcx
- popq %rdx
- pushq %rcx
- pushq %rdx
call _relocate
- popq %rdi
- popq %rsi
+ popq %rdx
+ popq %rcx
+
+ testq %rax, %rax
+ jnz .exit
call efi_main
+.exit:
addq $8, %rsp
-.exit:
ret
/*
diff --git a/arch/x86/lib/efi/Makefile b/arch/x86/lib/efi/Makefile
deleted file mode 100644
index f6c65235e2..0000000000
--- a/arch/x86/lib/efi/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2002-2006
-# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-
-obj-$(CONFIG_EFI_STUB) += car.o
-obj-$(CONFIG_EFI_STUB) += efi.o