From: Sam Protsenko <semen.protsenko@linaro.org>
To: "Łukasz Stelmach" <l.stelmach@samsung.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Cc: Anand Moon <linux.amoon@gmail.com>,
Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Alim Akhtar <alim.akhtar@samsung.com>,
linux-samsung-soc@vger.kernel.org, linux-crypto@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/7] hwrng: exynos: Add support for Exynos850
Date: Tue, 18 Jun 2024 15:45:16 -0500 [thread overview]
Message-ID: <20240618204523.9563-1-semen.protsenko@linaro.org> (raw)
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
12081400.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
Changes in v2:
- Removed the patch for renaming the dt-bindings doc file
- Added the patch for using devm_clk_get_enabled() to get the clock
- Addressed all review comments for v1 series
Sam Protsenko (7):
dt-bindings: rng: Add Exynos850 support to exynos-trng
hwrng: exynos: Improve coding style
hwrng: exynos: Use devm_clk_get_enabled() to get the clock
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,exynos5250-trng.yaml | 40 +++-
arch/arm64/boot/dts/exynos/exynos850.dtsi | 8 +
drivers/char/hw_random/exynos-trng.c | 216 +++++++++++++-----
3 files changed, 206 insertions(+), 58 deletions(-)
--
2.39.2
next reply other threads:[~2024-06-18 20:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 20:45 Sam Protsenko [this message]
2024-06-18 20:45 ` [PATCH v2 1/7] dt-bindings: rng: Add Exynos850 support to exynos-trng Sam Protsenko
2024-06-20 7:27 ` Krzysztof Kozlowski
2024-06-18 20:45 ` [PATCH v2 2/7] hwrng: exynos: Improve coding style Sam Protsenko
2024-06-20 8:52 ` Lukasz Stelmach
2024-06-18 20:45 ` [PATCH v2 3/7] hwrng: exynos: Use devm_clk_get_enabled() to get the clock Sam Protsenko
2024-06-20 7:29 ` Krzysztof Kozlowski
2024-06-20 9:27 ` Anand Moon
2024-06-18 20:45 ` [PATCH v2 4/7] hwrng: exynos: Implement bus clock control Sam Protsenko
2024-06-20 7:29 ` Krzysztof Kozlowski
2024-06-20 9:27 ` Anand Moon
2024-06-18 20:45 ` [PATCH v2 5/7] hwrng: exynos: Add SMC based TRNG operation Sam Protsenko
2024-06-20 13:46 ` Lukasz Stelmach
2024-06-20 21:39 ` Sam Protsenko
2024-06-18 20:45 ` [PATCH v2 6/7] hwrng: exynos: Enable Exynos850 support Sam Protsenko
2024-06-20 7:29 ` Krzysztof Kozlowski
2024-06-20 8:47 ` Lukasz Stelmach
2024-06-18 20:45 ` [PATCH v2 7/7] arm64: dts: exynos850: Enable TRNG Sam Protsenko
2024-06-20 7:31 ` Krzysztof Kozlowski
2024-06-20 21:51 ` Sam Protsenko
2024-07-01 12:27 ` (subset) " Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618204523.9563-1-semen.protsenko@linaro.org \
--to=semen.protsenko@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=krzk+dt@kernel.org \
--cc=l.stelmach@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux.amoon@gmail.com \
--cc=olivia@selenic.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox