Skip to contentSkip to conversation

arm-bsp/fvp-base: Merge fvp-common.inc into fvp-base.conf

PATCH Applied Debbie Martin 2 participants 5 messages Oct 20, 2023 – Oct 25, 2023 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 arm-bsp/fvp-base: Merge fvp-common.inc into fvp-base.conf

Merge the common FVP configuration in fvp-common.inc into fvp-base.conf since that is the only place it is inherited.

Drop setting MACHINE_FEATURES to "optee" because there is no optee machine feature.

---
 meta-arm-bsp/conf/machine/fvp-base.conf       | 45 +++++++++++++++--
 .../conf/machine/include/fvp-common.inc       | 50 -------------------
 2 files changed, 42 insertions(+), 53 deletions(-)
 delete mode 100644 meta-arm-bsp/conf/machine/include/fvp-common.inc
meta-arm-bsp/conf/machine/fvp-base.conf +42 -3
index 3a923bad..cc0893fa 100644
@@ -4,15 +4,54 @@
 #@NAME: Armv8-A Base Platform FVP machine
 #@DESCRIPTION: Machine configuration for Armv8-A Base Platform FVP model
 
-require conf/machine/include/fvp-common.inc
 require conf/machine/include/arm/arch-armv8a.inc
 
 TUNE_FEATURES = "aarch64"
 
+IMAGE_NAME_SUFFIX = ""
+IMAGE_FSTYPES += "wic"
+WKS_FILE ?= "fvp-base.wks"
+
+SERIAL_CONSOLES = "115200;ttyAMA0"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+KERNEL_DEVICETREE = "arm/fvp-base-revc.dtb"
+KERNEL_IMAGETYPE = "Image"
+
+EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
+
 # FVP u-boot configuration
 UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
 
-KERNEL_IMAGETYPE = "Image"
+# As this is a virtual target that will not be used in the real world there is
+# no need for real SSH keys.
+MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
+
+TEST_TARGET = "OEFVPTarget"
+TEST_TARGET_IP = "127.0.0.1:2222"
+TEST_SUITES:append = " fvp_boot fvp_devices"
+TEST_FVP_DEVICES ?= "rtc watchdog networking virtiorng cpu_hotplug"
 
+FVP_PROVIDER ?= "fvp-base-a-aem-native"
+FVP_EXE ?= "FVP_Base_RevC-2xAEMvA"
+FVP_CONFIG[bp.ve_sysregs.exit_on_shutdown] ?= "1"
+FVP_CONFIG[bp.virtio_net.enabled] ?= "1"
+FVP_CONFIG[bp.virtio_net.hostbridge.userNetworking] ?= "1"
+# Tell testimage to connect to localhost:2222, and forward that to SSH in the FVP.
+FVP_CONFIG[bp.virtio_net.hostbridge.userNetPorts] = "2222=22"
 FVP_CONFIG[bp.virtio_rng.enabled] ?= "1"
-IMAGE_NAME_SUFFIX = ""
+FVP_CONFIG[cache_state_modelled] ?= "0"
+FVP_CONFIG[bp.secureflashloader.fname] ?= "bl1-fvp.bin"
+FVP_CONFIG[bp.flashloader0.fname] ?= "fip-fvp.bin"
+FVP_CONFIG[bp.virtioblockdevice.image_path] ?= "${IMAGE_NAME}.wic"
+# Set the baseline to ARMv8.4, as the default is 8.0.
+FVP_CONFIG[cluster0.has_arm_v8-4] = "1"
+FVP_CONFIG[cluster1.has_arm_v8-4] = "1"
+FVP_CONSOLE ?= "terminal_0"
+FVP_DATA ?= "cluster0.cpu0=${KERNEL_IMAGETYPE}@0x80080000 \
+             cluster0.cpu0=fvp-base-revc.dtb@0x8fc00000"
+FVP_TERMINALS[bp.terminal_0] ?= "Console"
+FVP_TERMINALS[bp.terminal_1] ?= ""
+FVP_TERMINALS[bp.terminal_2] ?= ""
+FVP_TERMINALS[bp.terminal_3] ?= ""
+
meta-arm-bsp/conf/machine/include/fvp-common.inc deleted +0 -50

50 lines not on this page · raw message

--
2.25.1

#1 lore raw

PATCH 3/5 arm-bsp/trusted-firmware-a/fvp-base: Add stdout path and virtio net and rng

Set the Trusted Firmware devicetree to fvp-base-gicv3-psci-1t. Patch the devicetree to include: the stdout path for console access, a virtio net node and a virtio rng node. This is necessary in the case that the Trusted Firmware devicetree is passed to Linux from U-boot (rather than sideloading).

Also rename the include file to change the suffix from "fvp" to "fvp-base".

---
 ...d-stdout-path-and-virtio-net-and-rng.patch | 64 +++++++++++++++++++
 ...vp.inc => trusted-firmware-a-fvp-base.inc} |  5 ++
 .../trusted-firmware-a_%.bbappend             |  2 +-
 3 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/fvp-base/0001-fdts-fvp-base-Add-stdout-path-and-virtio-net-and-rng.patch
 rename meta-arm-bsp/recipes-bsp/trusted-firmware-a/{trusted-firmware-a-fvp.inc => trusted-firmware-a-fvp-base.inc} (50%)
meta-arm-bsp/recipes-bsp/trusted-firmware-a/files/fvp-base/0001-fdts-fvp-base-Add-stdout-path-and-virtio-net-and-rng.patch new file +64 -0
new file mode 100644
index 00000000..4d0019a5
@@ -0,0 +1,64 @@
+From b79d3cf319cc5698311ef83247110c93d3c2de2c Mon Sep 17 00:00:00 2001
+Message-Id: <b79d3cf319cc5698311ef83247110c93d3c2de2c.1695834344.git.diego.sueiro@arm.com>
+From: Diego Sueiro <[email protected]>
+Date: Wed, 27 Sep 2023 18:05:26 +0100
+Subject: [PATCH] fdts/fvp-base: Add stdout-path and virtio net and rng nodes
+
+Upstream-Status: Pending
+Signed-off-by: Diego Sueiro <[email protected]>
+---
+ fdts/fvp-base-psci-common.dtsi |  8 ++++++--
+ fdts/rtsm_ve-motherboard.dtsi  | 12 ++++++++++++
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/fdts/fvp-base-psci-common.dtsi b/fdts/fvp-base-psci-common.dtsi
+index 79cf37d3b0..b1ba5ce703 100644
+--- a/fdts/fvp-base-psci-common.dtsi
++++ b/fdts/fvp-base-psci-common.dtsi
+@@ -30,7 +30,9 @@
+ #if (ENABLE_RME == 1)
+ 	chosen { bootargs = "console=ttyAMA0 earlycon=pl011,0x1c090000 root=/dev/vda ip=on";};
+ #else
+-	chosen {};
++	chosen {
++		stdout-path = &v2m_serial0;
++	};
+ #endif
+ 
+ 	aliases {
+@@ -243,6 +245,8 @@
+ 				<0 0 39 &gic 0 GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
+ 				<0 0 40 &gic 0 GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+ 				<0 0 41 &gic 0 GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+-				<0 0 42 &gic 0 GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
++				<0 0 42 &gic 0 GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
++				<0 0 44 &gic 0 GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
++				<0 0 46 &gic 0 GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+ 	};
+ };
+diff --git a/fdts/rtsm_ve-motherboard.dtsi b/fdts/rtsm_ve-motherboard.dtsi
+index 0a824b349a..21a083a51a 100644
+--- a/fdts/rtsm_ve-motherboard.dtsi
++++ b/fdts/rtsm_ve-motherboard.dtsi
+@@ -230,6 +230,18 @@
+ 					interrupts = <42>;
+ 				};
+ 
++				virtio@150000 {
++					compatible = "virtio,mmio";
++					reg = <0x150000 0x200>;
++					interrupts = <44>;
++				};
++
++				virtio@200000 {
++					compatible = "virtio,mmio";
++					reg = <0x200000 0x200>;
++					interrupts = <46>;
++				};
++
+ 				rtc@170000 {
+ 					compatible = "arm,pl031", "arm,primecell";
+ 					reg = <0x170000 0x1000>;
+-- 
+2.39.1
+
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-fvp-base.inc renamed from meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-fvp.inc +5 -0
similarity index 50%
rename from meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-fvp.inc
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-fvp-base.inc
index ca96b448..d773e41c 100644
@@ -4,9 +4,14 @@
 # Armv8-A Base Platform FVP
 #
 
+FILESEXTRAPATHS:prepend := "${THISDIR}/files/:"
+SRC_URI:append = " file://0001-fdts-fvp-base-Add-stdout-path-and-virtio-net-and-rng.patch"
+
 COMPATIBLE_MACHINE = "fvp-base"
 TFA_PLATFORM = "fvp"
 TFA_DEBUG = "1"
 TFA_MBEDTLS = "1"
 TFA_UBOOT ?= "1"
 TFA_BUILD_TARGET = "bl1 bl2 bl31 dtbs fip"
+
+EXTRA_OEMAKE:append = " FVP_DT_PREFIX=fvp-base-gicv3-psci-1t"
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +1 -1
index 7fbcd3ab..cb482a6f 100644
@@ -4,7 +4,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files/:"
 
 MACHINE_TFA_REQUIRE ?= ""
 MACHINE_TFA_REQUIRE:corstone1000 = "trusted-firmware-a-corstone1000.inc"
-MACHINE_TFA_REQUIRE:fvp-base = "trusted-firmware-a-fvp.inc"
+MACHINE_TFA_REQUIRE:fvp-base = "trusted-firmware-a-fvp-base.inc"
 MACHINE_TFA_REQUIRE:juno = "trusted-firmware-a-juno.inc"
 MACHINE_TFA_REQUIRE:n1sdp = "trusted-firmware-a-n1sdp.inc"
 MACHINE_TFA_REQUIRE:sgi575 = "trusted-firmware-a-sgi575.inc"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 4/5 arm-bsp/u-boot/fvp-base: Configure FVP base U-boot machine and enable U-boot sysreset, CRC-32 and virtio RNG

In reply to Debbie Martin

Configure FVP base to use vexpress_fvp_defconfig as the U-boot machine.

Configure U-boot:
1. Drop the patch to pick the DRAM size from the devicetree since the FVP now specifies a devicetree.
2. Enable sysreset to reset by PSCI and patch the vexpress U-boot machine to leave the reset to PSCI in this case.
3. Enable Virtio RNG and patch the U-boot Virtio RNG driver to workaround an issue with the FVP that results in RNG calls hanging.
4. Enable the Arm64 CRC-32 instruction by default and remove the now redundant config setting.

---
 meta-arm-bsp/conf/machine/fvp-base.conf       |  2 +-
 .../recipes-bsp/u-boot/u-boot-fvp-base.inc    |  5 +-
 ...rt-vexpress64-pick-DRAM-size-from-DT.patch | 44 ----------------
 ...round-for-FVP-returning-zero-size-bu.patch | 49 +++++++++++++++++
 ...2-vexpress64-Set-the-DM_RNG-property.patch | 31 +++++++++++
 ...press64-Select-PSCI-RESET-by-default.patch | 52 +++++++++++++++++++
 ...-Imply-CONFIG_ARM64_CRC32-by-default.patch | 31 +++++++++++
 .../u-boot/u-boot/fvp-base/bootargs.cfg       |  2 -
 8 files changed, 168 insertions(+), 48 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0001-Revert-vexpress64-pick-DRAM-size-from-DT.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0001-virtio-rng-Workaround-for-FVP-returning-zero-size-bu.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0002-vexpress64-Set-the-DM_RNG-property.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0003-vexpress64-Select-PSCI-RESET-by-default.patch
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0004-vexpress64-Imply-CONFIG_ARM64_CRC32-by-default.patch
meta-arm-bsp/conf/machine/fvp-base.conf +1 -1
index cc0893fa..940a4330 100644
@@ -21,7 +21,7 @@ KERNEL_IMAGETYPE = "Image"
 EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
 
 # FVP u-boot configuration
-UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
+UBOOT_MACHINE = "vexpress_fvp_defconfig"
 
 # As this is a virtual target that will not be used in the real world there is
 # no need for real SSH keys.
meta-arm-bsp/recipes-bsp/u-boot/u-boot-fvp-base.inc +4 -1
index 21046724..e1fcb1f2 100644
@@ -1,5 +1,8 @@
 # FVP base specific U-boot support
 
 SRC_URI:append = " file://bootargs.cfg \
-    file://0001-Revert-vexpress64-pick-DRAM-size-from-DT.patch \
+    file://0001-virtio-rng-Workaround-for-FVP-returning-zero-size-bu.patch \
+    file://0002-vexpress64-Set-the-DM_RNG-property.patch \
+    file://0003-vexpress64-Select-PSCI-RESET-by-default.patch \
+    file://0004-vexpress64-Imply-CONFIG_ARM64_CRC32-by-default.patch \
     "
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0001-Revert-vexpress64-pick-DRAM-size-from-DT.patch deleted +0 -44

44 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0001-virtio-rng-Workaround-for-FVP-returning-zero-size-bu.patch new file +49 -0

49 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0002-vexpress64-Set-the-DM_RNG-property.patch new file +31 -0
new file mode 100644
index 00000000..2f99eaf8
@@ -0,0 +1,31 @@
+From 9a28caf05b8345cd19276cf7a840599bd9e37749 Mon Sep 17 00:00:00 2001
+From: Debbie Martin <[email protected]>
+Date: Fri, 25 Aug 2023 15:09:33 +0100
+Subject: [PATCH] vexpress64: Set the DM_RNG property
+
+Enable the DM_RNG virtio random number generator driver in
+in order to consume entropy within u-boot. This is necessary
+in the case that the kernel is not configured to enable the
+virtio rng driver itself.
+
+Upstream-Status: Pending
+Signed-off-by: Debbie Martin <[email protected]>
+---
+ board/armltd/vexpress64/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/board/armltd/vexpress64/Kconfig b/board/armltd/vexpress64/Kconfig
+index cf998096e4..7ae5055f59 100644
+--- a/board/armltd/vexpress64/Kconfig
++++ b/board/armltd/vexpress64/Kconfig
+@@ -21,6 +21,7 @@ config VEXPRESS64_BASE_MODEL
+ 	imply EFI_SET_TIME if DM_RTC
+ 	select LINUX_KERNEL_IMAGE_HEADER
+ 	select POSITION_INDEPENDENT
++	imply DM_RNG
+
+ choice
+ 	prompt "VExpress64 board variant"
+--
+2.25.1
+
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0003-vexpress64-Select-PSCI-RESET-by-default.patch new file +52 -0

52 lines not on this page · raw message

meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/0004-vexpress64-Imply-CONFIG_ARM64_CRC32-by-default.patch new file +31 -0
new file mode 100644
index 00000000..3d10994b
@@ -0,0 +1,31 @@
+From 98035c418c3df58817ab678037599303842ee931 Mon Sep 17 00:00:00 2001
+Message-Id: <98035c418c3df58817ab678037599303842ee931.1696397516.git.diego.sueiro@arm.com>
+From: Diego Sueiro <[email protected]>
+Date: Wed, 4 Oct 2023 06:29:12 +0100
+Subject: [PATCH 1/2] vexpress64: Imply CONFIG_ARM64_CRC32 by default
+
+Enable the Arm64 CRC-32 instruction by default for 
+vexpress64. The CRC-32 instruction is a required 
+feature of ARMv8.1 and newer. 
+
+Upstream-Status: Pending
+Signed-off-by: Diego Sueiro <[email protected]>
+---
+ board/armltd/vexpress64/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/board/armltd/vexpress64/Kconfig b/board/armltd/vexpress64/Kconfig
+index 7ae5055f59..0d161740fb 100644
+--- a/board/armltd/vexpress64/Kconfig
++++ b/board/armltd/vexpress64/Kconfig
+@@ -22,6 +22,7 @@ config VEXPRESS64_BASE_MODEL
+ 	select LINUX_KERNEL_IMAGE_HEADER
+ 	select POSITION_INDEPENDENT
+ 	imply DM_RNG
++	imply ARM64_CRC32
+ 
+ choice
+ 	prompt "VExpress64 board variant"
+-- 
+2.39.1
+
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/bootargs.cfg +0 -2
index 13f4cb47..2cf42a53 100644
@@ -1,4 +1,2 @@
 CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 root=/dev/vda1 rw rootwait"
 CONFIG_BOOTCOMMAND="booti $kernel_addr_r - $fdt_addr_r"
-# Our FVP support CRC instructions
-CONFIG_ARM64_CRC32=y
Signature · 1 line
2.25.1
#3 lore raw

PATCH 5/5 arm-bsp/fvp-base: Configure grub as the EFI provider

In reply to Debbie Martin

Configure grub as the EFI provider and remove the U-boot boot args.

---
 meta-arm-bsp/conf/machine/fvp-base.conf                   | 8 +++++---
 meta-arm-bsp/recipes-bsp/u-boot/u-boot-fvp-base.inc       | 2 +-
 .../recipes-bsp/u-boot/u-boot/fvp-base/bootargs.cfg       | 2 --
 meta-arm-bsp/wic/fvp-base.wks                             | 3 ---
 4 files changed, 6 insertions(+), 9 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/bootargs.cfg
 delete mode 100644 meta-arm-bsp/wic/fvp-base.wks
meta-arm-bsp/conf/machine/fvp-base.conf +5 -3
index 940a4330..d202a79f 100644
@@ -8,9 +8,11 @@ require conf/machine/include/arm/arch-armv8a.inc
 
 TUNE_FEATURES = "aarch64"
 
+MACHINE_FEATURES = "efi"
+
 IMAGE_NAME_SUFFIX = ""
 IMAGE_FSTYPES += "wic"
-WKS_FILE ?= "fvp-base.wks"
+WKS_FILE ?= "efi-disk.wks.in"
 
 SERIAL_CONSOLES = "115200;ttyAMA0"
 
@@ -23,6 +25,8 @@ EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
 # FVP u-boot configuration
 UBOOT_MACHINE = "vexpress_fvp_defconfig"
 
+EFI_PROVIDER ?= "grub-efi"
+
 # As this is a virtual target that will not be used in the real world there is
 # no need for real SSH keys.
 MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
@@ -48,8 +52,6 @@ FVP_CONFIG[bp.virtioblockdevice.image_path] ?= "${IMAGE_NAME}.wic"
 FVP_CONFIG[cluster0.has_arm_v8-4] = "1"
 FVP_CONFIG[cluster1.has_arm_v8-4] = "1"
 FVP_CONSOLE ?= "terminal_0"
-FVP_DATA ?= "cluster0.cpu0=${KERNEL_IMAGETYPE}@0x80080000 \
-             cluster0.cpu0=fvp-base-revc.dtb@0x8fc00000"
 FVP_TERMINALS[bp.terminal_0] ?= "Console"
 FVP_TERMINALS[bp.terminal_1] ?= ""
 FVP_TERMINALS[bp.terminal_2] ?= ""
meta-arm-bsp/recipes-bsp/u-boot/u-boot-fvp-base.inc +1 -1
index e1fcb1f2..b766181b 100644
@@ -1,6 +1,6 @@
 # FVP base specific U-boot support
 
-SRC_URI:append = " file://bootargs.cfg \
+SRC_URI:append = " \
     file://0001-virtio-rng-Workaround-for-FVP-returning-zero-size-bu.patch \
     file://0002-vexpress64-Set-the-DM_RNG-property.patch \
     file://0003-vexpress64-Select-PSCI-RESET-by-default.patch \
meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-base/bootargs.cfg deleted +0 -2
deleted file mode 100644
index 2cf42a53..00000000
@@ -1,2 +0,0 @@
-CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 root=/dev/vda1 rw rootwait"
-CONFIG_BOOTCOMMAND="booti $kernel_addr_r - $fdt_addr_r"
meta-arm-bsp/wic/fvp-base.wks deleted +0 -3
deleted file mode 100644
index 8399d042..00000000
@@ -1,3 +0,0 @@
-# For fvp-base* machines we just need to populate the rootfs partition
-
-part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024 --extra-space 100
Signature · 1 line
2.25.1
Applied
#4 lore raw
In reply to Debbie Martin
Quoted 8 lines · Debbie Martin

Merge the common FVP configuration in fvp-common.inc into fvp-base.conf since that is the only place it is inherited.

Drop setting MACHINE_FEATURES to "optee" because there is no optee machine feature.

[...]

Applied, thanks!

[2/5] arm-bsp/fvp-base: Merge fvp-common.inc into fvp-base.conf

      commit: 05d631541f58138a966f3d9f0ce3d7fd05007bd8
[3/5] arm-bsp/trusted-firmware-a/fvp-base: Add stdout path and virtio net and rng
      commit: 809b401938e7f7f786b3afce1c388836c42af052
[4/5] arm-bsp/u-boot/fvp-base: Configure FVP base U-boot machine and enable U-boot sysreset, CRC-32 and virtio RNG
      commit: e4fcfa534de5c66c1917bd11af5ca05d7cb3fa7b
[5/5] arm-bsp/fvp-base: Configure grub as the EFI provider
      commit: 0262fee5aaabc1c84552e8bebcb12da7662465ac

Best regards,

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