From: Konrad Dybcio <hidden> Date: 2023-08-11 20:51:04
SM8450's PRNG seems to be the same good ol' IP, except without a core
clock.
For a lack of a better idea on how to test it, /proc/crypto reports that
the selftest has gone through..
Signed-off-by: Konrad Dybcio <redacted>
---
Konrad Dybcio (3):
dt-bindings: crypto: qcom,prng: Add SM8450
crypto: qcom-rng: Make the core clock optional regardless of ACPI presence
arm64: dts: qcom: sm8450: Add PRNG
.../devicetree/bindings/crypto/qcom,prng.yaml | 24 +++++++++++++++++-----
arch/arm64/boot/dts/qcom/sm8450.dtsi | 5 +++++
drivers/crypto/qcom-rng.c | 10 +++------
3 files changed, 27 insertions(+), 12 deletions(-)
---
base-commit: 21ef7b1e17d039053edaeaf41142423810572741
change-id: 20230811-topic-8450_prng-6af00873db4d
Best regards,
--
Konrad Dybcio [off-list ref]
From: Konrad Dybcio <hidden> Date: 2023-08-11 20:51:09
SM8450's PRNG does not require a core clock reference. Add a new
compatible with a qcom,prng-ee fallback and handle that.
Signed-off-by: Konrad Dybcio <redacted>
---
.../devicetree/bindings/crypto/qcom,prng.yaml | 24 +++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
@@ -11,9 +11,13 @@ maintainers:properties:compatible:-enum:--qcom,prng# 8916 etc.--qcom,prng-ee# 8996 and later using EE+oneOf:+-enum:+-qcom,prng# 8916 etc.+-qcom,prng-ee# 8996 and later using EE+-items:+-const:qcom,sm8450-prng-ee+-const:qcom,prng-eereg:maxItems:1
From: Konrad Dybcio <hidden> Date: 2023-08-11 20:51:12
Some newer SoCs (like SM8450) do not require a clock vote for the PRNG
to function. Make it entirely optional and rely on the bindings checker
to ensure platforms that need it, consume one.
Signed-off-by: Konrad Dybcio <redacted>
---
drivers/crypto/qcom-rng.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
@@ -173,13 +173,9 @@ static int qcom_rng_probe(struct platform_device *pdev)if(IS_ERR(rng->base))returnPTR_ERR(rng->base);-/* ACPI systems have clk already on, so skip clk_get */-if(!has_acpi_companion(&pdev->dev)){-rng->clk=devm_clk_get(&pdev->dev,"core");-if(IS_ERR(rng->clk))-returnPTR_ERR(rng->clk);-}-+rng->clk=devm_clk_get_optional(&pdev->dev,"core");+if(IS_ERR(rng->clk))+returnPTR_ERR(rng->clk);rng->skip_init=(unsignedlong)device_get_match_data(&pdev->dev);
On Fri, Aug 11, 2023 at 10:50:56PM +0200, Konrad Dybcio wrote:
SM8450's PRNG does not require a core clock reference. Add a new
compatible with a qcom,prng-ee fallback and handle that.
Signed-off-by: Konrad Dybcio <redacted>
@@ -11,9 +11,13 @@ maintainers:properties:compatible:-enum:--qcom,prng# 8916 etc.--qcom,prng-ee# 8996 and later using EE+oneOf:+-enum:+-qcom,prng# 8916 etc.+-qcom,prng-ee# 8996 and later using EE+-items:+-const:qcom,sm8450-prng-ee+-const:qcom,prng-eereg:maxItems:1
On Fri, Aug 11, 2023 at 10:50:57PM +0200, Konrad Dybcio wrote:
Some newer SoCs (like SM8450) do not require a clock vote for the PRNG
to function. Make it entirely optional and rely on the bindings checker
to ensure platforms that need it, consume one.
Signed-off-by: Konrad Dybcio <redacted>
On Fri, 11 Aug 2023 22:50:55 +0200, Konrad Dybcio wrote:
SM8450's PRNG seems to be the same good ol' IP, except without a core
clock.
For a lack of a better idea on how to test it, /proc/crypto reports that
the selftest has gone through..
[...]
From: Herbert Xu <herbert@gondor.apana.org.au> Date: 2023-08-18 10:28:21
On Fri, Aug 11, 2023 at 10:50:55PM +0200, Konrad Dybcio wrote:
SM8450's PRNG seems to be the same good ol' IP, except without a core
clock.
For a lack of a better idea on how to test it, /proc/crypto reports that
the selftest has gone through..
Signed-off-by: Konrad Dybcio <redacted>
---
Konrad Dybcio (3):
dt-bindings: crypto: qcom,prng: Add SM8450
crypto: qcom-rng: Make the core clock optional regardless of ACPI presence
arm64: dts: qcom: sm8450: Add PRNG
.../devicetree/bindings/crypto/qcom,prng.yaml | 24 +++++++++++++++++-----
arch/arm64/boot/dts/qcom/sm8450.dtsi | 5 +++++
drivers/crypto/qcom-rng.c | 10 +++------
3 files changed, 27 insertions(+), 12 deletions(-)
---
base-commit: 21ef7b1e17d039053edaeaf41142423810572741
change-id: 20230811-topic-8450_prng-6af00873db4d
From: Om Prakash Singh <hidden> Date: 2023-08-18 16:18:43
Instead of having SoC name "qcom,sm8450-prng-ee" we could use "qcom,rng-ee" as
new IP core is not longer pseudo random number generator. so "prng" can be
changed to "rng". Clock configuration is not needed on sm8550 as well. So it is
better to use generic compatible string.
From: Krzysztof Kozlowski <hidden> Date: 2023-08-19 07:46:11
On 18/08/2023 18:17, Om Prakash Singh wrote:
Instead of having SoC name "qcom,sm8450-prng-ee" we could use "qcom,rng-ee" as
new IP core is not longer pseudo random number generator. so "prng" can be
changed to "rng". Clock configuration is not needed on sm8550 as well. So it is
better to use generic compatible string.
I am not sure if I understand your point. You mean drop "p" in "prng" or
drop specific compatible? The first depends in the block - if it is
still pseudo. The second - why? That's contradictory to what is in the
guidelines and what we have been pushing for very long time. Going
against guidelines would require proper justification (and not some
usual justification "I don't need it", because we talked about this many
many times). One should not bring downstream poor practices to upstream,
but the other way. You should fix downstream code.
Best regards,
Krzysztof
From: Om Prakash Singh <hidden> Date: 2023-08-21 00:52:42
I meant first one. using "qcom,rng-ee".
I am looking for generic compatible string for all SoCs for which core clock can be optional, same as we have "qcom,prng-ee".
If we are using SoC name in compatible string, for each SoC support we need to update qcom,prng.yaml file.
Please suggest approach that we can followed!
Thanks,
Om
On 8/19/2023 1:15 PM, Krzysztof Kozlowski wrote:
On 18/08/2023 18:17, Om Prakash Singh wrote:
quoted
Instead of having SoC name "qcom,sm8450-prng-ee" we could use "qcom,rng-ee" as
new IP core is not longer pseudo random number generator. so "prng" can be
changed to "rng". Clock configuration is not needed on sm8550 as well. So it is
better to use generic compatible string.
I am not sure if I understand your point. You mean drop "p" in "prng" or
drop specific compatible? The first depends in the block - if it is
still pseudo. The second - why? That's contradictory to what is in the
guidelines and what we have been pushing for very long time. Going
against guidelines would require proper justification (and not some
usual justification "I don't need it", because we talked about this many
many times). One should not bring downstream poor practices to upstream,
but the other way. You should fix downstream code.
Best regards,
Krzysztof
From: Om Prakash Singh <hidden> Date: 2023-08-22 04:27:43
On 8/21/2023 11:37 AM, Krzysztof Kozlowski wrote:
On 21/08/2023 02:52, Om Prakash Singh wrote:
quoted
I meant first one. using "qcom,rng-ee".
Then please provide some reasons.
New IP block available on SM8450 and newer platform is true random number generator with it's entropy source. Also it is NIST SP800 90B compliant.
By introducing "qcom,rng-ee" I am also planning to add hwrng support in driver.
quoted
I am looking for generic compatible string for all SoCs for which core
clock can be optional, same as we have "qcom,prng-ee".
There is a generic compatible already... but anyway, is the clock really
optional? Or just configured by firmware?
Clock is configured using security firmware.
quoted
If we are using SoC name in compatible string, for each SoC support we
need to update qcom,prng.yaml file.
From: Konrad Dybcio <hidden> Date: 2026-01-20 10:41:18
On 8/18/23 6:17 PM, Om Prakash Singh wrote:
Instead of having SoC name "qcom,sm8450-prng-ee" we could use "qcom,rng-ee" as
new IP core is not longer pseudo random number generator. so "prng" can be
changed to "rng". Clock configuration is not needed on sm8550 as well. So it is
better to use generic compatible string.
(updated the email addresses of various recipients)
Sorry for digging out this old thread, but I can't seem to find
supporting evidence for this, at least described in a in-your-face
way..
Can we determine whether the RNG generates pseudo-random numbers based
on a version number, or some other register? Would RNGv3.0 be a good
check?
I see that today we describe kodiak and talos marked as having a TRNG,
but they're much much older than 8450..
Konrad