[PATCH v2 0/3] hwrng: Add Cortina Systems CS7542 random number generator

From: Fil Dunsky via B4 Relay

Date: Tue Nov 24 2026 - 03:20:41 EST


Add the Elliptic random number generator integrated in the CS7542,
based on the GPL vendor and OpenWrt implementations. Use a syscon
regmap for its shared global scratch bit and provide bounded polling,
nonblocking pending requests and partial output through the hwrng core.

Hardware ring reseeding is limited to the documented CS7542 A1 path.
The vendor driver avoids it on A0 for erratum 28891 and substitutes a
RTC/timer-derived nonce. Reject unsupported revisions using the global
syscon identification register instead of adopting that workaround.
The saved Almond+ capture identifies the tested board as CS7542 A1.

The binding, driver and MAINTAINERS entry apply to Linux v7.4-rc4
without the pending CS75xx platform or clock/pinctrl series.

The existing OpenWrt entropy quality setting of 512 is retained for
review. The output smoke tests do not establish an entropy estimate.

The v1 sources passed binding/example checks, ARM built-in and module
builds and RAM hardware smoke tests on Almond+. The hardware test
returned EAGAIN for the first nonblocking read, then provided 4096
bytes without all-zero or repeated-block output.

No additional hardware run is claimed for v2. The generating path on
A1 is unchanged; revision checks and their error paths were tested
with the actual C code and mocked resource/regmap/hwrng interfaces.
Full ARM W=1 built-in and module builds were repeated for v2.

---
Changes in v2:
- Drop the redundant linux/mod_devicetable.h include as suggested by
Uwe Kleine-König. The existing linux/of.h provides the OF device ID.
- Restrict hardware reseeding to CS7542 A1 after inspecting the vendor
erratum 28891 workaround. Propagate revision-read failures and reject
unsupported silicon before registering the hwrng.
- Describe the hardware revision restriction and identification register
in the binding.
- Link to v1: https://lore.kernel.org/all/20261123-b4-cs7542-trng-v1-0-92d9ffcee531@xxxxxxxxx/

To: Fil Dunsky <filipp.dunsky@xxxxxxxxx>
To: Olivia Mackall <olivia@xxxxxxxxxxx>
To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
Cc: linux-crypto@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
Fil Dunsky (3):
dt-bindings: rng: Add Cortina Systems CS7542 TRNG
hwrng: Add Cortina Systems CS7542 TRNG driver
MAINTAINERS: Add Cortina Systems CS7542 TRNG support

.../bindings/rng/cortina,cs7542-trng.yaml | 43 +++++
MAINTAINERS | 7 +
drivers/char/hw_random/Kconfig | 11 ++
drivers/char/hw_random/Makefile | 1 +
drivers/char/hw_random/cs75xx-trng.c | 187 +++++++++++++++++++++
5 files changed, 249 insertions(+)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261123-b4-cs7542-trng-1a1b9f1cd392

Best regards,
--
Fil Dunsky <filipp.dunsky@xxxxxxxxx>