[PATCH 0/8] MPFS: add hardware RNG support and fix RNG consumers
Jamie Gibbons
jamie.gibbons at microchip.com
Thu Jun 25 14:23:17 CEST 2026
Hi all,
This series adds support for the hardware random number generator (RNG) on
the Microchip PolarFire SoC (MPFS) and fixes several related issues
uncovered during integration and testing.
The MPFS hardware RNG is accessed indirectly via the MPFS system
controller using the mailbox interface. Unlike typical memory-mapped RNGs,
the system controller mailbox is shared and non‑reentrant, which
introduces a number of integration challenges in U‑Boot, particularly
during autoboot when multiple system controller services are active.
This series addresses those challenges in various ways.
1. Fixes generic RNG command handling to correctly interpret dm_rng_read()
return values.
2. Adds missing infrastructure in the MPFS system controller driver to
explicitly receive mailbox responses.
3. Binds the MPFS RNG as a sub‑device of the system controller, mirroring
Linux behaviour and avoiding the need for a device tree node.
4. Introduces a new MPFS RNG driver implementing UCLASS_RNG.
5. Enables RNG support in the Microchip PolarFire SoC generic defconfig.
6. Replaces unbounded polling loops with regmap_read_poll_timeout().
7. Replaces an immediate -EBUSY return with a bounded wait for BUSY to clear,
preserving Linux‑equivalent semantics while avoiding spurious early‑boot
failures in U‑Boot.
8. Fixes boot-time KASLR seed generation to treat RNG as a best‑effort
entropy source, only causing a warning when entropy is temporarily
unavailable.
The resulting behaviour matches Linux semantics where possible, while
respecting U‑Boot’s single‑threaded, non‑blocking execution model. RNG
consumers receive entropy when available, and gracefully fall back when it
is not, without breaking autoboot.
All changes have been tested on the PolarFire SoC Icicle Kit ES.
Regards,
Jamie.
Jamie Gibbons (8):
cmd: rng: fix error handling for dm_rng_read()
misc: mpfs_syscontroller: add mailbox RX helper for service responses
misc: mpfs_syscontroller: bind RNG sub-device
rng: add Microchip PolarFire SoC hardware RNG driver
configs: microchip_mpfs_generic: enable MPFS RNG support
mailbox: mpfs-mbox: replace unbounded BUSY polling with bounded waits
mailbox: mpfs: add bounded wait for BUSY to clear before sending
request
boot: fdt: downgrade KASLR RNG failure to warning
boot/fdt_support.c | 13 ++-
cmd/rng.c | 2 +-
configs/microchip_mpfs_generic_defconfig | 3 +
drivers/mailbox/mpfs-mbox.c | 27 ++++--
drivers/misc/mpfs_syscontroller.c | 34 +++++++-
drivers/rng/Kconfig | 7 ++
drivers/rng/Makefile | 1 +
drivers/rng/mpfs_rng.c | 106 +++++++++++++++++++++++
include/mpfs-mailbox.h | 1 +
9 files changed, 178 insertions(+), 16 deletions(-)
create mode 100644 drivers/rng/mpfs_rng.c
--
2.43.0
More information about the U-Boot
mailing list