aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bmips/patches-5.15
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-21 19:36:16 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-21 19:36:16 +0100
commit82dc16fde0337b573c543f023f3fe1d3657e17e4 (patch)
tree91e570acc66ec33b9f2a8a428dd0caedbb5ded0d /target/linux/bmips/patches-5.15
parentc6eb099db98eeb438d84a75cf5fcfe49f104be2c (diff)
downloadupstream-82dc16fde0337b573c543f023f3fe1d3657e17e4.tar.gz
upstream-82dc16fde0337b573c543f023f3fe1d3657e17e4.tar.bz2
upstream-82dc16fde0337b573c543f023f3fe1d3657e17e4.zip
bmips: disable B53 MMAP phy read/write ops
Without this change, internal and external B53 switches couldn't coexist as reported in https://github.com/openwrt/openwrt/issues/10313. In order to fix this we need to force the B53 MMAP DSA switch driver to use bcm6368-mdio-mux for accessing the PHY registers instead of its own phy_read() and phy_write() functions. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bmips/patches-5.15')
-rw-r--r--target/linux/bmips/patches-5.15/510-net-dsa-b53-mmap-disable-phy-read-write-ops.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/bmips/patches-5.15/510-net-dsa-b53-mmap-disable-phy-read-write-ops.patch b/target/linux/bmips/patches-5.15/510-net-dsa-b53-mmap-disable-phy-read-write-ops.patch
new file mode 100644
index 0000000000..3b1ee6cfa2
--- /dev/null
+++ b/target/linux/bmips/patches-5.15/510-net-dsa-b53-mmap-disable-phy-read-write-ops.patch
@@ -0,0 +1,46 @@
+From 03e31e5197a041857299c70bbbc461131156d434 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 21 Mar 2023 19:11:58 +0100
+Subject: [PATCH] net: dsa: b53: mmap: disable phy read/write ops
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+B53 MMAP switches have a MDIO Mux bus controller which should be used instead
+of phy_read() and phy_write() ops.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+---
+ drivers/net/dsa/b53/b53_mmap.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/dsa/b53/b53_mmap.c
++++ b/drivers/net/dsa/b53/b53_mmap.c
+@@ -279,6 +279,7 @@ static int b53_mmap_probe(struct platfor
+ struct b53_platform_data *pdata = pdev->dev.platform_data;
+ struct b53_mmap_priv *priv;
+ struct b53_device *dev;
++ struct dsa_switch_ops *dso;
+ int ret;
+
+ if (!pdata && np) {
+@@ -298,10 +299,19 @@ static int b53_mmap_probe(struct platfor
+
+ priv->regs = pdata->regs;
+
++ dso = devm_kzalloc(&pdev->dev, sizeof(*dso), GFP_KERNEL);
++ if (!dso)
++ return -ENOMEM;
++
+ dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, priv);
+ if (!dev)
+ return -ENOMEM;
+
++ memcpy(dso, dev->ds->ops, sizeof(*dso));
++ dso->phy_read = NULL;
++ dso->phy_write = NULL;
++ dev->ds->ops = dso;
++
+ dev->pdata = pdata;
+
+ platform_set_drvdata(pdev, dev);