linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support
@ 2025-10-22 11:19 Tudor Ambarus
  2025-10-22 11:19 ` [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible Tudor Ambarus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tudor Ambarus @ 2025-10-22 11:19 UTC (permalink / raw)
  To: Łukasz Stelmach, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, Peter Griffin,
	André Draszik
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	linux-samsung-soc, linux-crypto, devicetree, linux-arm-kernel,
	linux-kernel, Tudor Ambarus

Hi,

I propose the bindings to go through the Samsung tree as well so that we
can match the compatible with the schema when pulling the DT patch.

Thanks!
ta

---
Enable GS101 TRNG support. It works well with the current Exynos850 TRNG
support. Tested on pixel 6 like this:

10141400.rng

1+0 records in
1+0 records out
100000 bytes (100 kB, 98 KiB) copied, 2.03619 s, 49.1 kB/s

rngtest 6.17
...
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=380.570; avg=385.422; max=386.964)Kibits/s
rngtest: FIPS tests speed: (min=75.092; avg=81.784; max=84.771)Mibits/s
rngtest: Program run time: 50908949 microseconds

To: Łukasz Stelmach <l.stelmach@samsung.com>
To: Olivia Mackall <olivia@selenic.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Alim Akhtar <alim.akhtar@samsung.com>
To: Peter Griffin <peter.griffin@linaro.org>
To: André Draszik <andre.draszik@linaro.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: semen.protsenko@linaro.org
Cc: willmcvicker@google.com
Cc: kernel-team@android.com
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>

---
Tudor Ambarus (2):
      dt-bindings: rng: add google,gs101-trng compatible
      arm64: dts: exynos: gs101: add TRNG node

 .../devicetree/bindings/rng/samsung,exynos5250-trng.yaml       | 10 +++++++---
 arch/arm64/boot/dts/exynos/google/gs101.dtsi                   |  9 +++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)
---
base-commit: 8ebc2add3e2d076adc5cc3e8c9bef268f7f1cb31
change-id: 20251022-gs101-trng-54b710218424

Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>



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

* [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible
  2025-10-22 11:19 [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
@ 2025-10-22 11:19 ` Tudor Ambarus
  2025-10-22 16:31   ` Krzysztof Kozlowski
  2025-10-22 11:19 ` [PATCH 2/2] arm64: dts: exynos: gs101: add TRNG node Tudor Ambarus
  2025-10-22 11:24 ` [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
  2 siblings, 1 reply; 6+ messages in thread
From: Tudor Ambarus @ 2025-10-22 11:19 UTC (permalink / raw)
  To: Łukasz Stelmach, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, Peter Griffin,
	André Draszik
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	linux-samsung-soc, linux-crypto, devicetree, linux-arm-kernel,
	linux-kernel, Tudor Ambarus

Add support for the TRNG found on GS101. It works well with the current
exynos850 TRNG support.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 .../devicetree/bindings/rng/samsung,exynos5250-trng.yaml       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml b/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml
index 1a71935d8a1906591439c03b7678538e656324b6..4cae7dccbb915cf50dfa8db86b43293a66200002 100644
--- a/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml
+++ b/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml
@@ -12,9 +12,13 @@ maintainers:
 
 properties:
   compatible:
-    enum:
-      - samsung,exynos5250-trng
-      - samsung,exynos850-trng
+    oneOf:
+      - enum:
+          - samsung,exynos5250-trng
+          - samsung,exynos850-trng
+      - items:
+          - const: google,gs101-trng
+          - const: samsung,exynos850-trng
 
   clocks:
     minItems: 1

-- 
2.51.0.915.g61a8936c21-goog



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

* [PATCH 2/2] arm64: dts: exynos: gs101: add TRNG node
  2025-10-22 11:19 [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
  2025-10-22 11:19 ` [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible Tudor Ambarus
@ 2025-10-22 11:19 ` Tudor Ambarus
  2025-10-22 11:24 ` [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
  2 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2025-10-22 11:19 UTC (permalink / raw)
  To: Łukasz Stelmach, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, Peter Griffin,
	André Draszik
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	linux-samsung-soc, linux-crypto, devicetree, linux-arm-kernel,
	linux-kernel, Tudor Ambarus

Define the TRNG node. GS101 TRNG works well with the current
Exynos850 TRNG support. Specify the Google specific compatible
in front of the Exynos one.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 arch/arm64/boot/dts/exynos/google/gs101.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
index d06d1d05f36408137a8acd98e43d48ea7d4f4292..380f7e70910ab8bcc28690782532fff87ca7e30b 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
@@ -630,6 +630,15 @@ watchdog_cl1: watchdog@10070000 {
 			status = "disabled";
 		};
 
+		trng: rng@10141400 {
+			compatible = "google,gs101-trng",
+				     "samsung,exynos850-trng";
+			reg = <0x10141400 0x100>;
+			clocks = <&cmu_misc CLK_GOUT_MISC_SSS_I_ACLK>,
+				 <&cmu_misc CLK_GOUT_MISC_SSS_I_PCLK>;
+			clock-names = "secss", "pclk";
+		};
+
 		gic: interrupt-controller@10400000 {
 			compatible = "arm,gic-v3";
 			#address-cells = <0>;

-- 
2.51.0.915.g61a8936c21-goog



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

* Re: [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support
  2025-10-22 11:19 [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
  2025-10-22 11:19 ` [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible Tudor Ambarus
  2025-10-22 11:19 ` [PATCH 2/2] arm64: dts: exynos: gs101: add TRNG node Tudor Ambarus
@ 2025-10-22 11:24 ` Tudor Ambarus
  2 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2025-10-22 11:24 UTC (permalink / raw)
  To: Łukasz Stelmach, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, Peter Griffin,
	André Draszik
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	linux-samsung-soc, linux-crypto, devicetree, linux-arm-kernel,
	linux-kernel



On 10/22/25 12:19 PM, Tudor Ambarus wrote:
> Hi,
> 
> I propose the bindings to go through the Samsung tree as well so that we
> can match the compatible with the schema when pulling the DT patch.
> 
> Thanks!
> ta
> 
> ---
> Enable GS101 TRNG support. It works well with the current Exynos850 TRNG
> support. Tested on pixel 6 like this:
> 

the commands started with # and were removed from the cover letter.
I fill them in to avoid a resubmit:

# cat /sys/devices/virtual/misc/hw_random/rng_current> 10141400.rng
> 

dd if=/dev/hwrng bs=100000 count=1 > /dev/null> 1+0 records in
> 1+0 records out
> 100000 bytes (100 kB, 98 KiB) copied, 2.03619 s, 49.1 kB/s
> 

# rngtest -c 1000 < /dev/hwrng> rngtest 6.17
> ...
> 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=380.570; avg=385.422; max=386.964)Kibits/s
> rngtest: FIPS tests speed: (min=75.092; avg=81.784; max=84.771)Mibits/s
> rngtest: Program run time: 50908949 microseconds
> 
> To: Łukasz Stelmach <l.stelmach@samsung.com>
> To: Olivia Mackall <olivia@selenic.com>
> To: Herbert Xu <herbert@gondor.apana.org.au>
> To: Rob Herring <robh@kernel.org>
> To: Krzysztof Kozlowski <krzk+dt@kernel.org>
> To: Conor Dooley <conor+dt@kernel.org>
> To: Alim Akhtar <alim.akhtar@samsung.com>
> To: Peter Griffin <peter.griffin@linaro.org>
> To: André Draszik <andre.draszik@linaro.org>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: semen.protsenko@linaro.org
> Cc: willmcvicker@google.com
> Cc: kernel-team@android.com
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: linux-crypto@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> 
> ---
> Tudor Ambarus (2):
>       dt-bindings: rng: add google,gs101-trng compatible
>       arm64: dts: exynos: gs101: add TRNG node
> 
>  .../devicetree/bindings/rng/samsung,exynos5250-trng.yaml       | 10 +++++++---
>  arch/arm64/boot/dts/exynos/google/gs101.dtsi                   |  9 +++++++++
>  2 files changed, 16 insertions(+), 3 deletions(-)
> ---
> base-commit: 8ebc2add3e2d076adc5cc3e8c9bef268f7f1cb31
> change-id: 20251022-gs101-trng-54b710218424
> 
> Best regards,



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

* Re: [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible
  2025-10-22 11:19 ` [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible Tudor Ambarus
@ 2025-10-22 16:31   ` Krzysztof Kozlowski
  2025-10-24  5:57     ` Tudor Ambarus
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-22 16:31 UTC (permalink / raw)
  To: Tudor Ambarus, Łukasz Stelmach, Olivia Mackall, Herbert Xu,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik
  Cc: semen.protsenko, willmcvicker, kernel-team, linux-samsung-soc,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel

On 22/10/2025 13:19, Tudor Ambarus wrote:
> Add support for the TRNG found on GS101. It works well with the current
> exynos850 TRNG support.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
>  .../devicetree/bindings/rng/samsung,exynos5250-trng.yaml       | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)


No power domains here? I would prefer to see such additions together
with the compatible, if that is possible.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible
  2025-10-22 16:31   ` Krzysztof Kozlowski
@ 2025-10-24  5:57     ` Tudor Ambarus
  0 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2025-10-24  5:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Łukasz Stelmach, Olivia Mackall,
	Herbert Xu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, Peter Griffin, André Draszik
  Cc: semen.protsenko, willmcvicker, kernel-team, linux-samsung-soc,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel



On 10/22/25 5:31 PM, Krzysztof Kozlowski wrote:
> On 22/10/2025 13:19, Tudor Ambarus wrote:
>> Add support for the TRNG found on GS101. It works well with the current
>> exynos850 TRNG support.
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
>> ---
>>  .../devicetree/bindings/rng/samsung,exynos5250-trng.yaml       | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> 
> No power domains here? I would prefer to see such additions together
> with the compatible, if that is possible.

It's part of the misc power domain.

I'll add the following in v2 and keep your R-b tag. Thanks!

+  power-domains:
+    maxItems: 1
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Best regards,
> Krzysztof



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

end of thread, other threads:[~2025-10-24  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 11:19 [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus
2025-10-22 11:19 ` [PATCH 1/2] dt-bindings: rng: add google,gs101-trng compatible Tudor Ambarus
2025-10-22 16:31   ` Krzysztof Kozlowski
2025-10-24  5:57     ` Tudor Ambarus
2025-10-22 11:19 ` [PATCH 2/2] arm64: dts: exynos: gs101: add TRNG node Tudor Ambarus
2025-10-22 11:24 ` [PATCH 0/2] hwrng: exynos: enable GS101 TRNG support Tudor Ambarus

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).