From patchwork Thu Mar 18 15:42:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455331 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=RfgoT86K; 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 4F1Wgg376pz9sS8 for ; Fri, 19 Mar 2021 02:50:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9E48F83478; Thu, 18 Mar 2021 15:50:04 +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 zNG-0i4jtxtY; Thu, 18 Mar 2021 15:50:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 80A4D842A1; Thu, 18 Mar 2021 15:50:02 +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 6CC701BF341 for ; Thu, 18 Mar 2021 15:49:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5A147605CD for ; Thu, 18 Mar 2021 15:49:34 +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 K6-gh_0Heqwq for ; Thu, 18 Mar 2021 15:49:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2A2566064D for ; Thu, 18 Mar 2021 15:49:32 +0000 (UTC) Received: from mail-03.mail-europe.com (mail-03.mail-europe.com [91.134.188.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4F1WWD2wvbz4wwwN for ; Thu, 18 Mar 2021 15:42:48 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="RfgoT86K" Date: Thu, 18 Mar 2021 15:42:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082157; bh=vhAD7072Y+SaFH3PaFr/u/NuGk38YjzjtOoE1rsWFtY=; h=Date:To:From:Cc:Reply-To:Subject:From; b=RfgoT86KxJZ7frruq1FniQtuc9HczH3oBAFKQCB5mIJ0p9Du3gKP64MukdfphG1dn CObSncAhGuBl0jP7bYU0X5Z1wjF8TO5Edj89UvbAgpXj2SdQ6/iCwO00lbR+x5mFWI fx1R83YeeVXFoNmsub7809n3e+z2+HbDIhBwWTkhTxRTwOdQZvVK2Z/8zSs1C/HT90 pUxoeUw0pPzqCFGml3fkvOekAFFkVSCD26wFKI+YmE/yBmkZlumGFp+1JliD/reGQJ 5B0qljKTt3PFieQG3BXr2R0Ycv6Dsl17scdwkBSiGg+GzDaizYuGiULajgscH7D/GP PvsTkeasD3NjA== To: buildroot@buildroot.org Message-ID: <34j7jMPklxbGS9VL3KH4ywYUUSnP2J5paG6i58IM9Uk@cp3-web-024.plabs.ch> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 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 , Dick Olsson 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 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) edk2-platforms fixes Signed-off-by: Dick Olsson --- package/Config.in | 1 + package/edk2-platforms/Config.in | 8 ++++++++ package/edk2-platforms/edk2-platforms.hash | 3 +++ package/edk2-platforms/edk2-platforms.mk | 21 +++++++++++++++++++++ 4 files changed, 33 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 d278e78b68..580c9b154a 100644 --- a/package/Config.in +++ b/package/Config.in @@ -458,6 +458,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..c6002ba019 --- /dev/null +++ b/package/edk2-platforms/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_EDK2_PLATFORMS + bool + help + EDK II description files for all supported platforms. The main EDK2 + bootloader package will depend on these description files while building + firmware for certain 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..5b57f653b6 --- /dev/null +++ b/package/edk2-platforms/edk2-platforms.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 b90b923425f81ca1b1ae37a5adc02853cdb609d716f08f64482b735ac5d253a7 edk2-platforms-f8958b86e8863432b815a132a0f0fe82950c6dd1.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..b9e3f0fb1b --- /dev/null +++ b/package/edk2-platforms/edk2-platforms.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# edk2-platforms +# +################################################################################ + +EDK2_PLATFORMS_VERSION = f8958b86e8863432b815a132a0f0fe82950c6dd1 +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 Thu Mar 18 15:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455335 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::133; helo=smtp2.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=rLiXCGkb; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4F1WhN6w7Qz9sS8 for ; Fri, 19 Mar 2021 02:50:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id ED5DC432A5; Thu, 18 Mar 2021 15:50:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1XQWUSCvVfbj; Thu, 18 Mar 2021 15:50:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id D92BE432AD; Thu, 18 Mar 2021 15:50:40 +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 6AC431BF341 for ; Thu, 18 Mar 2021 15:49:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 588524EE32 for ; Thu, 18 Mar 2021 15:49:37 +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 XDVuAPmU-vXp for ; Thu, 18 Mar 2021 15:49:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6ADB84EBDF for ; Thu, 18 Mar 2021 15:49:35 +0000 (UTC) Received: from mail-03.mail-europe.com (mail-03.mail-europe.com [91.134.188.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4F1WWW4bfnz4wwwj for ; Thu, 18 Mar 2021 15:43:03 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="rLiXCGkb" Date: Thu, 18 Mar 2021 15:42:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082171; bh=ewP6SyqKYgwh2gYQKO2NDiY6BhDt7US+QSus0kFCIsU=; h=Date:To:From:Cc:Reply-To:Subject:From; b=rLiXCGkbd1kbXbpOQ9DcNA9kYQIOSgAdQnEtZVVWnf/a3DAzDGvbacmAlEFn+THoD Fjw+qjqGZ8EzGYhbo+lcwpseBWT9kYGqlOUrn7JyEKMsKUQ1vc/mE5+uDaVC+CR3FD XDvBzuuE78QB7vHPxJHwwHlbBkaSdIK7K4olm0q8y4+sgnqPxlJnU4yPJ1stBL67qI ptuIWJkdVKZd7OzAngcQK3PvFXZ0ZbDVAmM+wpFve8BOjqwnN2zhKtzfhA1H+k3NXy Z0q/BwFGYictRdmglkFhxaYmaLDu+c0c67mwofR42pQM5gUaQojMuMwe7iB2nWjeJ4 Kzz/aOG1l9o1Q== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 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 , Dick Olsson 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 Signed-off-by: Dick Olsson --- 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). Signed-off-by: Dick Olsson --- boot/Config.in | 1 + boot/arm-trusted-firmware/Config.in | 2 +- boot/edk2/Config.in | 110 ++++++++++++++++++++ boot/edk2/edk2.hash | 3 + boot/edk2/edk2.mk | 150 ++++++++++++++++++++++++++++ 5 files changed, 265 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..b11dd67931 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. diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in new file mode 100644 index 0000000000..25525fc471 --- /dev/null +++ b/boot/edk2/Config.in @@ -0,0 +1,110 @@ +config BR2_TARGET_EDK2 + bool "EDK2" + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 + select BR2_PACKAGE_EDK2_PLATFORMS + depends on BR2_x86_64 || BR2_aarch64 + 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 + +config BR2_TARGET_EDK2_DEBUG + bool "Debug build" + help + Use the debug build type. + +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 + Configuration for x86-64. + 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 + 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 + 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 + Configuration for ARM SGI-575 on the Fixed Virtual Platform (FVP). + +config BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64 + bool "ARM VExpress FVP Aarch64" + depends on BR2_aarch64 + help + Configuration for ARM Versatile Express targeting the + Fixed Virtual Platform (FVP) AArch64 platform. + +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 + help + Configuration for the 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 + help + 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 + Configuration for QEMU targeting the SBSA reference platform. + +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..41b2855686 --- /dev/null +++ b/boot/edk2/edk2.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 12859b6ec8d7338434b8457bb7e74d0fd754a770e844d956ceac3f51a0844e28 edk2-248d08c5983b561549891fec54c213e1f354179c.tar.gz +sha256 50ce20c9cfdb0e19ee34fe0a51fc0afe961f743697b068359ab2f862b494df80 License.txt diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk new file mode 100644 index 0000000000..5268879e96 --- /dev/null +++ b/boot/edk2/edk2.mk @@ -0,0 +1,150 @@ +################################################################################ +# +# edk2 +# +################################################################################ + +EDK2_VERSION = 248d08c5983b561549891fec54c213e1f354179c +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_TARGET_EDK2_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 +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 Thu Mar 18 15:42:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455338 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.133; helo=smtp2.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=bpsvjEbt; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4F1WjW22Fsz9sS8 for ; Fri, 19 Mar 2021 02:51:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id CDDA3432B5; Thu, 18 Mar 2021 15:51:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lw8xHDteGsK1; Thu, 18 Mar 2021 15:51:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 32761432B2; Thu, 18 Mar 2021 15:51:40 +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 B20911BF341 for ; Thu, 18 Mar 2021 15:51:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A08214EE33 for ; Thu, 18 Mar 2021 15:51:13 +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 btMayYi6fE72 for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp4.osuosl.org (Postfix) with ESMTPS id 833854EE32 for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WWd0xNfz4wx7x for ; Thu, 18 Mar 2021 15:43:09 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="bpsvjEbt" Date: Thu, 18 Mar 2021 15:42:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082176; bh=sXPShEgyc73x248FaVtufyxoKXhaqnAoD78gW1H4794=; h=Date:To:From:Cc:Reply-To:Subject:From; b=bpsvjEbt5E4qp9rc+EtErxP4MNg5r8bmeUkNtA02ZJYKM2wTkkc6ihbrrqDwzjNte 67lTD4AO4pY8TGng3k0tI4ivJj4bbpS1ZyXVjXlVbu8fwZ30nwmQa6cbpiTIzX+uSP jEAlMHyS0zy7y12kbscbWmuFEDIaEhYOiIvgZrdZiG3RS9DRnKjHSyraG5SUQugfzC ZLzymeCul1kroaVXXD0vR2k8M4czd7rKEe/avbGm/9do6OTtui6gUafjH4bIl/E8Da TrOtbmAQxjcADxJi9/IDgYPrpY6r5gOqDRL1Gz7nG7AJ6yX0CcZDxoU30/yNtdk6n/ Ao0F6tnfyeUoA== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 03/10] boot/arm-trusted-firmware: Integrate with EDK2 as BL33 payload 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: Sergey Matyukevich , Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Support the use of EDK2 UEFI payloads as BL33 in ARM Trusted Firmware. This integrates with the newly introduced boot/edk2 package. Signed-off-by: Dick Olsson --- boot/arm-trusted-firmware/Config.in | 13 +++++++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index b11dd67931..9d347550a4 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -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) From patchwork Thu Mar 18 15:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455340 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=i8TXWQHZ; 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 4F1Wk420mXz9sS8 for ; Fri, 19 Mar 2021 02:52:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8C98A6064D; Thu, 18 Mar 2021 15:52:07 +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 2gIVP4uszy8H; Thu, 18 Mar 2021 15:52:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C344460601; Thu, 18 Mar 2021 15:52: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 14BCA1BF341 for ; Thu, 18 Mar 2021 15:51:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id ADC9D4EE34 for ; Thu, 18 Mar 2021 15:51:14 +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 8c2s7Nl4tG5h for ; Thu, 18 Mar 2021 15:51:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp4.osuosl.org (Postfix) with ESMTPS id B47404EE32 for ; Thu, 18 Mar 2021 15:51:13 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WWg3NVqz4wx7y for ; Thu, 18 Mar 2021 15:43:11 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="i8TXWQHZ" Date: Thu, 18 Mar 2021 15:42:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082180; bh=g1cbXOeDJcwpLdXL8Ngb5Z0sdSc/RUH5N/Nx/Pg09K8=; h=Date:To:From:Cc:Reply-To:Subject:From; b=i8TXWQHZxCU0UfvMjp3GN7jHBqrfMOSXxb9j1sbjMXuYgHcFKEUXCIb1rqr8RZtBd PO6QqEcGjOWuigPuIrbShZ13xHzlpMx4udcIhinQLvNFYREjxbnE04HZrW97d69MxE /MqmrnUHi/tYv9XlpAesMBMPKUx7Hk9Uy62x4YOs34CfLJtkJsY0PQ3HmKpFqjJ9uY qJ1nShP0D7mLetvK1qgGHGxlBhkmXxbERPRZDw7o5S7fgTs1u/iTPsurLDJdYCt8m5 dU+F4qn34wrpOy5gNByRwVQ2nQ1jMkoZLDEmqHVgdQlErLGB4Nkd46UiwhjLNqMNDF D2e68okgMs/Yg== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 04/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 Cc: 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 4: * Addressed review items from Yann E. MORIN * 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 Signed-off-by: Dick Olsson --- board/aarch64-efi/post-image.sh | 6 +++++- board/aarch64-efi/readme.txt | 9 ++++----- configs/aarch64_efi_defconfig | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/board/aarch64-efi/post-image.sh b/board/aarch64-efi/post-image.sh index f0214dc866..63a582d99a 100755 --- a/board/aarch64-efi/post-image.sh +++ b/board/aarch64-efi/post-image.sh @@ -1,5 +1,9 @@ -#!/bin/sh +#!/bin/bash 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..d0f900c616 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_RESIZED.fd,if=pflash,format=raw \ + -drive file=output/images/QEMU_VARS_RESIZED.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 Thu Mar 18 15:43:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455337 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=m+3PdsHp; 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 4F1WjH1wbFz9sVw for ; Fri, 19 Mar 2021 02:51:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3EE36842B3; Thu, 18 Mar 2021 15:51:29 +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 wB7TurYNH_zU; Thu, 18 Mar 2021 15:51:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 9A9E0842A2; Thu, 18 Mar 2021 15:51:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id EFA711BF9B4 for ; Thu, 18 Mar 2021 15:51:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id DF594432A5 for ; Thu, 18 Mar 2021 15:51:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HuR_NN1g9dVS for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp2.osuosl.org (Postfix) with ESMTPS id A753743291 for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WWr5KBWz4wxLW for ; Thu, 18 Mar 2021 15:43:20 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="m+3PdsHp" Date: Thu, 18 Mar 2021 15:43:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082191; bh=oREW5Bt9QUzvAZ2Ri/mZycNQQ+eUgLqOEIJnUwKuyfg=; h=Date:To:From:Cc:Reply-To:Subject:From; b=m+3PdsHp9kP3x+7EMaRL2H3X7nZxlOVczgi1OqDzAZAiGuyXCJNwSUDZ+lhK68CbX SRsOqnG4xTs7yhK/V4xjwKP3DMRZPQv0WF49aaWfdQUb0V5dIg+xGrX1d2GmKpwg5K COv0lvkXrE0kjwY+sqU6l0yYYsjffjjXMHDauSbO3UeGGvz/FYSp15zgYm3kVjl3cV Wih8pAgKhmHZGsnW1xccWgbC7iuAsibdWCvOFuT6wNKjV2uxiUfZuqEnu8Ani0Ndq2 0c53nOYHwS5jZJoIzoxptohhDRgIBjThpOfFryG7mJTPMVw4pcHkOl+cm0qTQ2FTFl iafTzSpec1BZA== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 05/10] configs/pc_x86_64_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 Cc: 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 --- 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 Thu Mar 18 15:43:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455339 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=wWFsXCAo; 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 4F1Wjm1ltPz9sS8 for ; Fri, 19 Mar 2021 02:51:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B3CD2842B3; Thu, 18 Mar 2021 15:51:54 +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 ntlmA8XIir2l; Thu, 18 Mar 2021 15:51:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id C1EDF842B9; Thu, 18 Mar 2021 15:51: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 B1C481BF341 for ; Thu, 18 Mar 2021 15:51:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CBF0D4EE33 for ; Thu, 18 Mar 2021 15:51:13 +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 sTnkbc_1lrUM for ; Thu, 18 Mar 2021 15:51:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9EB174EE34 for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WWz6Mbfz4wxT9 for ; Thu, 18 Mar 2021 15:43:27 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="wWFsXCAo" Date: Thu, 18 Mar 2021 15:43:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082198; bh=+lGjPRePwjYwAaM52vRjoWoJHtuHZwhUl0CazJkKfao=; h=Date:To:From:Cc:Reply-To:Subject:From; b=wWFsXCAox0QeTNEohz+ClOBqeUAFJgs0LsIBy0HnQRjoaODCrP3+B/6RHD1pvgSth emO15UDiDbyaRx3i/+1WdNLI7lTRav6rkI1CLeMFiwdhPpvLvlrcYOukk35ZC3DtXE fztpArBwUBgyihkwwo11BRHSAe4q07IxbVO16KHUauhaghrzp5/A/v7ePgo4r/4mpJ JecyPwav1jkP2W201lfcKJWSiEea2CapDWiOTvna4L1Io32U9R3TQiNpRjn+Ru5aEj 2fHPv2EJBK+F+y+lfG1xIj5NZecv6BUEtMDYbWgA8YkQSFhOG0vXfcNxTfTNYoNV4W 24wtrEDQmdNqw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 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 , Dick Olsson 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 the kernel in EFI stub mode with ACPI. Signed-off-by: Dick Olsson --- 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 Signed-off-by: Dick Olsson --- board/qemu/aarch64-sbsa/assemble-flash-images | 18 ++++++++ board/qemu/aarch64-sbsa/genimage.cfg | 27 ++++++++++++ board/qemu/aarch64-sbsa/readme.txt | 26 +++++++++++ board/qemu/aarch64-sbsa/startup.nsh | 1 + configs/qemu_aarch64_sbsa_defconfig | 43 +++++++++++++++++++ 5 files changed, 115 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/readme.txt create mode 100644 board/qemu/aarch64-sbsa/startup.nsh 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..6060a835dc --- /dev/null +++ b/board/qemu/aarch64-sbsa/assemble-flash-images @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +EFI_PART=${BINARIES_DIR}/efi-part +EFI_DIR=${EFI_PART}/EFI/BOOT + +# Create the EFI system partition with startup script and kernel +# executable according to the UEFI standard. +rm -rf ${EFI_DIR} +mkdir -p ${EFI_DIR} +cp ${BOARD_DIR}/startup.nsh ${EFI_PART}/ +ln -sf ${BINARIES_DIR}/Image ${EFI_DIR}/bootaa64.efi + +# 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..7c37d6a7dd --- /dev/null +++ b/board/qemu/aarch64-sbsa/genimage.cfg @@ -0,0 +1,27 @@ +image efi-part.vfat { + vfat { + file EFI { + image = "efi-part/EFI" + } + file startup.nsh { + image = "efi-part/startup.nsh" + } + } + 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/readme.txt b/board/qemu/aarch64-sbsa/readme.txt new file mode 100644 index 0000000000..cb5679ccde --- /dev/null +++ b/board/qemu/aarch64-sbsa/readme.txt @@ -0,0 +1,26 @@ +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: + + output/host/bin/qemu-system-aarch64 \ + -M sbsa-ref \ + -cpu cortex-a57 \ + -smp 4 \ + -m 1024 \ + -nographic \ + -pflash output/images/SBSA_FLASH0.fd \ + -pflash output/images/SBSA_FLASH1.fd \ + -hda output/images/disk.img diff --git a/board/qemu/aarch64-sbsa/startup.nsh b/board/qemu/aarch64-sbsa/startup.nsh new file mode 100644 index 0000000000..1e8f81f9ef --- /dev/null +++ b/board/qemu/aarch64-sbsa/startup.nsh @@ -0,0 +1 @@ +FS0:\EFI\BOOT\bootaa64.efi root=/dev/sda2 console=ttyAMA0 diff --git a/configs/qemu_aarch64_sbsa_defconfig b/configs/qemu_aarch64_sbsa_defconfig new file mode 100644 index 0000000000..eb9aa13be7 --- /dev/null +++ b/configs/qemu_aarch64_sbsa_defconfig @@ -0,0 +1,43 @@ +# Architecture +BR2_aarch64=y + +# Toolchain +BR2_TOOLCHAIN_BUILDROOT=y + +# System +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +# 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" + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.2" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y + +# Linux headers same as kernel, a 5.10 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y + +# UEFI firmware +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=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 testing +BR2_PACKAGE_HOST_QEMU=y +BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y From patchwork Thu Mar 18 15:43:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455329 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=OiNpmbFv; 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 4F1Wg94t1Qz9sS8 for ; Fri, 19 Mar 2021 02:49:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3C67D4EBF9; Thu, 18 Mar 2021 15:49:38 +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 L5EF1it9pY62; Thu, 18 Mar 2021 15:49:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 10CC94EE2A; Thu, 18 Mar 2021 15:49:36 +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 353811BF341 for ; Thu, 18 Mar 2021 15:49:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 244BE60650 for ; Thu, 18 Mar 2021 15:49:34 +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 yCiiNTb11Pp6 for ; Thu, 18 Mar 2021 15:49:32 +0000 (UTC) X-Greylist: delayed 00:06:47 by SQLgrey-1.8.0 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9C53D605CD for ; Thu, 18 Mar 2021 15:49:31 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4F1WX93XnNz4xSCg for ; Thu, 18 Mar 2021 15:43:37 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="OiNpmbFv" Date: Thu, 18 Mar 2021 15:43:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082208; bh=tEe4gs3m1kOlA5XC/DPsjGaUli7TKns/5aInxDq6DJY=; h=Date:To:From:Cc:Reply-To:Subject:From; b=OiNpmbFvQp2p8qYEQSGGUEdFZ0XAb3FX+JygAe1mrmBZx0IzvJ7RcdbufQaGfv4D2 dH1qQHAVT9l7vGYzW+dZDkrNYqAj8l35dcYg705CzdaW5kUHrv9o3Lo6o1CRhrBylf WSHihbY1GEM4xEPQOShck9CGF/4zpurG1BKNKQv2zsxrvW0zB9ewKMgFwQyg8cdakQ udr7DVSsZAihEOCzjlM6iyrL5timDR8/rPB4RiJ6Jy2aQVpg3+Rb8ch0AgUima9RJn psg8xcEp1bHLoemmjwC4bDREtVibMRwluxhxNtQpovdxdboGaHCH9SjcOyafNILyZf e3+rccV6b+jvw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 07/10] configs/qemu_aarch64_virt_efi_defconfig: new config for QEMU Virt EFI 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 , Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This introduces a configuration for QEMU Virt that boots Linux with ATF and the EDK2 EFI firmware without any additional bootloaders. ATF is loading EDK2 in EL2 using the BL33 payload configuration. Signed-off-by: Dick Olsson --- Revision 4: * Addressed review items by Yann E. MORIN * 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 Revision 3: * Changed flash device setup to work with QEMU 5.0 Signed-off-by: Dick Olsson --- .../aarch64-virt-efi/assemble-flash-images | 19 ++++++++ board/qemu/aarch64-virt-efi/genimage.cfg | 27 +++++++++++ board/qemu/aarch64-virt-efi/readme.txt | 27 +++++++++++ board/qemu/aarch64-virt-efi/startup.nsh | 1 + configs/qemu_aarch64_virt_efi_defconfig | 45 +++++++++++++++++++ 5 files changed, 119 insertions(+) create mode 100755 board/qemu/aarch64-virt-efi/assemble-flash-images create mode 100644 board/qemu/aarch64-virt-efi/genimage.cfg create mode 100644 board/qemu/aarch64-virt-efi/readme.txt create mode 100644 board/qemu/aarch64-virt-efi/startup.nsh create mode 100644 configs/qemu_aarch64_virt_efi_defconfig diff --git a/board/qemu/aarch64-virt-efi/assemble-flash-images b/board/qemu/aarch64-virt-efi/assemble-flash-images new file mode 100755 index 0000000000..f1f50f3cdf --- /dev/null +++ b/board/qemu/aarch64-virt-efi/assemble-flash-images @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +EFI_PART=${BINARIES_DIR}/efi-part +EFI_DIR=${EFI_PART}/EFI/BOOT + +# Create the EFI system partition with startup script and kernel +# executable according to the UEFI standard. +rm -rf ${EFI_DIR} +mkdir -p ${EFI_DIR} +cp ${BOARD_DIR}/startup.nsh ${EFI_PART}/ +ln -sf ${BINARIES_DIR}/Image ${EFI_DIR}/bootaa64.efi + +# 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-efi/genimage.cfg b/board/qemu/aarch64-virt-efi/genimage.cfg new file mode 100644 index 0000000000..7c37d6a7dd --- /dev/null +++ b/board/qemu/aarch64-virt-efi/genimage.cfg @@ -0,0 +1,27 @@ +image efi-part.vfat { + vfat { + file EFI { + image = "efi-part/EFI" + } + file startup.nsh { + image = "efi-part/startup.nsh" + } + } + 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-efi/readme.txt b/board/qemu/aarch64-virt-efi/readme.txt new file mode 100644 index 0000000000..3f3c9d7619 --- /dev/null +++ b/board/qemu/aarch64-virt-efi/readme.txt @@ -0,0 +1,27 @@ +Intro +===== + +This board allows to build a minimal Linux system that boot directly +with Arm Trusted Firmware, EDK2 (UEFI), ACPI and GICv3 without any +additional bootloaders like GRUB2. + +Build +===== + + $ make qemu_aarch64_virt_efi_defconfig + $ make + +Emulation +========= + +Run the emulation with: + + output/host/bin/qemu-system-aarch64 \ + -M virt,secure=on,gic-version=3 \ + -cpu cortex-a57 \ + -smp 4 \ + -m 1024 \ + -nographic \ + -bios output/images/flash.bin \ + -drive file=output/images/disk.img,if=none,format=raw,id=hd0 \ + -device virtio-blk-device,drive=hd0 diff --git a/board/qemu/aarch64-virt-efi/startup.nsh b/board/qemu/aarch64-virt-efi/startup.nsh new file mode 100644 index 0000000000..b7a000f6f0 --- /dev/null +++ b/board/qemu/aarch64-virt-efi/startup.nsh @@ -0,0 +1 @@ +FS0:\EFI\BOOT\bootaa64.efi root=/dev/vda2 rootwait console=ttyAMA0 diff --git a/configs/qemu_aarch64_virt_efi_defconfig b/configs/qemu_aarch64_virt_efi_defconfig new file mode 100644 index 0000000000..5d59d81dcb --- /dev/null +++ b/configs/qemu_aarch64_virt_efi_defconfig @@ -0,0 +1,45 @@ +# Architecture +BR2_aarch64=y + +# Toolchain +BR2_TOOLCHAIN_BUILDROOT=y + +# System +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-virt-efi/assemble-flash-images support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-virt-efi/genimage.cfg" + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.2" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y + +# Linux headers same as kernel, a 5.10 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y + +# UEFI firmware +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL=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 testing +BR2_PACKAGE_HOST_QEMU=y +BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y From patchwork Thu Mar 18 15:43:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455332 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::133; helo=smtp2.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=dFGxiEC0; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4F1Wgv5Xsdz9sS8 for ; Fri, 19 Mar 2021 02:50:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5CF05432A5; Thu, 18 Mar 2021 15:50:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IHuJwPrO4Iey; Thu, 18 Mar 2021 15:50:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id A570343291; Thu, 18 Mar 2021 15:50:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 486C81BF341 for ; Thu, 18 Mar 2021 15:49:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 40C6643291 for ; Thu, 18 Mar 2021 15:49:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uk99C-su4P7g for ; Thu, 18 Mar 2021 15:49:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp2.osuosl.org (Postfix) with ESMTPS id 155034328B for ; Thu, 18 Mar 2021 15:49:35 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4F1WXF4Mf9z4xSSM for ; Thu, 18 Mar 2021 15:43:41 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="dFGxiEC0" Date: Thu, 18 Mar 2021 15:43:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082213; bh=x2nA2DJSwm0APEj8LPg1CUA+zEQLSyFfrmDYtm8kEdg=; h=Date:To:From:Cc:Reply-To:Subject:From; b=dFGxiEC0FEp1NCOy6cedULAqn91ZLDY4Fc9E7TXTJFRaWtAg3pgjupF0sPi+7Q51v lBzeW71zxe3VnPV51EvEfNIai+FXKMEnf7pvvuyWBHLA9RRXOa/nArQpllm1bCfUjc c+3hfpAdjp0jGgv+Ssdqp3cLwR5ZIxkqQjm2xg8VlB8/0Uz6oHGH/h3hAXcx0YzYGX +nyHDHx+frP7vUTXCRYdnDJKfHZDidKbfAML0wRRPCLpatRq5L8axhexPkMXWHlXDV XLzccX6WCLvE0BBT0piDhWUV1O0GpeTEv8QACp80vtesntKkT/nQuvIOpPOQlc0vkm 2vua8Jo+b/R0g== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 08/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 Cc: 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 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 Signed-off-by: Dick Olsson --- .../developerbox/assemble-flash-images | 14 +++++++++++ board/socionext/developerbox/genimage.cfg | 24 +++++++++++++++++++ board/socionext/developerbox/readme.txt | 16 +++++++++++++ board/socionext/developerbox/startup.nsh | 1 + configs/socionext_developerbox_defconfig | 21 ++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100755 board/socionext/developerbox/assemble-flash-images create mode 100644 board/socionext/developerbox/genimage.cfg create mode 100644 board/socionext/developerbox/readme.txt create mode 100644 board/socionext/developerbox/startup.nsh 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..22a86e1f6b --- /dev/null +++ b/board/socionext/developerbox/assemble-flash-images @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +EFI_PART=${BINARIES_DIR}/efi-part +EFI_DIR=${EFI_PART}/EFI/BOOT + +# Create the EFI system partition with startup script and kernel +# executable according to the UEFI standard. +rm -rf ${EFI_DIR} +mkdir -p ${EFI_DIR} +cp ${BOARD_DIR}/startup.nsh ${EFI_PART}/ +ln -sf ${BINARIES_DIR}/Image ${EFI_DIR}/bootaa64.efi diff --git a/board/socionext/developerbox/genimage.cfg b/board/socionext/developerbox/genimage.cfg new file mode 100644 index 0000000000..f653b1f35d --- /dev/null +++ b/board/socionext/developerbox/genimage.cfg @@ -0,0 +1,24 @@ +image efi-part.vfat { + vfat { + file EFI { + image = "efi-part/EFI" + } + } + 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/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/board/socionext/developerbox/startup.nsh b/board/socionext/developerbox/startup.nsh new file mode 100644 index 0000000000..8c85089d7d --- /dev/null +++ b/board/socionext/developerbox/startup.nsh @@ -0,0 +1 @@ +FS0:\EFI\BOOT\bootaa64.efi root=/dev/sda2 rootwait diff --git a/configs/socionext_developerbox_defconfig b/configs/socionext_developerbox_defconfig new file mode 100644 index 0000000000..4a389eb48b --- /dev/null +++ b/configs/socionext_developerbox_defconfig @@ -0,0 +1,21 @@ +BR2_aarch64=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=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.2" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +# 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_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_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y From patchwork Thu Mar 18 15:43:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455330 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=njJTHR/C; 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 4F1WgQ0ghSz9sVw for ; Fri, 19 Mar 2021 02:49:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 82B2483415; Thu, 18 Mar 2021 15:49:51 +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 OLWLfqFgCsph; Thu, 18 Mar 2021 15:49:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 8794683478; Thu, 18 Mar 2021 15:49:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 62A361BF9B4 for ; Thu, 18 Mar 2021 15:49:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5F32D43291 for ; Thu, 18 Mar 2021 15:49:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BG80ZA6VaJJk for ; Thu, 18 Mar 2021 15:49:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp2.osuosl.org (Postfix) with ESMTPS id B06E84328B for ; Thu, 18 Mar 2021 15:49:31 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4F1WXQ2J1sz4xTff for ; Thu, 18 Mar 2021 15:43:50 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="njJTHR/C" Date: Thu, 18 Mar 2021 15:43:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082221; bh=jFVMHO0iWHKU3kgHqyWqHasdo3I/K8dj+LGhQSYMNbQ=; h=Date:To:From:Cc:Reply-To:Subject:From; b=njJTHR/CLLSDp9+Vv+Sm2HCyPZ6PTG2viHPO0X9OEBEJn4M2s4vYmoGxIBZb3eNrm 34OG9ch8HMc5eGiRpm385LnpZzeLUUP3yC9AW+WfWaKV6U90mFfvUW2uj1iU2fvBal m0ToqSwpcHhgriX3GlSDvN0QLuBTcrxugsarMZHVzB70blXpn1roMTs6CSStu66qUs F3R2e6hmudUWCwh+4dodK7kSWNhD6Hh+R7PkkU6SdNRKWE6tF9lB4+snrM5oRfoYz/ 6Q7WJbhsKODz5Px8JKu+7sIE06yFYuMul+HNHxyfA8l15NAlGUQHB2OQqJ30ptDKW9 uwuYYCkTg+VZA== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 09/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 Cc: 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 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 Signed-off-by: Dick Olsson --- .../macchiatobin-efi/assemble-flash-images | 14 +++ board/solidrun/macchiatobin-efi/genimage.cfg | 24 +++++ .../solidrun/macchiatobin-efi/linux.fragment | 3 + board/solidrun/macchiatobin-efi/readme.txt | 90 +++++++++++++++++++ board/solidrun/macchiatobin-efi/startup.nsh | 1 + configs/solidrun_macchiatobin_efi_defconfig | 25 ++++++ 6 files changed, 157 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/linux.fragment create mode 100644 board/solidrun/macchiatobin-efi/readme.txt create mode 100644 board/solidrun/macchiatobin-efi/startup.nsh 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..22a86e1f6b --- /dev/null +++ b/board/solidrun/macchiatobin-efi/assemble-flash-images @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +EFI_PART=${BINARIES_DIR}/efi-part +EFI_DIR=${EFI_PART}/EFI/BOOT + +# Create the EFI system partition with startup script and kernel +# executable according to the UEFI standard. +rm -rf ${EFI_DIR} +mkdir -p ${EFI_DIR} +cp ${BOARD_DIR}/startup.nsh ${EFI_PART}/ +ln -sf ${BINARIES_DIR}/Image ${EFI_DIR}/bootaa64.efi diff --git a/board/solidrun/macchiatobin-efi/genimage.cfg b/board/solidrun/macchiatobin-efi/genimage.cfg new file mode 100644 index 0000000000..5d8457e4ac --- /dev/null +++ b/board/solidrun/macchiatobin-efi/genimage.cfg @@ -0,0 +1,24 @@ +image efi-part.vfat { + vfat { + file EFI { + image = "efi-part/EFI" + } + } + 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/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..b9794dd3d4 --- /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.9 (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/board/solidrun/macchiatobin-efi/startup.nsh b/board/solidrun/macchiatobin-efi/startup.nsh new file mode 100644 index 0000000000..79c00ce65c --- /dev/null +++ b/board/solidrun/macchiatobin-efi/startup.nsh @@ -0,0 +1 @@ +FS0:\EFI\BOOT\bootaa64.efi console=ttyS0,115200n8 root=/dev/mmcblk1p2 rootwait diff --git a/configs/solidrun_macchiatobin_efi_defconfig b/configs/solidrun_macchiatobin_efi_defconfig new file mode 100644 index 0000000000..a71b5fa322 --- /dev/null +++ b/configs/solidrun_macchiatobin_efi_defconfig @@ -0,0 +1,25 @@ +BR2_aarch64=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=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.2" +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="200M" +# 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_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_MV_DDR_MARVELL=y +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y From patchwork Thu Mar 18 15:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455336 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.133; helo=smtp2.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=o+ZYeVCO; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4F1Wj24YxVz9sS8 for ; Fri, 19 Mar 2021 02:51:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id AEBF0432B4; Thu, 18 Mar 2021 15:51:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VkNDBXwEI07R; Thu, 18 Mar 2021 15:51:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id F1FAC432A5; Thu, 18 Mar 2021 15:51:14 +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 E83E91BF341 for ; Thu, 18 Mar 2021 15:51:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E3FF04EE37 for ; Thu, 18 Mar 2021 15:51:12 +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 pg6-S0GQrkBS for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9948C4EE33 for ; Thu, 18 Mar 2021 15:51:11 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WXW28Pzz4wyL7 for ; Thu, 18 Mar 2021 15:43:55 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="o+ZYeVCO" Date: Thu, 18 Mar 2021 15:43:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082226; bh=8f63qSh4Lcm7ya+cUDxZKXNzebB2E6/bJ66bMEca1p8=; h=Date:To:From:Cc:Reply-To:Subject:From; b=o+ZYeVCObHS2etXVYG03Sd4EnA5WtIQZkbuJ/8Mf3W/Gdz6fbgkJXBKTybZe1fC+H /bX9N8q5PxZ1M4Yx31I2jBZNr20LawcAs+mOrOaZwQHIt2UZoSQBohEAWsbm2Nrflf WwSh28vfmvoMrFE4tJkgrGfbaWRDvZw16WVgrEa4fSSHrcNDN8UOkqHkZ07Ugh27Qg Un0L8mVjgdNXOZlEj9/1Giq3GjvkyL1V8NjSNLwYi2MvtwZvptvIww0ZvQ8gNbnKci BfypNCfVWE8hn+cunh4Gj/pFYp/SiTPO61HjqeY9N780U//bl+dQO/2msSV35/BCXy EhjmzmUQyfXsQ== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 10/10] DEVELOPERS: add Dick Olsson to all files related to 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 Cc: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Dick Olsson --- DEVELOPERS | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DEVELOPERS b/DEVELOPERS index 6a7e88039e..7475c74fab 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -673,6 +673,23 @@ F: package/libstrophe/ 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-efi/ +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_efi_defconfig +F: configs/socionext_developerbox_defconfig +F: configs/solidrun_macchiatobin_efi_defconfig +F: package/edk2-platforms/ + N: Dimitrios Siganos F: package/wireless-regdb/