From patchwork Mon Jun 20 15:29:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 9568 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC054CCA473 for ; Fri, 24 Jun 2022 17:26:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.10466.1656091574642988102 for ; Fri, 24 Jun 2022 10:26:14 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 45D951042 for ; Fri, 24 Jun 2022 10:26:14 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F014C3F792 for ; Fri, 24 Jun 2022 10:26:13 -0700 (PDT) From: Jon Mason 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 Message-Id: <20220620152913.3563-1-jon.mason@arm.com> X-Mailer: git-send-email 2.17.1 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 24 Jun 2022 17:26:18 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3538 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 --- 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" From patchwork Mon Jun 20 15:29:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 9567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB4CAC43334 for ; Fri, 24 Jun 2022 17:26:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.10721.1656091574707876624 for ; Fri, 24 Jun 2022 10:26:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7365D143D for ; Fri, 24 Jun 2022 10:26:14 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2BCE43F792 for ; Fri, 24 Jun 2022 10:26:14 -0700 (PDT) From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/2] ci: update edk2 yml file to work with qemuarm/qemuarm64 Date: Mon, 20 Jun 2022 11:29:13 -0400 Message-Id: <20220620152913.3563-2-jon.mason@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220620152913.3563-1-jon.mason@arm.com> References: <20220620152913.3563-1-jon.mason@arm.com> List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 24 Jun 2022 17:26:18 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/3539 Signed-off-by: Jon Mason --- .gitlab-ci.yml | 4 ++++ ci/edk2.yml | 6 ++++++ ci/jobs-to-kas | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6532fd09..f91d678a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -185,6 +185,9 @@ qemuarm64: extends: .build parallel: matrix: + - TOOLCHAINS: [gcc, clang] + EFI: [uboot, edk2] + TESTING: testimage - VIRT: xen qemuarm-secureboot: @@ -199,6 +202,7 @@ qemuarm: parallel: matrix: - TOOLCHAINS: [gcc, clang] + EFI: [uboot, edk2] TESTING: testimage - VIRT: xen diff --git a/ci/edk2.yml b/ci/edk2.yml index 77eaee88..219ee28b 100644 --- a/ci/edk2.yml +++ b/ci/edk2.yml @@ -7,3 +7,9 @@ local_conf_header: MACHINE_FEATURES += "efi" TFA_UBOOT = "0" TFA_UEFI = "1" + + EXTRA_IMAGEDEPENDS += "edk2-firmware" + EFI_PROVIDER ?= "grub-efi" + + QB_DEFAULT_BIOS = "QEMU_EFI.fd" + WKS_FILE ?= "efi-disk.wks.in" diff --git a/ci/jobs-to-kas b/ci/jobs-to-kas index f442a22d..d6896b77 100755 --- a/ci/jobs-to-kas +++ b/ci/jobs-to-kas @@ -18,7 +18,7 @@ for i in $(echo $1 | cut -s -d ':' -f 2 | sed 's/[][,]//g'); do # defaults, we can simply ignore those parameters. They are necessary # to pass in so that matrix can correctly setup all of the permutations # of each individual run. - if [[ $i == 'none' || $i == 'gcc' || $i == 'glibc' ]]; then + if [[ $i == 'none' || $i == 'gcc' || $i == 'glibc' || $i == 'uboot' ]]; then continue fi FILES+=":ci/$i.yml"