From: Jon Mason <jon.mason@arm.com>
To: meta-arm@lists.yoctoproject.org
Subject: [PATCH 1/2] arm/edk2: add support for qemuarm and qemuarm64
Date: Mon, 20 Jun 2022 11:29:12 -0400 [thread overview]
Message-ID: <20220620152913.3563-1-jon.mason@arm.com> (raw)
Add basic support for running edk2 on qemuarm and qemuarm64. This
necessitated the need to add ACPI and EFI to the default kernel configs
for these machines.
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
meta-arm/recipes-bsp/uefi/edk2-firmware.inc | 5 +++++
.../recipes-bsp/uefi/edk2-firmware_%.bbappend | 17 +++++++++++++++++
.../recipes-kernel/linux/linux-yocto/efi.cfg | 2 ++
.../recipes-kernel/linux/linux-yocto_%.bbappend | 6 ++++++
4 files changed, 30 insertions(+)
create mode 100644 meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
index 63c422f6..21bc58dd 100644
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
+++ b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
@@ -71,9 +71,14 @@ export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike"
EDK_COMPILER ?= "GCC5"
export GCC5_AARCH64_PREFIX = "${TARGET_PREFIX}"
+export GCC5_ARM_PREFIX = "${TARGET_PREFIX}"
EDK_COMPILER:toolchain-clang = "CLANG38"
export CLANG38_AARCH64_PREFIX = "${TARGET_PREFIX}"
+export CLANG38_ARM_PREFIX = "${TARGET_PREFIX}"
+
+#FIXME - arm32 doesn't work with clang due to a linker issue
+TOOLCHAIN:arm = "gcc"
do_configure:prepend() {
sed -i -e "s#-target ${HOST_ARCH}-linux-gnu*#-target ${HOST_SYS}#" ${S}/BaseTools/Conf/tools_def.template
diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend b/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend
index f65cb094..7a39bb03 100644
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend
+++ b/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend
@@ -3,6 +3,15 @@ EDK2_PLATFORM:qemuarm64-secureboot = "ArmVirtQemu-AARCH64"
EDK2_PLATFORM_DSC:qemuarm64-secureboot = "ArmVirtPkg/ArmVirtQemu.dsc"
EDK2_BIN_NAME:qemuarm64-secureboot = "QEMU_EFI.fd"
+COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64"
+EDK2_PLATFORM:qemuarm64 = "ArmVirtQemu-AARCH64"
+EDK2_PLATFORM_DSC:qemuarm64 = "ArmVirtPkg/ArmVirtQemu.dsc"
+EDK2_BIN_NAME:qemuarm64 = "QEMU_EFI.fd"
+
+COMPATIBLE_MACHINE:qemuarm = "qemuarm"
+EDK2_PLATFORM:qemuarm = "ArmVirtQemu-ARM"
+EDK2_PLATFORM_DSC:qemuarm = "ArmVirtPkg/ArmVirtQemu.dsc"
+EDK2_BIN_NAME:qemuarm = "QEMU_EFI.fd"
COMPATIBLE_MACHINE:qemu-generic-arm64 = "qemu-generic-arm64"
DEPENDS:append:qemu-generic-arm64 = " trusted-firmware-a coreutils-native"
@@ -21,3 +30,11 @@ do_install:append:qemu-generic-arm64() {
# QEMU requires that the images be minimum of 256M in size
truncate -s 256M ${D}/firmware/SBSA_FLASH*.fd
}
+
+do_install:append:qemuarm64() {
+ install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/
+}
+
+do_install:append:qemuarm() {
+ install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/
+}
diff --git a/meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg b/meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
new file mode 100644
index 00000000..00be1bc6
--- /dev/null
+++ b/meta-arm/recipes-kernel/linux/linux-yocto/efi.cfg
@@ -0,0 +1,2 @@
+CONFIG_ACPI=y
+CONFIG_EFI=y
diff --git a/meta-arm/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto_%.bbappend
index cf093f04..1d01daa0 100644
--- a/meta-arm/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/meta-arm/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -16,3 +16,9 @@ FILESEXTRAPATHS:prepend:qemuarm-secureboot = "${ARMFILESPATHS}"
SRC_URI:append:qemuarm-secureboot = " \
file://tee.cfg \
"
+
+FILESEXTRAPATHS:prepend:qemuarm64 = "${ARMFILESPATHS}"
+SRC_URI:append:qemuarm64 = " file://efi.cfg"
+
+FILESEXTRAPATHS:prepend:qemuarm = "${ARMFILESPATHS}"
+SRC_URI:append:qemuarm = " file://efi.cfg"
--
2.17.1
next reply other threads:[~2022-06-24 17:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 15:29 Jon Mason [this message]
2022-06-20 15:29 ` [PATCH 2/2] ci: update edk2 yml file to work with qemuarm/qemuarm64 Jon Mason
2022-06-27 14:03 ` [PATCH 1/2] arm/edk2: add support for qemuarm and qemuarm64 Jon Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220620152913.3563-1-jon.mason@arm.com \
--to=jon.mason@arm.com \
--cc=meta-arm@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.