Skip to contentSkip to conversation

vexpress64: Set the DM_RNG property

PATCH Superseded Debbie Horsfall 2 participants 4 messages Sep 10, 2025 – Sep 12, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 vexpress64: Set the DM_RNG property

Enable the DM_RNG virtio random number generator driver in order to consume entropy within U-Boot. This allows U-Boot to inject entropy to the kernel via UEFI, so the kernel can use that early, for instance for address layout randomisation, or when the kernel does not provide an entropy driver itself.

---
 board/armltd/vexpress64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
board/armltd/vexpress64/Kconfig +1 -0
index 7e8709444fe..f413c51ac43 100644
@@ -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"
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 arm: vexpress64: Enable SYSRESET and SYSRESET_PSCI

Select SYSRESET on Vexpress64 to enable system reset to support other features, such as capsule-on-disk. Select SYSRESET_PSCI if PSCI is inferred from the firmware (via ARM_PSCI_FW).
Select ARM_SMCCC for Vexpress64 boards which in turn selects ARM_PSCI_FW.

The sysreset uclass unconditionally implements a reset_cpu() function. Remove the empty reset_cpu() in vexpress64 board code.

---
 arch/arm/Kconfig                     | 2 ++
 board/armltd/vexpress64/Kconfig      | 2 ++
 board/armltd/vexpress64/vexpress64.c | 5 -----
 3 files changed, 4 insertions(+), 5 deletions(-)
arch/arm/Kconfig +2 -0
index 40368abc297..d51a7619cdb 100644
@@ -1417,6 +1417,8 @@ config ARCH_VEXPRESS64
 	select MTD_NOR_FLASH if MTD
 	select FLASH_CFI_DRIVER if MTD
 	select ENV_IS_IN_FLASH if MTD
+	select SYSRESET
+	select SYSRESET_PSCI if ARM_PSCI_FW
 	imply DISTRO_DEFAULTS
 
 config TARGET_CORSTONE1000
board/armltd/vexpress64/Kconfig +2 -0
index f413c51ac43..5b10074e03f 100644
@@ -22,6 +22,7 @@ config VEXPRESS64_BASE_MODEL
 	select LINUX_KERNEL_IMAGE_HEADER
 	select POSITION_INDEPENDENT
 	imply DM_RNG
+	select ARM_SMCCC
 
 choice
 	prompt "VExpress64 board variant"
@@ -47,6 +48,7 @@ config TARGET_VEXPRESS64_JUNO
 	select USB_EHCI_GENERIC if USB
 	select USB_OHCI_HCD if USB
 	select USB_OHCI_GENERIC if USB
+	select ARM_SMCCC
 	imply OF_HAS_PRIOR_STAGE
 
 endchoice
board/armltd/vexpress64/vexpress64.c +0 -5
index 0b75c1358f0..e8f1c2fe9fe 100644
@@ -206,11 +206,6 @@ int board_fdt_blob_setup(void **fdtp)
 #endif
 #endif
 
-/* Actual reset is done via PSCI. */
-void reset_cpu(void)
-{
-}
-
 /*
  * Board specific ethernet initialization routine.
  */
Signature · 1 line
2.43.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] arm: vexpress64: Enable SYSRESET and SYSRESET_PSCI

On Wed, 10 Sep 2025 16:13:42 +0100
Debbie Horsfall <[email protected]> wrote:

Hi Debbie,

Quoted 8 lines

Select SYSRESET on Vexpress64 to enable system reset to support other features, such as capsule-on-disk. Select SYSRESET_PSCI if PSCI is inferred from the firmware (via ARM_PSCI_FW).
Select ARM_SMCCC for Vexpress64 boards which in turn selects ARM_PSCI_FW.

The sysreset uclass unconditionally implements a reset_cpu() function. Remove the empty reset_cpu() in vexpress64 board code.

Thanks for the cleanup, looks good. Tested on AEM-RevC FVP and Juno.

Quoted 1 line

Cheers,
Andre

Quoted 55 lines
---
 arch/arm/Kconfig                     | 2 ++
 board/armltd/vexpress64/Kconfig      | 2 ++
 board/armltd/vexpress64/vexpress64.c | 5 -----
 3 files changed, 4 insertions(+), 5 deletions(-)
arch/arm/Kconfig +2 -0
index 40368abc297..d51a7619cdb 100644
@@ -1417,6 +1417,8 @@ config ARCH_VEXPRESS64
 	select MTD_NOR_FLASH if MTD
 	select FLASH_CFI_DRIVER if MTD
 	select ENV_IS_IN_FLASH if MTD
+	select SYSRESET
+	select SYSRESET_PSCI if ARM_PSCI_FW
 	imply DISTRO_DEFAULTS
 
 config TARGET_CORSTONE1000
board/armltd/vexpress64/Kconfig +2 -0
index f413c51ac43..5b10074e03f 100644
@@ -22,6 +22,7 @@ config VEXPRESS64_BASE_MODEL
 	select LINUX_KERNEL_IMAGE_HEADER
 	select POSITION_INDEPENDENT
 	imply DM_RNG
+	select ARM_SMCCC
 
 choice
 	prompt "VExpress64 board variant"
@@ -47,6 +48,7 @@ config TARGET_VEXPRESS64_JUNO
 	select USB_EHCI_GENERIC if USB
 	select USB_OHCI_HCD if USB
 	select USB_OHCI_GENERIC if USB
+	select ARM_SMCCC
 	imply OF_HAS_PRIOR_STAGE
 
 endchoice
board/armltd/vexpress64/vexpress64.c +0 -5
index 0b75c1358f0..e8f1c2fe9fe 100644
@@ -206,11 +206,6 @@ int board_fdt_blob_setup(void **fdtp)
 #endif
 #endif
 
-/* Actual reset is done via PSCI. */
-void reset_cpu(void)
-{
-}
-
 /*
  * Board specific ethernet initialization routine.
  */
#3 lore raw
In reply to Debbie Horsfall

On Wed, 10 Sep 2025 16:13:41 +0100
Debbie Horsfall <[email protected]> wrote:

Hi,

Quoted 5 lines

Enable the DM_RNG virtio random number generator driver in order to consume entropy within U-Boot. This allows U-Boot to inject entropy to the kernel via UEFI, so the kernel can use that early, for instance for address layout randomisation, or when the kernel does not provide an entropy driver itself.

The change looks alright, but is a bit useless on its own, since there wouldn't be a usable entropy source by default:
- The FVP optionally provides a VIRTIO_RNG device, and this can be simply enabled on the FVP command line (*.virtio_rng.enabled=1). But the normal DTs omit the required DT node, since that would cause SErrors when the command line option is not provided, so this still doesn't show up, even when now CONFIG_VIRTIO_RNG is set.
- The FVP model can provide the ARMv8.4 FEAT_RNG system registers (cluster<x>.has_rndr=1), but the feature is not enabled in any of the VExpress64 builds. This feature uses auto-detection, so it doesn't hurt to have it always in.

So I would suggest to enable CONFIG_RNG_ARM_RNDR here as well (another imply line?), to make this more useful.

Cheers,
Andre

Quoted 18 lines
---
 board/armltd/vexpress64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
board/armltd/vexpress64/Kconfig +1 -0
index 7e8709444fe..f413c51ac43 100644
@@ -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"