[PATCH net-next 1/2] dt-bindings: net: microchip,lan8650: add reset-gpios property

Subsystems: microchip lan8650/1 10base-t1s macphy ethernet driver, networking drivers, open firmware and flattened device tree bindings, the rest

COLD29d

3 messages, 2 authors, 29d ago · open the first message on its own page

[PATCH net-next 1/2] dt-bindings: net: microchip,lan8650: add reset-gpios property

From: Alessandro Zini <hidden>
Date: 2026-09-09 12:54:23

Add optional reset-gpios property to describe the connection to the
hardware RESET_N pin of the LAN8650/1 MAC-PHY.

Signed-off-by: Alessandro Zini <redacted>
---
 Documentation/devicetree/bindings/net/microchip,lan8650.yaml | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
index 766ff58147ae3..1b543ce307632 100644
--- a/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
+++ b/Documentation/devicetree/bindings/net/microchip,lan8650.yaml
@@ -40,6 +40,11 @@ properties:
       Event.
     maxItems: 1
 
+  reset-gpios:
+    description:
+      GPIO connected to the active-low RESET_N pin of the MAC-PHY.
+    maxItems: 1
+
   spi-max-frequency:
     minimum: 15000000
     maximum: 25000000
-- 
2.55.0

[PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support

From: Alessandro Zini <hidden>
Date: 2026-09-09 12:54:24

Add support for an optional reset GPIO. If specified, assert the
hardware reset line for 10 us (datasheet specifies min 5 us) and allow
1 ms settle time for crystal oscillator startup before starting OA TC6
communication.

Signed-off-by: Alessandro Zini <redacted>
---
 .../net/ethernet/microchip/lan865x/lan865x.c  | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index 26a2761332a5a..62abc577be90d 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -9,6 +9,8 @@
 #include <linux/kernel.h>
 #include <linux/phy.h>
 #include <linux/oa_tc6.h>
+#include <linux/gpio/consumer.h>
+#include <linux/delay.h>
 
 #define DRV_NAME			"lan8650"
 
@@ -41,6 +43,7 @@ struct lan865x_priv {
 	struct net_device *netdev;
 	struct spi_device *spi;
 	struct oa_tc6 *tc6;
+	struct gpio_desc *reset_gpio;
 };
 
 static int lan865x_set_hw_macaddr_low_bytes(struct oa_tc6 *tc6, const u8 *mac)
@@ -346,6 +349,24 @@ static int lan865x_probe(struct spi_device *spi)
 	spi_set_drvdata(spi, priv);
 	INIT_WORK(&priv->multicast_work, lan865x_multicast_work_handler);
 
+	priv->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
+						   GPIOD_OUT_LOW);
+	if (IS_ERR(priv->reset_gpio)) {
+		ret = dev_err_probe(&spi->dev, PTR_ERR(priv->reset_gpio),
+				    "Failed to get reset GPIO\n");
+		goto free_netdev;
+	}
+
+	if (priv->reset_gpio) {
+		/* Assert hardware reset for 10 us (datasheet specifies min 5 us)
+		 * and allow 1 ms settle time for crystal oscillator startup.
+		 */
+		gpiod_set_value_cansleep(priv->reset_gpio, 1);
+		fsleep(10);
+		gpiod_set_value_cansleep(priv->reset_gpio, 0);
+		fsleep(1000);
+	}
+
 	priv->tc6 = oa_tc6_init(spi, netdev, NULL);
 	if (!priv->tc6) {
 		ret = -ENODEV;
-- 
2.55.0

Re: [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support

From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Date: 2026-09-10 04:41:12

On 09/09/26 6:23 pm, Alessandro Zini wrote:
quoted hunk

+       priv->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
+                                                  GPIOD_OUT_LOW);
+       if (IS_ERR(priv->reset_gpio)) {
+               ret = dev_err_probe(&spi->dev, PTR_ERR(priv->reset_gpio),
+                                   "Failed to get reset GPIO\n");
+               goto free_netdev;
+       }
+
+       if (priv->reset_gpio) {
+               /* Assert hardware reset for 10 us (datasheet specifies min 5 us)
+                * and allow 1 ms settle time for crystal oscillator startup.
+                */
+               gpiod_set_value_cansleep(priv->reset_gpio, 1);
+               fsleep(10);
+               gpiod_set_value_cansleep(priv->reset_gpio, 0);
+               fsleep(1000);
+       }
+
According to the OPEN_Alliance_10BASET1x_MAC-PHY_Serial_Interface_V1.1.pdf, Section 8.2 mentions the following:

reset 	This variable reflects the logical-OR of all reset sources of 	         the MAC-PHY and is TRUE when any of the reset sources are asserted. Reset sources include power-on reset (POR), software reset (see Section 9.2.4.2), and an external RESET pin (if implemented).

In my opinion, the “external RESET pin” can be considered optional. As mentioned in the specification, it would be better to move this functionality to oa_tc6.c so that any implemented MAC-PHY device can make use of it.

Best regards,
Parthiban V>          priv->tc6 = oa_tc6_init(spi, netdev, NULL);
         if (!priv->tc6) {
                 ret = -ENODEV;
--
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