boot/edk2: add support to build 32bit edk2 when using x86_64 architecture

Add BR2_TARGET_EDK2_PLATFORM_OVMF_I386 for x86_64 architecture.
Update the management of EDK2_ARCH to follow the edk2 platform type in
place of BR2 architecture.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Kory Maincent 2021-10-04 15:27:40 +02:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent e11b068d6a
commit 883f9fc754
2 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ choice
config BR2_TARGET_EDK2_PLATFORM_OVMF_I386
bool "i386"
depends on BR2_i386
depends on BR2_i386 || BR2_x86_64
help
Platform configuration for a generic i386 target.
This platform will boot from flash address 0x0.

View File

@ -14,14 +14,6 @@ EDK2_DEPENDENCIES = edk2-platforms host-python3 host-acpica host-util-linux
EDK2_INSTALL_TARGET = NO
EDK2_INSTALL_IMAGES = YES
ifeq ($(BR2_i386),y)
EDK2_ARCH = IA32
else ifeq ($(BR2_x86_64),y)
EDK2_ARCH = X64
else ifeq ($(BR2_aarch64),y)
EDK2_ARCH = AARCH64
endif
ifeq ($(BR2_ENABLE_DEBUG),y)
EDK2_BUILD_TYPE = DEBUG
else
@ -58,33 +50,39 @@ EDK2_BUILD_PACKAGES = $(@D)/Build/Buildroot
EDK2_PACKAGES_PATH = $(@D):$(EDK2_BUILD_PACKAGES):$(STAGING_DIR)/usr/share/edk2-platforms
ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_I386),y)
EDK2_ARCH = IA32
EDK2_DEPENDENCIES += host-nasm
EDK2_PACKAGE_NAME = OvmfPkg
EDK2_PLATFORM_NAME = OvmfPkgIa32
EDK2_BUILD_DIR = OvmfIa32
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_X64),y)
EDK2_ARCH = X64
EDK2_DEPENDENCIES += host-nasm
EDK2_PACKAGE_NAME = OvmfPkg
EDK2_PLATFORM_NAME = OvmfPkgX64
EDK2_BUILD_DIR = OvmfX64
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU),y)
EDK2_ARCH = AARCH64
EDK2_PACKAGE_NAME = ArmVirtPkg
EDK2_PLATFORM_NAME = ArmVirtQemu
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-$(EDK2_ARCH)
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL),y)
EDK2_ARCH = AARCH64
EDK2_PACKAGE_NAME = ArmVirtPkg
EDK2_PLATFORM_NAME = ArmVirtQemuKernel
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-$(EDK2_ARCH)
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64),y)
EDK2_ARCH = AARCH64
EDK2_PACKAGE_NAME = Platform/ARM/VExpressPkg
EDK2_PLATFORM_NAME = ArmVExpress-FVP-AArch64
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX),y)
EDK2_ARCH = AARCH64
EDK2_DEPENDENCIES += host-dtc arm-trusted-firmware
EDK2_PACKAGE_NAME = Platform/Socionext/DeveloperBox
EDK2_PLATFORM_NAME = DeveloperBox
@ -103,6 +101,7 @@ define EDK2_PRE_BUILD_SOCIONEXT_DEVELOPERBOX
endef
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN),y)
EDK2_ARCH = AARCH64
EDK2_DEPENDENCIES += host-dtc arm-trusted-firmware
EDK2_PACKAGE_NAME = Platform/SolidRun/Armada80x0McBin
EDK2_PLATFORM_NAME = Armada80x0McBin
@ -111,6 +110,7 @@ EDK2_BUILD_ENV += DTC_PREFIX=$(HOST_DIR)/bin/
EDK2_BUILD_OPTS += -D INCLUDE_TFTP_COMMAND
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA),y)
EDK2_ARCH = AARCH64
EDK2_DEPENDENCIES += arm-trusted-firmware
EDK2_PACKAGE_NAME = Platform/Qemu/SbsaQemu
EDK2_PLATFORM_NAME = SbsaQemu