790-35-v6.10-net-dsa-mt7530-fix-port-mirroring-for-MT7988-SoC-swi.patch 1.8 KB

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