devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] hwrng: exynos: Add support for Exynos850
@ 2024-06-18  0:37 Sam Protsenko
  2024-06-18  0:37 ` [PATCH 1/7] dt-bindings: rng: Rename exynos5250-trng to exynos-trng Sam Protsenko
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Sam Protsenko @ 2024-06-18  0:37 UTC (permalink / raw)
  To: Łukasz Stelmach, Krzysztof Kozlowski, Rob Herring,
	Conor Dooley
  Cc: Olivia Mackall, Herbert Xu, Alim Akhtar, linux-samsung-soc,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel

Exynos850 has True Random Number Generator (TRNG) block which is very
similar to Exynos5250 for which the driver already exists
(exynos-trng.c). There are two differences though:
  1. Additional SSS PCLK clock has to be enabled to make TRNG registers
     accessible.
  2. All SSS registers (including TRNG area) are protected with
     TrustZone and can only be accessed from EL3 monitor. So the
     corresponding SMC calls have to be used instead to interact with
     TRNG block.

This patch series enables TRNG support on Exynos850 SoC. It was tested
on the E850-96 board running Debian rootfs like this:

    8<-------------------------------------------------------------->8
    # cat /sys/devices/virtual/misc/hw_random/rng_current
    exyswd_rng

    # dd if=/dev/hwrng bs=100000 count=1 > /dev/null
    ...
    122KB/s

    # apt install rng-tools5
    # rngtest -c 1000 < /dev/hwrng
    ...
    rngtest: starting FIPS tests...
    rngtest: bits received from input: 20000032
    rngtest: FIPS 140-2 successes: 1000
    rngtest: FIPS 140-2 failures: 0
    rngtest: FIPS 140-2(2001-10-10) Monobit: 0
    rngtest: FIPS 140-2(2001-10-10) Poker: 0
    rngtest: FIPS 140-2(2001-10-10) Runs: 0
    rngtest: FIPS 140-2(2001-10-10) Long run: 0
    rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
    rngtest: input channel speed: (min=941.855; avg=965.515;
             max=968.236)Kibits/s
    rngtest: FIPS tests speed: (min=49.542; avg=52.886;
             max=53.577)Mibits/s
    rngtest: Program run time: 20590194 microseconds
    8<-------------------------------------------------------------->8

Sam Protsenko (7):
  dt-bindings: rng: Rename exynos5250-trng to exynos-trng
  dt-bindings: rng: Add Exynos850 support to exynos-trng
  hwrng: exynos: Improve coding style
  hwrng: exynos: Implement bus clock control
  hwrng: exynos: Add SMC based TRNG operation
  hwrng: exynos: Enable Exynos850 support
  arm64: dts: exynos850: Enable TRNG

 .../bindings/rng/samsung,exynos-trng.yaml     |  85 +++++++
 .../bindings/rng/samsung,exynos5250-trng.yaml |  44 ----
 MAINTAINERS                                   |   2 +-
 arch/arm64/boot/dts/exynos/exynos850.dtsi     |   8 +
 drivers/char/hw_random/exynos-trng.c          | 216 ++++++++++++++----
 5 files changed, 266 insertions(+), 89 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rng/samsung,exynos-trng.yaml
 delete mode 100644 Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml

-- 
2.39.2


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

end of thread, other threads:[~2024-06-18 20:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18  0:37 [PATCH 0/7] hwrng: exynos: Add support for Exynos850 Sam Protsenko
2024-06-18  0:37 ` [PATCH 1/7] dt-bindings: rng: Rename exynos5250-trng to exynos-trng Sam Protsenko
2024-06-18  6:32   ` Krzysztof Kozlowski
2024-06-18  0:37 ` [PATCH 2/7] dt-bindings: rng: Add Exynos850 support " Sam Protsenko
2024-06-18  6:33   ` Krzysztof Kozlowski
2024-06-18  0:37 ` [PATCH 3/7] hwrng: exynos: Improve coding style Sam Protsenko
2024-06-18  6:34   ` Krzysztof Kozlowski
2024-06-18  0:37 ` [PATCH 4/7] hwrng: exynos: Implement bus clock control Sam Protsenko
2024-06-18  4:26   ` Anand Moon
2024-06-18 19:26     ` Sam Protsenko
2024-06-18  0:37 ` [PATCH 5/7] hwrng: exynos: Add SMC based TRNG operation Sam Protsenko
2024-06-18  6:37   ` Krzysztof Kozlowski
2024-06-18  0:37 ` [PATCH 6/7] hwrng: exynos: Enable Exynos850 support Sam Protsenko
2024-06-18  6:39   ` Krzysztof Kozlowski
2024-06-18 20:25     ` Sam Protsenko
2024-06-18  0:37 ` [PATCH 7/7] arm64: dts: exynos850: Enable TRNG Sam Protsenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).