U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] MPFS: add hardware RNG support and fix RNG consumers
@ 2026-06-25 12:23 Jamie Gibbons
  2026-06-25 12:23 ` [PATCH 1/8] cmd: rng: fix error handling for dm_rng_read() Jamie Gibbons
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Jamie Gibbons @ 2026-06-25 12:23 UTC (permalink / raw)
  To: u-boot
  Cc: Conor Dooley, Valentina Fernandez Alanis, Tom Rini, Marek Vasut,
	Leo Yu-Chi Liang, Sughosh Ganu, Heinrich Schuchardt,
	Martin Herren, Michal Simek, Adriana Nicolae, Sam Protsenko,
	jamie.gibbons

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-07-01 10:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 12:23 [PATCH 0/8] MPFS: add hardware RNG support and fix RNG consumers Jamie Gibbons
2026-06-25 12:23 ` [PATCH 1/8] cmd: rng: fix error handling for dm_rng_read() Jamie Gibbons
2026-06-25 14:38   ` Simon Glass
2026-06-25 12:23 ` [PATCH 2/8] misc: mpfs_syscontroller: add mailbox RX helper for service responses Jamie Gibbons
2026-07-01  9:45   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 3/8] misc: mpfs_syscontroller: bind RNG sub-device Jamie Gibbons
2026-07-01  9:52   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 4/8] rng: add Microchip PolarFire SoC hardware RNG driver Jamie Gibbons
2026-07-01  9:55   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 5/8] configs: microchip_mpfs_generic: enable MPFS RNG support Jamie Gibbons
2026-07-01 10:04   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 6/8] mailbox: mpfs-mbox: replace unbounded BUSY polling with bounded waits Jamie Gibbons
2026-07-01 10:05   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 7/8] mailbox: mpfs: add bounded wait for BUSY to clear before sending request Jamie Gibbons
2026-07-01 10:06   ` Conor Dooley
2026-06-25 12:23 ` [PATCH 8/8] boot: fdt: downgrade KASLR RNG failure to warning Jamie Gibbons
2026-06-25 14:38   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox