Skip to contentSkip to conversation

w5100: remove MMIO support

PATCH Applied Arnd Bergmann 2 participants 4 messages May 5 – May 7

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

PATCH 1/3 w5100: remove MMIO support

From: Arnd Bergmann <[email protected]>

This driver supports both SPI and MMIO based register access, but only the former has devicetree support. While MMIO mode would have worked with old-style board files, those have never defined such a device upstream.

Remove the MMIO mode, leaving SPI as the only way to use this driver, but leave it in two loadable modules. More cleanups can be done by combining the two into one file.

---
 drivers/net/ethernet/wiznet/Kconfig  |  19 +-
 drivers/net/ethernet/wiznet/Makefile |   3 +-
 drivers/net/ethernet/wiznet/w5100.c  | 350 ---------------------------
 include/linux/platform_data/wiznet.h |  23 --
 4 files changed, 3 insertions(+), 392 deletions(-)
 delete mode 100644 include/linux/platform_data/wiznet.h
drivers/net/ethernet/wiznet/Kconfig +2 -17
index 4bac2ad2d6a1..67b3376b39c7 100644
@@ -5,7 +5,6 @@
 
 config NET_VENDOR_WIZNET
 	bool "WIZnet devices"
-	depends on HAS_IOMEM
 	default y
 	help
 	  If you have a network (Ethernet) card belonging to this class, say Y.
@@ -18,8 +17,8 @@ config NET_VENDOR_WIZNET
 if NET_VENDOR_WIZNET
 
 config WIZNET_W5100
-	tristate "WIZnet W5100 Ethernet support"
-	depends on HAS_IOMEM
+	tristate "WIZnet W5100/W5200/W5500 Ethernet support for SPI mode"
+	depends on SPI
 	help
 	  Support for WIZnet W5100 chips.
 
@@ -70,18 +69,4 @@ config WIZNET_BUS_ANY
 	  Performance may decrease compared to explicitly selected bus mode.
 endchoice
 
-config WIZNET_W5100_SPI
-	tristate "WIZnet W5100/W5200/W5500 Ethernet support for SPI mode"
-	depends on WIZNET_BUS_ANY && WIZNET_W5100
-	depends on SPI
-	help
-	  In SPI mode host system accesses registers using SPI protocol
-	  (mode 0) on the SPI bus.
-
-	  Performance decreases compared to other bus interface mode.
-	  In W5100 SPI mode, burst READ/WRITE processing are not provided.
-
-	  To compile this driver as a module, choose M here: the module
-	  will be called w5100-spi.
-
 endif # NET_VENDOR_WIZNET
drivers/net/ethernet/wiznet/Makefile +1 -2
index 78104f0bf415..a97fdcdf4632 100644
@@ -1,4 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_WIZNET_W5100) += w5100.o
-obj-$(CONFIG_WIZNET_W5100_SPI) += w5100-spi.o
+obj-$(CONFIG_WIZNET_W5100) += w5100.o w5100-spi.o
 obj-$(CONFIG_WIZNET_W5300) += w5300.o
drivers/net/ethernet/wiznet/w5100.c +0 -350

377 lines not on this page · raw message

include/linux/platform_data/wiznet.h deleted +0 -23
deleted file mode 100644
index 1154c4db8a13..000000000000
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Ethernet driver for the WIZnet W5x00 chip.
- */
-
-#ifndef PLATFORM_DATA_WIZNET_H
-#define PLATFORM_DATA_WIZNET_H
-
-#include <linux/if_ether.h>
-
-struct wiznet_platform_data {
-	int	link_gpio;
-	u8	mac_addr[ETH_ALEN];
-};
-
-#ifndef CONFIG_WIZNET_BUS_SHIFT
-#define CONFIG_WIZNET_BUS_SHIFT 0
-#endif
-
-#define W5100_BUS_DIRECT_SIZE	(0x8000 << CONFIG_WIZNET_BUS_SHIFT)
-#define W5300_BUS_DIRECT_SIZE	(0x0400 << CONFIG_WIZNET_BUS_SHIFT)
-
-#endif /* PLATFORM_DATA_WIZNET_H */
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/3 : w5300: remove unused driver

From: Arnd Bergmann <[email protected]>

Unlike w5100, this driver does not support SPI mode or devicetree bindings, and is hence entirely unusable without third-party board support patches that likely haven't existed for any recent kernel version.

Remove the entire driver.

If anyone is in fact using it with their custom board files, they can bring it back and include an earlier patch I sent to add DT based probing for the GPIO lines.

---
 drivers/net/ethernet/wiznet/Kconfig  |  40 --
 drivers/net/ethernet/wiznet/Makefile |   1 -
 drivers/net/ethernet/wiznet/w5300.c  | 687 ---------------------------
 3 files changed, 728 deletions(-)
 delete mode 100644 drivers/net/ethernet/wiznet/w5300.c
drivers/net/ethernet/wiznet/Kconfig +0 -40
index 67b3376b39c7..bc83f6d389b1 100644
@@ -29,44 +29,4 @@ config WIZNET_W5100
 	  To compile this driver as a module, choose M here: the module
 	  will be called w5100.
 
-config WIZNET_W5300
-	tristate "WIZnet W5300 Ethernet support"
-	depends on HAS_IOMEM
-	help
-	  Support for WIZnet W5300 chips.
-
-	  W5300 is a single chip with integrated 10/100 Ethernet MAC,
-	  PHY and hardware TCP/IP stack, but this driver is limited to
-	  the MAC and PHY functions only, onchip TCP/IP is unused.
-
-	  To compile this driver as a module, choose M here: the module
-	  will be called w5300.
-
-choice
-	prompt "WIZnet interface mode"
-	depends on WIZNET_W5100 || WIZNET_W5300
-	default WIZNET_BUS_ANY
-
-config WIZNET_BUS_DIRECT
-	bool "Direct address bus mode"
-	help
-	  In direct address mode host system can directly access all registers
-	  after mapping to Memory-Mapped I/O space.
-
-config WIZNET_BUS_INDIRECT
-	bool "Indirect address bus mode"
-	help
-	  In indirect address mode host system indirectly accesses registers
-	  using Indirect Mode Address Register and Indirect Mode Data Register,
-	  which are directly mapped to Memory-Mapped I/O space.
-
-config WIZNET_BUS_ANY
-	bool "Select interface mode in runtime"
-	help
-	  If interface mode is unknown in compile time, it can be selected
-	  in runtime from board/platform resources configuration.
-
-	  Performance may decrease compared to explicitly selected bus mode.
-endchoice
-
 endif # NET_VENDOR_WIZNET
drivers/net/ethernet/wiznet/Makefile +0 -1
index a97fdcdf4632..502150d6ead2 100644
@@ -1,3 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_WIZNET_W5100) += w5100.o w5100-spi.o
-obj-$(CONFIG_WIZNET_W5300) += w5300.o
drivers/net/ethernet/wiznet/w5300.c deleted +0 -687

687 lines not on this page · raw message

Signature · 1 line
2.39.5
#2 lore raw

PATCH v5 3/3 w5100: remove unused gpio link detection

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Since the platform_device support is now gone, nothing ever passes a valid gpio number, and all the link state handling can go away.

An earlier version of my patch changed this to look up the GPIO descriptor from devicetree and convert it all to the modern interface, but there are no users of that binding at the moment.

Remove the gpio handling, which is now one of the last users of the legacy gpio interface in platform-independent code.

---
v5: rewrite to just remove gpio support
v4: rebase to 7.1
v3: include linux/gpio/consumer.h to avoid build failure without GPIOLIB
v2: replace CONFIG_WIZNET_BUS_SHIFT with a constant

---
 drivers/net/ethernet/wiznet/w5100-spi.c |  2 +-
 drivers/net/ethernet/wiznet/w5100.c     | 62 +------------------------
 drivers/net/ethernet/wiznet/w5100.h     |  3 +-
 3 files changed, 3 insertions(+), 64 deletions(-)
drivers/net/ethernet/wiznet/w5100-spi.c +1 -1
index 990a3cce8c0f..d2c5e99ab9c7 100644
@@ -450,7 +450,7 @@ static int w5100_spi_probe(struct spi_device *spi)
 		return -EINVAL;
 	}
 
-	return w5100_probe(&spi->dev, ops, priv_size, mac, spi->irq, -EINVAL);
+	return w5100_probe(&spi->dev, ops, priv_size, mac, spi->irq);
 }
 
 static void w5100_spi_remove(struct spi_device *spi)
drivers/net/ethernet/wiznet/w5100.c +1 -61

130 lines not on this page · raw message

drivers/net/ethernet/wiznet/w5100.h +1 -2
index 481af3b6d9e8..76e1b8149041 100644
@@ -29,8 +29,7 @@ struct w5100_ops {
 void *w5100_ops_priv(const struct net_device *ndev);
 
 int w5100_probe(struct device *dev, const struct w5100_ops *ops,
-		int sizeof_ops_priv, const void *mac_addr, int irq,
-		int link_gpio);
+		int sizeof_ops_priv, const void *mac_addr, int irq);
 void w5100_remove(struct device *dev);
 
 extern const struct dev_pm_ops w5100_pm_ops;
Signature · 1 line
2.39.5
#3 lore raw
In reply to Arnd Bergmann
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 5 May 2026 20:04:57 +0200 you wrote:

From: Arnd Bergmann <[email protected]>

This driver supports both SPI and MMIO based register access, but only the former has devicetree support. While MMIO mode would have worked with old-style board files, those have never defined such a device upstream.

[...]

Here is the summary with links:
- [1/3,net-next] w5100: remove MMIO support

    https://git.kernel.org/netdev/net-next/c/5e138e0ec32b
  - [2/3,net-next] : w5300: remove unused driver
    https://git.kernel.org/netdev/net-next/c/68edebbd0e7d
  - [3/3,net-next,v5] w5100: remove unused gpio link detection
    https://git.kernel.org/netdev/net-next/c/dacf281771a9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html