From 16562cb859ad323153a9fe6d8b3890cc7dd73093 Mon Sep 17 00:00:00 2001 From: Lijian Zhao Date: Sat, 20 Jul 2019 13:06:03 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34459 Reviewed-by: Philipp Deppenwiese Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- payloads/external/Makefile.inc | 6 ++--- payloads/external/tianocore/Kconfig | 33 ++++++++++-------------- payloads/external/tianocore/Kconfig.name | 2 +- payloads/external/tianocore/Makefile | 30 ++++++++++++++------- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index df168f2bee..d5c4e7f5d3 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -128,14 +128,14 @@ payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFI $(MAKE) -C payloads/external/tianocore all \ HOSTCC="$(HOSTCC)" \ CC="$(HOSTCC)" \ - CONFIG_TIANOCORE_MASTER=$(CONFIG_TIANOCORE_MASTER) \ - CONFIG_TIANOCORE_STABLE=$(CONFIG_TIANOCORE_STABLE) \ - CONFIG_TIANOCORE_REVISION=$(CONFIG_TIANOCORE_REVISION) \ CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \ CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \ CONFIG_TIANOCORE_TARGET_IA32=$(CONFIG_TIANOCORE_TARGET_IA32) \ CONFIG_TIANOCORE_USE_8254_TIMER=$(CONFIG_TIANOCORE_USE_8254_TIMER) \ CONFIG_TIANOCORE_BOOTSPLASH_FILE=$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \ + CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \ + CONFIG_TIANOCORE_COREBOOTPAYLOAD=$(CONFIG_TIANOCORE_COREBOOTPAYLOAD) \ + CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \ GCC_CC_x86_32=$(GCC_CC_x86_32) \ GCC_CC_x86_64=$(GCC_CC_x86_64) \ GCC_CC_arm=$(GCC_CC_arm) \ diff --git a/payloads/external/tianocore/Kconfig b/payloads/external/tianocore/Kconfig index d8b7d9251d..7717917f94 100644 --- a/payloads/external/tianocore/Kconfig +++ b/payloads/external/tianocore/Kconfig @@ -7,38 +7,32 @@ config PAYLOAD_FILE The result of a corebootPkg build choice - prompt "Tianocore version" - default TIANOCORE_STABLE + prompt "Tianocore payload" + default TIANOCORE_COREBOOTPAYLOAD help - Select which version of Tianocore to build (default is to build stable) - stable: MrChromebox's customized version of Tianocore which works on most + Select which type of payload Tianocore will build (default is CorebootPayload) + CorebootPayload: MrChromebox's customized version of Tianocore which works on most (all?) x86_64 devices - revision: use specific commit or branch to build Tianocore (specified by user) + UEFIPayload: Use upstream Tianocore payload from https://github.com/tianocore/edk2 -config TIANOCORE_STABLE - bool "stable" +config TIANOCORE_COREBOOTPAYLOAD + bool "CorebootPayload" help Select this option to build using MrChromebox's custom Tianocore tree i.e. a version of Tianocore that builds without any errors and just works. -config TIANOCORE_REVISION - bool "git revision" +config TIANOCORE_UEFIPAYLOAD + bool "UEFIPayload" help - Select this option if you have a specific commit or branch - that you want to use from either MrChromebox's tree or upstream - EDK2 from which to build Tianocore. - - You will be able to specify the name of a branch or a commit id - later. + Select this option if you want to use upstream EDK2 to build Tianocore. endchoice config TIANOCORE_REVISION_ID string "Insert a commit's SHA-1 or a branch name" - depends on TIANOCORE_REVISION - default "upstream/master" help - The commit's SHA-1 or branch name of the revision to use. + The commit's SHA-1 or branch name of the revision to use. Choose "upstream/master" + for master branch of Tianocore release on github. choice prompt "Target architecture" @@ -89,7 +83,7 @@ config TIANOCORE_USE_8254_TIMER config TIANOCORE_BOOTSPLASH_IMAGE bool "Use a custom bootsplash image" - depends on TIANOCORE_STABLE + depends on TIANOCORE_COREBOOTPAYLOAD help Select this option if you have a bootsplash image that you would like to be used. If this option is not selected, the default @@ -98,6 +92,7 @@ config TIANOCORE_BOOTSPLASH_IMAGE config TIANOCORE_BOOTSPLASH_FILE string "Tianocore Bootsplash path and filename" depends on TIANOCORE_BOOTSPLASH_IMAGE + depends on TIANOCORE_COREBOOTPAYLOAD default "bootsplash.bmp" help The path and filename of the file to use as graphical bootsplash diff --git a/payloads/external/tianocore/Kconfig.name b/payloads/external/tianocore/Kconfig.name index a56d248bab..7b0b300351 100644 --- a/payloads/external/tianocore/Kconfig.name +++ b/payloads/external/tianocore/Kconfig.name @@ -1,5 +1,5 @@ config PAYLOAD_TIANOCORE - bool "Tianocore coreboot payload package" + bool "Tianocore payload" depends on ARCH_X86 help Select this option if you want to build a coreboot image 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: