* [PATCH net-next 1/2] dt-bindings: net: microchip,lan8650: add reset-gpios property
@ 2026-09-09 12:53 Alessandro Zini
2026-09-09 12:53 ` [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support Alessandro Zini
0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Zini @ 2026-09-09 12:53 UTC (permalink / raw)
To: Parthiban Veerasooran, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev,
devicetree, linux-kernel, Alessandro Zini
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 <alessandro.zini@siemens.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support
2026-09-09 12:53 [PATCH net-next 1/2] dt-bindings: net: microchip,lan8650: add reset-gpios property Alessandro Zini
@ 2026-09-09 12:53 ` Alessandro Zini
2026-09-10 4:41 ` Parthiban Veerasooran
0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Zini @ 2026-09-09 12:53 UTC (permalink / raw)
To: Parthiban Veerasooran, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev,
devicetree, linux-kernel, Alessandro Zini
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 <alessandro.zini@siemens.com>
---
.../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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support
2026-09-09 12:53 ` [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support Alessandro Zini
@ 2026-09-10 4:41 ` Parthiban Veerasooran
0 siblings, 0 replies; 3+ messages in thread
From: Parthiban Veerasooran @ 2026-09-10 4:41 UTC (permalink / raw)
To: Alessandro Zini, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev,
devicetree, linux-kernel
On 09/09/26 6:23 pm, Alessandro Zini wrote:
>
> + 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-10 4:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 12:53 [PATCH net-next 1/2] dt-bindings: net: microchip,lan8650: add reset-gpios property Alessandro Zini
2026-09-09 12:53 ` [PATCH net-next 2/2] net: ethernet: microchip: lan865x: add reset-gpios support Alessandro Zini
2026-09-10 4:41 ` Parthiban Veerasooran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox