From patchwork Wed May 12 18:36:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477765 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=ybaTmoq4; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNmH37dYz9tjv for ; Thu, 13 May 2021 04:36:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1417984421; Wed, 12 May 2021 18:36:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dvaDeg6BidvV; Wed, 12 May 2021 18:36:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 58E0D8441D; Wed, 12 May 2021 18:36:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id AC70F1C1178 for ; Wed, 12 May 2021 18:36:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9BF1960DE2 for ; Wed, 12 May 2021 18:36:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H9LWwaVhWiQk for ; Wed, 12 May 2021 18:36:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6E25060DE1 for ; Wed, 12 May 2021 18:36:16 +0000 (UTC) Date: Wed, 12 May 2021 18:36:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844573; bh=E79SI+SXCmT8/WXh9uJcpsiTVea4d+aD1CUhS2hYlIM=; h=Date:To:From:Cc:Reply-To:Subject:From; b=ybaTmoq4rt5htMLTaaztI7JG4xFd3u4RwSbMxKId9ao730OrXu0UMqc59JrsJyx0D 3tYJZRqOi6oSGx3hBkPEH81OWci2ABVCbEDlHenVvXqn2gXHlVn5y8MTIxSpqZVL0h C8KrJJOKpZM7uVPPj8UT9Jcg3WA3x/PDTIS7vqyNmJ/7y7Zd1+IgxSKEFIjJdWQP7P 8dzIRJ44ZR5O25NDxAu2wrd0yzxWxSkyXJs6Yo6lqfTHidRHm/RaLbUFtV8Q308/b4 j930l71bb8bBiJJn/KFkxgWC6uDXLqHT+yeaKNRsbceTYyTQGjdszzHEBZQu22rAUa jr9ZLyHE07EbA== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 01/10] package/edk2-platforms: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Cc: Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" EDK2 firmware is usually built from two sources; the core EDK2 environment, and additional platform description files maintained separately. This package adds the latter set of description files to staging so that the core EDK2 package can build with these for certain platforms during the building process. Signed-off-by: Dick Olsson --- Revision 5: * check-package fixes * Bumped to the latest stable version Revision 4: * Addressed review items from Yann Morin * Install description files to the staging dir instead of the host dir * Updated to HEAD as of 7 Jan, 2021 Revision 3: * Added standard comment header * Added sha256 of the license file * Updated to hash matching edk2 202008 Revision 2: * Now installs all description files into HOST_DIR so other packages do not have to compile from its BUILD_DIR (suggested by Thomas Petazzoni) --- package/Config.in | 1 + package/edk2-platforms/Config.in | 8 ++++++++ package/edk2-platforms/edk2-platforms.hash | 3 +++ package/edk2-platforms/edk2-platforms.mk | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 package/edk2-platforms/Config.in create mode 100644 package/edk2-platforms/edk2-platforms.hash create mode 100644 package/edk2-platforms/edk2-platforms.mk diff --git a/package/Config.in b/package/Config.in index 6181aaac2c..bfb8d5a78b 100644 --- a/package/Config.in +++ b/package/Config.in @@ -460,6 +460,7 @@ endmenu source "package/dvb-apps/Config.in" source "package/dvbsnoop/Config.in" source "package/edid-decode/Config.in" + source "package/edk2-platforms/Config.in" source "package/eudev/Config.in" source "package/ev3dev-linux-drivers/Config.in" source "package/evemu/Config.in" diff --git a/package/edk2-platforms/Config.in b/package/edk2-platforms/Config.in new file mode 100644 index 0000000000..17633c0fdd --- /dev/null +++ b/package/edk2-platforms/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_EDK2_PLATFORMS + bool + help + EDK2 description files for all supported platforms. + The main EDK2 bootloader package will depend on these + description files while building firmware for some platforms. + + https://github.com/tianocore/edk2-platforms diff --git a/package/edk2-platforms/edk2-platforms.hash b/package/edk2-platforms/edk2-platforms.hash new file mode 100644 index 0000000000..30ae235078 --- /dev/null +++ b/package/edk2-platforms/edk2-platforms.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 dfdc34fea86e5037a3a6cbd2a83b1f655f16b4c9ab4f5ff9da91e45a358c9a14 edk2-platforms-db922e1253cb6f1fc456805bc42fb7d401eed5c2.tar.gz +sha256 50ce20c9cfdb0e19ee34fe0a51fc0afe961f743697b068359ab2f862b494df80 License.txt diff --git a/package/edk2-platforms/edk2-platforms.mk b/package/edk2-platforms/edk2-platforms.mk new file mode 100644 index 0000000000..47e6b1c51d --- /dev/null +++ b/package/edk2-platforms/edk2-platforms.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# edk2-platforms +# +################################################################################ + +# Keep in sync with latest commit as of the release date for boot/edk2 +EDK2_PLATFORMS_VERSION = db922e1253cb6f1fc456805bc42fb7d401eed5c2 +EDK2_PLATFORMS_SITE = $(call github,tianocore,edk2-platforms,$(EDK2_PLATFORMS_VERSION)) +EDK2_PLATFORMS_LICENSE = BSD-2-Clause +EDK2_PLATFORMS_LICENSE_FILE = License.txt +EDK2_PLATFORMS_INSTALL_TARGET = NO +EDK2_PLATFORMS_INSTALL_STAGING = YES + +# There is nothing to build for edk2-platforms. All we need to do is to copy +# all description files to staging, for other packages to build with. +define EDK2_PLATFORMS_INSTALL_STAGING_CMDS + rm -rf $(STAGING_DIR)/usr/share/edk2-platforms + cp -rf $(@D) $(STAGING_DIR)/usr/share/edk2-platforms +endef + +$(eval $(generic-package)) From patchwork Wed May 12 18:36:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477766 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=b/YQJv1H; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNmX1CCWz9tT8 for ; Thu, 13 May 2021 04:36:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 216A160DE1; Wed, 12 May 2021 18:36:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t8JgeJvpmHeu; Wed, 12 May 2021 18:36:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C390760DE3; Wed, 12 May 2021 18:36:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4AEDD1BF2E3 for ; Wed, 12 May 2021 18:36:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 39AE760DE2 for ; Wed, 12 May 2021 18:36:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rUEyrNCa2kAU for ; Wed, 12 May 2021 18:36:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6391A60DE1 for ; Wed, 12 May 2021 18:36:23 +0000 (UTC) Date: Wed, 12 May 2021 18:36:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844579; bh=t1PcaoK3vg8htHOVomDT1mBeY5lFZB+uwYTXM1ySTSc=; h=Date:To:From:Cc:Reply-To:Subject:From; b=b/YQJv1HH+wtC0Shu1O1rUa90Xknvpa/aZB3gPzcSThthsQ3K3bRHvf5gd0xHPx8d ei6pMz1jvLnGiNwJBkeAaJjl2S6US8v15J9maVSuysGVmlYmVVi2iP7fA2UploMNrr Ft5MJzv/2vPUfStrF+HQannuKvmxuQ6JPufyLGAax0RdJUkCRTZOd2ahuwBzEvlD6s 1xKK9KA8TGbgGNNfyB0GGslFw1/QVMO+VoJVNOkavmbrSSEtSSqMxcVKIp86l73VnA ZydX2WcLFUFWTnL8wDdtp7BCPbsDEYLqf8Qh5aEQDEUOb3x57bnzfZ7+WdVja1iMJU TVUAkdOLK3DCw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 02/10] boot/edk2: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Cc: Thomas Petazzoni , Sergey Matyukevich Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" EDK2 is a modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications. The initial version of this bootloader package makes it possible to build firmware for the following seven configurations: * QEMU x86-64 pc machine * QEMU aarch64 virt machine, booting directly from flash * QEMU aarch64 virt machine, booting via the kernel protocol * QEMU aarch64 sbsa-ref machine * ARM FVP vexpress machine * Socionext SynQuacer Developerbox * SolidRun MacchiatoBin Support the use of EDK2 UEFI payloads as BL33 in ARM Trusted Firmware. Signed-off-by: Dick Olsson --- Revision 5: * Addressed feedback from Erico Nunes * Merged patch with the previously separate arm-trusted-firmware patch * Use the global debug config instead * check-package fixes * Bumped to the latest stable version * Fixed some indentation issues * Fixed incorrect archive name and hash * Made dependencies on ATF fiptool explicit to resolve dependency issues relating to openssl changes in ATF 2.4 Revision 4: * Addressed review items from Yann Morin * Simplified the inline comments * Updated to HEAD as of 7 Jan, 2021 * Removed upstream patch since it was merged on 4 Jan, 2021 * edk2-platforms is now a permanent depednency. Most platform descriptions depend on it anyway and it makes an already complicated build setup a little bit simpler. * Removed EDK2_EL2_NAME and instead using Kconfig for the edk2 flash device names * Renamed EDK2_OUTPUT_BASE to EDK2_BUILD_PACKAGES and relocate it to $(@D)/Build * Renamed EDK2_MAKE_ENV to EDK2_BASETOOLS_OPTS to better indicate these are options for building EDK2 BaseTools for the host * Added architecture dependencies in Kconfig * Fixed indentation in Config.in * Using _PRE_BUILD_HOOKS instead of _PRE_CONFIGURE_HOOKS * Using BR2_JLEVEL Revision 3: * Added standard comment header * Removed spurious change * Using proper compiler flags * Added missing libuuid dependency with host-util-linux * Automated QEMU SBSA config dependency * Updated to 202008 * Improved code comments * Added upstream patch to fix Python 3.9 build issues * Added support for Developerbox and MacchiatoBin Revision 2: Review items from Thomas Petazzoni: * Fixed alphabetical inclusion of Config.in * Removed spurious change in ATF * Added architecture dependencies * Added hash for license file * Using host dir (instead of build dir) from edk2-platforms * Simplified _BUILD_CMDS * Simplified _INSTALL_IMAGES_CMDS Other improvements: * Added support for x86-64 and OVMF * General cleanup and simplification * Improved code comments * Renamed variable EDK2_FD_NAME to EDK2_EL2_NAME to be more specific. This variable is only meaningful for platforms that build images intended to be used by other bootloaders in EL2 context (e.g. ATF). --- boot/Config.in | 1 + boot/arm-trusted-firmware/Config.in | 15 +- .../arm-trusted-firmware.mk | 9 ++ boot/edk2/Config.in | 110 +++++++++++++ boot/edk2/edk2.hash | 3 + boot/edk2/edk2.mk | 150 ++++++++++++++++++ 6 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 boot/edk2/Config.in create mode 100644 boot/edk2/edk2.hash create mode 100644 boot/edk2/edk2.mk diff --git a/boot/Config.in b/boot/Config.in index b3adbfc8bc..5684517d93 100644 --- a/boot/Config.in +++ b/boot/Config.in @@ -8,6 +8,7 @@ source "boot/arm-trusted-firmware/Config.in" source "boot/barebox/Config.in" source "boot/binaries-marvell/Config.in" source "boot/boot-wrapper-aarch64/Config.in" +source "boot/edk2/Config.in" source "boot/grub2/Config.in" source "boot/gummiboot/Config.in" source "boot/lpc32xxcdl/Config.in" diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index c06294040e..9d347550a4 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -1,7 +1,7 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE bool "ARM Trusted Firmware (ATF)" depends on (BR2_ARM_CPU_ARMV8A || BR2_ARM_CPU_ARMV7A) && \ - BR2_TARGET_UBOOT + (BR2_TARGET_UBOOT || BR2_TARGET_EDK2) help Enable this option if you want to build the ATF for your ARM based embedded device. @@ -135,6 +135,19 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE endif +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 + bool "Use EDK2 as BL33" + depends on BR2_TARGET_EDK2 + help + This option allows to embed EDK2 as the BL33 part of + the ARM Trusted Firmware. It ensures that the EDK2 package + gets built before ATF, and that the appropriate BL33 + variable pointing to the EDK2 is passed when building ATF. + + Do not choose this option if you intend to build ATF and EDK2 + for the 'qemu_sbsa' platform. In this case, due to the EDK2 + build system, the dependency between ATF and EDK is reversed. + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS string "Additional ATF make targets" help diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 0597cecf71..279658712b 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -79,6 +79,15 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += AARCH32_SP=optee endif endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33),y) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += edk2 +# Since the flash device name vary between platforms, we use the variable +# provided by the EDK2 package for this. Using this variable here is OK +# as it will expand after all dependencies are resolved, inside _BUILD_CMDS. +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ + BL33=$(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_EDK2_FD_NAME).fd) +endif + ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y) ARM_TRUSTED_FIRMWARE_UBOOT_BIN = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE)) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UBOOT_BIN) diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in new file mode 100644 index 0000000000..be6bb7ca17 --- /dev/null +++ b/boot/edk2/Config.in @@ -0,0 +1,110 @@ +config BR2_TARGET_EDK2 + bool "EDK2" + depends on BR2_x86_64 || BR2_aarch64 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 + select BR2_PACKAGE_EDK2_PLATFORMS + help + EDK II is a modern, feature-rich, cross-platform firmware + development environment for the UEFI and PI specifications. + + https://github.com/tianocore/tianocore.github.io/wiki/EDK-II + +if BR2_TARGET_EDK2 + +choice + prompt "Platform" + default BR2_TARGET_EDK2_PLATFORM_OVMF_X64 if BR2_x86_64 + default BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU if BR2_aarch64 + +config BR2_TARGET_EDK2_PLATFORM_OVMF_X64 + bool "x86-64" + depends on BR2_x86_64 + help + Platform configuration for a generic x86-64 target. + This platform will boot from flash address 0x0. + It should therefore be used as the first bootloader. + +config BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU + bool "ARM Virt Qemu (flash)" + depends on BR2_aarch64 + help + Platform configuration for QEMU targeting the Virt machine. + This platform will only boot from flash address 0x0. + It should therefore be used as the first bootloader. + +config BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL + bool "ARM Virt Qemu (kernel)" + depends on BR2_aarch64 + help + Platform configuration for QEMU targeting the Virt machine. + This platform can boot from either flash address 0x0 or via + the Linux boot protocol. It can therefore be loaded by a + previous bootloader like ARM Trusted Firmware or OP-TEE. + +config BR2_TARGET_EDK2_PLATFORM_ARM_SGI575 + bool "ARM SGI-575" + depends on BR2_aarch64 + help + Platform configuration for ARM SGI-575 on ARM's + Fixed Virtual Platform (FVP). + +config BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64 + bool "ARM VExpress FVP Aarch64" + depends on BR2_aarch64 + help + Platform configuration for ARM Versatile Express targeting + the Aarch64 Fixed Virtual Platform (FVP). + +config BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX + bool "Socionext DeveloperBox" + depends on BR2_aarch64 + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE + depends on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 + select BR2_PACKAGE_HOST_DTC + select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP + help + Platform configuration for Socionext SynQuacer DeveloperBox + (SC2A11). + +comment "Socionext DeveloperBox depends on ATF not using EDK2 as BL33" + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 + +config BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN + bool "SolidRun MacchiatoBin" + depends on BR2_aarch64 + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE + select BR2_PACKAGE_HOST_DTC + select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP + help + Platform configuration for the SolidRun MacchiatoBin. + +config BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA + bool "QEMU SBSA" + depends on BR2_aarch64 + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE + depends on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 + help + Platform configuration for QEMU targeting the SBSA reference + machine. + +comment "QEMU SBSA depends on ATF not using EDK2 as BL33" + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 + +endchoice + +config BR2_TARGET_EDK2_FD_NAME + string + default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_X64 + default "QEMU_EFI" \ + if BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU \ + || BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL + default "BL33_AP_UEFI" if BR2_TARGET_EDK2_PLATFORM_ARM_SGI575 + default "FVP_AARCH64_EFI" \ + if BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64 \ + || BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX + default "ARMADA_EFI" if BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN + +endif + +comment "EDK2 needs a toolchain w/ gcc >= 5" + depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5 diff --git a/boot/edk2/edk2.hash b/boot/edk2/edk2.hash new file mode 100644 index 0000000000..f28e9ce841 --- /dev/null +++ b/boot/edk2/edk2.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 04791c13b414a6d1877182a6d565cb762c30aa63e49bb4d495fca68ef4dd209d edk2-edk2-stable202102-br1.tar.gz +sha256 50ce20c9cfdb0e19ee34fe0a51fc0afe961f743697b068359ab2f862b494df80 License.txt diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk new file mode 100644 index 0000000000..903fdfb89e --- /dev/null +++ b/boot/edk2/edk2.mk @@ -0,0 +1,150 @@ +################################################################################ +# +# edk2 +# +################################################################################ + +EDK2_VERSION = edk2-stable202102 +EDK2_SITE = https://github.com/tianocore/edk2 +EDK2_SITE_METHOD = git +EDK2_LICENSE = BSD-2-Clause +EDK2_LICENSE_FILE = License.txt +EDK2_DEPENDENCIES = edk2-platforms host-python3 host-acpica host-util-linux +EDK2_INSTALL_TARGET = NO +EDK2_INSTALL_IMAGES = YES + +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 +EDK2_BUILD_TYPE = RELEASE +endif + +# Build system notes. +# +# The EDK2 build system is rather unique, so here are a few useful notes. +# +# First, builds rely heavily on Git submodules to fetch various dependencies +# into specific directory structures. It might be possible to work around this +# and rely on Buildroot's infrastructure, but using Git submodules greatly +# simplifies this already complicated build system. +# +# Second, the build system is spread across various commands and stages. +# Therefore, all build variables needs to be exported to be available +# accordingly. The first stage will build $(@D)/BaseTools which contains +# various tools and scripts for the host. +# +# Third, where applicable, the dependency direction between EDK2 and +# ARM Trusted Firmware (ATF) will go in different direction for different +# platforms. Most commonly, ATF will depend on EDK2 via the BL33 payload. +# But for some platforms (e.g. QEMU SBSA or DeveloperBox) EDK2 will package +# the ATF images within its own build system. In such cases, intermediary +# "EDK2 packages" will be built in $(EDK2_BUILD_PACKAGES) in order for EDK2 +# to be able to use them in subsequent build stages. +# +# For more information about the build setup: +# https://edk2-docs.gitbook.io/edk-ii-build-specification/4_edk_ii_build_process_overview + +EDK2_GIT_SUBMODULES = YES +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_X64),y) +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_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_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_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_DEPENDENCIES += host-dtc arm-trusted-firmware +EDK2_PACKAGE_NAME = Platform/Socionext/DeveloperBox +EDK2_PLATFORM_NAME = DeveloperBox +EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME) +EDK2_BUILD_ENV += DTC_PREFIX=$(HOST_DIR)/bin/ +EDK2_BUILD_OPTS += -D DO_X86EMU=TRUE +EDK2_PRE_BUILD_HOOKS += EDK2_PRE_BUILD_SOCIONEXT_DEVELOPERBOX + +define EDK2_PRE_BUILD_SOCIONEXT_DEVELOPERBOX + mkdir -p $(EDK2_BUILD_PACKAGES)/Platform/Socionext/DeveloperBox + $(ARM_TRUSTED_FIRMWARE_DIR)/tools/fiptool/fiptool create \ + --tb-fw $(BINARIES_DIR)/bl31.bin \ + --soc-fw $(BINARIES_DIR)/bl31.bin \ + --scp-fw $(BINARIES_DIR)/bl31.bin \ + $(EDK2_BUILD_PACKAGES)/Platform/Socionext/DeveloperBox/fip_all_arm_tf.bin +endef + +else ifeq ($(BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN),y) +EDK2_DEPENDENCIES += host-dtc arm-trusted-firmware +EDK2_PACKAGE_NAME = Platform/SolidRun/Armada80x0McBin +EDK2_PLATFORM_NAME = Armada80x0McBin +EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-$(EDK2_ARCH) +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_DEPENDENCIES += arm-trusted-firmware +EDK2_PACKAGE_NAME = Platform/Qemu/SbsaQemu +EDK2_PLATFORM_NAME = SbsaQemu +EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME) +EDK2_PRE_BUILD_HOOKS += EDK2_PRE_BUILD_QEMU_SBSA + +define EDK2_PRE_BUILD_QEMU_SBSA + mkdir -p $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa + ln -srf $(BINARIES_DIR)/{bl1.bin,fip.bin} $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa/ +endef + +endif + +EDK2_BASETOOLS_OPTS = \ + EXTRA_LDFLAGS="$(HOST_LDFLAGS)" \ + EXTRA_OPTFLAGS="$(HOST_CPPFLAGS)" + +EDK2_BUILD_ENV += \ + WORKSPACE=$(@D) \ + PACKAGES_PATH=$(EDK2_PACKAGES_PATH) \ + PYTHON_COMMAND=$(HOST_DIR)/bin/python3 \ + IASL_PREFIX=$(HOST_DIR)/bin/ \ + NASM_PREFIX=$(HOST_DIR)/bin/ \ + GCC5_$(EDK2_ARCH)_PREFIX=$(TARGET_CROSS) + +EDK2_BUILD_OPTS += \ + -t GCC5 \ + -n $(BR2_JLEVEL) \ + -a $(EDK2_ARCH) \ + -b $(EDK2_BUILD_TYPE) \ + -p $(EDK2_PACKAGE_NAME)/$(EDK2_PLATFORM_NAME).dsc + +define EDK2_BUILD_CMDS + mkdir -p $(EDK2_BUILD_PACKAGES) + export $(EDK2_BUILD_ENV) && \ + unset ARCH && \ + source $(@D)/edksetup.sh && \ + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/BaseTools $(EDK2_BASETOOLS_OPTS) && \ + build $(EDK2_BUILD_OPTS) all +endef + +define EDK2_INSTALL_IMAGES_CMDS + cp -f $(@D)/Build/$(EDK2_BUILD_DIR)/$(EDK2_BUILD_TYPE)_GCC5/FV/*.fd $(BINARIES_DIR) +endef + +$(eval $(generic-package)) From patchwork Wed May 12 18:36:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477767 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=QEcp/PiS; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNmm2G2nz9tT8 for ; Thu, 13 May 2021 04:36:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5F7C840F5E; Wed, 12 May 2021 18:36:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b3mHpOSu3cxC; Wed, 12 May 2021 18:36:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 81E1140F65; Wed, 12 May 2021 18:36:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9E0641BF2E3 for ; Wed, 12 May 2021 18:36:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8D47140F65 for ; Wed, 12 May 2021 18:36:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1ksSp80JK2xZ for ; Wed, 12 May 2021 18:36:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9593640F5E for ; Wed, 12 May 2021 18:36:35 +0000 (UTC) Date: Wed, 12 May 2021 18:36:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844593; bh=VMhfxUms022suFMlaMQSDtrqFG2PYMwqJ155tpWSzag=; h=Date:To:From:Cc:Reply-To:Subject:From; b=QEcp/PiSYmzHxRRHPK7+9u0dBX35rHT+gaJxOnyExgE7pPvVMxcoKzlu8l+lLIvB9 RsUuIUHvrmGpYXhKRJHHNFO58WaHFgrXYVOtwBZtbZKnQ18l6XgII2caho2ow//K+F 1GEsUBQpztdDTbaDWFoZM+RF4ayUYDXXKikn7jcC7yTvHNCRO8wS2difkK1F60/kUV T+jKw60t9tcYsVRMZFQHkcEYd8YPc20o7Df2axOnayS2k62BbFrLK+lXb0IyntNidh gM3U+IOszEwR8CJMALglj+/F/7v5gcroB+BLvoNUc2jMF71EK2BFc7dPTpc7ViLAz4 3ygAge9apt+Fg== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 03/10] configs/aarch64_efi_defconfig: build the EDK2 firmware from source X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Prior to this, you had to manually download a pre-built EDK2 flash device image (QEMU_EFI.fd) in order to boot this configuration with QEMU. Now, the configuration is building EDK2 from source. Signed-off-by: Dick Olsson --- Revision 5: * Addressed feedback from Erico Nunes * Fixed spelling mistake in readme.txt Revision 4: * Simplified resizing of the flash images with the trucate command Revision 3: * post-image.sh will now provide resized flash devices * readme.txt suggests pflash instead of bios Revision 2: * Explicitly added the default EDK2 platform to defconfig --- board/aarch64-efi/post-image.sh | 4 ++++ board/aarch64-efi/readme.txt | 9 ++++----- configs/aarch64_efi_defconfig | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/board/aarch64-efi/post-image.sh b/board/aarch64-efi/post-image.sh index f0214dc866..22cd99c8ac 100755 --- a/board/aarch64-efi/post-image.sh +++ b/board/aarch64-efi/post-image.sh @@ -3,3 +3,7 @@ BOARD_DIR="$(dirname $0)" cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg + +# The QEMU virt machine expects flash devices to be 64M. +truncate -s 64M "${BINARIES_DIR}/QEMU_EFI.fd" +truncate -s 64M "${BINARIES_DIR}/QEMU_VARS.fd" diff --git a/board/aarch64-efi/readme.txt b/board/aarch64-efi/readme.txt index 65a6345b6c..1c51d4d4c0 100644 --- a/board/aarch64-efi/readme.txt +++ b/board/aarch64-efi/readme.txt @@ -22,13 +22,12 @@ qemu-system-aarch64 \ -cpu cortex-a57 \ -m 512 \ -nographic \ - -bios \ + -drive file=output/images/QEMU_EFI.fd,if=pflash,format=raw \ + -drive file=output/images/QEMU_VARS.fd,if=pflash,format=raw \ -drive file=output/images/disk.img,if=none,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -netdev user,id=eth0 \ -device virtio-net-device,netdev=eth0 -Note that needs to point to a valid aarch64 UEFI -firmware image for qemu. -It may be provided by your distribution as a edk2-aarch64 or AAVMF -package, in path such as /usr/share/edk2/aarch64/QEMU_EFI.fd . +Note that output/images/QEMU_*.fd are the flash device files built by +the EDK2 package. diff --git a/configs/aarch64_efi_defconfig b/configs/aarch64_efi_defconfig index 99600575ed..0e8d7f8c1c 100644 --- a/configs/aarch64_efi_defconfig +++ b/configs/aarch64_efi_defconfig @@ -12,6 +12,8 @@ BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_PACKAGE_HOST_GENIMAGE=y # Bootloader +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU=y BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_ARM64_EFI=y From patchwork Wed May 12 18:36:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477768 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=gu4tqEFm; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNn24pKxz9t0G for ; Thu, 13 May 2021 04:37:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 611C484610; Wed, 12 May 2021 18:37:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V4dGPsYSQooQ; Wed, 12 May 2021 18:37:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id A9E2D8461B; Wed, 12 May 2021 18:37:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9869C1BF2E3 for ; Wed, 12 May 2021 18:36:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 87AF840F66 for ; Wed, 12 May 2021 18:36:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g41EdqnpUYEf for ; Wed, 12 May 2021 18:36:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) by smtp4.osuosl.org (Postfix) with ESMTPS id B73B640F5E for ; Wed, 12 May 2021 18:36:41 +0000 (UTC) Date: Wed, 12 May 2021 18:36:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844598; bh=6bxkskb94ZyuuOSbJQigcWagafnt1b0NV9MWv4PXVzs=; h=Date:To:From:Cc:Reply-To:Subject:From; b=gu4tqEFmha7l38sY/jzTiVDPk/uyiKBXWEuNcgG+TaF5gEeUeORvTVd8vzkZl5imI rJUGFJmtpEuca0QHUGVXY28rsQwMXw+7MJqOIwTeiGB/cnWYN43YhKumZNo7iX+sQU OE/tkCDWCN8304SO0sm2lbr6F9E9qagUBioPkZk+W4K36OlvowfdAnPWWMW9I1IReY UHTXo7DpxepxQvjvlqU4ti7GHSLi50XMiO0NVKblcjzV03eeojyZ0a1iopoR+8AoO0 SH75taFR0q0poekWH0O9EzHn+zCd7Y1+xchIiLATqVhSvC9TmaAolGPWk0sz318imh YbkLFF/kTSIJw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 04/10] configs/pc_x86_64_efi_defconfig: build the EDK2 firmware from source X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Prior to this, you had to manually download a pre-built EDK2 flash device image (OVMF_CODE.fd) in order to boot this configuration with QEMU. Now, the configuration is building EDK2 from source. Signed-off-by: Dick Olsson --- Revision 5: * Addressed feedback from Erico Nunes * Corrected the commit summary --- board/pc/readme.txt | 9 ++++----- configs/pc_x86_64_efi_defconfig | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/pc/readme.txt b/board/pc/readme.txt index 41aec50d36..c06ffb0a51 100644 --- a/board/pc/readme.txt +++ b/board/pc/readme.txt @@ -61,12 +61,11 @@ Run the emulation with: qemu-system-x86_64 \ -M pc \ - -bios \ + -drive file=output/images/OVMF_CODE.fd,if=pflash,format=raw \ + -drive file=output/images/OVMF_VARS.fd,if=pflash,format=raw \ -drive file=output/images/disk.img,if=virtio,format=raw \ -net nic,model=virtio \ -net user -Note that needs to point to a valid x86_64 UEFI -firmware image for qemu. It may be provided by your distribution as a -edk2 or OVMF package, in path such as -/usr/share/edk2/ovmf/OVMF_CODE.fd . +Note that output/images/OVMF_*.fd are the flash device files built by +the EDK2 package. diff --git a/configs/pc_x86_64_efi_defconfig b/configs/pc_x86_64_efi_defconfig index 984fc8f92f..1680cda9bb 100644 --- a/configs/pc_x86_64_efi_defconfig +++ b/configs/pc_x86_64_efi_defconfig @@ -14,6 +14,8 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # Bootloader +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_OVMF_X64=y BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_X86_64_EFI=y From patchwork Wed May 12 18:36:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477769 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=xzTKMnXi; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNnG005rz9sRN for ; Thu, 13 May 2021 04:37:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 13F0A8462A; Wed, 12 May 2021 18:37:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fo4nU7TUVgzh; Wed, 12 May 2021 18:37:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 4914084628; Wed, 12 May 2021 18:37:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DC4431BF2E3 for ; Wed, 12 May 2021 18:36:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CB57740F65 for ; Wed, 12 May 2021 18:36:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sfdS3XMvtmgW for ; Wed, 12 May 2021 18:36:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6A14C40F5E for ; Wed, 12 May 2021 18:36:44 +0000 (UTC) Date: Wed, 12 May 2021 18:36:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844601; bh=vJkmt2tP7QdTOstVrTb78CNAyVn0Vc7SztFZAqMnAho=; h=Date:To:From:Cc:Reply-To:Subject:From; b=xzTKMnXimAv8Rie/1i29DSCesG+fe8XM93qOf0PRYHK7fhJa76c8SIALrdemu+1uU n/Lgh6RAKJvDYjnWGGn9fu3Sa1nsFsFSw9N67TyRoMXBvriPAu6oq4WiSlha7kwkq/ 96/fLgO1oA07UtHjs12rYttQ/mBbDzW85pEkmqVKaykxnxsami4CSgRcNik9jCMXXs dSUDbfDRwAyhtGQ8XLEk/7z0KYdF2zc+lT3uBSU02hsMBwtOGIY7aESyDPO2es9A6l SrAtLfjRTC60odEFOxm1ckcuy6Rfw5StKWJCjvsYZPKo0BQb8lescj+chzlXoff5Yi +xx13OqPPzlkw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 05/10] configs/qemu_aarch64_virt_defconfig: build with EDK2 firmware X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Cc: Gerome Burlats , Romain Naour Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Build and boot the QEMU Aarch64 Virt machine with ATF, EDK2, GRUB2 and a minimal kernel configuration. Compared to booting with a stand-alone kernel this configuration provides for better emulation of the boot process. Signed-off-by: Dick Olsson --- board/qemu/aarch64-virt/assemble-flash-images | 12 ++++++++ board/qemu/aarch64-virt/genimage.cfg | 30 +++++++++++++++++++ board/qemu/aarch64-virt/grub.cfg | 6 ++++ board/qemu/aarch64-virt/readme.txt | 2 +- configs/qemu_aarch64_virt_defconfig | 25 ++++++++++++++-- 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100755 board/qemu/aarch64-virt/assemble-flash-images create mode 100644 board/qemu/aarch64-virt/genimage.cfg create mode 100644 board/qemu/aarch64-virt/grub.cfg diff --git a/board/qemu/aarch64-virt/assemble-flash-images b/board/qemu/aarch64-virt/assemble-flash-images new file mode 100755 index 0000000000..c472604e2d --- /dev/null +++ b/board/qemu/aarch64-virt/assemble-flash-images @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/ + +# BL1 and FIP needs to be concatenated into a single flash device. +rm -rf ${BINARIES_DIR}/flash.bin +dd if=${BINARIES_DIR}/bl1.bin of=${BINARIES_DIR}/flash.bin bs=4096 conv=notrunc +dd if=${BINARIES_DIR}/fip.bin of=${BINARIES_DIR}/flash.bin seek=64 bs=4096 conv=notrunc diff --git a/board/qemu/aarch64-virt/genimage.cfg b/board/qemu/aarch64-virt/genimage.cfg new file mode 100644 index 0000000000..285b308d90 --- /dev/null +++ b/board/qemu/aarch64-virt/genimage.cfg @@ -0,0 +1,30 @@ +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + } + size = 32M +} + +image disk.img { + hdimage { + gpt = true + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition root { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/qemu/aarch64-virt/grub.cfg b/board/qemu/aarch64-virt/grub.cfg new file mode 100644 index 0000000000..ab88da91b9 --- /dev/null +++ b/board/qemu/aarch64-virt/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=/dev/vda2 rootwait console=ttyAMA0 +} diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt index db35a3a7a8..8d3b1ba197 100644 --- a/board/qemu/aarch64-virt/readme.txt +++ b/board/qemu/aarch64-virt/readme.txt @@ -1,5 +1,5 @@ Run the emulation with: - qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig + qemu-system-aarch64 -M virt,secure=on,gic-version=3 -cpu cortex-a53 -smp 1 -nographic -bios output/images/flash.bin -drive file=output/images/disk.img,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 The login prompt will appear in the terminal that started Qemu. diff --git a/configs/qemu_aarch64_virt_defconfig b/configs/qemu_aarch64_virt_defconfig index aa00ddf831..3588aed318 100644 --- a/configs/qemu_aarch64_virt_defconfig +++ b/configs/qemu_aarch64_virt_defconfig @@ -2,6 +2,9 @@ BR2_aarch64=y BR2_cortex_a53=y +# Toolchain +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y + # System BR2_SYSTEM_DHCP="eth0" BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" @@ -12,8 +15,8 @@ BR2_TARGET_ROOTFS_EXT2_4=y # BR2_TARGET_ROOTFS_TAR is not set # Image -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-virt/assemble-flash-images support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-virt/genimage.cfg" # Linux headers same as kernel, a 5.10 series BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y @@ -26,6 +29,24 @@ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config" BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +# UEFI firmware +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL=y +BR2_TARGET_GRUB2=y +BR2_TARGET_GRUB2_ARM64_EFI=y + +# ARM Trusted Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="QEMU_USE_GIC_DRIVER=QEMU_GICV3" + +# Host tools for genimage +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_MTOOLS=y + # host-qemu for gitlab testing BR2_PACKAGE_HOST_QEMU=y BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y From patchwork Wed May 12 18:36:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477770 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=Itsa53Z7; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNnV4Qz0z9sRN for ; Thu, 13 May 2021 04:37:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0383384635; Wed, 12 May 2021 18:37:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vU994L87dKQQ; Wed, 12 May 2021 18:37:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 1392D84630; Wed, 12 May 2021 18:37:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D337D1BF2E3 for ; Wed, 12 May 2021 18:36:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CF90240F67 for ; Wed, 12 May 2021 18:36:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YRDfkFzNHk5Z for ; Wed, 12 May 2021 18:36:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by smtp4.osuosl.org (Postfix) with ESMTPS id AB7D040F65 for ; Wed, 12 May 2021 18:36:55 +0000 (UTC) Date: Wed, 12 May 2021 18:36:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844613; bh=74Im/Q6rf+igvdzCoyWJPMPANwgYak+v0ebqgYFPG1A=; h=Date:To:From:Cc:Reply-To:Subject:From; b=Itsa53Z7U93ZFEWdIMnmMwNws7SadgVv2IJoqTdllQwrn/Q6iMsCYPI0qclL+uzjj m54rgV8qFxTiVQYJLERz8ZxsHWBpsMS1gqE1FvW8PQ/N4CbaeXGp3lkS8KtPvOGlwp NnRxdDL+mNMdjb0dSqs4SBpyc7pHeqf17rGyRlMy+kedgdLdrTaoGwPiqwxDLjEx7H XAVPqi6nRF6yiIqy7HzN/bE/Erq04t6sTf3nGSmGB2cz7eonccgyRDRIJhr7otA16q Vegn2QujT9x+wG9Blyuf4z65NrJxEWQcm9csMzc+tciK1yHR/TNZwuvNRemPjJo54c fyxrSCO8u4DdQ== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 06/10] configs/qemu_aarch64_sbsa_defconfig: new config for QEMU sbsa-ref X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Cc: Gerome Burlats , Romain Naour Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This introduces a configuration for the SBSA reference machine under QEMU that is intended for developing and testing firmware. It consists of ATF that load EDK2 as BL33 which in turn will load GRUB2. Included with the board files is a minimal kernel configuration, almost identical to that of board/qemu/aarch64-virt/linux.config. The main difference is the addition of ACPI which is preferred over DTB for booting an UEFI system. Signed-off-by: Dick Olsson --- Revision 5: * Replaced kernel EFI stub mode with GRUB2 for more convenience * The GRUB2 package handles the efi-part image * Simplified the post script * Removed the startup.nsh in favour of that provided by GRUB2 * Added a minimal kernel configuration with ACPI support * Added section to board/qemu/aarch-sbsa/readme.txt about missing SeaBIOS dependency for Debian hosts Revision 4: * The qemu-sbsa-ref machine is now able to boot the kernel. Adjusted readme.txt accordingly * Updated to Linux LTS kernel 5.10 * Renamed post-image.sh to assemble-flash-images * Added startup.nsh for auto-booting from the EFI shell * Simplified resizing of the flash images with the truncate command Revision 3: * post-image.sh cleanup * Added host-qemu to config for testing Revision 2: * This board was renamed/moved to be specific for QEMU sbsa-ref * General simplification * Using set -e in the post-images.sh script --- board/qemu/aarch64-sbsa/assemble-flash-images | 11 +++ board/qemu/aarch64-sbsa/genimage.cfg | 30 ++++++++ board/qemu/aarch64-sbsa/grub.cfg | 6 ++ board/qemu/aarch64-sbsa/linux.config | 68 +++++++++++++++++++ board/qemu/aarch64-sbsa/readme.txt | 32 +++++++++ configs/qemu_aarch64_sbsa_defconfig | 49 +++++++++++++ 6 files changed, 196 insertions(+) create mode 100755 board/qemu/aarch64-sbsa/assemble-flash-images create mode 100644 board/qemu/aarch64-sbsa/genimage.cfg create mode 100644 board/qemu/aarch64-sbsa/grub.cfg create mode 100644 board/qemu/aarch64-sbsa/linux.config create mode 100644 board/qemu/aarch64-sbsa/readme.txt create mode 100644 configs/qemu_aarch64_sbsa_defconfig diff --git a/board/qemu/aarch64-sbsa/assemble-flash-images b/board/qemu/aarch64-sbsa/assemble-flash-images new file mode 100755 index 0000000000..abcc276b0b --- /dev/null +++ b/board/qemu/aarch64-sbsa/assemble-flash-images @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg + +# The QEMU sbsa machine expects flash devices to be 256M. +truncate -s 256M ${BINARIES_DIR}/SBSA_FLASH0.fd +truncate -s 256M ${BINARIES_DIR}/SBSA_FLASH1.fd diff --git a/board/qemu/aarch64-sbsa/genimage.cfg b/board/qemu/aarch64-sbsa/genimage.cfg new file mode 100644 index 0000000000..285b308d90 --- /dev/null +++ b/board/qemu/aarch64-sbsa/genimage.cfg @@ -0,0 +1,30 @@ +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + } + size = 32M +} + +image disk.img { + hdimage { + gpt = true + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition root { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/qemu/aarch64-sbsa/grub.cfg b/board/qemu/aarch64-sbsa/grub.cfg new file mode 100644 index 0000000000..cd486caf4c --- /dev/null +++ b/board/qemu/aarch64-sbsa/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=/dev/sda2 rootwait console=ttyAMA0 +} diff --git a/board/qemu/aarch64-sbsa/linux.config b/board/qemu/aarch64-sbsa/linux.config new file mode 100644 index 0000000000..a60cce02ec --- /dev/null +++ b/board/qemu/aarch64-sbsa/linux.config @@ -0,0 +1,68 @@ +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_NO_HZ_IDLE=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_TASKSTATS=y +CONFIG_SCHED_AUTOGROUP=y +CONFIG_PROFILING=y +CONFIG_ARCH_VEXPRESS=y +CONFIG_COMPAT=y +CONFIG_FW_CFG_SYSFS=y +CONFIG_FW_CFG_SYSFS_CMDLINE=y +CONFIG_ACPI=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_BLK_DEV_BSGLIB=y +CONFIG_BINFMT_MISC=y +CONFIG_TRANSPARENT_HUGEPAGE=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_PACKET_DIAG=y +CONFIG_UNIX=y +CONFIG_NET_KEY=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_BRIDGE=m +CONFIG_NET_SCHED=y +CONFIG_VSOCKETS=y +CONFIG_PCI=y +CONFIG_PCI_HOST_GENERIC=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_VIRTIO_BLK=y +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_SG=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_VIRTIO=y +CONFIG_ATA=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_NETDEVICES=y +CONFIG_DUMMY=y +CONFIG_MACVLAN=y +CONFIG_VIRTIO_NET=y +CONFIG_NLMON=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_TCG_TPM=y +CONFIG_TCG_TIS=y +CONFIG_DRM=y +CONFIG_DRM_VIRTIO_GPU=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y +CONFIG_MAILBOX=y +CONFIG_PL320_MBOX=y +CONFIG_ARM_SMMU_V3=y +CONFIG_EXT4_FS=y +CONFIG_FUSE_FS=y +CONFIG_VIRTIO_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y diff --git a/board/qemu/aarch64-sbsa/readme.txt b/board/qemu/aarch64-sbsa/readme.txt new file mode 100644 index 0000000000..7935108ef1 --- /dev/null +++ b/board/qemu/aarch64-sbsa/readme.txt @@ -0,0 +1,32 @@ +Intro +===== + +The QEMU sbsa-ref machine is primarily meant for firmware development +and testing according to ARM's SBSA and SBBR standards. + +Build +===== + + $ make qemu_aarch64_sbsa_defconfig + $ make + +Emulation +========= + +Run the emulation with: + + qemu-system-aarch64 \ + -M sbsa-ref \ + -cpu cortex-a53 \ + -smp 4 \ + -m 1024 \ + -nographic \ + -pflash output/images/SBSA_FLASH0.fd \ + -pflash output/images/SBSA_FLASH1.fd \ + -hda output/images/disk.img + +Note that if you want to run sbsa-ref emulation with QEMU provided by +your distro (i.e., not host-qemu by Buildroot) then you may need to +install the SeaBIOS package for some required drivers. On Debian: + + # apt install seabios diff --git a/configs/qemu_aarch64_sbsa_defconfig b/configs/qemu_aarch64_sbsa_defconfig new file mode 100644 index 0000000000..20ae393cd7 --- /dev/null +++ b/configs/qemu_aarch64_sbsa_defconfig @@ -0,0 +1,49 @@ +# Architecture +BR2_aarch64=y +BR2_cortex_a53=y + +# Toolchain +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y + +# System +BR2_SYSTEM_DHCP="eth0" +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + +# Filesystem +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set + +# Image +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-sbsa/assemble-flash-images support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-sbsa/genimage.cfg" + +# Linux headers same as kernel, a 5.10 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.34" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +# UEFI firmware +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y +BR2_TARGET_GRUB2=y +BR2_TARGET_GRUB2_ARM64_EFI=y + +# ARM Trusted Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y + +# Host tools for genimage +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_MTOOLS=y + +# host-qemu for gitlab testing +BR2_PACKAGE_HOST_QEMU=y +BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y From patchwork Wed May 12 18:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477771 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=yuxed+we; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNnl5mhTz9sRN for ; Thu, 13 May 2021 04:37:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C7BE260DE9; Wed, 12 May 2021 18:37:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3fctsvqyTBnl; Wed, 12 May 2021 18:37:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 1DB8960DE2; Wed, 12 May 2021 18:37:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4C2221BF2E3 for ; Wed, 12 May 2021 18:36:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3C27F60DE9 for ; Wed, 12 May 2021 18:36:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mjDvUY1gKb2c for ; Wed, 12 May 2021 18:36:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by smtp3.osuosl.org (Postfix) with ESMTPS id EBB6760DE6 for ; Wed, 12 May 2021 18:36:56 +0000 (UTC) Date: Wed, 12 May 2021 18:36:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844614; bh=yiW4/+b+qC4LKcR1ORl/Hfa6UmDKgm2HZAcjz8TqPu0=; h=Date:To:From:Cc:Reply-To:Subject:From; b=yuxed+wekmJ22QbZD9rtvgfszsTqebq7fnyZ1o5IbpHApTgfhkcPafRoUW+XsATYg ZGnzP2ZdFvOxqwZYm8xeQGyod/4OJiD24cN1Ac8/sUFjnlQHHe4jMNo1vLP+ZPxAgV L629CWQNeIkc8PvWjeVducHIbQ1IASJwWKTBD9L0FS9f3lXLuO6uEpjm9rf2HyQuZT FMQVXs+RGHbi8lWZxPydPsahZ1h3118rv7GWDa3i3C9M73ae5OgpZOkywuVi1mzRkX PV0AuruqleS4WtH/uKk7McEFO/JD0MF2PvGXcSRkGwg3pb5bZdqDc+d2OCKRDY2tps ++aIlu5D+SpDQ== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 07/10] configs/socionext_developerbox_defconfig: new config for Developerbox X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This introduces configuration for the Socionext Developerbox, an Aarch64 workstation built with ARM Trusted Firmware and EDK2 firmware. Signed-off-by: Dick Olsson --- Revision 5: * Replaced kernel EFI stub mode with GRUB2 for more convenience * The GRUB2 package handles the efi-part image * Simplified the post script * Removed the startup.nsh in favour of that provided by GRUB2 * Re-exported the defconfig Revision 4: * Renamed post-image.sh to assemble-flash-images * Updated to Linux LTS kernel 5.10 * Added startup.nsh script for auto-booting from the EFI shell --- .../developerbox/assemble-flash-images | 7 +++++ board/socionext/developerbox/genimage.cfg | 30 +++++++++++++++++++ board/socionext/developerbox/grub.cfg | 6 ++++ board/socionext/developerbox/readme.txt | 16 ++++++++++ configs/socionext_developerbox_defconfig | 24 +++++++++++++++ 5 files changed, 83 insertions(+) create mode 100755 board/socionext/developerbox/assemble-flash-images create mode 100644 board/socionext/developerbox/genimage.cfg create mode 100644 board/socionext/developerbox/grub.cfg create mode 100644 board/socionext/developerbox/readme.txt create mode 100644 configs/socionext_developerbox_defconfig diff --git a/board/socionext/developerbox/assemble-flash-images b/board/socionext/developerbox/assemble-flash-images new file mode 100755 index 0000000000..51e4e33458 --- /dev/null +++ b/board/socionext/developerbox/assemble-flash-images @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg diff --git a/board/socionext/developerbox/genimage.cfg b/board/socionext/developerbox/genimage.cfg new file mode 100644 index 0000000000..285b308d90 --- /dev/null +++ b/board/socionext/developerbox/genimage.cfg @@ -0,0 +1,30 @@ +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + } + size = 32M +} + +image disk.img { + hdimage { + gpt = true + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition root { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/socionext/developerbox/grub.cfg b/board/socionext/developerbox/grub.cfg new file mode 100644 index 0000000000..ab88da91b9 --- /dev/null +++ b/board/socionext/developerbox/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=/dev/vda2 rootwait console=ttyAMA0 +} diff --git a/board/socionext/developerbox/readme.txt b/board/socionext/developerbox/readme.txt new file mode 100644 index 0000000000..4c301c1353 --- /dev/null +++ b/board/socionext/developerbox/readme.txt @@ -0,0 +1,16 @@ +Intro +===== + +This is the board support for the Socionext SynQuacer Developerbox (SC2A11). +The firmware is built with ARM Trusted Firmware and EDK2 (UEFI). + +CM3_IMAGE.bin + +More info +========= + +For more information about this board and the firmware see: + +- https://www.96boards.org/product/developerbox/ +- https://www.96boards.org/documentation/enterprise/developerbox/downloads/edk2.md.html +- https://trustedfirmware-a.readthedocs.io/en/latest/plat/synquacer.html diff --git a/configs/socionext_developerbox_defconfig b/configs/socionext_developerbox_defconfig new file mode 100644 index 0000000000..4d8e9b7c05 --- /dev/null +++ b/configs/socionext_developerbox_defconfig @@ -0,0 +1,24 @@ +BR2_aarch64=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/socionext/developerbox/assemble-flash-images support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/socionext/developerbox/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.34" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="synquacer" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS="bl31 fiptool" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="PRELOADED_BL33_BASE=0x8200000" +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX=y +BR2_TARGET_GRUB2=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y From patchwork Wed May 12 18:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477772 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=C0+dQrcZ; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNp06bvdz9sRN for ; Thu, 13 May 2021 04:38:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C87AB60DFB; Wed, 12 May 2021 18:37:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JsvPxlaqqlD8; Wed, 12 May 2021 18:37:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 9D84D60DF9; Wed, 12 May 2021 18:37:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8A54D1BF2E3 for ; Wed, 12 May 2021 18:37:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7AC2440F66 for ; Wed, 12 May 2021 18:37:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fvYKcboTqTfZ for ; Wed, 12 May 2021 18:37:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1623340F6F for ; Wed, 12 May 2021 18:37:02 +0000 (UTC) Date: Wed, 12 May 2021 18:36:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844620; bh=vVz/76gSzOiVS2gwUDOFpqUcdz1nycOLVQx1SV6fKZk=; h=Date:To:From:Cc:Reply-To:Subject:From; b=C0+dQrcZ+QGdLgpDi9itYXzo1Tvr5K/zhur0kbvnDsa+PDrnm/cyewGia+tQ9vFCc PVlA3UTlOMJQlagC1XiKFwTBt6uz8Wiu2UBvKpkZEP9mE7v5Rp6ppF5aJE1myTMA6f TuoNr4UL0ZYZNhfa0hCAo/VNJC3N7WsiixwUVhPPI8/P+9XNMgyFLnhW5GQj4WUEM3 /EXI7vyKBzKDtARoOxGbNDlsOjemIH4W2hXQSLEY7gOl+MCBTuSxv6dL13O12XNdxd QPpj3wGPG58e0Cykp758Mh6JWkSipyZb05x/x7JjyIjB/LJEeW38f6W3Qw++WG0/Ig aO+aG9mz/b4fQ== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 08/10] configs/solidrun_macchiatobin_efi_defconfig: EFI config for MacchiatoBin X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This introduces an alternative board build for the MacchiatoBin based on EDK2 (UEFI) firmware loaded as BL33 by ARM Trusted Firmware. Signed-off-by: Dick Olsson --- Revision 5: * Fixed incorrect Linux version statement in readme.txt * Replaced kernel EFI stub mode with GRUB2 for more convenience * The GRUB2 package handles the efi-part image * Simplified the post script * Removed the startup.nsh in favour of that provided by GRUB2 * Re-exported the defconfig Revision 4: * Renamed post-image.sh to assemble-flash-images * Updated to Linux LTS kernel 5.10 * Added startup.nsh for auto-booting from the EFI shell --- .../macchiatobin-efi/assemble-flash-images | 7 ++ board/solidrun/macchiatobin-efi/genimage.cfg | 30 +++++++ board/solidrun/macchiatobin-efi/grub.cfg | 6 ++ .../solidrun/macchiatobin-efi/linux.fragment | 3 + board/solidrun/macchiatobin-efi/readme.txt | 90 +++++++++++++++++++ configs/solidrun_macchiatobin_efi_defconfig | 28 ++++++ 6 files changed, 164 insertions(+) create mode 100755 board/solidrun/macchiatobin-efi/assemble-flash-images create mode 100644 board/solidrun/macchiatobin-efi/genimage.cfg create mode 100644 board/solidrun/macchiatobin-efi/grub.cfg create mode 100644 board/solidrun/macchiatobin-efi/linux.fragment create mode 100644 board/solidrun/macchiatobin-efi/readme.txt create mode 100644 configs/solidrun_macchiatobin_efi_defconfig diff --git a/board/solidrun/macchiatobin-efi/assemble-flash-images b/board/solidrun/macchiatobin-efi/assemble-flash-images new file mode 100755 index 0000000000..51e4e33458 --- /dev/null +++ b/board/solidrun/macchiatobin-efi/assemble-flash-images @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg diff --git a/board/solidrun/macchiatobin-efi/genimage.cfg b/board/solidrun/macchiatobin-efi/genimage.cfg new file mode 100644 index 0000000000..f1e72c0f32 --- /dev/null +++ b/board/solidrun/macchiatobin-efi/genimage.cfg @@ -0,0 +1,30 @@ +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + } + size = 32M +} + +image sdcard.img { + hdimage { + gpt = true + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition root { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/solidrun/macchiatobin-efi/grub.cfg b/board/solidrun/macchiatobin-efi/grub.cfg new file mode 100644 index 0000000000..ab88da91b9 --- /dev/null +++ b/board/solidrun/macchiatobin-efi/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=/dev/vda2 rootwait console=ttyAMA0 +} diff --git a/board/solidrun/macchiatobin-efi/linux.fragment b/board/solidrun/macchiatobin-efi/linux.fragment new file mode 100644 index 0000000000..29fd630626 --- /dev/null +++ b/board/solidrun/macchiatobin-efi/linux.fragment @@ -0,0 +1,3 @@ +CONFIG_MARVELL_PHY=y +CONFIG_MARVELL_10G_PHY=y +CONFIG_SFP=y diff --git a/board/solidrun/macchiatobin-efi/readme.txt b/board/solidrun/macchiatobin-efi/readme.txt new file mode 100644 index 0000000000..26d1bb37c1 --- /dev/null +++ b/board/solidrun/macchiatobin-efi/readme.txt @@ -0,0 +1,90 @@ +Intro +===== + +This is the board support for MacchiatoBin with a more modern firmware stack +compared to the original build with board/solidrun/macchiatobin. + +The goal with this default configuration is to provide a build as close to +ARM Server Base Boot Requirement (SBBR) as possible. This gives us the +following benefits: + + - The firmware is built and flashed separately from the OS image + - Therefore, the board will boot with any standard Aarch64 distribution image + - UEFI provides a more standardized firmware interface + +How to build +============ + +The default configuration provides the following stack: + + - ARM Trusted Firmware (mainline) + - EDK2 UEFI firmware (mainline) + - Linux 5.10 (mainline) + + $ make solidrun_macchiatobin_efi_defconfig + $ make + +The next step will depend on whether you have U-Boot or UEFI flashed on the +board. + +How to flash the firmware from U-Boot +===================================== + +In this example we will assume that the board has U-Boot flashed on it. We will +flash the new UEFI firmware from the U-Boot console to the SPI flash, using +the "bubt" (Burn ATF) command. + +Once the build process is finished you will have an image called +"flash-image.bin" in the output/images/ directory. + +First, format a USB drive with an EXT4 partition and copy the "flash-image.bin" +file onto the USB drive. + +Second, attach to the serial console[1], insert the USB drive into the board, +boot the board and enter the U-Boot console. On the U-Boot console enter the +following commands: + + usb start + bubt flash-image.bin spi usb + +Lastly, unplug the USB drive and reboot the board. The board will now +boot with the newly flashed UEFI firmware. + +How to flash the firmware from UEFI +=================================== + +In this example we will assume that the board has UEFI flashed on it. We will +flash the new UEFI firmware from the old UEFI console to the SPI flash, using +the "fupdate" command. + +First, format a USB drive with an FAT partition and copy the "flash-image.bin" +file onto the USB drive. + +Second, attach to the serial console[1], insert the USB drive into the board, +boot the board and enter the UEFI shell. In the UEFI shell, find what file +system your USB drive got mapped to by using the "map" and "ls" commands. +Then enter this command (assuming your USB drive is on "FS0"): + + fupdate FS0:\flash-image.bin spi + +Lastly, unplug the USB drive and reboot the board. The board will now +boot with the newly flashed UEFI firmware. + +How to write the SD card +======================== + +Once the build process is finished you will have an image called "sdcard.img" +in the output/images/ directory. This image only contains the Linux kernel and +the rest of the operating system. + +Copy the bootable "sdcard.img" onto an SD card with "dd": + + $ sudo dd if=output/images/sdcard.img of=/dev/sdX bs=1M conv=fsync + $ sudo sync + +Plug in the SD card into the board and boot. + +Note that because the board is now using UEFI firmware, the board will also +boot any other standard Aarch64 distribution image. + +[1]: http://wiki.espressobin.net/tiki-index.php?page=Quick+User+Guide diff --git a/configs/solidrun_macchiatobin_efi_defconfig b/configs/solidrun_macchiatobin_efi_defconfig new file mode 100644 index 0000000000..9ed9237d65 --- /dev/null +++ b/configs/solidrun_macchiatobin_efi_defconfig @@ -0,0 +1,28 @@ +BR2_aarch64=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/macchiatobin-efi/assemble-flash-images support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/solidrun/macchiatobin-efi/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.34" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/macchiatobin-efi/linux.fragment" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS="mrvl_flash" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="USE_COHERENT_MEM=0" +BR2_TARGET_BINARIES_MARVELL=y +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN=y +BR2_TARGET_GRUB2=y +BR2_TARGET_MV_DDR_MARVELL=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y From patchwork Wed May 12 18:37:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477773 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=t7LLbWIG; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNpG0bqvz9tjv for ; Thu, 13 May 2021 04:38:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B935240F66; Wed, 12 May 2021 18:38:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UPknO06O8paN; Wed, 12 May 2021 18:38:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id CDC6440F61; Wed, 12 May 2021 18:38:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B801B1BF2E3 for ; Wed, 12 May 2021 18:37:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A44B284421 for ; Wed, 12 May 2021 18:37:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rRUb9_Xnz2WV for ; Wed, 12 May 2021 18:37:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0159884624 for ; Wed, 12 May 2021 18:37:19 +0000 (UTC) Date: Wed, 12 May 2021 18:37:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844637; bh=Z5Hpw6YfPmU1B/evUU597H1WT2bKC5CqEixDq+FLHDA=; h=Date:To:From:Cc:Reply-To:Subject:From; b=t7LLbWIGY/CJboGsVFRQrrNZomYyIR1dCABp31Kx52rkwk7j0d//snbDucuNrXQe6 WQdXyYtA8rhrcpzldcGT5g6PZrqauZz728vWFViJErpDe/LQztr0BElJthcFYerbBY /D98jHt5CyHqtousD2iTxI8oRsVspS2U8LH1oQMi86CGA+rZ/YZbRkxSp+DlEnf2dk Iqeq1RJLPM1deus4cGORo9YvBZ60zcCD5sCaq2cKNAfjZqmK1dxGe+0xntaktU8gvS 6K0+OBypQukU72KpwXUJEVHJ+lvGcsKMDqJ+bu+NENjYGwKZU0258R/SGpOSTQdPr9 Ae7JN6ZSmfAbA== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 09/10] support/testing: new boot test for EDK2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Boot a QEMU sbsa-ref machine with ATF, EDK2, GRUB2 and a minimal kernel. This is a simple but effective test of a compliant setup. Signed-off-by: Dick Olsson --- support/testing/tests/boot/test_edk2.py | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 support/testing/tests/boot/test_edk2.py diff --git a/support/testing/tests/boot/test_edk2.py b/support/testing/tests/boot/test_edk2.py new file mode 100644 index 0000000000..c1be8fad95 --- /dev/null +++ b/support/testing/tests/boot/test_edk2.py @@ -0,0 +1,45 @@ +import os + +import infra.basetest + + +class TestEdk2(infra.basetest.BRTest): + config = \ + """ + BR2_aarch64=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_TARGET_ROOTFS_EXT2=y + BR2_TARGET_ROOTFS_EXT2_4=y + # BR2_TARGET_ROOTFS_TAR is not set + BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-sbsa/assemble-flash-images support/scripts/genimage.sh" + BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-sbsa/genimage.cfg" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.34" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-sbsa/linux.config" + BR2_TARGET_EDK2=y + BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y + BR2_TARGET_GRUB2=y + BR2_TARGET_GRUB2_ARM64_EFI=y + BR2_TARGET_ARM_TRUSTED_FIRMWARE=y + BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa" + BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y + BR2_PACKAGE_HOST_GENIMAGE=y + BR2_PACKAGE_HOST_DOSFSTOOLS=y + BR2_PACKAGE_HOST_MTOOLS=y + """ + + def test_run(self): + hda = os.path.join(self.builddir, "images", "disk.img") + flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd") + flash1 = os.path.join(self.builddir, "images", "SBSA_FLASH1.fd") + self.emulator.boot(arch="aarch64", + options=["-M", "sbsa-ref", + "-cpu", "cortex-a57", + "-m", "512M", + "-pflash", flash0, + "-pflash", flash1, + "-hda", hda]) + self.emulator.login() From patchwork Wed May 12 18:37:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1477774 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=oCxsr5pQ; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgNpV0vH4z9tk1 for ; Thu, 13 May 2021 04:38:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6F01884627; Wed, 12 May 2021 18:38:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xbi3aO6UazQ9; Wed, 12 May 2021 18:38:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id DC20E8461C; Wed, 12 May 2021 18:38:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 859611BF2E3 for ; Wed, 12 May 2021 18:37:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 750B460DE6 for ; Wed, 12 May 2021 18:37:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ewFz0NDT9YxC for ; Wed, 12 May 2021 18:37:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by smtp3.osuosl.org (Postfix) with ESMTPS id B17F560DE2 for ; Wed, 12 May 2021 18:37:21 +0000 (UTC) Date: Wed, 12 May 2021 18:37:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1620844639; bh=iweJ9DxzRTTho86L8G+Ikx+5lh9UptC8yth/Rd7wIgo=; h=Date:To:From:Cc:Reply-To:Subject:From; b=oCxsr5pQHLwzkaWrD1aGjSZ1QBt7k/Prg/VjA4mqzluIaw0NzsqpGa8nUZg9MxFDf skeVWZNWUitxYMeJociChHCeaxADLu/z/TQV+xNzN7JU3X91LdPgOwYhQawqN3/91J gu9Uy7X9u8Jmn6W5AkYmW/t22+ybYzQAHJMY6QD52oQhrmKbV3AYYX5F0d6ZxRLc2J fKqmqnf45Xm3cbPbLa3pmndFJPSw1q2ATUIO3h05E9zuuWkbMFoeq6QvHQQl0glDjw HQaHSg/eevzpnIzK34/Gy/5m8fs9fxdic4r8brzxnAzllwKLIirgMVZtntRHUt+UND encmOuYGMP/Yw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 10/10] DEVELOPERS: add files related to EDK2 for Dick Olsson X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Dick Olsson --- DEVELOPERS | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/DEVELOPERS b/DEVELOPERS index 573d8d84de..b589f882b2 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -675,7 +675,22 @@ N: Derrick Lyndon Pallas F: package/ipcalc/ N: Dick Olsson +F: board/aarch64-efi/ +F: board/pc/ +F: board/qemu/aarch64-sbsa/ +F: board/qemu/aarch64-virt/ +F: board/socionext/developerbox/ +F: board/solidrun/macchiatobin-efi/ +F: boot/arm-trusted-firmware/ +F: boot/edk2/ +F: configs/aarch64_efi_defconfig +F: configs/pc_x86_64_efi_defconfig +F: configs/qemu_aarch64_sbsa_defconfig +F: configs/qemu_aarch64_virt_defconfig +F: configs/socionext_developerbox_defconfig +F: configs/solidrun_macchiatobin_efi_defconfig F: package/bearssl/ +F: package/edk2-platforms/ F: package/execline/ F: package/mdevd/ F: package/s6-dns/ @@ -686,6 +701,7 @@ F: package/s6-portable-utils/ F: package/s6-rc/ F: package/s6/ F: package/skalibs/ +F: support/testing/tests/boot/test_edk2.py N: Dimitrios Siganos F: package/wireless-regdb/