[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250528203152.628818-1-corentin.guillevic@smile.fr>
Date: Wed, 28 May 2025 22:31:51 +0200
From: Corentin Guillevic <corentin.guillevic@...le.fr>
To: Woojung Huh <woojung.huh@...rochip.com>,
UNGLinuxDriver@...rochip.com,
Andrew Lunn <andrew@...n.ch>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Marek Vasut <marex@...x.de>
Cc: Corentin Guillevic <corentin.guillevic@...le.fr>,
Woojung Huh <Woojung.Huh@...rochip.com>,
netdev@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] dt-bindings: net: dsa: microchip: add bit-banged SMI example
KSZ8863 can be configured using I2C, SPI or Microchip SMI. The latter is
similar to MDIO, but uses a different protocol. If the hardware doesn't
support this, SMI bit banging can help. This commit adds an device tree
example that uses the CONFIG_MDIO_GPIO driver for SMI bit banging.
Signed-off-by: Corentin Guillevic <corentin.guillevic@...le.fr>
---
.../bindings/net/dsa/microchip,ksz.yaml | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index 62ca63e8a26f..6cab0100065b 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -242,3 +242,60 @@ examples:
};
};
...
+ # KSZ8863 with bit-banged SMI
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ // Ethernet switch connected via SMI to the host, CPU port wired to eth0:
+ ethernet0 {
+ phy-mode = "rmii";
+
+ fixed-link {
+ speed = <100>;
+ full-duplex;
+ pause;
+ };
+ };
+
+ mdio: mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "microchip,mdio-smi0";
+ gpios = <&gpioc 1 GPIO_ACTIVE_HIGH>,
+ <&gpioa 2 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+
+ switch@0 {
+ compatible = "microchip,ksz8863";
+ reg = <0>;
+ reset-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
+ status = "okay";
+
+ ethernet-ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ lan1: port@0 {
+ reg = <0>;
+ label = "lan1";
+ phy-mode = "internal";
+ };
+ lan2: port@1 {
+ reg = <1>;
+ label = "lan2";
+ phy-mode = "internal";
+ };
+ port@2 {
+ reg = <2>;
+ label = "cpu";
+ ethernet = <ðernet0>;
+ phy-mode = "rmii";
+ microchip,rmii-clk-internal;
+
+ fixed-link {
+ speed = <100>;
+ full-duplex;
+ };
+ };
+ };
+ };
+ };
--
2.49.0
Powered by blists - more mailing lists