Skip to contentSkip to conversation

net: dsa: lantiq_gswip: split into common and MMIO parts

RFC PATCH In review Daniel Golle 1 participant 1 message Aug 16, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 19/23 net: dsa: lantiq_gswip: split into common and MMIO parts

Move all parts specific for the MMIO/SoC driver into a module of its own to prepare for supporting MDIO-connected switch ICs.

---
 drivers/net/dsa/Kconfig               |    6 +-
 drivers/net/dsa/Makefile              |    1 +
 drivers/net/dsa/lantiq_gswip.c        | 1786 +------------------------
 drivers/net/dsa/lantiq_gswip.h        |    9 +
 drivers/net/dsa/lantiq_gswip_common.c | 1774 ++++++++++++++++++++++++
 5 files changed, 1815 insertions(+), 1761 deletions(-)
 create mode 100644 drivers/net/dsa/lantiq_gswip_common.c
drivers/net/dsa/Kconfig +5 -1
index 26e54958e61e..95275f7bc701 100644
@@ -26,11 +26,15 @@ config NET_DSA_LOOP
 
 source "drivers/net/dsa/hirschmann/Kconfig"
 
+config NET_DSA_LANTIQ_COMMON
+	tristate
+	select REGMAP
+
 config NET_DSA_LANTIQ_GSWIP
 	tristate "Lantiq / Intel GSWIP"
 	depends on HAS_IOMEM
 	select NET_DSA_TAG_GSWIP
-	select REGMAP
+	select NET_DSA_LANTIQ_COMMON
 	help
 	  This enables support for the Lantiq / Intel GSWIP 2.1 found in
 	  the xrx200 / VR9 SoC.
drivers/net/dsa/Makefile +1 -0
index cb9a97340e58..ac54bf870cd6 100644
@@ -6,6 +6,7 @@ ifdef CONFIG_NET_DSA_LOOP
 obj-$(CONFIG_FIXED_PHY)		+= dsa_loop_bdinfo.o
 endif
 obj-$(CONFIG_NET_DSA_LANTIQ_GSWIP) += lantiq_gswip.o
+obj-$(CONFIG_NET_DSA_LANTIQ_COMMON) += lantiq_gswip_common.o
 obj-$(CONFIG_NET_DSA_MT7530)	+= mt7530.o
 obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
 obj-$(CONFIG_NET_DSA_MT7530_MMIO) += mt7530-mmio.o
drivers/net/dsa/lantiq_gswip.c +26 -1760

1,835 lines not on this page · raw message

drivers/net/dsa/lantiq_gswip.h +9 -0
index 8efe298a5be3..fd898991180d 100644
@@ -287,4 +287,13 @@ struct gswip_priv {
 	struct mutex pce_table_lock;
 };
 
+void gswip_disable_switch(struct gswip_priv *priv);
+
+int gswip_validate_cpu_port(struct dsa_switch *ds);
+
+int gswip_allocate_vlans(struct gswip_priv *priv);
+
+extern const struct dsa_switch_ops gswip_switch_ops;
+extern const struct phylink_mac_ops gswip_phylink_mac_ops;
+
 #endif /* __LANTIQ_GSWIP_H */
drivers/net/dsa/lantiq_gswip_common.c new file +1774 -0

1,129 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.50.1

Part of the diff is not shown here. View the raw message.