diff options
author | Sean Rhodes <sean@starlabs.systems> | 2022-07-13 10:11:44 +0100 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-08-13 16:35:18 +0000 |
commit | 38c99b56599d2b11d68c844e9f2adda9050b8efa (patch) | |
tree | de43b09f7bac0e010ac6c77f0bf7edfdc09ae981 /payloads/external/edk2 | |
parent | 8f7f4bf87a238dd046a376804b9e53162092f601 (diff) |
payloads/tianocore: Rename TianoCore to edk2
coreboot uses TianoCore interchangeably with EDK II, and whilst the
meaning is generally clear, it's not the payload it uses. EDK II is
commonly written as edk2.
coreboot builds edk2 directly from the edk2 repository. Whilst it
can build some components from edk2-platforms, the target is still
edk2.
[1] tianocore.org - "Welcome to TianoCore, the community supporting"
[2] tianocore.org - "EDK II is a modern, feature-rich, cross-platform
firmware development environment for the UEFI and UEFI Platform
Initialization (PI) specifications."
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I4de125d92ae38ff8dfd0c4c06806c2d2921945ab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65820
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads/external/edk2')
-rw-r--r-- | payloads/external/edk2/Kconfig | 203 | ||||
-rw-r--r-- | payloads/external/edk2/Kconfig.name | 9 | ||||
-rw-r--r-- | payloads/external/edk2/Makefile | 185 | ||||
-rw-r--r-- | payloads/external/edk2/tools_def.txt | 183 |
4 files changed, 580 insertions, 0 deletions
diff --git a/payloads/external/edk2/Kconfig b/payloads/external/edk2/Kconfig new file mode 100644 index 0000000000..ec6be897e3 --- /dev/null +++ b/payloads/external/edk2/Kconfig @@ -0,0 +1,203 @@ +if PAYLOAD_EDK2 + +config PAYLOAD_FILE + string "edk2 binary" + default "$(obj)/UEFIPAYLOAD.fd" + help + The result of a UefiPayloadPkg build + +choice + prompt "Tianocore's EDK II payload" + default EDK2_UEFIPAYLOAD + help + Select which type of payload edk2 will build (default is UefiPayload) + UefiPayload: MrChromebox's customized fork of edk2 which works on most + x86_64 devices + Upstream: Use upstream edk2 payload from https://github.com/tianocore/edk2 + +config EDK2_UEFIPAYLOAD + bool "UEFIPayload" + help + Select this option to build using MrChromebox's custom edk2 fork, + which incorporates fixes/improvements from System 76's and 9elements' trees. + +config EDK2_UPSTREAM + bool "Upstream" + help + Select this option if you want to use upstream edk2 to build edk2. + +config EDK2_CUSTOM + bool "Custom" + help + Specify your own edk2 repository and branch to use. + +endchoice + +config EDK2_REPOSITORY + string "URL to git repository for edk2" + default "https://github.com/tianocore/edk2" if EDK2_UPSTREAM + default "https://github.com/mrchromebox/edk2" if EDK2_UEFIPAYLOAD + help + coreboot supports an array of build options which can be found below. These options + will only have an effect if the relevant options exist in the target repository. + +config EDK2_TAG_OR_REV + string "Insert a commit's SHA-1 or a branch name" + default "origin/uefipayload_202207" if EDK2_UEFIPAYLOAD + default "origin/master" if EDK2_UPSTREAM + help + The commit's SHA-1 or branch name of the revision to use. This must exist in + EDK2_REPOSITORY, and in the case of a branch name, prefixed with origin i.e. + "origin/uefipayload_202202" + +choice + prompt "edk2 build" + default EDK2_RELEASE + help + Select whether to generate a debug or release build for + edk2; default is to generate a release build. + +config EDK2_DEBUG + bool "Generate edk2 debug build" + help + Generate a debug build. + +config EDK2_RELEASE + bool "Generate edk2 release build" + help + Generate a release build. + +endchoice + +if EDK2_UEFIPAYLOAD || EDK2_CUSTOM || EDK2_UPSTREAM + +config EDK2_ABOVE_4G_MEMORY + bool "Enable above 4G memory" + default n + help + Select this option to enable Above 4G Decode. This will allow the + payload to use all of the memory, rather than an maximum of 4G. + + Disabling memory above 4G is useful for bootloaders that are not + fully 64-bit aware such as Qubes R4.0.4 bootloader. + +config EDK2_BOOTSPLASH_FILE + string "edk2 Bootsplash path and filename" + default "Documentation/coreboot_logo.bmp" + help + The path and filename of the file to use as graphical bootsplash + image. If this option is not configured, the default + coreboot logo (European Brown Hare) will used. + + You can use any image format supported by imagemagick, a list of which + can be found [here](https://imagemagick.org/script/formats.php). + + The build process will automatically convert this to the format that + edk2 requires, which is an uncompressed BMP, in BMP3 format. It does + this using imagemagick (`convert splosh.bmp BMP3:splash.bmp`). + + The newly formatted file will be the dimensions size as the original + one. + + The build process will automatically do this conversion, so it can + be supplied with any format that imagemagick can process (which is + pretty much any!). + + This image will also be used as the BGRT boot image, which may + persist through your OS boot process. + + See ACPI spec 6.3, 5.2.22 Boot Graphics Resource Table (BGRT), and + Microsoft's documentation on BGRT positioning: + Docs/Windows/Windows Drivers/Bring up guide/Boot screen components + + Accordingly, the image used should be no taller/wider than 40% of + the display panel's native pixel height/width (or resolution set). + + If an absolute path is not given, the path will assumed to be + relative to the coreboot root directory. + +config EDK2_BOOT_MANAGER_ESCAPE + bool "Use Escape key for Boot Manager" + default n + help + Use Escape as the hot-key to access the Boot Manager. This replaces + the default key of F2. + +config EDK2_BOOT_TIMEOUT + int "Set the timeout for boot menu prompt" + default 2 + help + The length of time in seconds for which the boot splash/menu prompt will be displayed. + For boards with an internal display, the default value of 2s is generally sufficient. + For boards with an external display, a value of 5s is generally sufficient. + +config EDK2_CBMEM_LOGGING + bool "Enable edk2 logging to CBMEM" + help + Select this option if you want to enable edk2 logging to CBMEM. + You may want to increase the default cbmem buffer size when selecting + this option, especially if using a debug (vs release) build. + Selecting this option will increase the payload size in CBFS by 0x10000. + +config EDK2_FOLLOW_BGRT_SPEC + bool "Center logo 38.2% from the top of screen" + default n + help + Follow the BGRT Specification implemented by Microsoft and + the Boot Logo 38.2% will be vertically centered 38.2% from + the top of the display. + +config EDK2_FULL_SCREEN_SETUP + bool "Use the full screen for the edk2 frontpage" + default y + help + Allow edk2 to use the full screen to display the frontpage + (aka "Boot Menu"). With this option disable, it will be + limited to 640x480. + +config EDK2_HAVE_EFI_SHELL + bool "Include EFI Shell" + default y + help + Include the EFI shell Binary + +config EDK2_PRIORITIZE_INTERNAL + bool "Prioritize internal boot devices" + default y + help + Prioritize internal boot devices over external devices + +config EDK2_PS2_SUPPORT + bool "Support PS/2 Keyboards" + default y + help + Include support for PS/2 keyboards + +config EDK2_SD_MMC_TIMEOUT + int "Timeout in ms for initializing SD and eMMC devices" + default 10 + help + The amount of time allowed to initialize the SD Card reader and/or eMMC drive. + Most only require 10ms, but certain readers can take 1s. + +config EDK2_SERIAL_SUPPORT + bool "Support serial output" + default y if EDK2_DEBUG + default n + help + Enable serial port output in edk2. Serial output limits the performance of edk2's + FrontPage. + +endif + +config EDK2_CUSTOM_BUILD_PARAMS + string "edk2 additional custom build parameters" + default "-D VARIABLE_SUPPORT=SMMSTORE" if EDK2_UEFIPAYLOAD && SMMSTORE_V2 + help + edk2 has build options that are not modified by coreboot, and these can be + found in `UefiPayloadPkg/UefiPayloadPkg.dsc`. Forks may also support + additional build options that should have been upstreamed but have not. + + This option can support both macros `-D` and Pcds `--pcd`. + +endif diff --git a/payloads/external/edk2/Kconfig.name b/payloads/external/edk2/Kconfig.name new file mode 100644 index 0000000000..3e07f8075a --- /dev/null +++ b/payloads/external/edk2/Kconfig.name @@ -0,0 +1,9 @@ +config PAYLOAD_EDK2 + bool "edk2 payload" + depends on ARCH_X86 || ARCH_ARM64 + help + Select this option if you want to build a coreboot image + with a edk2 payload. If you don't know what this is + about, just leave it enabled. + + See https://coreboot.org/Payloads for more information. diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile new file mode 100644 index 0000000000..3dbb1b5412 --- /dev/null +++ b/payloads/external/edk2/Makefile @@ -0,0 +1,185 @@ +## SPDX-License-Identifier: GPL-2.0-only + +# force the shell to bash - the edksetup.sh script doesn't work with dash +export SHELL := env bash + +project_name = edk2 +project_dir = $(CURDIR)/$(word 3,$(subst /, ,$(CONFIG_EDK2_REPOSITORY))) + +BUILD_STR = -a IA32 -a X64 -t COREBOOT +BUILD_STR += -p UefiPayloadPkg/UefiPayloadPkg.dsc +BUILD_STR += -D BOOTLOADER=COREBOOT -q + +# +# EDK II has the following build options relevant to coreboot: +# +# +# OPTION = DEFAULT_VALUE +# +# ABOVE_4G_MEMORY = TRUE +ifneq ($(CONFIG_EDK2_ABOVE_4G_MEMORY),y) +BUILD_STR += -D ABOVE_4G_MEMORY=FALSE +endif +# BOOTSPLASH_IMAGE = FALSE +ifneq ($(CONFIG_EDK2_BOOTSPLASH_FILE),) +BUILD_STR += -D BOOTSPLASH_IMAGE=TRUE +endif +# BOOT_MANAGER_ESCAPE = FALSE +ifeq ($(CONFIG_EDK2_BOOT_MANAGER_ESCAPE),y) +BUILD_STR += -D BOOT_MANAGER_ESCAPE=TRUE +endif +# BUILD_TARGETS = DEBUG +ifeq ($(CONFIG_EDK2_RELEASE),y) +BUILD_STR += -b RELEASE +endif +# DISABLE_SERIAL_TERMINAL = FALSE +ifneq ($(CONFIG_EDK2_SERIAL_SUPPORT),y) +BUILD_STR += -D DISABLE_SERIAL_TERMINAL=TRUE +endif +# FOLLOW_BGRT_SPEC = FALSE +ifeq ($(CONFIG_EDK2_FOLLOW_BGRT_SPEC),y) +BUILD_STR += -D FOLLOW_BGRT_SPEC=TRUE +endif +# PCIE_BASE_ADDRESS = 0 +ifneq ($(CONFIG_ECAM_MMCONF_LENGTH),) +BUILD_STR += --pcd gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) +endif +# PCIE_BASE_LENGTH = 0 +ifneq ($(CONFIG_ECAM_MMCONF_LENGTH),) +BUILD_STR += --pcd gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize=$(CONFIG_ECAM_MMCONF_LENGTH) +endif +# PRIORITIZE_INTERNAL = FALSE +ifeq ($(CONFIG_EDK2_PRIORITIZE_INTERNAL),y) +BUILD_STR += -D PRIORITIZE_INTERNAL=TRUE +endif +# PS2_KEYBOARD_ENABLE = FALSE +ifeq ($(CONFIG_EDK2_PS2_SUPPORT),y) +BUILD_STR += -D PS2_KEYBOARD_ENABLE=TRUE +endif +# PLATFORM_BOOT_TIMEOUT = 3 +ifneq ($(CONFIG_EDK2_BOOT_TIMEOUT),) +BUILD_STR += -D PLATFORM_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) +endif +# SIO_BUS_ENABLE = FALSE +ifeq ($(CONFIG_EDK2_PS2_SUPPORT),y) +BUILD_STR += -D SIO_BUS_ENABLE=TRUE +endif +# SHELL_TYPE = BUILD_SHELL +ifneq ($(CONFIG_EDK2_HAVE_EFI_SHELL),y) +BUILD_STR += -D SHELL_TYPE=NONE +endif +# USE_CBMEM_FOR_CONSOLE = FALSE +ifeq ($(CONFIG_EDK2_CBMEM_LOGGING),y) +BUILD_STR += -D USE_CBMEM_FOR_CONSOLE=TRUE +endif +# SD_MMC_TIMEOUT = 1000000 +ifneq ($(CONFIG_EDK2_SD_MMC_TIMEOUT),) +BUILD_STR += -D SD_MMC_TIMEOUT=$(shell echo $$(( $(CONFIG_EDK2_SD_MMC_TIMEOUT) * 1000)) ) +endif + +# +# EDKII has the below PCDs that are relevant to coreboot: +# +# Allows EDKII to use the full framebuffer +ifeq ($(CONFIG_EDK2_FULL_SCREEN_SETUP),y) +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow=0 +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn=0 +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow=0 +BUILD_STR += --pcd gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn=0 +endif + +bootloader = $(word 8,$(subst /, ,$(BUILD_STR))) + +ifneq ($(CONFIG_EDK2_CUSTOM_BUILD_PARAMS),) +BUILD_STR += $(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) +endif + +all: clean build + +$(project_dir): + echo " Cloning $(project_name) from $(CONFIG_EDK2_REPOSITORY)" + git clone $(CONFIG_EDK2_REPOSITORY) $(project_dir); \ + cd $(project_dir); + +update: $(project_dir) + if [ ! -d "$(project_dir)" ]; then \ + git clone $(CONFIG_EDK2_REPOSITORY) $(project_dir); \ + fi + cd $(project_dir); \ + echo " Fetching new commits from $(CONFIG_EDK2_REPOSITORY)"; \ + git fetch origin 2>/dev/null; \ + if ! git rev-parse --verify -q $(CONFIG_EDK2_TAG_OR_REV) >/dev/null; then \ + echo " $(CONFIG_EDK2_TAG_OR_REV) is not a valid git reference"; \ + exit 1; \ + fi; \ + if git status --ignore-submodules=dirty | grep -q clean; then \ + echo " Checking out $(project_name) revision $(CONFIG_EDK2_TAG_OR_REV)"; \ + git checkout --detach $(CONFIG_EDK2_TAG_OR_REV) -f; \ + else \ + echo " Working directory not clean; will not overwrite"; \ + fi; \ + git submodule update --init --checkout + +logo: $(project_dir) + case "$(CONFIG_EDK2_BOOTSPLASH_FILE)" in \ + "") ;; \ + /*) convert -background None $(CONFIG_EDK2_BOOTSPLASH_FILE) \ + BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \ + *) convert -background None $(top)/$(CONFIG_EDK2_BOOTSPLASH_FILE) \ + BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \ + esac \ + +checktools: + echo -n "EDK2: Checking uuid-dev:" + echo "#include <uuid/uuid.h>" > libtest.c + echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c + $(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " Found!" || \ + ( echo " Not found!"; \ + echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 ) + rm -rf libtest.c libtest + echo -n "EDK2: Checking nasm:" + type nasm > /dev/null 2>&1 && echo " Found!" || \ + ( echo " Not found!"; echo "ERROR: Please install nasm."; exit 1 ) + echo -n "EDK2: Checking imagemagick:" + -convert -size 1x1 xc: test.png &> /dev/null; + if [ -f test.png ]; then \ + rm test.png && echo " Found!"; \ + else \ + echo " Not found!"; \ + echo "ERROR: Please install imagemagick"; \ + exit 1; \ + fi + +build: update logo checktools + echo " ##### $(project_name) Build Summary #####" + echo " Repository: $(CONFIG_EDK2_REPOSITORY)" + echo " Branch: $(CONFIG_EDK2_TAG_OR_REV)" + echo " $(BUILD_STR)" | \ + sed 's/-/\n /g' | sort | sed \ + -e 's/a /Architecture: /g' \ + -e 's/b /Release: /g' \ + -e 's/D /Option: /g' \ + -e 's/p /Payload: /g' \ + -e 's/q /Build: Quiet/' \ + -e 's/t /Toolchain: /' + unset CC; $(MAKE) -C $(project_dir)/BaseTools 2>&1 + cd $(project_dir); \ + export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \ + export WORKSPACE=$(project_dir); \ + . ./edksetup.sh BaseTools; \ + grep -q "COREBOOT" $(project_dir)/Conf/tools_def.txt; \ + if [ $$? -ne 0 ]; then \ + cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \ + fi; \ + build $(BUILD_STR); \ + mkdir -p $(project_dir)/../output; \ + mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/../output/UEFIPAYLOAD.fd; \ + git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true + +clean: + test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0 + +distclean: + rm -rf */ + +.PHONY: all update checktools config build clean distclean logo diff --git a/payloads/external/edk2/tools_def.txt b/payloads/external/edk2/tools_def.txt new file mode 100644 index 0000000000..b9a67ebec9 --- /dev/null +++ b/payloads/external/edk2/tools_def.txt @@ -0,0 +1,183 @@ +# +# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> +# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> +# Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR> +# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# + +#The following has been adapted from the BaseTools/Conf/tools_def.template file +#and is used to direct the edk2 build to use coreboot's crossgcc toolchain +#rather than the host machine's toolchain + +DEFINE COREBOOT_IA32_PREFIX = ENV(GCC_CC_x86_32) +DEFINE COREBOOT_X64_PREFIX = ENV(GCC_CC_x86_64) +DEFINE COREBOOT_ARM_PREFIX = ENV(GCC_CC_arm) +DEFINE COREBOOT_ARM64_PREFIX = ENV(GCC_CC_arm64) + +DEFINE COREBOOT_IA32_OBJCOPY = ENV(OBJCOPY_x86_32) +DEFINE COREBOOT_X64_OBJCOPY = ENV(OBJCOPY_x86_64) +DEFINE COREBOOT_ARM_OBJCOPY = ENV(OBJCOPY_arm) +DEFINE COREBOOT_ARM64_OBJCOPY = ENV(OBJCOPY_arm64) + +#################################################################################### +# +# COREBOOT - This configuration is used to compile under Linux to produce +# PE/COFF binaries using coreboot's toolchain. +# +################################################################################## + +*_COREBOOT_*_*_FAMILY = GCC + +*_COREBOOT_*_MAKE_PATH = make +*_COREBOOT_*_*_DLL = ENV(GCC5_DLL) +*_COREBOOT_*_ASL_PATH = DEF(UNIX_IASL_BIN) + +*_COREBOOT_*_PP_FLAGS = DEF(GCC_PP_FLAGS) +*_COREBOOT_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) +*_COREBOOT_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_COREBOOT_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) +*_COREBOOT_*_APP_FLAGS = +*_COREBOOT_*_ASL_FLAGS = DEF(IASL_FLAGS) +*_COREBOOT_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) + +################## +# COREBOOT IA32 definitions +################## +*_COREBOOT_IA32_OBJCOPY_PATH = DEF(COREBOOT_IA32_OBJCOPY) +*_COREBOOT_IA32_CC_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_SLINK_PATH = DEF(COREBOOT_IA32_PREFIX)-ar +*_COREBOOT_IA32_DLINK_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_ASLDLINK_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_ASM_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_PP_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_VFRPP_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_ASLCC_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_ASLPP_PATH = DEF(COREBOOT_IA32_PREFIX) +*_COREBOOT_IA32_RC_PATH = DEF(COREBOOT_IA32_OBJCOPY) + +*_COREBOOT_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto +*_COREBOOT_IA32_ASLDLINK_FLAGS = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 +*_COREBOOT_IA32_ASM_FLAGS = DEF(GCC5_ASM_FLAGS) -m32 -march=i386 +*_COREBOOT_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) +*_COREBOOT_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) +*_COREBOOT_IA32_OBJCOPY_FLAGS = +*_COREBOOT_IA32_NASM_FLAGS = -f elf32 + + DEBUG_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os + DEBUG_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 + +RELEASE_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os -Wno-unused-but-set-variable +RELEASE_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 + + NOOPT_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0 + NOOPT_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,-m,elf_i386,--oformat=elf32-i386 -O0 + +################## +# COREBOOT X64 definitions +################## +*_COREBOOT_X64_OBJCOPY_PATH = DEF(COREBOOT_X64_OBJCOPY) +*_COREBOOT_X64_CC_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_SLINK_PATH = DEF(COREBOOT_X64_PREFIX)-ar +*_COREBOOT_X64_DLINK_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_ASLDLINK_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_ASM_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_PP_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_VFRPP_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_ASLCC_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_ASLPP_PATH = DEF(COREBOOT_X64_PREFIX) +*_COREBOOT_X64_RC_PATH = DEF(COREBOOT_X64_OBJCOPY) + +*_COREBOOT_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto +*_COREBOOT_X64_ASLDLINK_FLAGS = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_x86_64 +*_COREBOOT_X64_ASM_FLAGS = DEF(GCC5_ASM_FLAGS) -m64 +*_COREBOOT_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) +*_COREBOOT_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) +*_COREBOOT_X64_OBJCOPY_FLAGS = +*_COREBOOT_X64_NASM_FLAGS = -f elf64 + + DEBUG_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os + DEBUG_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os + +RELEASE_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os -Wno-unused-but-set-variable +RELEASE_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os + + NOOPT_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0 + NOOPT_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -O0 + +################## +# COREBOOT ARM definitions +################## +*_COREBOOT_ARM_CC_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_SLINK_PATH = ENV(COREBOOT_ARM_PREFIX)-ar +*_COREBOOT_ARM_DLINK_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_ASLDLINK_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_ASM_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_PP_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_VFRPP_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_ASLCC_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_ASLPP_PATH = ENV(COREBOOT_ARM_PREFIX) +*_COREBOOT_ARM_RC_PATH = ENV(COREBOOT_ARM_OBJCOPY) + +*_COREBOOT_ARM_ARCHCC_FLAGS = -mthumb +*_COREBOOT_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_COREBOOT_ARM_ASLDLINK_FLAGS = DEF(GCC5_ARM_ASLDLINK_FLAGS) +*_COREBOOT_ARM_ASM_FLAGS = DEF(GCC5_ARM_ASM_FLAGS) +*_COREBOOT_ARM_DLINK2_FLAGS = DEF(GCC5_ARM_DLINK2_FLAGS) +*_COREBOOT_ARM_PLATFORM_FLAGS = -march=armv7-a +*_COREBOOT_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS) +*_COREBOOT_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS) +*_COREBOOT_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) +*_COREBOOT_ARM_CC_XIPFLAGS = DEF(GCC5_ARM_CC_XIPFLAGS) + + DEBUG_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0 + DEBUG_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) + +RELEASE_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable +RELEASE_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm + + NOOPT_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0 + NOOPT_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0 + +################## +# COREBOOT AARCH64 definitions +################## +*_COREBOOT_AARCH64_CC_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_SLINK_PATH = ENV(COREBOOT_ARM64_PREFIX)-ar +*_COREBOOT_AARCH64_DLINK_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_ASLDLINK_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_ASM_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_PP_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_VFRPP_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_ASLCC_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_ASLPP_PATH = ENV(COREBOOT_ARM64_PREFIX) +*_COREBOOT_AARCH64_RC_PATH = ENV(COREBOOT_ARM64_OBJCOPY) + +*_COREBOOT_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_COREBOOT_AARCH64_ASLDLINK_FLAGS = DEF(GCC5_AARCH64_ASLDLINK_FLAGS) +*_COREBOOT_AARCH64_ASM_FLAGS = DEF(GCC5_AARCH64_ASM_FLAGS) +*_COREBOOT_AARCH64_DLINK2_FLAGS = DEF(GCC5_AARCH64_DLINK2_FLAGS) +*_COREBOOT_AARCH64_PLATFORM_FLAGS = +*_COREBOOT_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS) +*_COREBOOT_AARCH64_RC_FLAGS = DEF(GCC_AARCH64_RC_FLAGS) +*_COREBOOT_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) +*_COREBOOT_AARCH64_CC_XIPFLAGS = DEF(GCC5_AARCH64_CC_XIPFLAGS) + + DEBUG_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small + DEBUG_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 + DEBUG_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 + +RELEASE_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer +RELEASE_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 + + NOOPT_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small + NOOPT_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0 + NOOPT_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0 |