Skip to contentSkip to conversation

net: dsa: mv88e6xxx: Make global2 support mandatory

PATCH Applied Andrew Lunn 4 participants 4 messages Jan 27, 2021 – Jan 28, 2021

Subsystems (4)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

PATCH v2 1/1 net: dsa: mv88e6xxx: Make global2 support mandatory

Early generations of the mv88e6xxx did not have the global 2 registers. In order to keep the driver slim, it was decided to make the code for these registers optional. Over time, more generations of switches have been added, always supporting global 2 and adding more and more registers. No effort has been made to keep these additional registers also optional to slim the driver down when used for older generations. Optional global 2 now just gives additional development and maintenance burden for no real gain.

Make global 2 support always compiled in.

---
 drivers/net/dsa/mv88e6xxx/Kconfig   |  12 --
 drivers/net/dsa/mv88e6xxx/Makefile  |   6 +-
 drivers/net/dsa/mv88e6xxx/chip.c    |   4 -
 drivers/net/dsa/mv88e6xxx/global2.h | 194 ----------------------------
 4 files changed, 3 insertions(+), 213 deletions(-)
drivers/net/dsa/mv88e6xxx/Kconfig +0 -12
index b17540926c11..05af632b0f59 100644
@@ -9,21 +9,9 @@ config NET_DSA_MV88E6XXX
 	  This driver adds support for most of the Marvell 88E6xxx models of
 	  Ethernet switch chips, except 88E6060.
 
-config NET_DSA_MV88E6XXX_GLOBAL2
-	bool "Switch Global 2 Registers support"
-	default y
-	depends on NET_DSA_MV88E6XXX
-	help
-	  This registers set at internal SMI address 0x1C provides extended
-	  features like EEPROM interface, trunking, cross-chip setup, etc.
-
-	  It is required on most chips. If the chip you compile the support for
-	  doesn't have such registers set, say N here. In doubt, say Y.
-
 config NET_DSA_MV88E6XXX_PTP
 	bool "PTP support for Marvell 88E6xxx"
 	default n
-	depends on NET_DSA_MV88E6XXX_GLOBAL2
 	depends on PTP_1588_CLOCK
 	help
 	  Say Y to enable PTP hardware timestamping on Marvell 88E6xxx switch
drivers/net/dsa/mv88e6xxx/Makefile +3 -3
index 4b080b448ce7..c8eca2b6f959 100644
@@ -5,9 +5,9 @@ mv88e6xxx-objs += devlink.o
 mv88e6xxx-objs += global1.o
 mv88e6xxx-objs += global1_atu.o
 mv88e6xxx-objs += global1_vtu.o
-mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2) += global2.o
-mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2) += global2_avb.o
-mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2) += global2_scratch.o
+mv88e6xxx-objs += global2.o
+mv88e6xxx-objs += global2_avb.o
+mv88e6xxx-objs += global2_scratch.o
 mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_PTP) += hwtstamp.o
 mv88e6xxx-objs += phy.o
 mv88e6xxx-objs += port.o
drivers/net/dsa/mv88e6xxx/chip.c +0 -4
index 2f976050a0d7..2a70d379aa4c 100644
@@ -5227,10 +5227,6 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip)
 	/* Update the compatible info with the probed one */
 	chip->info = info;
 
-	err = mv88e6xxx_g2_require(chip);
-	if (err)
-		return err;
-
 	dev_info(chip->dev, "switch 0x%x detected: %s, revision %u\n",
 		 chip->info->prod_num, chip->info->name, rev);
 
drivers/net/dsa/mv88e6xxx/global2.h +0 -194

204 lines not on this page · raw message

Signature · 1 line
2.30.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Andrew Lunn

Early generations of the mv88e6xxx did not have the global 2 registers. In order to keep the driver slim, it was decided to make the code for these registers optional. Over time, more generations of switches have been added, always supporting global 2 and adding more and more registers. No effort has been made to keep these additional registers also optional to slim the driver down when used for older generations. Optional global 2 now just gives additional development and maintenance burden for no real gain.

Quoted 3 lines

Make global 2 support always compiled in.

Signature · 1 line
Florian
maintainer Reviewed-by Tested-by on v2 1/1
#2 lore raw
In reply to Andrew Lunn
Quoted 9 lines · Andrew Lunn

Early generations of the mv88e6xxx did not have the global 2 registers. In order to keep the driver slim, it was decided to make the code for these registers optional. Over time, more generations of switches have been added, always supporting global 2 and adding more and more registers. No effort has been made to keep these additional registers also optional to slim the driver down when used for older generations. Optional global 2 now just gives additional development and maintenance burden for no real gain.

Quoted 4 lines

Make global 2 support always compiled in.

---

#3 lore raw
In reply to Andrew Lunn
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 10 lines · On Wed, 27 Jan 2021 01:32:10 +0100 you wrote:

Early generations of the mv88e6xxx did not have the global 2 registers. In order to keep the driver slim, it was decided to make the code for these registers optional. Over time, more generations of switches have been added, always supporting global 2 and adding more and more registers. No effort has been made to keep these additional registers also optional to slim the driver down when used for older generations. Optional global 2 now just gives additional development and maintenance burden for no real gain.

[...]

Here is the summary with links:
- [net-next,v2] net: dsa: mv88e6xxx: Make global2 support mandatory

    https://git.kernel.org/netdev/net-next/c/63368a7416df

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html