mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"George McCollister" <george.mccollister@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Marcin Wojtas" <mw@semihalf.com>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	"Lars Povlsen" <lars.povlsen@microchip.com>,
	"Steen Hegelund" <Steen.Hegelund@microchip.com>,
	"Daniel Machon" <daniel.machon@microchip.com>,
	"Radhey Shyam Pandey" <radhey.shyam.pandey@amd.com>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Claudiu Beznea" <claudiu.beznea@microchip.com>,
	"Marek Vasut" <marex@denx.de>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"John Crispin" <john@phrozen.org>,
	"Madalin Bucur" <madalin.bucur@nxp.com>,
	"Ioana Ciornei" <ioana.ciornei@nxp.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Felix Fietkau" <nbd@nbd.name>,
	"Horatiu Vultur" <horatiu.vultur@microchip.com>,
	"Oleksij Rempel" <linux@rempel-privat.de>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	"Giuseppe Cavallaro" <peppe.cavallaro@st.com>,
	"Jose Abreu" <joabreu@synopsys.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Sekhar Nori" <nsekhar@ti.com>,
	"Shyam Pandey" <radhey.shyam.pandey@xilinx.com>
Cc: Woojung Huh <Woojung.Huh@microchip.com>,
	Steen Hegelund <steen.hegelund@microchip.com>,
	mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH net-next v2 05/10] dt-bindings: net: dsa: define MDIO bus child node
Date: Sat, 16 Sep 2023 14:08:57 +0300	[thread overview]
Message-ID: <20230916110902.234273-6-arinc.unal@arinc9.com> (raw)
In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com>

Some DSA subdrivers register the MDIO bus of the switch they control. Or
let the DSA driver register the MDIO bus. The node for these buses are
either required or optional, depending on the subdriver. Document this on
all of the affected DSA switch schemas.

The attributes of a DSA subdriver that lets the DSA driver register the
bus:
- ds->ops->phy_read() and ds->ops->phy_write() are present.
- ds->slave_mii_bus is not populated by the DSA subdriver.
- The bus is registered non-OF-based or OF-based. Registered OF-based if
  "mdio" child node is defined.

The affected DSA switch schemas are documented below.

- brcm,b53.yaml

drivers/net/dsa/b53/b53_common.c:
- The DSA subdriver lets the DSA driver register the bus.

---

- mediatek,mt7530.yaml

drivers/net/dsa/mt7530.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio"
  child node is defined.

---

- microchip,ksz.yaml
- microchip,lan937x.yaml

drivers/net/dsa/microchip/ksz_common.c:
- The DSA subdriver won't let the DSA driver register the bus when "mdio"
  child node is defined. Registers the bus OF-based only. Registers the bus
  when "mdio" child node is defined.
  - mdio_np = of_get_child_by_name(dev->dev->of_node, "mdio");
    if (!mdio_np)
      return 0;
    ds->slave_mii_bus = bus;

---

- nxp,sja1105.yaml

drivers/net/dsa/sja1105/sja1105_mdio.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers multiple buses OF-based only. Registers the buses when "mdios"
  child node and "nxp,sja1110-base-tx-mdio" and "nxp,sja1110-base-t1-mdio"
  compatible strings per child node under "mdios" is defined.
  - mdio_node = of_get_child_by_name(switch_node, "mdios");
    if (!mdio_node)
      return 0;
  - np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-tx-mdio");
    if (!np)
      return 0;
  - np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-t1-mdio");
    if (!np)
      return 0;

---

- qca8k.yaml

drivers/net/dsa/qca/qca8k-8xxx.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio"
  child node is defined.
  - mdio = of_get_child_by_name(priv->dev->of_node, "mdio");

---

- realtek.yaml

drivers/net/dsa/realtek/realtek-smi.c:
- The DSA subdriver won't let the DSA driver register the bus. Registers
  the bus OF-based only. Registering the bus is mandatory. Registers the
  bus when compatible string "realtek,smi-mdio" on a child node is defined.
  - mdio_np = of_get_compatible_child(priv->dev->of_node, "realtek,smi-mdio");
    if (!mdio_np)
      return -ENODEV;
    ds->slave_mii_bus = priv->slave_mii_bus;

drivers/net/dsa/realtek/realtek-mdio.c:
- The DSA subdriver lets the DSA driver register the bus.

---

- renesas,rzn1-a5psw.yaml

drivers/net/dsa/rzn1_a5psw.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers the bus OF-based only. Registers the bus when "mdio" child node
  is defined.
  -	mdio = of_get_child_by_name(dev->of_node, "mdio");
    if (of_device_is_available(mdio))
      ret = a5psw_probe_mdio(a5psw, mdio);

---

- ar9331.txt

drivers/net/dsa/qca/ar9331.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers the bus OF-based only. Registering the bus is mandatory.
  Registers the bus when "mdio" child node is defined.
  - mnp = of_get_child_by_name(np, "mdio");
    if (!mnp)
      return -ENODEV;

---

- lan9303.txt

drivers/net/dsa/lan9303-core.c:
- The DSA subdriver lets the DSA driver register the bus.

---

- lantiq-gswip.txt

drivers/net/dsa/lantiq_gswip.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - No ds->ops->phy_read() or ds->ops->phy_write().
- Registers the bus OF-based only. Registers the bus when compatible string
  "lantiq,xrx200-mdio" on a child node is defined.
  - mdio_np = of_get_compatible_child(dev->of_node, "lantiq,xrx200-mdio");
    if (mdio_np)
      err = gswip_mdio(priv, mdio_np);

---

- marvell.txt

drivers/net/dsa/mv88e6xxx/chip.c:
- The DSA subdriver won't let the DSA driver register the bus.
  - ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
- Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio"
  child node is defined.

---

- vitesse,vsc73xx.txt

drivers/net/dsa/vitesse-vsc73xx-core.c:
- The DSA subdriver lets the DSA driver register the bus.

I will convert the non json-schema documents accordingly.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
 .../devicetree/bindings/net/dsa/brcm,b53.yaml          |  7 +++++++
 .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml   |  7 +++++++
 .../devicetree/bindings/net/dsa/microchip,ksz.yaml     |  7 +++++++
 .../devicetree/bindings/net/dsa/microchip,lan937x.yaml |  3 +++
 .../devicetree/bindings/net/dsa/nxp,sja1105.yaml       |  3 ++-
 Documentation/devicetree/bindings/net/dsa/qca8k.yaml   | 10 +++++-----
 Documentation/devicetree/bindings/net/dsa/realtek.yaml |  4 ++++
 .../bindings/net/dsa/renesas,rzn1-a5psw.yaml           |  3 +++
 8 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
index 4c78c546343f..0bb2ff0cf2d0 100644
--- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
@@ -65,6 +65,13 @@ properties:
               - brcm,bcm63268-switch
           - const: brcm,bcm63xx-switch
 
+  mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus will be
+      registered non-OF-based if this is not defined.
+    $ref: /schemas/net/mdio.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index e532c6b795f4..31a7dbbf704d 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -151,6 +151,13 @@ properties:
       ethsys.
     maxItems: 1
 
+  mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus will be
+      registered non-OF-based if this is not defined.
+    $ref: /schemas/net/mdio.yaml#
+    unevaluatedProperties: false
+
 patternProperties:
   "^(ethernet-)?ports$":
     type: object
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index e51be1ac0362..20e4174fe1ab 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -49,6 +49,13 @@ properties:
       Set if the output SYNCLKO clock should be disabled. Do not mix with
       microchip,synclko-125.
 
+  mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus will be
+      registered non-OF-based if this is not defined.
+    $ref: /schemas/net/mdio.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
index d187034fb31a..33a4926b2d94 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
@@ -32,6 +32,9 @@ properties:
     maxItems: 1
 
   mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus will be
+      registered non-OF-based if this is not defined.
     $ref: /schemas/net/mdio.yaml#
     unevaluatedProperties: false
 
diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
index 3f3c4ecc6442..6838dc165d06 100644
--- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
@@ -37,7 +37,8 @@ properties:
 
   mdios:
     description:
-      The optional container node for the two MDIO buses of the SJA1110.
+      The optional container node for the two MDIO buses of the SJA1110. The bus
+      won't be registered if its node is not defined.
     type: object
 
     properties:
diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
index df64eebebe18..c472050582be 100644
--- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
@@ -60,13 +60,13 @@ properties:
       B68 on the QCA832x and B49 on the QCA833x.
 
   mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus will be
+      registered non-OF-based if this is not defined. In that case, the legacy
+      mapping will be used. With the legacy mapping, the reg corresponding to
+      the MDIO bus is the switch reg with an offset of -1.
     $ref: /schemas/net/mdio.yaml#
     unevaluatedProperties: false
-    description: Qca8k switch have an internal mdio to access switch port.
-                 If this is not present, the legacy mapping is used and the
-                 internal mdio access is used.
-                 With the legacy mapping the reg corresponding to the internal
-                 mdio is the switch reg with an offset of -1.
 
 $ref: dsa.yaml#
 
diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
index 7eb025df0df8..62ebaa4b5ae3 100644
--- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
@@ -96,6 +96,10 @@ properties:
       - '#interrupt-cells'
 
   mdio:
+    description:
+      The node for the MDIO bus of the switch. For the MDIO controlled switches,
+      this is optional and the bus will be registered non-OF-based if this is
+      not defined.
     $ref: /schemas/net/mdio.yaml#
     unevaluatedProperties: false
 
diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
index 833d2f68daa1..9ad9f5cdf688 100644
--- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
@@ -46,6 +46,9 @@ properties:
     maxItems: 1
 
   mdio:
+    description:
+      The optional node for the MDIO bus of the switch. The bus won't be
+      registered if this is not defined.
     $ref: /schemas/net/mdio.yaml#
     unevaluatedProperties: false
 
-- 
2.39.2


  parent reply	other threads:[~2023-09-16 11:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16 11:08 [PATCH net-next v2 00/10] define and enforce phylink bindings Arınç ÜNAL
2023-09-16 11:08 ` [PATCH net-next v2 01/10] net: dsa: mt7530: register OF node for internal MDIO bus Arınç ÜNAL
2023-09-16 11:08 ` [PATCH net-next v2 02/10] dt-bindings: net: dsa: microchip,lan937x: add missing ethernet on example Arınç ÜNAL
2023-09-16 11:08 ` [PATCH net-next v2 03/10] dt-bindings: net: dsa: realtek: fix MDIO bus child node restrictions Arınç ÜNAL
2023-09-16 11:08 ` [PATCH net-next v2 04/10] dt-bindings: net: dsa: nxp,sja1105: improve MDIO bus bindings Arınç ÜNAL
2023-09-18 18:22   ` Rob Herring
2023-09-16 11:08 ` Arınç ÜNAL [this message]
2023-09-16 14:11   ` [PATCH net-next v2 05/10] dt-bindings: net: dsa: define MDIO bus child node Andrew Lunn
2023-09-16 15:30     ` Arınç ÜNAL
2023-09-18 18:44   ` Rob Herring
2023-09-16 11:08 ` [PATCH net-next v2 06/10] dt-bindings: net: define phylink bindings Arınç ÜNAL
2023-09-16 11:08 ` [PATCH net-next v2 07/10] dt-bindings: net: enforce phylink bindings on certain ethernet controllers Arınç ÜNAL
2023-09-16 14:58   ` Rob Herring
2023-09-16 16:00     ` Arınç ÜNAL
2023-09-18 18:13   ` Rob Herring
2023-09-21 11:38     ` Arınç ÜNAL
2023-09-21 13:00       ` Andrew Lunn
2023-09-21 18:21         ` Arınç ÜNAL
2023-09-21 23:29           ` Andrew Lunn
2023-09-22  5:47             ` Arınç ÜNAL
2023-09-16 11:09 ` [PATCH net-next v2 08/10] dt-bindings: net: dsa: marvell: convert to json-schema Arınç ÜNAL
2023-09-16 14:05   ` Andrew Lunn
2023-09-16 15:44     ` Arınç ÜNAL
2023-09-18 18:40   ` Rob Herring
2023-09-16 11:09 ` [PATCH net-next v2 09/10] MAINTAINERS: update MARVELL 88E6XXX ETHERNET SWITCH document file name Arınç ÜNAL
2023-09-16 11:09 ` [PATCH net-next v2 10/10] dt-bindings: net: marvell-armada-370-neta: convert to json-schema Arınç ÜNAL
     [not found]   ` <169487631064.1637966.13545721653989465162.robh@kernel.org>
2023-09-16 16:15     ` Arınç ÜNAL
2023-09-22 12:40 ` [PATCH net-next v2 00/10] define and enforce phylink bindings Russell King (Oracle)
2023-09-22 21:57   ` Arınç ÜNAL
2023-09-22 22:29     ` Russell King (Oracle)
2023-09-22 22:44       ` Andrew Lunn
2023-09-23  6:06         ` Arınç ÜNAL
2023-09-23  7:51       ` Arınç ÜNAL
2023-09-23 14:54         ` Andrew Lunn
2023-09-22 22:36     ` Andrew Lunn
2023-09-23  6:28       ` Arınç ÜNAL
2023-09-23 15:12         ` Andrew Lunn
2023-09-23 17:51           ` Arınç ÜNAL
2023-09-24  3:15             ` Andrew Lunn
2023-09-24  7:49               ` Arınç ÜNAL
2023-09-24 14:55                 ` Andrew Lunn
2023-09-25  7:47                   ` Arınç ÜNAL

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=20230916110902.234273-6-arinc.unal@arinc9.com \
    --to=arinc.unal@arinc9.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=clement.leger@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.machon@microchip.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=f.fainelli@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=george.mccollister@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=joabreu@synopsys.com \
    --cc=john@phrozen.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=lars.povlsen@microchip.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rempel-privat.de \
    --cc=lorenzo@kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=magnus.damm@gmail.com \
    --cc=marex@denx.de \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mithat.guner@xeront.com \
    --cc=mw@semihalf.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=nsekhar@ti.com \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=radhey.shyam.pandey@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=woojung.huh@microchip.com \
    /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

all inboxes | Powered by JetHome®