1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-01-12 03:10:15 +00:00

arm/edk2-firmware: update to 202502

Update to the latest tagged version of edk2-firmware.  This requires
rebasing the sbsa-acs patches.  Also, sgi575 works with the latest
version but requires a patch to compile cleanly.

There is an issue with qemuarm/qemuarm64 where the boot device is not
found in edk2 if 'RELEASE' is set as the build mode.  Temporarily
changing that to DEBUG while the issue is being worked on (in
https://github.com/tianocore/edk2/issues/10942).

Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Jon Mason
2025-04-02 16:02:26 -04:00
parent ce4c7f6661
commit 69121ff4e5
10 changed files with 89 additions and 32 deletions

View File

@@ -13,9 +13,6 @@ KERNEL_IMAGETYPE ?= "Image"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
SERIAL_CONSOLES = "115200;ttyAMA0"
#FIXME - for some reason newer EDK2 refuses to boot the kernel
PREFERRED_VERSION_edk2-firmware ?= "202408%"
EFI_PROVIDER ?= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd-boot", "grub-efi", d)}"
MACHINE_FEATURES += "efi"

View File

@@ -5,3 +5,6 @@ EDK2_PLATFORM_DSC = "Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc"
EDK2_BIN_NAME = "BL33_AP_UEFI.fd"
COMPATIBLE_MACHINE = "sgi575"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " file://0001-Platform-Sgi-workaround-ArmFfaLib-error.patch;patchdir=edk2-platforms"

View File

@@ -0,0 +1,41 @@
From b368ff0e774508b60c18bc19fbfaaa3910616e66 Mon Sep 17 00:00:00 2001
From: Jon Mason <jon.mason@arm.com>
Date: Wed, 2 Apr 2025 15:57:21 -0400
Subject: [PATCH] Platform/Sgi: workaround ArmFfaLib error
When attempting to build sgi575, the following error is encountered
| Active Platform = /builder/meta-arm/build/tmp/work/sgi575-poky-linux/edk2-firmware/202502/edk2/edk2-platforms/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
|
|
| build.py...
| /builder/meta-arm/build/tmp/work/sgi575-poky-linux/edk2-firmware/202502/edk2/edk2-platforms/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc(...): error 4000: Instance of library class [ArmFfaLib] is not found
| in [/builder/meta-arm/build/tmp/work/sgi575-poky-linux/edk2-firmware/202502/edk2/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf] [AARCH64]
| consumed by module [/builder/meta-arm/build/tmp/work/sgi575-poky-linux/edk2-firmware/202502/edk2/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf]
|
|
This is because commit 9f9a3de9e4c5595cd42d14c705570887630209d8 in
edk2-firmware adds a reference to the ArmFfaLib in
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
That file is referenced in Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
To workaround this issue, add the ArmFfaLib to Sgi575.dsc.
Upstream-Status: Pending [https://github.com/tianocore/edk2-platforms/issues/761]
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
index f29272778d73..30f2d1fd49a7 100644
--- a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
+++ b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
@@ -55,3 +55,6 @@
[Components.common]
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+
+[LibraryClasses.common.DXE_RUNTIME_DRIVER]
+ ArmFfaLib|ArmPkg/Library/ArmFfaLib/ArmFfaDxeLib.inf

View File

@@ -7,11 +7,21 @@ COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
EDK2_PLATFORM:qemuarm64 = "ArmVirtQemu-AARCH64"
EDK2_PLATFORM_DSC:qemuarm64 = "ArmVirtPkg/ArmVirtQemu.dsc"
EDK2_BIN_NAME:qemuarm64 = "QEMU_EFI.fd"
# No need for PXE booting in qemu, disable to reduce unnecessary noise
EDK2_EXTRA_BUILD:qemuarm64 += " -D NETWORK_PXE_BOOT_ENABLE=FALSE "
# FIXME - issue with 'RELEASE' firmware, use 'DEBUG'. This is being tracked in
# https://github.com/tianocore/edk2/issues/10942
EDK2_BUILD_RELEASE:qemuarm64 = "0"
COMPATIBLE_MACHINE:qemuarm = "qemuarm"
EDK2_PLATFORM:qemuarm = "ArmVirtQemu-ARM"
EDK2_PLATFORM_DSC:qemuarm = "ArmVirtPkg/ArmVirtQemu.dsc"
EDK2_BIN_NAME:qemuarm = "QEMU_EFI.fd"
# No need for PXE booting in qemu, disable to reduce unnecessary noise
EDK2_EXTRA_BUILD:qemuarm += " -D NETWORK_PXE_BOOT_ENABLE=FALSE "
# FIXME - issue with 'RELEASE' firmware, use 'DEBUG'. This is being tracked in
# https://github.com/tianocore/edk2/issues/10942
EDK2_BUILD_RELEASE:qemuarm = "0"
do_install:append:qemuarm64() {
install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/

View File

@@ -1,11 +0,0 @@
SRCREV_edk2 ?= "0f3867fa6ef0553e26c42f7d71ff6bdb98429742"
SRCREV_edk2-platforms ?= "2d66a9e048285af8ba4bfe4bdaab37a8e98288b3"
# FIXME - clang is having issues with antlr
TOOLCHAIN:aarch64 = "gcc"
require recipes-bsp/uefi/edk2-firmware.inc
SRC_URI += "\
file://edk2_fix_epoch.patch \
"

View File

@@ -0,0 +1,9 @@
require recipes-bsp/uefi/edk2-firmware.inc
SRCREV_edk2 ?= "fbe0805b2091393406952e84724188f8c1941837"
SRCREV_edk2-platforms ?= "728c8bb974be69b4034fad7a1c60917cca2dd03d"
# FIXME - clang is having issues with antlr
TOOLCHAIN:aarch64 = "gcc"
SRC_URI += " file://edk2_fix_epoch.patch"

View File

@@ -1,6 +1,6 @@
From e7918dbd4a02be2a474534da3f1e565931a5e632 Mon Sep 17 00:00:00 2001
From 17df0e93949097c18c65567bdf8c7ad2478f63b4 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Thu, 16 Feb 2023 21:53:25 +0000
Date: Thu, 16 Feb 2023 21:53:25 -0500
Subject: [PATCH] Patch in the paths to the SBSA test suite
Upstream-Status: Inappropriate (required action)
@@ -10,15 +10,15 @@ Signed-off-by: Ross Burton <ross.burton@arm.com>
1 file changed, 3 insertions(+)
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index 7e985f8280a7..ca7a716fadc7 100644
index 7e985f8280a7..052510236cae 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -23,6 +23,8 @@
!include MdePkg/MdeLibs.dsc.inc
[LibraryClasses.common]
+ SbsaValLib|ShellPkg/Application/sbsa-acs/val/SbsaValLib.inf
+ SbsaPalLib|ShellPkg/Application/sbsa-acs/platform/pal_uefi/SbsaPalLib.inf
+ SbsaValLib|ShellPkg/Application/sbsa-acs/val/SbsaValLib.inf
+ SbsaPalLib|ShellPkg/Application/sbsa-acs/platform/pal_uefi/SbsaPalLib.inf
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
@@ -26,7 +26,7 @@ index 7e985f8280a7..ca7a716fadc7 100644
# Build all the libraries when building this package.
# This helps developers test changes and how they affect the package.
#
+ ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf
+ ShellPkg/Application/sbsa-acs/uefi_app/SbsaAvs.inf
ShellPkg/Library/UefiShellLib/UefiShellLib.inf
ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf

View File

@@ -1,13 +1,21 @@
From a91273485735b89e67050bb39a09b60a16055dbd Mon Sep 17 00:00:00 2001
From 76665f48f5a4672d8c8bed3c57822307193b2b72 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 7 Apr 2021 00:16:07 -0700
Date: Wed, 7 Apr 2021 00:16:07 -0400
Subject: [PATCH] Enforce using good old BFD linker
some distros may use gold as system linker and it crashes while linking the app
some distros may use gold as system linker and it crashes while linking
the app
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:54:10: INFO section type is unsupported
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: error: TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:66:14: INFO section type is unsupported
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld: internal error in do_layout, at ../../gold/object.cc:1939
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
error:
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:54:10:
INFO section type is unsupported
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
error:
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/edk2/BaseTools/Scripts/GccBase.lds:66:14:
INFO section type is unsupported
TOPDIR/build/tmpfs/work/qemuarm64-yoe-linux/sbsa-acs/3.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/../../libexec/aarch64-yoe-linux/gcc/aarch64-yoe-linux/11.0.1/ld:
internal error in do_layout, at ../../gold/object.cc:1939
collect2: error: ld returned 1 exit status
Upstream-Status: Pending
@@ -17,15 +25,15 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 14f3b643c43d..ce3d969625de 100755
index ffeb22742142..ba24113d216c 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -905,7 +905,7 @@ DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-
@@ -928,7 +928,7 @@ DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mstack-protector-guard=global
DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_RISCV64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
-DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
+DEFINE GCC_DLINK2_FLAGS_COMMON = -fuse-ld=bfd -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_IA32_X64_DLINK_COMMON = -nostdlib --pie --fatal-warnings -z,noexecstack --gc-sections
DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map -Wl,--fatal-warnings -Wl,-z,noexecstack
DEFINE GCC_LOONGARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map

View File

@@ -1,4 +1,4 @@
require recipes-bsp/uefi/edk2-firmware_202411.bb
require recipes-bsp/uefi/edk2-firmware_202502.bb
PROVIDES:remove = "virtual/bootloader"
LICENSE += "& Apache-2.0"