aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/config.mk
diff options
context:
space:
mode:
authorSimon Glass2015-08-04 12:33:56 -0600
committerSimon Glass2015-08-05 08:44:07 -0600
commit96a8d409a75af99ac7a9a9ba707d544f9cf44fc0 (patch)
tree42d2df0ab57c55ce9f0a191b97fb88a7858b81ff /arch/x86/config.mk
parent6f92ed8f1abfe94ee1c96c83c21f4092bb04ff63 (diff)
efi: Add 64-bit payload support
Most EFI implementations use 64-bit. Add a way to build U-Boot as a 64-bit EFI payload. The payload unpacks a (32-bit) U-Boot and starts it. This can be enabled for x86 boards at present. Signed-off-by: Simon Glass <sjg@chromium.org> Improvements to how the payload is built: Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/config.mk')
-rw-r--r--arch/x86/config.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 334c10b882d..d7addd87286 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -34,14 +34,24 @@ OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
CFLAGS_NON_EFI := -mregparm=3
CFLAGS_EFI := -fpic -fshort-wchar
+ifeq ($(CONFIG_EFI_STUB_64BIT),)
+CFLAGS_EFI += $(call cc-option, -mno-red-zone)
EFIARCH = ia32
EFIPAYLOAD_BFDTARGET = elf32-i386
+else
+EFIARCH = x86_64
+EFIPAYLOAD_BFDTARGET = elf64-x86-64
+endif
EFIPAYLOAD_BFDARCH = i386
LDSCRIPT_EFI := $(srctree)/$(CPUDIR)/efi/elf_$(EFIARCH)_efi.lds
+EFISTUB := crt0-efi-$(EFIARCH).o reloc_$(EFIARCH).o
OBJCOPYFLAGS_EFI += --target=efi-app-$(EFIARCH)
+CPPFLAGS_REMOVE_crt0-efi-$(EFIARCH).o += $(CFLAGS_NON_EFI)
+CPPFLAGS_crt0-efi-$(EFIARCH).o += $(CFLAGS_EFI)
+
ifeq ($(CONFIG_EFI_APP),y)
PLATFORM_CPPFLAGS += $(CFLAGS_EFI)