Skip to contentSkip to conversation

*** Initial Wiznet W5500 support ***

PATCH Superseded [email protected] 2 participants 5 messages Apr 24, 2025 – Apr 28, 2025 Network drivers

v1 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

cover *** Initial Wiznet W5500 support ***

From: Jean-Marie Verdun <[email protected]>

Jean-Marie Verdun (1):
Initial support for Wiznet W5500

 drivers/net/Kconfig  |  54 ++---
 drivers/net/Makefile |   7 +-
 drivers/net/w5500.c  | 508 +++++++++++++++++++++++++++++++++++++++++++
 drivers/net/w5500.h  | 135 ++++++++++++
 4 files changed, 662 insertions(+), 42 deletions(-)
 create mode 100644 drivers/net/w5500.c
 create mode 100644 drivers/net/w5500.h
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 Initial support for Wiznet W5500

From: Jean-Marie Verdun <[email protected]>

Add support for the Wiznet W5500 spi to ethernet controller

---
 drivers/net/Kconfig  |  54 ++---
 drivers/net/Makefile |   7 +-
 drivers/net/w5500.c  | 508 +++++++++++++++++++++++++++++++++++++++++++
 drivers/net/w5500.h  | 135 ++++++++++++
 4 files changed, 662 insertions(+), 42 deletions(-)
 create mode 100644 drivers/net/w5500.c
 create mode 100644 drivers/net/w5500.h
drivers/net/Kconfig +17 -37
index a0a7890bd26..41ecc8e05dc 100644
@@ -19,6 +19,15 @@ config SPL_DM_ETH
 	depends on SPL_NET
 	def_bool y
 
+config W5500
+        bool "W5500 device driver"
+	depends on SPI
+        help
+          Enable w5500 driver
+
+	  Adds support for Wiznet W5500 device. The device must be attached
+	  to a SPI bus.
+
 config DM_MDIO
 	bool "Enable Driver Model for MDIO devices"
 	depends on PHYLIB
@@ -122,14 +131,6 @@ config AG7XXX
 	  This driver supports the Atheros AG7xxx Ethernet MAC. This MAC is
 	  present in the Atheros AR7xxx, AR9xxx and QCA9xxx MIPS chips.
 
-config AIROHA_ETH
-	bool "Airoha Ethernet QDMA Driver"
-	depends on ARCH_AIROHA
-	select PHYLIB
-	select DM_RESET
-	help
-	  This Driver support Airoha Ethernet QDMA Driver
-	  Say Y to enable support for the Airoha Ethernet QDMA.
 
 config ALTERA_TSE
 	bool "Altera Triple-Speed Ethernet MAC support"
@@ -245,13 +246,6 @@ config DWC_ETH_QOS
 	  Of Service) IP block. The IP supports many options for bus type,
 	  clocking/reset structure, and feature list.
 
-config DWC_ETH_QOS_ADI
-	bool "Synopsys DWC Ethernet QOS device support for ADI SC59x-64 parts"
-	depends on DWC_ETH_QOS
-	help
-		The Synopsis Designware Ethernet QoS IP block with the specific
-		configuration used in the ADI ADSP-SC59X 64 bit SoCs
-
 config DWC_ETH_QOS_IMX
 	bool "Synopsys DWC Ethernet QOS device support for IMX"
 	depends on DWC_ETH_QOS
@@ -867,7 +861,6 @@ config RENESAS_ETHER_SWITCH
 config RENESAS_RAVB
 	bool "Renesas Ethernet AVB MAC"
 	depends on RCAR_64
-	select BITBANGMII
 	select PHYLIB
 	select PHY_ETHERNET_ID
 	help
@@ -982,7 +975,14 @@ config TSEC_ENET
 	  This driver implements support for the (Enhanced) Three-Speed
 	  Ethernet Controller found on Freescale SoCs.
 
-source "drivers/net/mtk_eth/Kconfig"
+config MEDIATEK_ETH
+	bool "MediaTek Ethernet GMAC Driver"
+	select PHYLIB
+	select DM_GPIO
+	select DM_RESET
+	help
+	  This Driver support MediaTek Ethernet GMAC
+	  Say Y to enable support for the MediaTek Ethernet GMAC.
 
 config HIFEMAC_ETH
 	bool "HiSilicon Fast Ethernet Controller"
@@ -1016,26 +1016,6 @@ config FSL_ENETC
 	  This driver supports the NXP ENETC Ethernet controller found on some
 	  of the NXP SoCs.
 
-config FSL_ENETC_NETC_BLK_CTRL
-	bool "NXP ENETC NETC blocks control driver"
-	depends on FSL_ENETC && IMX95
-	default y if IMX95
-	help
-	  This driver configures Integrated Endpoint Register Block (IERB) and
-	  Privileged Register Block (PRB) of NETC. For i.MX platforms, it also
-	  includes the configuration of NETCMIX block.
-	  The IERB contains registers that are used for pre-boot initialization,
-	  debug, and non-customer configuration. The PRB controls global reset
-	  and global error handling for NETC. The NETCMIX block is mainly used
-	  to set MII protocol and PCS protocol of the links, it also contains
-	  settings for some other functions.
-
-config MDIO_GPIO_BITBANG
-	bool "GPIO bitbanging MDIO driver"
-	depends on DM_MDIO && DM_GPIO
-	help
-	 Driver for bitbanging MDIO
-
 config MDIO_MUX_I2CREG
 	bool "MDIO MUX accessed as a register over I2C"
 	depends on DM_MDIO_MUX && DM_I2C
drivers/net/Makefile +2 -5
index 3244d39036d..28578efb92f 100644
@@ -5,7 +5,6 @@
 
 
 obj-$(CONFIG_AG7XXX) += ag7xxx.o
-obj-$(CONFIG_AIROHA_ETH) += airoha_eth.o
 obj-$(CONFIG_ALTERA_TSE) += altera_tse.o
 obj-$(CONFIG_ASPEED_MDIO) += aspeed_mdio.o
 obj-$(CONFIG_BCM6348_ETH) += bcm6348-eth.o
@@ -20,7 +19,6 @@ obj-$(CONFIG_DM_ETH_PHY) += eth-phy-uclass.o
 obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o
 obj-$(CONFIG_DSA_SANDBOX) += dsa_sandbox.o
 obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o
-obj-$(CONFIG_DWC_ETH_QOS_ADI) += dwc_eth_qos_adi.o
 obj-$(CONFIG_DWC_ETH_QOS_IMX) += dwc_eth_qos_imx.o
 obj-$(CONFIG_DWC_ETH_QOS_INTEL) += dwc_eth_qos_intel.o
 obj-$(CONFIG_DWC_ETH_QOS_ROCKCHIP) += dwc_eth_qos_rockchip.o
@@ -46,7 +44,6 @@ obj-$(CONFIG_FEC_MXC) += fec_mxc.o
 obj-$(CONFIG_FMAN_ENET) += fm/
 obj-$(CONFIG_FMAN_ENET) += fsl_mdio.o
 obj-$(CONFIG_FSL_ENETC) += fsl_enetc.o fsl_enetc_mdio.o
-obj-$(CONFIG_FSL_ENETC_NETC_BLK_CTRL) += fsl_enetc_netc_blk_ctrl.o
 obj-$(CONFIG_FSL_LS_MDIO) += fsl_ls_mdio.o
 obj-$(CONFIG_FSL_MC_ENET) += fsl-mc/
 obj-$(CONFIG_FSL_MC_ENET) += ldpaa_eth/
@@ -64,14 +61,13 @@ obj-$(CONFIG_LITEETH) += liteeth.o
 obj-$(CONFIG_MACB) += macb.o
 obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 obj-$(CONFIG_MDIO_IPQ4019) += mdio-ipq4019.o
-obj-$(CONFIG_MDIO_GPIO_BITBANG) += mdio_gpio.o
 obj-$(CONFIG_MDIO_MUX_I2CREG) += mdio_mux_i2creg.o
 obj-$(CONFIG_MDIO_MUX_MESON_G12A) += mdio_mux_meson_g12a.o
 obj-$(CONFIG_MDIO_MUX_MESON_GXL) += mdio_mux_meson_gxl.o
 obj-$(CONFIG_MDIO_MUX_MMIOREG) += mdio_mux_mmioreg.o
 obj-$(CONFIG_MDIO_MUX_SANDBOX) += mdio_mux_sandbox.o
 obj-$(CONFIG_MDIO_SANDBOX) += mdio_sandbox.o
-obj-$(CONFIG_MEDIATEK_ETH) += mtk_eth/
+obj-$(CONFIG_MEDIATEK_ETH) += mtk_eth.o
 obj-$(CONFIG_MPC8XX_FEC) += mpc8xx_fec.o
 obj-$(CONFIG_MT7620_ETH) += mt7620-eth.o
 obj-$(CONFIG_MT7628_ETH) += mt7628-eth.o
@@ -103,6 +99,7 @@ obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
 obj-$(CONFIG_TULIP) += dc2114x.o
+obj-$(CONFIG_W5500) += w5500.o
 obj-$(CONFIG_VSC7385_ENET) += vsc7385.o
 obj-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
 obj-$(CONFIG_XILINX_AXIMRMAC) += xilinx_axi_mrmac.o
drivers/net/w5500.c new file +508 -0

508 lines not on this page · raw message

drivers/net/w5500.h new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v1 1/1] Initial support for Wiznet W5500

Quoted 5 lines · On Thu, Apr 24, 2025 at 09:43:35PM +0000, [email protected] wrote:

From: Jean-Marie Verdun <[email protected]>

Add support for the Wiznet W5500 spi to ethernet controller

Quoted 8 lines
---
 drivers/net/Kconfig  |  54 ++---
 drivers/net/Makefile |   7 +-
 drivers/net/w5500.c  | 508 +++++++++++++++++++++++++++++++++++++++++++
 drivers/net/w5500.h  | 135 ++++++++++++
 4 files changed, 662 insertions(+), 42 deletions(-)
 create mode 100644 drivers/net/w5500.c
 create mode 100644 drivers/net/w5500.h

There are spacing problems in the Kconfig file as well as a number of unrelated and incorrect changes. The Makefile also has removing of other drivers in it. Finally, the driver itself has checkpatch.pl issues to resolve. Please look in to all of this for v2, thanks.

Signature · 1 line
Tom
#3 lore raw

Re: [PATCH v1 1/1] Initial support for Wiznet W5500

Hi Tom,

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #51:
new file mode 100644

CHECK: Avoid CamelCase: <W5500_Sn_RXMEM_SIZE>
#530: FILE: drivers/net/w5500.c:475:
+ w5500_spi_write(dev, W5500_Sn_RXMEM_SIZE(0), 0x10);

CHECK: Avoid CamelCase: <W5500_Sn_TXMEM_SIZE>
#531: FILE: drivers/net/w5500.c:476:
+ w5500_spi_write(dev, W5500_Sn_TXMEM_SIZE(0), 0x10);

CHECK: Avoid CamelCase: <W5100_Sn_MR>
#592: FILE: drivers/net/w5500.h:23:
+#define W5100_Sn_MR 0x0000 /* Sn Mode Register */

CHECK: Avoid CamelCase: <W5100_Sn_CR>
#593: FILE: drivers/net/w5500.h:24:
+#define W5100_Sn_CR 0x0001 /* Sn Command Register */

CHECK: Avoid CamelCase: <W5100_Sn_IR>
#594: FILE: drivers/net/w5500.h:25:
+#define W5100_Sn_IR 0x0002 /* Sn Interrupt Register */

CHECK: Avoid CamelCase: <W5100_Sn_SR>
#595: FILE: drivers/net/w5500.h:26:
+#define W5100_Sn_SR 0x0003 /* Sn Status Register */

CHECK: Avoid CamelCase: <W5100_Sn_TX_FSR>
#596: FILE: drivers/net/w5500.h:27:
+#define W5100_Sn_TX_FSR 0x0020 /* Sn Transmit free memory size */

CHECK: Avoid CamelCase: <W5100_Sn_TX_RD>
#597: FILE: drivers/net/w5500.h:28:
+#define W5100_Sn_TX_RD 0x0022 /* Sn Transmit memory read pointer */

CHECK: Avoid CamelCase: <W5100_Sn_TX_WR>
#598: FILE: drivers/net/w5500.h:29:
+#define W5100_Sn_TX_WR 0x0024 /* Sn Transmit memory write pointer */

CHECK: Avoid CamelCase: <W5100_Sn_RX_RSR>
#599: FILE: drivers/net/w5500.h:30:
+#define W5100_Sn_RX_RSR 0x0026 /* Sn Receive free memory size */

CHECK: Avoid CamelCase: <W5100_Sn_RX_RD>
#600: FILE: drivers/net/w5500.h:31:
+#define W5100_Sn_RX_RD 0x0028 /* Sn Receive memory read pointer */

This is the errors message I am getting with checkpatch.pl from uboot repo.
All of these Macros/define are defined that way inside the linux kernel. Do you want me to adapt for uboot or is that something acceptable ?

I assumed it was acceptable, and sent a v2 of the patch. I can make a v3 without any issues if needed. What might be your guidance in such case ? Everything in uppercase ?

I didn’t added myself into the net MAINTAINER section as others dev didn’t did it. Is that something I need to fix ?

Jean-Marie

On 4/24/25, 4:55 PM, "Tom Rini" <[email protected]> wrote:

Quoted 5 lines · On Thu, Apr 24, 2025 at 09:43:35PM +0000…

From: Jean-Marie Verdun <[email protected]<mailto:[email protected]>>

Add support for the Wiznet W5500 spi to ethernet controller

Quoted 8 lines
---
 drivers/net/Kconfig  |  54 ++---
 drivers/net/Makefile |   7 +-
 drivers/net/w5500.c  | 508 +++++++++++++++++++++++++++++++++++++++++++
 drivers/net/w5500.h  | 135 ++++++++++++
 4 files changed, 662 insertions(+), 42 deletions(-)
 create mode 100644 drivers/net/w5500.c
 create mode 100644 drivers/net/w5500.h

There are spacing problems in the Kconfig file as well as a number of unrelated and incorrect changes. The Makefile also has removing of other drivers in it. Finally, the driver itself has checkpatch.pl issues to resolve. Please look in to all of this for v2, thanks.

--
Tom

#4 lore raw

Re: [PATCH v1 1/1] Initial support for Wiznet W5500

Quoted 46 lines · Jean-Marie

Hi Tom,

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #51:
new file mode 100644

CHECK: Avoid CamelCase: <W5500_Sn_RXMEM_SIZE>
#530: FILE: drivers/net/w5500.c:475:
+ w5500_spi_write(dev, W5500_Sn_RXMEM_SIZE(0), 0x10);

CHECK: Avoid CamelCase: <W5500_Sn_TXMEM_SIZE>
#531: FILE: drivers/net/w5500.c:476:
+ w5500_spi_write(dev, W5500_Sn_TXMEM_SIZE(0), 0x10);

CHECK: Avoid CamelCase: <W5100_Sn_MR>
#592: FILE: drivers/net/w5500.h:23:
+#define W5100_Sn_MR 0x0000 /* Sn Mode Register */

CHECK: Avoid CamelCase: <W5100_Sn_CR>
#593: FILE: drivers/net/w5500.h:24:
+#define W5100_Sn_CR 0x0001 /* Sn Command Register */

CHECK: Avoid CamelCase: <W5100_Sn_IR>
#594: FILE: drivers/net/w5500.h:25:
+#define W5100_Sn_IR 0x0002 /* Sn Interrupt Register */

CHECK: Avoid CamelCase: <W5100_Sn_SR>
#595: FILE: drivers/net/w5500.h:26:
+#define W5100_Sn_SR 0x0003 /* Sn Status Register */

CHECK: Avoid CamelCase: <W5100_Sn_TX_FSR>
#596: FILE: drivers/net/w5500.h:27:
+#define W5100_Sn_TX_FSR 0x0020 /* Sn Transmit free memory size */

CHECK: Avoid CamelCase: <W5100_Sn_TX_RD>
#597: FILE: drivers/net/w5500.h:28:
+#define W5100_Sn_TX_RD 0x0022 /* Sn Transmit memory read pointer */

CHECK: Avoid CamelCase: <W5100_Sn_TX_WR>
#598: FILE: drivers/net/w5500.h:29:
+#define W5100_Sn_TX_WR 0x0024 /* Sn Transmit memory write pointer */

CHECK: Avoid CamelCase: <W5100_Sn_RX_RSR>
#599: FILE: drivers/net/w5500.h:30:
+#define W5100_Sn_RX_RSR 0x0026 /* Sn Receive free memory size */

Quoted 6 lines

CHECK: Avoid CamelCase: <W5100_Sn_RX_RD>
#600: FILE: drivers/net/w5500.h:31:
+#define W5100_Sn_RX_RD 0x0028 /* Sn Receive memory read pointer */

This is the errors message I am getting with checkpatch.pl from uboot repo.
All of these Macros/define are defined that way inside the linux kernel. Do you want me to adapt for uboot or is that something acceptable ?

This part is fine then, thanks for explaining.

Quoted 2 lines

I didn’t added myself into the net MAINTAINER section as others dev didn’t did it. Is that something I need to fix ?

It would be good to list yourself somewhere for this, yes. Thanks!

Signature · 1 line
Tom