Skip to contentSkip to conversation

Add UEFI to fvp-baser-aemv8r64 using U-Boot

PATCH Applied Peter Hoyes 2 participants 8 messages Feb 17, 2022 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

cover Add UEFI to fvp-baser-aemv8r64 using U-Boot

From: Peter Hoyes <[email protected]>

These patches provide the following updates for the fvp-baser-aemv8r64 BSP:

* Add board support patches for U-Boot v2022.01, and bundle U-Boot in the boot-wrapper-aarch64 binary to provide UEFI support.
* Update boot-wrapper to more recent version and include patches to boot U-Boot at S-EL2.
* Align FVP RAM size with upstream kernel device tree.
* Enable the use_real_time FVP flag so that the counter increments using the wall clock.
* Update documentation, including a section on the new boot architecture.

Peter Hoyes (6):
arm/boot-wrapper-aarch64: Upgrade to newer revision arm-bsp/boot-wrapper-aarch64: Update patches for fvp-baser-aemv8r64 arm-bsp/u-boot: Add U-Boot for fvp-baser-aemv8r64 arm-bsp/kernel: Use 4 Gb of RAM in fvp-baser-aemv8r64 arm-bsp/conf: Use real-time clock for fvp-baser-aemv8r64 arm-bsp/docs: Update fvp-baser-aemv8r64 docs

 .../conf/machine/fvp-baser-aemv8r64.conf      |    8 +-
 .../documentation/fvp-baser-aemv8r64.md       |   65 +-
 ...oot-wrapper-aarch64-fvp-baser-aemv8r64.inc |   24 +-
 ...M_SYS-config-by-auto-detect-dtb-node.patch |   67 -
 ...abels-and-prepare-for-lower-EL-booti.patch |  135 +
 ...0002-aarch64-Prepare-for-EL1-booting.patch |   48 +
 ...4-Introduce-EL2-boot-code-for-v8-r64.patch |  314 -
 ...aarch64-Prepare-for-lower-EL-booting.patch |   55 +
 ...04-gic-v3-Prepare-for-gicv3-with-EL2.patch |  105 +
 ...aarch64-Prepare-for-booting-with-EL2.patch |   63 +
 ...ce-EL2-boot-code-for-Armv8-R-AArch64.patch |  182 +
 ...-psci-to-choose-between-smc-and-hvc.patch} |   42 +-
 ...4-Disable-CNTPCT_EL0-trap-for-v8-R64.patch |   48 +
 .../0009-lds-Mark-the-mem-range.patch         |   38 +
 .../0010-common-Introduce-the-libfdt.patch    | 6044 +++++++++++++++++
 ...-common-Add-essential-libc-functions.patch |  101 +
 ...dd-the-libfdt-to-the-Makefile-system.patch |   61 +
 .../0013-platform-Add-print_hex-func.patch    |   67 +
 ...4-common-Add-mem-usage-to-memreserve.patch |   96 +
 ...dd-the-enable-keep-el-compile-option.patch |  102 +
 ...efile-Change-COUNTER_FREQ-to-100-MHz.patch |   34 +
 ...ation-for-the-Arm-VExpress64-board-c.patch |  109 +
 ...tor-header-file-to-make-it-easier-to.patch |  172 +
 ...Clean-up-BASE_FVP-boot-configuration.patch |   99 +
 ...e-OF_CONTROL-and-OF_BOARD-for-VExpre.patch |  110 +
 ...s64-Enable-VIRTIO_NET-network-driver.patch |   62 +
 ...v8-Add-ARMv8-MPU-configuration-logic.patch |  259 +
 ...bling-exception-vectors-on-non-SPL-b.patch |  111 +
 ...mv8-ARMV8_SWITCH_TO_EL1-improvements.patch |  163 +
 ...ling-HVC-configurable-when-switching.patch |   73 +
 ...press64-Do-not-set-COUNTER_FREQUENCY.patch |   37 +
 ...Add-BASER_FVP-vexpress-board-variant.patch |  275 +
 .../recipes-bsp/u-boot/u-boot_%.bbappend      |   17 +
 .../fvp-baser-aemv8r64/fvp-baser-aemv8r64.dts |    2 +-
 .../boot-wrapper-aarch64_git.bb               |    2 +-
 .../boot-wrapper-aarch64_%.bbappend           |    3 +
 36 files changed, 8784 insertions(+), 409 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-Decouple-V2M_SYS-config-by-auto-detect-dtb-node.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-aarch64-Rename-labels-and-prepare-for-lower-EL-booti.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-aarch64-Prepare-for-EL1-booting.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-arch64-Introduce-EL2-boot-code-for-v8-r64.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0003-aarch64-Prepare-for-lower-EL-booting.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0004-gic-v3-Prepare-for-gicv3-with-EL2.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0005-aarch64-Prepare-for-booting-with-EL2.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0006-aarch64-Introduce-EL2-boot-code-for-Armv8-R-AArch64.patch
 rename meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/{0003-Allow-enable-psci-to-choose-between-smc-and-hvc.patch => 0007-Allow-enable-psci-to-choose-between-smc-and-hvc.patch} (71%)
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0008-aarch64-Disable-CNTPCT_EL0-trap-for-v8-R64.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0009-lds-Mark-the-mem-range.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0010-common-Introduce-the-libfdt.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0011-common-Add-essential-libc-functions.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0012-Makefile-Add-the-libfdt-to-the-Makefile-system.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0013-platform-Add-print_hex-func.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0014-common-Add-mem-usage-to-memreserve.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0015-boot-Add-the-enable-keep-el-compile-option.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0016-Makefile-Change-COUNTER_FREQ-to-100-MHz.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0001-doc-Add-documentation-for-the-Arm-VExpress64-board-c.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0002-vexpress64-Refactor-header-file-to-make-it-easier-to.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0003-vexpress64-Clean-up-BASE_FVP-boot-configuration.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0004-vexpress64-Enable-OF_CONTROL-and-OF_BOARD-for-VExpre.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0005-vexpress64-Enable-VIRTIO_NET-network-driver.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0006-armv8-Add-ARMv8-MPU-configuration-logic.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0007-armv8-Allow-disabling-exception-vectors-on-non-SPL-b.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0008-armv8-ARMV8_SWITCH_TO_EL1-improvements.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0009-armv8-Make-disabling-HVC-configurable-when-switching.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0010-vexpress64-Do-not-set-COUNTER_FREQUENCY.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0011-vexpress64-Add-BASER_FVP-vexpress-board-variant.patch
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/6 arm/boot-wrapper-aarch64: Upgrade to newer revision

From: Peter Hoyes <[email protected]>

Upgrade boot-wrapper-aarch64 to 1044c77062573985f7c994c3b6cef5695f57e955

Hold back gem5 at 8d5a765251d9113c3c0f9fa14de42a9e7486fe8a in bbappend.

Issue-Id: SCM-3871

Change-Id Ia5ccca2234dd117d530970f9f90469dacbb778e3
---
 .../boot-wrapper-aarch64/boot-wrapper-aarch64_git.bb           | 2 +-
 .../boot-wrapper-aarch64/boot-wrapper-aarch64_%.bbappend       | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
meta-arm/recipes-bsp/boot-wrapper-aarch64/boot-wrapper-aarch64_git.bb +1 -1
index 2251eff..74adaf3 100644
@@ -4,7 +4,7 @@ LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bb63326febfb5fb909226c8e7ebcef5c"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git;branch=master"
-SRCREV = "8d5a765251d9113c3c0f9fa14de42a9e7486fe8a"
+SRCREV = "1044c77062573985f7c994c3b6cef5695f57e955"
 
 PV = "git${SRCPV}"
 
meta-gem5/recipes-bsp/boot-wrapper-aarch64/boot-wrapper-aarch64_%.bbappend +3 -0
index 57e6b53..3dd2cba 100644
@@ -11,3 +11,6 @@ BOOT_WRAPPER_AARCH64_DEVICETREE:gem5-arm64 = "gem5-aarch64.dtb"
 DEPLOY_DEPEND_LIST ?= ""
 DEPLOY_DEPEND_LIST:gem5-arm64 = " gem5-aarch64-dtb:do_deploy"
 do_deploy[depends] += "${DEPLOY_DEPEND_LIST}"
+
+# The base recipe has been upgraded, so hold back at known working revision
+SRCREV = "8d5a765251d9113c3c0f9fa14de42a9e7486fe8a"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/6 arm-bsp/boot-wrapper-aarch64: Update patches for fvp-baser-aemv8r64

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Update the machine-specific patches, which makes the following changes:
* Add PSCI services to /memreserve/ in the device tree using libfdt.
* Add --enable-keep-el option, which allows boot-wrapper-aarch64 to boot the next stage at the same exception level.
* Update the counter frequency to 100 MHz.

Issue-Id: SCM-3871

Change-Id I41843e958cf629d69de644bb57b660fb542fc8b7
---
 ...oot-wrapper-aarch64-fvp-baser-aemv8r64.inc |   19 +-
 ...M_SYS-config-by-auto-detect-dtb-node.patch |   67 -
 ...abels-and-prepare-for-lower-EL-booti.patch |  135 +
 ...0002-aarch64-Prepare-for-EL1-booting.patch |   48 +
 ...4-Introduce-EL2-boot-code-for-v8-r64.patch |  314 -
 ...aarch64-Prepare-for-lower-EL-booting.patch |   55 +
 ...04-gic-v3-Prepare-for-gicv3-with-EL2.patch |  105 +
 ...aarch64-Prepare-for-booting-with-EL2.patch |   63 +
 ...ce-EL2-boot-code-for-Armv8-R-AArch64.patch |  182 +
 ...-psci-to-choose-between-smc-and-hvc.patch} |   42 +-
 ...4-Disable-CNTPCT_EL0-trap-for-v8-R64.patch |   48 +
 .../0009-lds-Mark-the-mem-range.patch         |   38 +
 .../0010-common-Introduce-the-libfdt.patch    | 6044 +++++++++++++++++
 ...-common-Add-essential-libc-functions.patch |  101 +
 ...dd-the-libfdt-to-the-Makefile-system.patch |   61 +
 .../0013-platform-Add-print_hex-func.patch    |   67 +
 ...4-common-Add-mem-usage-to-memreserve.patch |   96 +
 ...dd-the-enable-keep-el-compile-option.patch |  102 +
 ...efile-Change-COUNTER_FREQ-to-100-MHz.patch |   34 +
 19 files changed, 7219 insertions(+), 402 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-Decouple-V2M_SYS-config-by-auto-detect-dtb-node.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-aarch64-Rename-labels-and-prepare-for-lower-EL-booti.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-aarch64-Prepare-for-EL1-booting.patch
 delete mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-arch64-Introduce-EL2-boot-code-for-v8-r64.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0003-aarch64-Prepare-for-lower-EL-booting.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0004-gic-v3-Prepare-for-gicv3-with-EL2.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0005-aarch64-Prepare-for-booting-with-EL2.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0006-aarch64-Introduce-EL2-boot-code-for-Armv8-R-AArch64.patch
 rename meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/{0003-Allow-enable-psci-to-choose-between-smc-and-hvc.patch => 0007-Allow-enable-psci-to-choose-between-smc-and-hvc.patch} (71%)
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0008-aarch64-Disable-CNTPCT_EL0-trap-for-v8-R64.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0009-lds-Mark-the-mem-range.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0010-common-Introduce-the-libfdt.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0011-common-Add-essential-libc-functions.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0012-Makefile-Add-the-libfdt-to-the-Makefile-system.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0013-platform-Add-print_hex-func.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0014-common-Add-mem-usage-to-memreserve.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0015-boot-Add-the-enable-keep-el-compile-option.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0016-Makefile-Change-COUNTER_FREQ-to-100-MHz.patch
meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/boot-wrapper-aarch64-fvp-baser-aemv8r64.inc +16 -3
index f1bf614..628571f 100644
@@ -2,9 +2,22 @@ COMPATIBLE_MACHINE = "fvp-baser-aemv8r64"
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/files/${MACHINE}:"
 SRC_URI:append = " \
-    file://0001-Decouple-V2M_SYS-config-by-auto-detect-dtb-node.patch \
-    file://0002-arch64-Introduce-EL2-boot-code-for-v8-r64.patch \
-    file://0003-Allow-enable-psci-to-choose-between-smc-and-hvc.patch \
+    file://0001-aarch64-Rename-labels-and-prepare-for-lower-EL-booti.patch \
+    file://0002-aarch64-Prepare-for-EL1-booting.patch \
+    file://0003-aarch64-Prepare-for-lower-EL-booting.patch \
+    file://0004-gic-v3-Prepare-for-gicv3-with-EL2.patch \
+    file://0005-aarch64-Prepare-for-booting-with-EL2.patch \
+    file://0006-aarch64-Introduce-EL2-boot-code-for-Armv8-R-AArch64.patch \
+    file://0007-Allow-enable-psci-to-choose-between-smc-and-hvc.patch \
+    file://0008-aarch64-Disable-CNTPCT_EL0-trap-for-v8-R64.patch \
+    file://0009-lds-Mark-the-mem-range.patch \
+    file://0010-common-Introduce-the-libfdt.patch \
+    file://0011-common-Add-essential-libc-functions.patch \
+    file://0012-Makefile-Add-the-libfdt-to-the-Makefile-system.patch \
+    file://0013-platform-Add-print_hex-func.patch \
+    file://0014-common-Add-mem-usage-to-memreserve.patch \
+    file://0015-boot-Add-the-enable-keep-el-compile-option.patch \
+    file://0016-Makefile-Change-COUNTER_FREQ-to-100-MHz.patch \
     "
 
 BOOT_WRAPPER_AARCH64_CMDLINE = "\
meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-Decouple-V2M_SYS-config-by-auto-detect-dtb-node.patch deleted +0 -67

67 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0001-aarch64-Rename-labels-and-prepare-for-lower-EL-booti.patch new file +135 -0

135 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-aarch64-Prepare-for-EL1-booting.patch new file +48 -0

48 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0002-arch64-Introduce-EL2-boot-code-for-v8-r64.patch deleted +0 -314

314 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0003-aarch64-Prepare-for-lower-EL-booting.patch new file +55 -0

55 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0004-gic-v3-Prepare-for-gicv3-with-EL2.patch new file +105 -0

105 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0005-aarch64-Prepare-for-booting-with-EL2.patch new file +63 -0

63 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0006-aarch64-Introduce-EL2-boot-code-for-Armv8-R-AArch64.patch new file +182 -0

182 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0007-Allow-enable-psci-to-choose-between-smc-and-hvc.patch renamed from meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0003-Allow-enable-psci-to-choose-between-smc-and-hvc.patch +24 -18

79 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0008-aarch64-Disable-CNTPCT_EL0-trap-for-v8-R64.patch new file +48 -0

48 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0009-lds-Mark-the-mem-range.patch new file +38 -0
new file mode 100644
index 0000000..3d4fec8
@@ -0,0 +1,38 @@
+From 2851f0e6c1216894b9498d7b91256bb1ef49e544 Mon Sep 17 00:00:00 2001
+From: Jaxson Han <[email protected]>
+Date: Tue, 2 Nov 2021 15:10:28 +0800
+Subject: [PATCH] lds: Mark the mem range
+
+Add firmware_start and firmware_end, so that we can use them to
+calculate the mem range of boot-wrapper and then set the range to
+/memreserve/ of dtb.
+
+Issue-ID: SCM-3815
+Upstream-Status: Inappropriate [other]
+  Temporary patch
+Signed-off-by: Jaxson Han <[email protected]>
+Change-Id: Idc5a2894e193c75381049a0f359b4b2a51c567ee
+---
+ model.lds.S | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/model.lds.S b/model.lds.S
+index d4e7e13..ab98ddf 100644
+--- a/model.lds.S
++++ b/model.lds.S
+@@ -64,6 +64,7 @@ SECTIONS
+ #endif
+ 
+ 	.boot PHYS_OFFSET: {
++		PROVIDE(firmware_start = .);
+ 		*(.init)
+ 		*(.text*)
+ 		*(.data* .rodata* .bss* COMMON)
+@@ -76,6 +77,7 @@ SECTIONS
+ 		mbox = .;
+ 		QUAD(0x0)
+ 	}
++	PROVIDE(firmware_end = .);
+ 
+ 	ASSERT(etext <= (PHYS_OFFSET + TEXT_LIMIT), ".text overflow!")
+ }
meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0010-common-Introduce-the-libfdt.patch new file +6044 -0

1,841 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0011-common-Add-essential-libc-functions.patch new file +101 -0

101 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0012-Makefile-Add-the-libfdt-to-the-Makefile-system.patch new file +61 -0

61 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0013-platform-Add-print_hex-func.patch new file +67 -0

67 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0014-common-Add-mem-usage-to-memreserve.patch new file +96 -0

96 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0015-boot-Add-the-enable-keep-el-compile-option.patch new file +102 -0

102 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/files/fvp-baser-aemv8r64/0016-Makefile-Change-COUNTER_FREQ-to-100-MHz.patch new file +34 -0
new file mode 100644
index 0000000..a6b16e4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/6 arm-bsp/u-boot: Add U-Boot for fvp-baser-aemv8r64

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

This patch introduces U-Boot into the fvp-baser-aemv8r64 boot flow, providing EFI services.

The fvp-baser-aemv8r64 does not have an EL3, so the system starts at S-EL2. For now, U-Boot is running at S-EL2, alongside boot-wrapper. Enable the --enable-keep-el option in boot-wrapper-aarch64 so that it boots the next stage (U-Boot) at S-EL2. Additionally, tell boot-wrapper-aarch64 to bundle U-Boot instead of the kernel.

Linux only supports booting from S-EL1 on the fvp-baser-aemv8r64, so U-Boot is configured with CONFIG_SWITCH_TO_EL1, so that booti or bootefi switch to S-EL1 before booting the EFI payload (unless an enviornment variable - armv8_switch_to_el1 - is set to 'n').

Add patches to U-Boot, which:
* Add board support for the fvp-baser-aemv8r64 (with a memory map which is inverted from the fvp-base).
* Enable the configuration of U-Boot using the device tree passed from boot-wrapper-aarch64.
* Enable virtio-net.
* Disable setting the exception vectors at S-EL2 so that the PSCI vectors pass through to Linux.
* Set up system registers at S-EL2 for Linux.
* Configure the S-EL2 MPU for the EFI services.
* Allows bootefi to switch to EL1 before booting Linux.

Issue-Id: SCM-3871

Change-Id I229d14b0717df412c1fe33772230ca779f79b32d
---
 .../conf/machine/fvp-baser-aemv8r64.conf      |   6 +-
 ...oot-wrapper-aarch64-fvp-baser-aemv8r64.inc |   5 +-
 ...ation-for-the-Arm-VExpress64-board-c.patch | 109 +++++++
 ...tor-header-file-to-make-it-easier-to.patch | 172 +++++++++++
 ...Clean-up-BASE_FVP-boot-configuration.patch |  99 +++++++
 ...e-OF_CONTROL-and-OF_BOARD-for-VExpre.patch | 110 +++++++
 ...s64-Enable-VIRTIO_NET-network-driver.patch |  62 ++++
 ...v8-Add-ARMv8-MPU-configuration-logic.patch | 259 +++++++++++++++++
 ...bling-exception-vectors-on-non-SPL-b.patch | 111 +++++++
 ...mv8-ARMV8_SWITCH_TO_EL1-improvements.patch | 163 +++++++++++
 ...ling-HVC-configurable-when-switching.patch |  73 +++++
 ...press64-Do-not-set-COUNTER_FREQUENCY.patch |  37 +++
 ...Add-BASER_FVP-vexpress-board-variant.patch | 275 ++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_%.bbappend      |  17 ++
 14 files changed, 1496 insertions(+), 2 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0001-doc-Add-documentation-for-the-Arm-VExpress64-board-c.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0002-vexpress64-Refactor-header-file-to-make-it-easier-to.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0003-vexpress64-Clean-up-BASE_FVP-boot-configuration.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0004-vexpress64-Enable-OF_CONTROL-and-OF_BOARD-for-VExpre.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0005-vexpress64-Enable-VIRTIO_NET-network-driver.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0006-armv8-Add-ARMv8-MPU-configuration-logic.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0007-armv8-Allow-disabling-exception-vectors-on-non-SPL-b.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0008-armv8-ARMV8_SWITCH_TO_EL1-improvements.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0009-armv8-Make-disabling-HVC-configurable-when-switching.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0010-vexpress64-Do-not-set-COUNTER_FREQUENCY.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0011-vexpress64-Add-BASER_FVP-vexpress-board-variant.patch
meta-arm-bsp/conf/machine/fvp-baser-aemv8r64.conf +5 -1
index 031e010..96db158 100644
@@ -15,10 +15,14 @@ PREFERRED_VERSION_linux-yocto-rt ?= "5.15%"
 KERNEL_IMAGETYPE = "Image"
 KERNEL_DEVICETREE = "arm/fvp-baser-aemv8r64.dtb"
 
+UBOOT_MACHINE ?= "vexpress_aemv8r_defconfig"
+
 SERIAL_CONSOLES = "115200;ttyAMA0"
 
 IMAGE_FSTYPES += "wic"
-WKS_FILE ?= "fvp-base.wks"
+WKS_FILE ?= "efi-disk.wks.in"
+EFI_PROVIDER ?= "grub-efi"
+MACHINE_FEATURES:append = " efi"
 
 # As this is a virtual target that will not be used in the real world there is
 # no need for real SSH keys.  Disable rng-tools (which takes too long to
meta-arm-bsp/recipes-bsp/boot-wrapper-aarch64/boot-wrapper-aarch64-fvp-baser-aemv8r64.inc +4 -1
index 628571f..6bc7385 100644
@@ -23,6 +23,9 @@ SRC_URI:append = " \
 BOOT_WRAPPER_AARCH64_CMDLINE = "\
 earlycon console=ttyAMA0 loglevel=8 rootfstype=ext4 root=/dev/vda1 rw"
 
-EXTRA_OECONF += "--enable-psci=hvc"
+EXTRA_OECONF += "--enable-psci=hvc --enable-keep-el"
 
 TUNE_CCARGS = ""
+
+BOOT_WRAPPER_AARCH64_KERNEL = "u-boot.bin"
+do_deploy[depends] += "u-boot:do_deploy"
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0001-doc-Add-documentation-for-the-Arm-VExpress64-board-c.patch new file +109 -0

109 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0002-vexpress64-Refactor-header-file-to-make-it-easier-to.patch new file +172 -0

172 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0003-vexpress64-Clean-up-BASE_FVP-boot-configuration.patch new file +99 -0

99 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0004-vexpress64-Enable-OF_CONTROL-and-OF_BOARD-for-VExpre.patch new file +110 -0

110 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0005-vexpress64-Enable-VIRTIO_NET-network-driver.patch new file +62 -0

62 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0006-armv8-Add-ARMv8-MPU-configuration-logic.patch new file +259 -0

259 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0007-armv8-Allow-disabling-exception-vectors-on-non-SPL-b.patch new file +111 -0

111 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0008-armv8-ARMV8_SWITCH_TO_EL1-improvements.patch new file +163 -0

163 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0009-armv8-Make-disabling-HVC-configurable-when-switching.patch new file +73 -0

73 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0010-vexpress64-Do-not-set-COUNTER_FREQUENCY.patch new file +37 -0
new file mode 100644
index 0000000..2912070
@@ -0,0 +1,37 @@
+From 511f1b1a8534da8f4947561a70d0fbe9cea5b84c Mon Sep 17 00:00:00 2001
+From: Peter Hoyes <[email protected]>
+Date: Fri, 10 Dec 2021 15:09:09 +0000
+Subject: [PATCH 10/11] vexpress64: Do not set COUNTER_FREQUENCY
+
+VExpress boards normally run as a second-stage bootloader so should not
+need to modify CNTFRQ_EL0. On the BASER_FVP, U-Boot can modify it if
+running at EL2, but shouldn't because it might be different from the
+value being used by the first-stage bootloader (which might be
+providing PSCI services).
+
+Issue-Id: SCM-3728
+Upstream-Status: Inappropriate [other]
+  Temporary patch
+Signed-off-by: Peter Hoyes <[email protected]>
+Change-Id: I137473d721e58e4c348b9641f5b9778178d3bb65
+---
+ include/configs/vexpress_aemv8.h | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
+index ef271ea89b..76935f3173 100644
+--- a/include/configs/vexpress_aemv8.h
++++ b/include/configs/vexpress_aemv8.h
+@@ -70,9 +70,6 @@
+ #define V2M_SYS_CFGCTRL			(V2M_SYSREGS + 0x0a4)
+ #define V2M_SYS_CFGSTAT			(V2M_SYSREGS + 0x0a8)
+ 
+-/* Generic Timer Definitions */
+-#define COUNTER_FREQUENCY		24000000	/* 24MHz */
+-
+ /* Generic Interrupt Controller Definitions */
+ #ifdef CONFIG_GICV3
+ #define GICD_BASE			(V2M_PA_BASE + 0x2f000000)
+-- 
+2.25.1
+
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0011-vexpress64-Add-BASER_FVP-vexpress-board-variant.patch new file +275 -0

275 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend +17 -0
index a0709dd..8d96873 100644
@@ -74,6 +74,23 @@ SRC_URI:append:fvp-base = " file://bootargs.cfg"
 #
 SRC_URI:append:fvp-base-arm32 = " file://0001-Add-vexpress_aemv8a_aarch32-variant.patch"
 
+#
+# FVP BASER
+#
+SRC_URI:append:fvp-baser-aemv8r64 = " \
+    file://0001-doc-Add-documentation-for-the-Arm-VExpress64-board-c.patch \
+    file://0002-vexpress64-Refactor-header-file-to-make-it-easier-to.patch \
+    file://0003-vexpress64-Clean-up-BASE_FVP-boot-configuration.patch \
+    file://0004-vexpress64-Enable-OF_CONTROL-and-OF_BOARD-for-VExpre.patch \
+    file://0005-vexpress64-Enable-VIRTIO_NET-network-driver.patch \
+    file://0006-armv8-Add-ARMv8-MPU-configuration-logic.patch \
+    file://0007-armv8-Allow-disabling-exception-vectors-on-non-SPL-b.patch \
+    file://0008-armv8-ARMV8_SWITCH_TO_EL1-improvements.patch \
+    file://0009-armv8-Make-disabling-HVC-configurable-when-switching.patch \
+    file://0010-vexpress64-Do-not-set-COUNTER_FREQUENCY.patch \
+    file://0011-vexpress64-Add-BASER_FVP-vexpress-board-variant.patch \
+    "
+
 #
 # TC0 and TC1 MACHINES
 #
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/6 arm-bsp/kernel: Use 4 Gb of RAM in fvp-baser-aemv8r64

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

The FVP default configuration has bp.dram_size=4, which is sufficient for development and testing purposes, so remove the FVP_CONFIG override and set to 4 Gb in the device tree.

Issue-Id: SCM-3871

Change-Id I4a96062c9e94d36f5459f33c86aab4d4885bab43
---
 meta-arm-bsp/conf/machine/fvp-baser-aemv8r64.conf               | 1 -
 .../linux/files/fvp-baser-aemv8r64/fvp-baser-aemv8r64.dts       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
meta-arm-bsp/conf/machine/fvp-baser-aemv8r64.conf +0 -1
index 96db158..f7bed76 100644
@@ -39,7 +39,6 @@ FVP_CONSOLE ?= "terminal_0"
 FVP_CONFIG[bp.virtioblockdevice.image_path] ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.wic"
 FVP_CONFIG[bp.dram_metadata.init_value] ?= "0"
 FVP_CONFIG[bp.dram_metadata.is_enabled] ?= "true"
-FVP_CONFIG[bp.dram_size] ?= "8"
 FVP_CONFIG[bp.exclusive_monitor.monitor_access_level] ?= "1"
 FVP_CONFIG[bp.pl011_uart0.unbuffered_output] ?= "1"
 FVP_CONFIG[bp.pl011_uart0.untimed_fifos] ?= "true"
meta-arm-bsp/recipes-kernel/linux/files/fvp-baser-aemv8r64/fvp-baser-aemv8r64.dts +1 -1
index 4d6640a..a5078f2 100644
@@ -13,7 +13,7 @@
                 #size-cells = <0x2>;
                 device_type = "memory";
                 reg = <0x0        0x0        0x0 0x80000000>,
-                      <0x00000008 0x80000000 0x1 0x80000000>;
+                      <0x00000008 0x80000000 0x0 0x80000000>;
         };
 
         cpus {
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/6 arm-bsp/conf: Use real-time clock for fvp-baser-aemv8r64

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Enable the bp.refcounter.use_real_time option, so that the CNTPCT_EL0 increments in real-time instead of simulator time.

Issue-Id: SCM-3871

Change-Id I197d6de4a7316e5299aee34e64e149cbd3d515a9
---
 meta-arm-bsp/conf/machine/fvp-baser-aemv8r64.conf | 1 +
 1 file changed, 1 insertion(+)
meta-arm-bsp/conf/machine/fvp-baser-aemv8r64.conf +1 -0
index f7bed76..1f1b170 100644
@@ -62,3 +62,4 @@ FVP_CONFIG[pctl.startup] ?= "0.0.0.*"
 FVP_CONFIG[bp.virtio_net.enabled] ?= "1"
 FVP_CONFIG[bp.virtio_net.hostbridge.userNetworking] ?= "1"
 FVP_CONFIG[bp.vis.rate_limit-enable] ?= "0"
+FVP_CONFIG[bp.refcounter.use_real_time] ?= "1"
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/6 arm-bsp/docs: Update fvp-baser-aemv8r64 docs

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Document U-Boot addition, add new architecture section and update the change log.

Issue-Id: SCM-3871

Change-Id Ie0e1ff35ade634f2b523c14bb058c9d775802632
---
 .../documentation/fvp-baser-aemv8r64.md       | 65 ++++++++++++++++++-
 1 file changed, 63 insertions(+), 2 deletions(-)
meta-arm-bsp/documentation/fvp-baser-aemv8r64.md +63 -2
index fdf5038..1c723d9 100644
@@ -28,12 +28,65 @@ where either a standard or Real-Time Linux kernel (PREEMPT\_RT) can be built
 and run:
 
  - boot-wrapper-aarch64: provides PSCI support
- - Linux kernel: linux-yocto-5.14
- - Linux kernel with PREEMPT\_RT support: linux-yocto-rt-5.14
+ - U-Boot: v2022.01 - provides UEFI services
+ - Linux kernel: linux-yocto-5.15
+ - Linux kernel with PREEMPT\_RT support: linux-yocto-rt-5.15
 
 Note that the Real-Time Linux kernel (PREEMPT\_RT) does not use the real-time
 architectural extensions of the Armv8-R feature set.
 
+High-Level Architecture
+-----------------------
+
+The diagram below shows the current boot flow:
+
+    +---------------------------------------------------------------+
+    |                         Linux kernel                          |
+    +---------------------------------------------------------------+
+               /|\                                     /|\
+                |                                       |
+                | UEFI services                         |
+                |                         PSCI services |
+               \|/                                      |
+        +----------------+                              |     S-EL1
+    ----|     U-Boot     |------------------------------|-----------
+        +----------------+                              |     S-EL2
+               /|\                                      |
+                |                                       |
+                |                                       |
+                |                                       |
+    +--------------------------------------------------\|/----------+
+    |                        +----------------+ +----------------+  |
+    |  boot-wrapper-aarch64  |  Device tree   | |  PSCI handler  |  |
+    |                        +----------------+ +----------------+  |
+    +---------------------------------------------------------------+
+
+
+The firmware binary (generated as `linux-system.axf`) includes
+boot-wrapper-aarch64, the flattened device tree and U-Boot. U-Boot is configured
+to automatically detect a virtio block device and boot the UEFI payload at the
+path `/efi/boot/bootaa64.efi`. Using the standard build, the first partition
+contains a Grub image at this path, which boots the Linux kernel at `/Image` on
+the same partition. The second partition of the image contains the Linux root
+file system.
+
+There is no EL3 or non-secure world in the Armv8-R AArch64 architecture, so the
+reset vector starts boot-wrapper-aarch64 at S-EL2. Boot-wrapper-aarch64 is
+compiled with the `--enable-keep-el` flag, which causes it to boot U-Boot at
+S-EL2 too. U-Boot is compiled with the `CONFIG_ARMV8_SWITCH_TO_EL1` flag, which
+causes it to switch to S-EL1 before booting Linux.
+
+The bundled device tree is passed to U-Boot via register x0. U-Boot passes the
+same device tree to Linux via the UEFI system table.
+
+Power state management is provided by PSCI services in boot-wrapper-aarch64.
+Linux accesses the PSCI handler via HVC calls to S-EL2. U-Boot has been patched
+to prevent it from overriding the exception vector at S-EL2. The PSCI handler
+memory region is added to a `/memreserve/` node in the device tree.
+
+Please note that the final firmware architecture for the fvp-baser-aemv8r64 is
+not yet stabilized. The patches in this layer are provided for development and
+evaluation purposes only, and should not be used in production firmware.
 
 Quick start: Howto Build and Run
 --------------------------------
@@ -167,6 +220,14 @@ Known Issues and Limitations
 Change Log
 ----------
 
+- Added U-Boot v2022.01 for UEFI support.
+- Updated Linux kernel version from 5.14 to 5.15 for both standard and
+  Real-Time (PREEMPT\_RT) builds.
+- Updated boot-wrapper-aarch64 revision and added support for booting U-Boot.
+- Included boot-wrapper-aarch64 PSCI services in /memreserve/ region.
+- Fixed the counter frequency initialization in boot-wrapper-aarch64.
+- Configured the FVP to use the default RAM size of 4 Gb
+- Fixed PL011 and SP805 register sizes in the device tree.
 - Added virtio_net User Networking mode by default and removed instructions
   about tap networking setup.
 - Updated Linux kernel version from 5.10 to 5.14 for both standard and
Signature · 1 line
2.25.1
Applied
#7 lore raw
In reply to Peter Hoyes
Quoted 11 lines · Peter Hoyes

These patches provide the following updates for the fvp-baser-aemv8r64 BSP:

* Add board support patches for U-Boot v2022.01, and bundle U-Boot in the boot-wrapper-aarch64 binary to provide UEFI support.
* Update boot-wrapper to more recent version and include patches to boot U-Boot at S-EL2.
* Align FVP RAM size with upstream kernel device tree.
* Enable the use_real_time FVP flag so that the counter increments using the wall clock.
* Update documentation, including a section on the new boot architecture.

Quoted 1 line

[...]

Applied, thanks!

[1/6] arm/boot-wrapper-aarch64: Upgrade to newer revision

      commit: 855e6924b371137f097f084b430b77821cdb9561
[2/6] arm-bsp/boot-wrapper-aarch64: Update patches for fvp-baser-aemv8r64
      commit: 14db960041b2fda93b116c60b1d4837302dbec6f
[3/6] arm-bsp/u-boot: Add U-Boot for fvp-baser-aemv8r64
      commit: 9359bc9163e52dd73eef62082adde1b5dac3517d
[4/6] arm-bsp/kernel: Use 4 Gb of RAM in fvp-baser-aemv8r64
      commit: d58df6ec52733a12c3adbea0504f7715999f3630
[5/6] arm-bsp/conf: Use real-time clock for fvp-baser-aemv8r64
      commit: 0519fdf444144ec7e4110cd3c0c80ab1157710d2
[6/6] arm-bsp/docs: Update fvp-baser-aemv8r64 docs
      commit: 692ca08b1d90d721eeb259a9a2708f950404cd13

Best regards,

Signature · 1 line
Jon Mason <[email protected]>