generic: 5.15: replace ramips AR8033 fiber patch with 5.18 patches
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch
1 From 45977e58ce65ed0459edc9a0466d9dfea09463f5 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
3 Date: Thu, 23 Mar 2023 20:48:41 +0100
4 Subject: [PATCH] net: dsa: b53: mmap: add phy ops
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
10 B53_PORT_MII_PAGE registers which hangs the device.
11 This access should be done through the MDIO Mux bus controller.
12
13 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
14 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 ---
17 drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++
18 1 file changed, 14 insertions(+)
19
20 --- a/drivers/net/dsa/b53/b53_mmap.c
21 +++ b/drivers/net/dsa/b53/b53_mmap.c
22 @@ -216,6 +216,18 @@ static int b53_mmap_write64(struct b53_d
23 return 0;
24 }
25
26 +static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg,
27 + u16 *value)
28 +{
29 + return -EIO;
30 +}
31 +
32 +static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg,
33 + u16 value)
34 +{
35 + return -EIO;
36 +}
37 +
38 static const struct b53_io_ops b53_mmap_ops = {
39 .read8 = b53_mmap_read8,
40 .read16 = b53_mmap_read16,
41 @@ -227,6 +239,8 @@ static const struct b53_io_ops b53_mmap_
42 .write32 = b53_mmap_write32,
43 .write48 = b53_mmap_write48,
44 .write64 = b53_mmap_write64,
45 + .phy_read16 = b53_mmap_phy_read16,
46 + .phy_write16 = b53_mmap_phy_write16,
47 };
48
49 static int b53_mmap_probe_of(struct platform_device *pdev,