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