Thread (9 messages) 9 messages, 3 authors, 23h ago

[PATCH net-next v5 2/5] dt-bindings: net: realtek,rtl9301-mdio: add clock-frequency

flat view
HOTtoday IN NET-NEXT

From: Markus Stockhausen <hidden>
Date: 2026-10-05 07:49:49
Also in: linux-devicetree
Subsystem: networking drivers, open firmware and flattened device tree bindings, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Torvalds

Revision v5 of 2 in this series; queued in net-next as dbaa9e9e05eb on 2026-10-08.

Revisions (2)
  1. v1 [diff vs current]
  2. v5 current
The Ethernet MDIO controllers in Realtek Otto switches support several
MDC frequencies. Document the supported clock-frequency values:

- RTL838x: 2.5 MHz or 10 MHz
- RTL839x, RTL930x and RTL931x: 1.25 MHz, 2.5 MHz or 5 MHz

RTL839x has a single frequency selector shared by both MDIO buses.
Require explicitly specified frequencies to be identical and document
that a bus without clock-frequency inherits the frequency selected by
the other available bus. Use 2.5 MHz if neither bus specifies a
frequency.

There is neither an official documentation nor any obvious registers that
indicate a dependency to one of the hardware clocks. The usable setup bits
are more like hardcoded values than dividers. Without further details do
not add a clock reference.

Signed-off-by: Markus Stockhausen <redacted>
---
 .../bindings/net/realtek,rtl9301-mdio.yaml    | 44 +++++++++++++++++--
 1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
index 7f5b4897487b..139190e3f900 100644
--- a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
@@ -67,6 +67,10 @@ patternProperties:
 
     unevaluatedProperties: false
 
+required:
+  - compatible
+  - reg
+
 allOf:
   - if:
       properties:
@@ -77,8 +81,16 @@ allOf:
               - realtek,rtl8381-mdio
               - realtek,rtl8382-mdio
     then:
+      properties:
+        mdio-bus@0:
+          properties:
+            clock-frequency:
+              enum: [2500000, 10000000]
+              default: 2500000
+
       patternProperties:
         '^mdio-bus@[1-3]$': false
+
   - if:
       properties:
         compatible:
@@ -89,11 +101,37 @@ allOf:
               - realtek,rtl8393-mdio
     then:
       patternProperties:
+        '^mdio-bus@[01]$':
+          properties:
+            clock-frequency:
+              enum: [1250000, 2500000, 5000000]
+              description: |
+                RTL839x has one clock selector shared by both MDIO buses. All explicitly
+                specified clock-frequency values must be identical. A bus without this
+                property inherits the shared frequency selected by another available bus.
+                If neither available bus specifies a frequency, 2500000 Hz is used.
+
         '^mdio-bus@[2-3]$': false
 
-required:
-  - compatible
-  - reg
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - realtek,rtl9301-mdio
+              - realtek,rtl9302b-mdio
+              - realtek,rtl9302c-mdio
+              - realtek,rtl9303-mdio
+              - realtek,rtl9311-mdio
+              - realtek,rtl9312-mdio
+              - realtek,rtl9313-mdio
+    then:
+      patternProperties:
+        '^mdio-bus@[0-3]$':
+          properties:
+            clock-frequency:
+              enum: [1250000, 2500000, 5000000]
+              default: 2500000
 
 unevaluatedProperties: false
 
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help