summaryrefslogtreecommitdiff
path: root/payloads/external/tianocore/Makefile
diff options
context:
space:
mode:
authorLijian Zhao <lijian.zhao@intel.com>2019-07-20 13:06:03 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-08-21 09:34:27 +0000
commit16562cb859ad323153a9fe6d8b3890cc7dd73093 (patch)
tree9b4556aaeeb1dceca951dd5620c6bc4408667706 /payloads/external/tianocore/Makefile
parent44348185d97036012353c8d53211c68c2444b36d (diff)
downloadcoreboot-16562cb859ad323153a9fe6d8b3890cc7dd73093.tar.xz
payloads/tianocore: Enable UEFIPayload
corebootpayload package in upstream TianoCore was replaced with UEFIPayload, add external payload build option for UEFIPayload. BUG=N/A TEST=Select TianoCore payload as UEFIPayload, build and able to boot up on QEMU q35 after PCIE_BASE set. Change-Id: I0b7785fde9f4113b2cd91323ac0358b229c5a6e6 Signed-off-by: Lijian Zhao <lijian.zhao@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34459 Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/external/tianocore/Makefile')
-rw-r--r--payloads/external/tianocore/Makefile30
1 files changed, 20 insertions, 10 deletions
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
index f208e5952f..7adb700a6e 100644
--- a/payloads/external/tianocore/Makefile
+++ b/payloads/external/tianocore/Makefile
@@ -22,9 +22,19 @@ project_git_repo=https://github.com/mrchromebox/edk2
project_git_branch=coreboot_fb
upstream_git_repo=https://github.com/tianocore/edk2
+ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
+bootloader=UefiPayloadPkg
+build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS)
+TAG=upstream/master
+else
+bootloader=CorebootPayloadPkg
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
-TAG-$(CONFIG_TIANOCORE_STABLE)=origin/$(project_git_branch)
-TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
+TAG=origin/$(project_git_branch)
+endif
+
+ifneq ($(CONFIG_TIANOCORE_REVISION_ID),)
+TAG=$(CONFIG_TIANOCORE_REVISION_ID)
+endif
export EDK_TOOLS_PATH=$(project_dir)/BaseTools
@@ -39,9 +49,9 @@ TIMER=-DUSE_HPET_TIMER
endif
ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
- BUILD_STR=-a IA32 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc -b $(BUILD_TYPE) $(TIMER)
+ BUILD_STR=-a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
else
- BUILD_STR=-a IA32 -a X64 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -b $(BUILD_TYPE) $(TIMER)
+ BUILD_STR=-a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
endif
all: clean build
@@ -56,13 +66,13 @@ update: $(project_dir)
cd $(project_dir); \
echo " Fetching new commits from the $(project_name) repo"; \
git fetch --multiple origin upstream 2>/dev/null; \
- if ! git rev-parse --verify -q $(TAG-y) >/dev/null; then \
- echo " $(TAG-y) is not a valid git reference"; \
+ if ! git rev-parse --verify -q $(TAG) >/dev/null; then \
+ echo " $(TAG) is not a valid git reference"; \
exit 1; \
fi; \
if git describe --all --dirty | grep -qv dirty; then \
- echo " Checking out $(project_name) revision $(TAG-y)"; \
- git checkout --detach $(TAG-y); \
+ echo " Checking out $(project_name) revision $(TAG)"; \
+ git checkout --detach $(TAG); \
else \
echo " Working directory not clean; will not overwrite"; \
fi
@@ -80,7 +90,7 @@ checktools:
build: update checktools
unset CC; $(MAKE) -C $(project_dir)/BaseTools
- echo " build $(project_name) $(TAG-y)"
+ echo " build $(project_name) $(TAG)"
if [ -n $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) ]; then \
echo " Copying custom bootsplash image"; \
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
@@ -99,7 +109,7 @@ build: update checktools
cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
fi; \
build $(BUILD_STR); \
- mv $(project_dir)/Build/CorebootPayloadPkg*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
+ mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
git checkout CorebootPayloadPkg/Logo/Logo.bmp > /dev/null 2>&1 || true
clean: