mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards
@ 2021-08-31 15:32 Ahmad Fatoum
  2021-09-02  7:00 ` Rouven Czerwinski
  2021-10-04 11:26 ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-08-31 15:32 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The STM32MP1 boards call their mdio subnode mdio0, which is now skipped
since ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node").

Fix networking for them by only falling back to the mdio node name when a
child node with the correct compatible could not be found.

Fixes: ed8c7bdf8592 ("net: designware: eqos: set mdio bus device node")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/designware_eqos.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index f83ec127143c..5eee844e289a 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -824,6 +824,7 @@ static void eqos_probe_dt(struct device_d *dev, struct eqos *eqos)
 
 int eqos_probe(struct device_d *dev, const struct eqos_ops *ops, void *priv)
 {
+	struct device_node *np = dev->device_node;
 	struct mii_bus *miibus;
 	struct resource *iores;
 	struct eqos *eqos;
@@ -862,7 +863,10 @@ int eqos_probe(struct device_d *dev, const struct eqos_ops *ops, void *priv)
 	miibus->read = eqos_mdio_read;
 	miibus->write = eqos_mdio_write;
 	miibus->priv = eqos;
-	miibus->dev.device_node = of_get_child_by_name(dev->device_node, "mdio");
+
+	miibus->dev.device_node = of_get_compatible_child(np, "snps,dwmac-mdio");
+	if (!miibus->dev.device_node)
+		miibus->dev.device_node = of_get_child_by_name(np, "mdio");
 
 	ret = eqos_init(dev, eqos);
 	if (ret)
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-05  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 15:32 [PATCH master] net: designware: eqos: fix MDIO regression for STM32MP1 boards Ahmad Fatoum
2021-09-02  7:00 ` Rouven Czerwinski
2021-10-04 11:26 ` Sascha Hauer
2021-10-04 11:39   ` Ahmad Fatoum
2021-11-05  7:51     ` Ahmad Fatoum
2021-11-05  9:20       ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox