summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-08-05 14:12:37 -0400
committerTom Rini <trini@konsulko.com>2015-08-05 14:12:37 -0400
commit1a2728ae4faf12874173de156b8a7e66cfbbeae5 (patch)
tree9aba8e6c915b341df8ec6077d8ecb28f1eb32b0b /Makefile
parentdcc7dbc73169bb4e39f27c1d95bbf031ccfc1744 (diff)
parent12c7510f17ff29190e52336910e43a50c0d620a6 (diff)
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 36 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7ccd614e1c..bb0ba9f8a2 100644
--- a/Makefile
+++ b/Makefile
@@ -754,6 +754,8 @@ ifneq ($(CONFIG_SPL_TARGET),)
ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
endif
ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
+ALL-$(CONFIG_EFI_APP) += u-boot-app.efi
+ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi
ifneq ($(BUILD_ROM),)
ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
@@ -780,8 +782,17 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
endif
+# Normally we fill empty space with 0xff
quiet_cmd_objcopy = OBJCOPY $@
-cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
+cmd_objcopy = $(OBJCOPY) --gap-fill=0xff $(OBJCOPYFLAGS) \
+ $(OBJCOPYFLAGS_$(@F)) $< $@
+
+# Provide a version which does not do this, for use by EFI
+quiet_cmd_zobjcopy = OBJCOPY $@
+cmd_zobjcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
+
+quiet_cmd_efipayload = OBJCOPY $@
+cmd_efipayload = $(OBJCOPY) -I binary -O $(EFIPAYLOAD_BFDTARGET) -B $(EFIPAYLOAD_BFDARCH) $< $@
quiet_cmd_mkimage = MKIMAGE $@
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
@@ -1076,6 +1087,30 @@ u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
endif
endif
+OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
+u-boot-app.efi: u-boot FORCE
+ $(call if_changed,zobjcopy)
+
+u-boot-dtb.bin.o: u-boot-dtb.bin FORCE
+ $(call if_changed,efipayload)
+
+u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
+ $(call if_changed_dep,cpp_lds)
+
+# Rule to link the EFI payload which contains a stub and a U-Boot binary
+quiet_cmd_u-boot_payload ?= LD $@
+ cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
+ -T u-boot-payload.lds arch/x86/cpu/call32.o \
+ lib/efi/efi.o lib/efi/efi_stub.o u-boot-dtb.bin.o \
+ $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
+
+u-boot-payload: u-boot-dtb.bin.o u-boot-payload.lds FORCE
+ $(call if_changed,u-boot_payload)
+
+OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)
+u-boot-payload.efi: u-boot-payload FORCE
+ $(call if_changed,zobjcopy)
+
u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE
$(call if_changed,cat)