public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants
@ 2026-03-04  0:55 Daniel Golle
  2026-03-04  0:56 ` [PATCH 2/2] hwrng: mtk - add support for hw access via SMCC Daniel Golle
  2026-03-04 11:34 ` [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Golle @ 2026-03-04  0:55 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Sean Wang, Daniel Golle, linux-crypto, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

Add compatible strings for MediaTek SoCs where the hardware random number
generator is accessed via a vendor-defined Secure Monitor Call (SMC)
rather than direct MMIO register access:

  - mediatek,mt7981-rng
  - mediatek,mt7987-rng
  - mediatek,mt7988-rng

These variants require no reg, clocks, or clock-names properties since
the RNG hardware is managed by ARM Trusted Firmware-A.

Relax the $nodename pattern to also allow 'rng' in addition to the
existing 'rng@...' pattern.

Add a second example showing the minimal SMC variant binding.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 .../devicetree/bindings/rng/mtk-rng.yaml      | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/rng/mtk-rng.yaml b/Documentation/devicetree/bindings/rng/mtk-rng.yaml
index 7e8dc62e5d3a6..6074758552ac3 100644
--- a/Documentation/devicetree/bindings/rng/mtk-rng.yaml
+++ b/Documentation/devicetree/bindings/rng/mtk-rng.yaml
@@ -11,12 +11,15 @@ maintainers:
 
 properties:
   $nodename:
-    pattern: "^rng@[0-9a-f]+$"
+    pattern: "^rng(@[0-9a-f]+)?$"
 
   compatible:
     oneOf:
       - enum:
           - mediatek,mt7623-rng
+          - mediatek,mt7981-rng
+          - mediatek,mt7987-rng
+          - mediatek,mt7988-rng
       - items:
           - enum:
               - mediatek,mt7622-rng
@@ -38,9 +41,22 @@ properties:
 
 required:
   - compatible
-  - reg
-  - clocks
-  - clock-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              enum:
+                - mediatek,mt7981-rng
+                - mediatek,mt7987-rng
+                - mediatek,mt7988-rng
+    then:
+      required:
+        - reg
+        - clocks
+        - clock-names
 
 additionalProperties: false
 
@@ -53,3 +69,7 @@ examples:
             clocks = <&infracfg CLK_INFRA_TRNG>;
             clock-names = "rng";
     };
+  - |
+    rng {
+            compatible = "mediatek,mt7981-rng";
+    };
-- 
2.53.0


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

end of thread, other threads:[~2026-03-04 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-04  0:55 [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants Daniel Golle
2026-03-04  0:56 ` [PATCH 2/2] hwrng: mtk - add support for hw access via SMCC Daniel Golle
2026-03-04 11:34 ` [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants Krzysztof Kozlowski
2026-03-04 12:14   ` Daniel Golle
2026-03-04 12:18     ` Krzysztof Kozlowski
2026-03-04 12:21       ` Daniel Golle
2026-03-04 12:26         ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox