aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2023-04-30 13:45:33 +0200
committerDavid Bauer <mail@david-bauer.net>2023-05-11 23:09:04 +0200
commit523c392fe675f83f7db8460e52f7f9b99bccae65 (patch)
tree8ba2bc3d5bb3d56293f8f6cf980ebdf763d9fc82 /target/linux/generic
parent1645c34d564e0df774ec0f7bb58bcef2771703a6 (diff)
downloadupstream-523c392fe675f83f7db8460e52f7f9b99bccae65.tar.gz
upstream-523c392fe675f83f7db8460e52f7f9b99bccae65.tar.bz2
upstream-523c392fe675f83f7db8460e52f7f9b99bccae65.zip
generic: mt7530: enable PHY configuration using OF
The MT753x switches provide a switch-internal MDIO bus for the embedded PHYs. Register a OF sub-node on the switch OF-node for this internal MDIO bus. This allows to configure the embedded PHYs using device-tree. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch
new file mode 100644
index 0000000000..f9b88db995
--- /dev/null
+++ b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch
@@ -0,0 +1,43 @@
+From 1d81e51d6d79d9098013b2e8cdd677bae998c5d8 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail@david-bauer.net>
+Date: Fri, 28 Apr 2023 02:22:59 +0200
+Subject: [PATCH 1/2] mt7530: register OF node for internal MDIO bus
+
+The MT753x switches provide a switch-internal MDIO bus for the embedded
+PHYs.
+
+Register a OF sub-node on the switch OF-node for this internal MDIO bus.
+This allows to configure the embedded PHYs using device-tree.
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+---
+ drivers/net/dsa/mt7530.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/mt7530.c
++++ b/drivers/net/dsa/mt7530.c
+@@ -2081,10 +2081,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr
+ {
+ struct dsa_switch *ds = priv->ds;
+ struct device *dev = priv->dev;
++ struct device_node *np, *mnp;
+ struct mii_bus *bus;
+ static int idx;
+ int ret;
+
++ np = priv->dev->of_node;
++
+ bus = devm_mdiobus_alloc(dev);
+ if (!bus)
+ return -ENOMEM;
+@@ -2101,7 +2104,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr
+ if (priv->irq)
+ mt7530_setup_mdio_irq(priv);
+
+- ret = devm_mdiobus_register(dev, bus);
++ mnp = of_get_child_by_name(np, "mdio");
++ ret = devm_of_mdiobus_register(dev, bus, mnp);
++ of_node_put(mnp);
+ if (ret) {
+ dev_err(dev, "failed to register MDIO bus: %d\n", ret);
+ if (priv->irq)