payloads/Tianocore: Update default build target, simplify build options

Drop the deprecated COREBOOTPAYLOAD option, and replace it with MrChromebox's
updated UefiPayloadPkg option. Simplify the Kconfig options to make it easier
to build from upstream edk2 master. Drop the TIANOCORE_USE_8254_TIMER Kconfig
option since it applied only to CorebootPayloadPkg. Clean up the Makefile now
that we're only building from a single Tianocore package/target.

Test: build/boot qemu Q35 target with both UefiPayload and Upstream options.

Change-Id: If545fbd0c30be6dcc6ff43107b80980fa23a527e
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54019
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2021-05-10 11:02:13 -05:00 committed by Patrick Georgi
parent 14ea5a0947
commit d3b49b4cda
4 changed files with 24 additions and 41 deletions

View File

@ -21,7 +21,7 @@ mainline code.
implementation of the UEFI Specifications that modern firmware for PCs is implementation of the UEFI Specifications that modern firmware for PCs is
based on. There were various projects in the past to make it suitable as a based on. There were various projects in the past to make it suitable as a
coreboot payload, but these days this function is available directly in the coreboot payload, but these days this function is available directly in the
CorebootPayloadPkg part of its source tree. UefiPayloadPkg part of its source tree.
## GRUB2 ## GRUB2

View File

@ -143,10 +143,9 @@ payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFI
CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \ CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \
CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \ CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \
CONFIG_TIANOCORE_TARGET_IA32=$(CONFIG_TIANOCORE_TARGET_IA32) \ 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_BOOTSPLASH_FILE=$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \ CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \
CONFIG_TIANOCORE_COREBOOTPAYLOAD=$(CONFIG_TIANOCORE_COREBOOTPAYLOAD) \ CONFIG_TIANOCORE_UPSTREAM=$(CONFIG_TIANOCORE_UPSTREAM) \
CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \ CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \
CONFIG_TIANOCORE_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT) \ CONFIG_TIANOCORE_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT) \
GCC_CC_x86_32=$(GCC_CC_x86_32) \ GCC_CC_x86_32=$(GCC_CC_x86_32) \

View File

@ -4,25 +4,25 @@ config PAYLOAD_FILE
string "Tianocore binary" string "Tianocore binary"
default "payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd" default "payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd"
help help
The result of a corebootPkg build The result of a UefiPayloadPkg build
choice choice
prompt "Tianocore payload" prompt "Tianocore payload"
default TIANOCORE_COREBOOTPAYLOAD default TIANOCORE_UEFIPAYLOAD
help help
Select which type of payload Tianocore will build (default is CorebootPayload) Select which type of payload Tianocore will build (default is UefiPayload)
CorebootPayload: MrChromebox's customized version of Tianocore which works on most UefiPayload: MrChromebox's customized fork of Tianocore which works on most
(all?) x86_64 devices x86_64 devices
UEFIPayload: Use upstream Tianocore payload from https://github.com/tianocore/edk2 Upstream: Use upstream Tianocore payload from https://github.com/tianocore/edk2
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_UEFIPAYLOAD config TIANOCORE_UEFIPAYLOAD
bool "UEFIPayload" bool "UEFIPayload"
help
Select this option to build using MrChromebox's custom Tianocore fork,
which incorporates fixes/improvements from System 76's and 9elements' trees.
config TIANOCORE_UPSTREAM
bool "Upstream"
help help
Select this option if you want to use upstream EDK2 to build Tianocore. Select this option if you want to use upstream EDK2 to build Tianocore.
@ -76,11 +76,6 @@ config TIANOCORE_RELEASE
endchoice endchoice
config TIANOCORE_USE_8254_TIMER
bool "TianoCore 8254 Timer"
help
Use 8254 Timer for legacy support.
config TIANOCORE_BOOTSPLASH_IMAGE config TIANOCORE_BOOTSPLASH_IMAGE
bool "Use a custom bootsplash image" bool "Use a custom bootsplash image"
help help

View File

@ -6,18 +6,15 @@ export SHELL := env bash
project_name=Tianocore project_name=Tianocore
project_dir=$(CURDIR)/tianocore project_dir=$(CURDIR)/tianocore
project_git_repo=https://github.com/mrchromebox/edk2 project_git_repo=https://github.com/mrchromebox/edk2
project_git_branch=coreboot_fb project_git_branch=uefipayloadpkg
upstream_git_repo=https://github.com/tianocore/edk2 upstream_git_repo=https://github.com/tianocore/edk2
ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
bootloader=UefiPayloadPkg
logo_pkg=MdeModulePkg
build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
ifeq ($(CONFIG_TIANOCORE_UPSTREAM),y)
TAG=upstream/master TAG=upstream/master
else else
bootloader=CorebootPayloadPkg # STABLE revision is MrChromebox's UefiPayloadPkg (ueifpayloadpkg) branch
logo_pkg=CorebootPayloadPkg
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
TAG=origin/$(project_git_branch) TAG=origin/$(project_git_branch)
endif endif
@ -33,23 +30,15 @@ else
BUILD_TYPE=RELEASE BUILD_TYPE=RELEASE
endif endif
ifneq ($(CONFIG_TIANOCORE_USE_8254_TIMER), y)
TIMER=-DUSE_HPET_TIMER
endif
TIMEOUT=-D PLATFORM_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT) TIMEOUT=-D PLATFORM_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT)
ifeq ($(CONFIG_TIANOCORE_COREBOOTPAYLOAD),y)
ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y) ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
ARCH=-a IA32 -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc ARCH=-a IA32
else else
ARCH=-a IA32 -a X64 -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc ARCH=-a IA32 -a X64
endif
else
ARCH=-a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc
endif endif
BUILD_STR=-q $(ARCH) -t COREBOOT -b $(BUILD_TYPE) $(TIMER) $(TIMEOUT) $(build_flavor) BUILD_STR=-q $(ARCH) -p UefiPayloadPkg/UefiPayloadPkg.dsc -t COREBOOT -b $(BUILD_TYPE) $(TIMEOUT) $(build_flavor)
all: clean build all: clean build
@ -93,9 +82,9 @@ build: update checktools
echo " Copying custom bootsplash image"; \ echo " Copying custom bootsplash image"; \
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \ case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
/*) cp $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \ /*) cp $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
$(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \ $(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \
*) cp $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \ *) cp $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
$(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \ $(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \
esac \ esac \
fi; \ fi; \
cd $(project_dir); \ cd $(project_dir); \
@ -108,7 +97,7 @@ build: update checktools
fi; \ fi; \
build $(BUILD_STR); \ build $(BUILD_STR); \
mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \ mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
git checkout $(logo_pkg)/Logo/Logo.bmp > /dev/null 2>&1 || true git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true
clean: clean:
test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0 test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0