1 From 019a17a5e76940ea86114838d1d638d4dc8d3750 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
3 Date: Sat, 13 Apr 2024 16:01:40 +0300
4 Subject: [PATCH 3/5] net: dsa: mt7530: fix port mirroring for MT7988 SoC
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
11 v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
12 forward control register. Currently, the MT7530 DSA subdriver configures
13 bits 0 to 2 of the CPU forward control register which breaks the port
14 mirroring feature for the MT7988 SoC switch.
16 Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
17 macros which utilise the correct bits.
19 Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
20 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
21 Acked-by: Daniel Golle <daniel@makrotopia.org>
22 Signed-off-by: David S. Miller <davem@davemloft.net>
24 drivers/net/dsa/mt7530.c | 10 ++++++----
25 1 file changed, 6 insertions(+), 4 deletions(-)
27 --- a/drivers/net/dsa/mt7530.c
28 +++ b/drivers/net/dsa/mt7530.c
29 @@ -1890,14 +1890,16 @@ mt7530_port_vlan_del(struct dsa_switch *
31 static int mt753x_mirror_port_get(unsigned int id, u32 val)
33 - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
35 + return (id == ID_MT7531 || id == ID_MT7988) ?
36 + MT7531_MIRROR_PORT_GET(val) :
40 static int mt753x_mirror_port_set(unsigned int id, u32 val)
42 - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
44 + return (id == ID_MT7531 || id == ID_MT7988) ?
45 + MT7531_MIRROR_PORT_SET(val) :
49 static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,