Netdev List
 help / color / mirror / Atom feed
From: Markus Stockhausen <markus.stockhausen@gmx.de>
To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	chris.packham@alliedtelesis.co.nz, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
Subject: [PATCH net-next v4 2/5] dt-bindings: net: realtek,rtl9301-mdio: add clock-frequency
Date: Sat, 12 Sep 2026 15:04:48 +0200	[thread overview]
Message-ID: <20260912130451.3757276-3-markus.stockhausen@gmx.de> (raw)
In-Reply-To: <20260912130451.3757276-1-markus.stockhausen@gmx.de>

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 <markus.stockhausen@gmx.de>
---
 .../bindings/net/realtek,rtl9301-mdio.yaml    | 47 +++++++++++++++++--
 1 file changed, 44 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..c5f2289dc0eb 100644
--- a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml
@@ -56,6 +56,9 @@ patternProperties:
       reg:
         maxItems: 1
 
+      clock-frequency:
+        $ref: /schemas/types.yaml#/definitions/uint32
+
     required:
       - reg
 
@@ -67,6 +70,10 @@ patternProperties:
 
     unevaluatedProperties: false
 
+required:
+  - compatible
+  - reg
+
 allOf:
   - if:
       properties:
@@ -77,8 +84,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 +104,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


  parent reply	other threads:[~2026-09-12 13:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 13:04 [PATCH net-next v4 0/5] net: mdio: realtek-rtl9300: add bus frequency handling Markus Stockhausen
2026-09-12 13:04 ` [PATCH net-next v4 1/5] dt-bindings: net: realtek,rtl9301-mdio: restrict MDIO buses by family Markus Stockhausen
2026-09-12 13:04 ` Markus Stockhausen [this message]
2026-09-12 13:04 ` [PATCH net-next v4 3/5] net: mdio: realtek-rtl9300: convert "fwnode" left-overs to "of" Markus Stockhausen
2026-09-12 13:04 ` [PATCH net-next v4 4/5] net: mdio: realtek-rtl9300: reject duplicate MDIO bus IDs Markus Stockhausen
2026-09-12 13:04 ` [PATCH net-next v4 5/5] net: mdio: realtek-rtl9300: support non-default clock frequencies Markus Stockhausen

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=20260912130451.3757276-3-markus.stockhausen@gmx.de \
    --to=markus.stockhausen@gmx.de \
    --cc=andrew@lunn.ch \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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