Netdev List
 help / color / mirror / Atom feed
* [RFC net-next 0/2] net: ethernet: add MEN Z087 driver
@ 2026-12-01 15:40 Jose Javier Rodriguez Barbarin
  2026-12-01 15:40 ` [RFC net-next 1/2] net: ethernet: add MEN Z87 driver Jose Javier Rodriguez Barbarin
  2026-12-01 15:40 ` [RFC net-next 2/2] net: ethernet: add build support for " Jose Javier Rodriguez Barbarin
  0 siblings, 2 replies; 6+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2026-12-01 15:40 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel,
	Jose Javier Rodriguez Barbarin

This series introduces an Ethernet driver for the MEN 16Z087 IP core
integrated in MCB FPGA devices.

The MAC implementation is inspired by the OpenCores Ethernet design and
connects to the external PHY through an MII interface. The driver
supports 10/100 Mbps operation and half- or full-duplex modes, subject
to the capabilities reported by the MAC. PHY access, link management,
and autonegotiation are handled through phylib.

The driver also retrieves the interface MAC address from EEPROM
over I2C, supports board-specific PHY configuration, and provides
ethtool link settings.

This is my first huge contribution so all comments/suggestions are
welcome.

Regards,

Jose Javier Rodriguez Barbarin (2):
  net: ethernet: add MEN Z87 driver
  net: ethernet: add build support for MEN Z87 driver

 MAINTAINERS                                   |    9 +
 drivers/net/ethernet/Kconfig                  |    1 +
 drivers/net/ethernet/Makefile                 |    1 +
 drivers/net/ethernet/men/Kconfig              |   33 +
 drivers/net/ethernet/men/Makefile             |    5 +
 drivers/net/ethernet/men/z87/Makefile         |    7 +
 .../net/ethernet/men/z87/men_z87_ethtool.c    |   63 +
 drivers/net/ethernet/men/z87/men_z87_hw.h     |  227 +++
 drivers/net/ethernet/men/z87/men_z87_i2c.c    |  240 +++
 drivers/net/ethernet/men/z87/men_z87_i2c.h    |   17 +
 drivers/net/ethernet/men/z87/men_z87_main.c   | 1539 +++++++++++++++++
 drivers/net/ethernet/men/z87/men_z87_main.h   |  133 ++
 drivers/net/ethernet/men/z87/men_z87_phy.c    |  673 +++++++
 drivers/net/ethernet/men/z87/men_z87_phy.h    |   27 +
 drivers/net/ethernet/men/z87/men_z87_regs.h   |   98 ++
 15 files changed, 3073 insertions(+)
 create mode 100644 drivers/net/ethernet/men/Kconfig
 create mode 100644 drivers/net/ethernet/men/Makefile
 create mode 100644 drivers/net/ethernet/men/z87/Makefile
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_ethtool.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_hw.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_i2c.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_i2c.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_main.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_main.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_phy.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_phy.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_regs.h

-- 
2.56.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RFC net-next 1/2] net: ethernet: add MEN Z87 driver
  2026-12-01 15:40 [RFC net-next 0/2] net: ethernet: add MEN Z087 driver Jose Javier Rodriguez Barbarin
@ 2026-12-01 15:40 ` Jose Javier Rodriguez Barbarin
  2026-12-01 18:27   ` Andrew Lunn
  2026-12-01 15:40 ` [RFC net-next 2/2] net: ethernet: add build support for " Jose Javier Rodriguez Barbarin
  1 sibling, 1 reply; 6+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2026-12-01 15:40 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel,
	Jose Javier Rodriguez Barbarin, Filip Jensen

Add support for 16Z087 Ethernet core on MCB devices.

The MAC is based on the OpenCores design and connects to the PHY
over MII. It supports 10/100 Mbps operation and half/full duplex
with link management handled by phylib.

Reviewed-by: Filip Jensen <dev-Felipe.Jensen@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
---
 MAINTAINERS                                   |    9 +
 drivers/net/ethernet/men/Kconfig              |   33 +
 drivers/net/ethernet/men/Makefile             |    5 +
 drivers/net/ethernet/men/z87/Makefile         |    7 +
 .../net/ethernet/men/z87/men_z87_ethtool.c    |   63 +
 drivers/net/ethernet/men/z87/men_z87_hw.h     |  227 +++
 drivers/net/ethernet/men/z87/men_z87_i2c.c    |  240 +++
 drivers/net/ethernet/men/z87/men_z87_i2c.h    |   17 +
 drivers/net/ethernet/men/z87/men_z87_main.c   | 1539 +++++++++++++++++
 drivers/net/ethernet/men/z87/men_z87_main.h   |  133 ++
 drivers/net/ethernet/men/z87/men_z87_phy.c    |  673 +++++++
 drivers/net/ethernet/men/z87/men_z87_phy.h    |   27 +
 drivers/net/ethernet/men/z87/men_z87_regs.h   |   98 ++
 13 files changed, 3071 insertions(+)
 create mode 100644 drivers/net/ethernet/men/Kconfig
 create mode 100644 drivers/net/ethernet/men/Makefile
 create mode 100644 drivers/net/ethernet/men/z87/Makefile
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_ethtool.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_hw.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_i2c.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_i2c.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_main.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_main.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_phy.c
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_phy.h
 create mode 100644 drivers/net/ethernet/men/z87/men_z87_regs.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9336fa93ce38..8ca64c2670dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -18070,6 +18070,15 @@ L:	linux-watchdog@vger.kernel.org
 S:	Maintained
 F:	drivers/watchdog/menz69_wdt.c
 
+MEN Z087 ETHERNET ADAPTER DRIVER
+M:	Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
+R:	Filip Jensen <dev-Felipe.Jensen@duagon.com>
+L:	netdev@vger.kernel.org
+S:	Maintained
+F:	drivers/net/ethernet/men/Kconfig
+F:	drivers/net/ethernet/men/Makefile
+F:	drivers/net/ethernet/men/z87/*
+
 MESON AO CEC DRIVER FOR AMLOGIC SOCS
 M:	Neil Armstrong <neil.armstrong@linaro.org>
 L:	linux-media@vger.kernel.org
diff --git a/drivers/net/ethernet/men/Kconfig b/drivers/net/ethernet/men/Kconfig
new file mode 100644
index 000000000000..34579c86e772
--- /dev/null
+++ b/drivers/net/ethernet/men/Kconfig
@@ -0,0 +1,33 @@
+#
+# MEN MCB network device configuration
+#
+
+config NET_VENDOR_MEN
+	bool "MEN MCB ethernet devices"
+	depends on I2C && MCB
+	help
+	  If you have a network (Ethernet) chipset belonging to this class,
+	  say Y.
+
+	  Note that the answer to this question does not directly affect
+	  the kernel: saying N will just cause the configurator to skip all
+	  the questions regarding MEN ip cores. If you say Y, you will be asked
+	  for your specific ip core/driver in the following questions.
+
+if NET_VENDOR_MEN
+
+config NET_MEN_Z087
+	tristate "Z087 ethernet devices"
+	depends on I2C
+	depends on MCB
+	select PHYLIB
+	select MII
+	select I2C_ALGOBIT
+	help
+	  If you have a Z087 ethernet network (Ethernet) card,
+	  answer Y here.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called men_z87_eth.
+
+endif #NET_VENDOR_MEN
diff --git a/drivers/net/ethernet/men/Makefile b/drivers/net/ethernet/men/Makefile
new file mode 100644
index 000000000000..b9dd16a1d9c6
--- /dev/null
+++ b/drivers/net/ethernet/men/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for the MEN MCB network device drivers.
+#
+
+obj-$(CONFIG_NET_MEN_Z087) += z87/
diff --git a/drivers/net/ethernet/men/z87/Makefile b/drivers/net/ethernet/men/z87/Makefile
new file mode 100644
index 000000000000..d10fe4f6508e
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the MEN Z087 network device driver.
+#
+
+obj-$(CONFIG_NET_MEN_Z087) += men_z87_eth.o
+
+men_z87_eth-y := men_z87_phy.o men_z87_ethtool.o men_z87_i2c.o men_z87_main.o
diff --git a/drivers/net/ethernet/men/z87/men_z87_ethtool.c b/drivers/net/ethernet/men/z87/men_z87_ethtool.c
new file mode 100644
index 000000000000..32598960db84
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_ethtool.c
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#include <linux/ethtool.h>
+
+#include "men_z87_main.h"
+
+#define Z87_DEF_MSG_ENABLE	  \
+	(NETIF_MSG_DRV		| \
+	 NETIF_MSG_PROBE	| \
+	 NETIF_MSG_LINK		| \
+	 NETIF_MSG_TIMER	| \
+	 NETIF_MSG_IFDOWN	| \
+	 NETIF_MSG_IFUP		| \
+	 NETIF_MSG_RX_ERR	| \
+	 NETIF_MSG_TX_ERR)
+
+static void z87_ethtool_get_drvinfo(struct net_device *dev,
+				    struct ethtool_drvinfo *info)
+{
+	struct z87_private  *np = netdev_priv(dev);
+	unsigned long flags;
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+
+	strscpy(info->driver, np->model_name, sizeof(info->driver));
+	strscpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+}
+
+static u32 z87_ethtool_get_msglevel(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	return READ_ONCE(np->msg_enable);
+}
+
+static void z87_ethtool_set_msglevel(struct net_device *dev, u32 v)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	WRITE_ONCE(np->msg_enable, v);
+}
+
+static const struct ethtool_ops men_z87_ethtool_ops = {
+	.get_drvinfo		= z87_ethtool_get_drvinfo,
+	.get_link_ksettings	= phy_ethtool_get_link_ksettings,
+	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
+	.nway_reset		= phy_ethtool_nway_reset,
+	.get_link		= ethtool_op_get_link,
+	.get_msglevel		= z87_ethtool_get_msglevel,
+	.set_msglevel		= z87_ethtool_set_msglevel,
+};
+
+const struct ethtool_ops *z87_get_ethtool_ops(void)
+{
+	return &men_z87_ethtool_ops;
+}
diff --git a/drivers/net/ethernet/men/z87/men_z87_hw.h b/drivers/net/ethernet/men/z87/men_z87_hw.h
new file mode 100644
index 000000000000..120db08d07e2
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_hw.h
@@ -0,0 +1,227 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#ifndef _MEN_Z87_HW_H_
+#define _MEN_Z87_HW_H_
+
+#include <linux/io.h>
+#include <linux/netdevice.h>
+#include <linux/bitfield.h>
+
+#include "men_z87_regs.h"
+#include "men_z87_main.h"
+
+#define Z087_TBD_FLAGS_MASK   GENMASK(15, 0)
+#define Z087_TBD_LEN_MASK     GENMASK(31, 16)
+#define Z087_TBD_LEN_SHIFT    16
+
+static inline u32 z87_mmio_read32(unsigned long base, u32 reg)
+{
+	return readl((void __iomem *)(base + reg));
+}
+
+static inline void z87_mmio_write32(unsigned long base, u32 reg, u32 val)
+{
+	writel(val, (void __iomem *)(base + reg));
+}
+
+static inline u32 z87_read32(const struct net_device *dev, u32 reg)
+{
+	return z87_mmio_read32(dev->base_addr, reg);
+}
+
+static inline void z87_write32(const struct net_device *dev, u32 reg, u32 val)
+{
+	z87_mmio_write32(dev->base_addr, reg, val);
+}
+
+static inline void z87_set_mode_flags(const struct net_device *dev, u32 flags)
+{
+	z87_write32(dev, Z087_REG_MODER,
+		    z87_read32(dev, Z087_REG_MODER) | flags);
+}
+
+static inline void z87_clear_mode_flags(const struct net_device *dev, u32 flags)
+{
+	z87_write32(dev, Z087_REG_MODER,
+		    z87_read32(dev, Z087_REG_MODER) & ~flags);
+}
+
+static inline void z87_enable_irqs(const struct net_device *dev, u32 mask)
+{
+	z87_write32(dev, Z087_REG_INT_MASK,
+		    z87_read32(dev, Z087_REG_INT_MASK) | mask);
+}
+
+static inline void z87_disable_irqs(const struct net_device *dev, u32 mask)
+{
+	z87_write32(dev, Z087_REG_INT_MASK,
+		    z87_read32(dev, Z087_REG_INT_MASK) & ~mask);
+}
+
+/* Generic BD accessors */
+
+static inline void z87_bd_set_addr(const struct z87_private *np, struct z87_desc *desc, u32 addr)
+{
+	WRITE_ONCE(desc->addr, cpu_to_le32(addr));
+	/* ensure DMA ordering */
+	dma_wmb();
+}
+
+static inline u32 z87_bd_get_addr(const struct z87_private *np, struct z87_desc *desc)
+{
+	return le32_to_cpu(READ_ONCE(desc->addr));
+}
+
+static inline void z87_bd_set_flags(const struct z87_private *np, struct z87_desc *desc, u16 f)
+{
+	u32 flags = le32_to_cpu(READ_ONCE(desc->flags));
+
+	flags |= FIELD_PREP(Z087_TBD_FLAGS_MASK, f);
+
+	WRITE_ONCE(desc->flags, cpu_to_le32(flags));
+	/* ensure DMA ordering */
+	dma_wmb();
+}
+
+static inline u16 z87_bd_get_flags(const struct z87_private *np, struct z87_desc *desc, u16 f)
+{
+	u32 flags = le32_to_cpu(READ_ONCE(desc->flags));
+
+	return FIELD_GET(Z087_TBD_FLAGS_MASK, flags) & f;
+}
+
+static inline void z87_bd_clear_flags(const struct z87_private *np, struct z87_desc *desc, u16 f)
+{
+	u32 flags = le32_to_cpu(READ_ONCE(desc->flags));
+
+	flags &= ~FIELD_PREP(Z087_TBD_FLAGS_MASK, f);
+
+	WRITE_ONCE(desc->flags, cpu_to_le32(flags));
+	/* ensure DMA ordering */
+	dma_wmb();
+}
+
+static inline void z87_bd_set_len(const struct z87_private *np, struct z87_desc *desc, u16 l)
+{
+	u32 len = le32_to_cpu(READ_ONCE(desc->flags));
+
+	len &= ~Z087_TBD_LEN_MASK;
+	len |= FIELD_PREP(Z087_TBD_LEN_MASK, l);
+
+	WRITE_ONCE(desc->flags, cpu_to_le32(len));
+	/* ensure DMA ordering */
+	dma_wmb();
+}
+
+static inline u16 z87_bd_get_len(const struct z87_private *np, struct z87_desc *desc)
+{
+	u32 len = le32_to_cpu(READ_ONCE(desc->flags));
+
+	return FIELD_GET(Z087_TBD_LEN_MASK, len);
+}
+
+static inline void z87_bd_clear_len(const struct z87_private *np, struct z87_desc *desc)
+{
+	u32 len = le32_to_cpu(READ_ONCE(desc->flags));
+
+	len &= ~Z087_TBD_LEN_MASK;
+
+	WRITE_ONCE(desc->flags, cpu_to_le32(len));
+	/* ensure DMA ordering */
+	dma_wmb();
+}
+
+/* BD offset helpers */
+static inline struct z87_desc *z87_tbd_base(const struct z87_private *np, u32 n)
+{
+	return np->tx_desc + n;
+}
+
+static inline struct z87_desc *z87_rbd_base(const struct z87_private *np, u32 n)
+{
+	return np->rx_desc + n;
+}
+
+/* TBD accessors */
+static inline void z87_tbd_set_addr(const struct z87_private *np, u32 n, u32 addr)
+{
+	z87_bd_set_addr(np, z87_tbd_base(np, n), addr);
+}
+
+static inline u32 z87_tbd_get_addr(const struct z87_private *np, u32 n)
+{
+	return z87_bd_get_addr(np, z87_tbd_base(np, n));
+}
+
+static inline void z87_tbd_set_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	z87_bd_set_flags(np, z87_tbd_base(np, n), f);
+}
+
+static inline void z87_tbd_clear_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	z87_bd_clear_flags(np, z87_tbd_base(np, n), f);
+}
+
+static inline u16 z87_tbd_get_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	return z87_bd_get_flags(np, z87_tbd_base(np, n), f);
+}
+
+static inline void z87_tbd_set_len(const struct z87_private *np, u32 n, u16 l)
+{
+	z87_bd_set_len(np, z87_tbd_base(np, n), l);
+}
+
+static inline u16 z87_tbd_get_len(const struct z87_private *np, u32 n)
+{
+	return z87_bd_get_len(np, z87_tbd_base(np, n));
+}
+
+/* RBD accessors */
+static inline void z87_rbd_set_addr(const struct z87_private *np, u32 n, u32 addr)
+{
+	z87_bd_set_addr(np, z87_rbd_base(np, n), addr);
+}
+
+static inline u32 z87_rbd_get_addr(const struct z87_private *np, u32 n)
+{
+	return z87_bd_get_addr(np, z87_rbd_base(np, n));
+}
+
+static inline void z87_rbd_set_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	z87_bd_set_flags(np, z87_rbd_base(np, n), f);
+}
+
+static inline void z87_rbd_clear_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	z87_bd_clear_flags(np, z87_rbd_base(np, n), f);
+}
+
+static inline u16 z87_rbd_get_flags(const struct z87_private *np, u32 n, u16 f)
+{
+	return z87_bd_get_flags(np, z87_rbd_base(np, n), f);
+}
+
+static inline u16 z87_rbd_get_len(const struct z87_private *np, u32 n)
+{
+	return z87_bd_get_len(np, z87_rbd_base(np, n));
+}
+
+static inline void z87_rbd_clear_len(const struct z87_private *np, u32 n)
+{
+	z87_bd_set_len(np, z87_rbd_base(np, n), 0);
+}
+
+static inline bool z87_rbd_is_empty(const struct z87_private *np, u32 n)
+{
+	return z87_rbd_get_flags(np, n, OETH_RX_BD_EMPTY) != 0;
+}
+
+#endif /* _MEN_Z87_HW_H_ */
diff --git a/drivers/net/ethernet/men/z87/men_z87_i2c.c b/drivers/net/ethernet/men/z87/men_z87_i2c.c
new file mode 100644
index 000000000000..1604553f295e
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_i2c.c
@@ -0,0 +1,240 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#include <linux/i2c.h>
+#include <linux/pci.h>
+#include <linux/bitops.h>
+
+#include "men_z87_main.h"
+#include "men_z87_hw.h"
+#include "men_z87_i2c.h"
+
+#define BRDID_EE_I2C_ADDR	0x57	/* CPU EEPROM I2C address */
+#define BRDID_EE_NAME_OFFSET	9	/* board name offset in ID EEPROM */
+#define BRDID_EE_MAC_OFFSET	0x90	/* begin of MAC(s) in Board ID EEPROM */
+#define MAC_EE_MAGIC_NUM	0xB0	/* MAC EEPROM MAGIC number */
+#define MAC_EE_BUF_SIZE		7	/* MAC EEPROM buffer size (6 + 1 for MAGIC Number) */
+#define MAC_EE_I2C_ADDR		0x50	/* Device MAC EEPROM I2C address */
+#define MAC_EE_ADDR_OFFSET	0x00	/* Device MAC EEPROM I2C address offset */
+#define MAC_ADDR_SIZE		6	/* MAC address size (in bytes) */
+#define ID_EE_NAME_LEN		6	/* length of name in ID EEPROM */
+
+#define SMB_REG_SCL		0x01
+#define SMB_REG_SDA		0x02
+#define MAC_EE_LEGACY_PARITY	0x00
+
+static void z87_set_sda(void *i2c_priv, int pinval)
+{
+	struct z87_i2c *i2c = i2c_priv;
+	unsigned int tmp;
+
+	tmp = z87_mmio_read32(i2c->base_addr, Z087_REG_SMBCTRL);
+
+	if (pinval)
+		tmp |= SMB_REG_SDA;
+	else
+		tmp &= ~SMB_REG_SDA;
+
+	z87_mmio_write32(i2c->base_addr, Z087_REG_SMBCTRL, tmp);
+}
+
+static int z87_get_sda(void *i2c_priv)
+{
+	struct z87_i2c *i2c = i2c_priv;
+	unsigned int tmp = 0;
+
+	/* Read SDA */
+	tmp = z87_mmio_read32(i2c->base_addr, Z087_REG_SMBCTRL);
+
+	return (tmp & SMB_REG_SDA) ? 1 : 0;
+}
+
+static void z87_set_scl(void *i2c_priv, int pinval)
+{
+	struct z87_i2c *i2c = i2c_priv;
+	unsigned int tmp;
+
+	tmp = z87_mmio_read32(i2c->base_addr, Z087_REG_SMBCTRL);
+
+	if (pinval)
+		tmp |= SMB_REG_SCL;
+	else
+		tmp &= ~SMB_REG_SCL;
+
+	z87_mmio_write32(i2c->base_addr, Z087_REG_SMBCTRL, tmp);
+
+	/**
+	 * Seems to be a bug on certain hardware while trying to read
+	 * the byte on i2c_inb() placed on i2c_algo_bit.c
+	 *
+	 * The solution found on other driver also works here and
+	 * consists on moving SDA line to high after the transition
+	 * of SCL from high to low immediately. This only happens during
+	 * the bit reading cycle.
+	 *
+	 * The workaround:
+	 * drivers/media/pci/pluto2/pluto2.c#L171
+	 */
+	if (pinval && i2c->i2c_bug == 0) {
+		i2c->i2c_bug = 1;
+	} else {
+		if (!pinval && i2c->i2c_bug == 1)
+			z87_set_sda(i2c, 1);
+
+		i2c->i2c_bug = 0;
+	}
+}
+
+static int z87_get_scl(void *i2c_priv)
+{
+	struct z87_i2c *i2c = i2c_priv;
+	unsigned int tmp = 0;
+
+	/* Read SCL */
+	tmp = z87_mmio_read32(i2c->base_addr, Z087_REG_SMBCTRL);
+
+	return (tmp & SMB_REG_SCL) ? 1 : 0;
+}
+
+static u8 z87_calc_mac_parity(u8 *ptr)
+{
+	u32 len = ETH_ALEN;
+	u8 parity = 0xF;
+
+	while (len--) {
+		parity ^= (*ptr >> 4);
+		parity ^= (*ptr & 0xf);
+		ptr++;
+	}
+
+	return parity;
+}
+
+struct z87_i2c *z87_i2c_alloc(struct device *dev, unsigned long addr)
+{
+	struct z87_i2c *i2c;
+	int ret;
+
+	i2c = kzalloc_obj(struct z87_i2c);
+
+	if (!i2c)
+		return ERR_PTR(-ENOMEM);
+
+	// Initialize z87_i2c stuff
+	i2c->base_addr = addr;
+	i2c->i2c_bug = 0;
+
+	// Prepare i2c adapter
+	i2c->adapter.owner = THIS_MODULE;
+	i2c->adapter.dev.parent = dev;
+	i2c->adapter.algo_data = &i2c->algo_bit;
+	snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
+		 "I2C adapter at %s", dev_name(dev));
+
+	// Prepare i2c bit-banging functions, parameters and private data.
+	i2c->algo_bit.setsda = z87_set_sda;
+	i2c->algo_bit.setscl = z87_set_scl;
+	i2c->algo_bit.getsda = z87_get_sda;
+	i2c->algo_bit.getscl = z87_get_scl;
+	i2c->algo_bit.udelay = 10; /* Recommended for SMBus */
+	i2c->algo_bit.timeout = usecs_to_jiffies(1000);
+	i2c->algo_bit.data = i2c;
+
+	i2c_set_adapdata(&i2c->adapter, i2c);
+
+	ret = i2c_bit_add_bus(&i2c->adapter);
+	if (ret < 0) {
+		dev_err(dev, "unable to create i2c adapter error: %d\n", ret);
+		goto end_free;
+	}
+
+	dev_info(dev, "I2C initialized OK. Nr: %d name: %s", i2c->adapter.nr, i2c->adapter.name);
+
+	return i2c;
+
+end_free:
+	kfree(i2c);
+	return ERR_PTR(ret);
+}
+
+void z87_i2c_free(struct z87_i2c *priv_data)
+{
+	struct z87_i2c *i2c = priv_data;
+
+	i2c_del_adapter(&i2c->adapter);
+	kfree(i2c);
+}
+
+int z87_i2c_load_mac_from_eeprom(struct z87_i2c *i2c, u8 *mac)
+{
+	u8 msgbuf[MAC_EE_BUF_SIZE] = {0};
+	bool legacy_parity = false;
+	struct i2c_msg i2cmes[2];
+	u8 parity;
+	int res;
+
+	if (!i2c || !mac)
+		return -EINVAL;
+
+	msgbuf[0] = MAC_EE_ADDR_OFFSET;
+
+	// Write offset in the EEPROM
+	i2cmes[0].addr = MAC_EE_I2C_ADDR;
+	i2cmes[0].buf = msgbuf;
+	i2cmes[0].flags = 0;
+	i2cmes[0].len = 1;
+
+	// Read magic/parity + 6 Byte MAC
+	i2cmes[1].addr = MAC_EE_I2C_ADDR;
+	i2cmes[1].buf = msgbuf;
+	i2cmes[1].flags = I2C_M_RD;
+	i2cmes[1].len = MAC_EE_BUF_SIZE;
+
+	res = i2c_transfer(&i2c->adapter, i2cmes, ARRAY_SIZE(i2cmes));
+	if (res != ARRAY_SIZE(i2cmes)) {
+		dev_err(&i2c->adapter.dev,
+			"unable to load MAC address from EEPROM. result: %d\n", res);
+		return -EIO;
+	}
+
+	dev_dbg(&i2c->adapter.dev,
+		"Read from i2c. Magic [%02x] MAC [%02x:%02x:%02x:%02x:%02x:%02x]\n",
+		msgbuf[0], msgbuf[1], msgbuf[2], msgbuf[3], msgbuf[4], msgbuf[5], msgbuf[6]);
+
+	/*
+	 * Check the data read is actually the MAC.
+	 * So check in offset = 0 the magic number.
+	 */
+	if ((msgbuf[0] & 0xF0) != MAC_EE_MAGIC_NUM) {
+		dev_err(&i2c->adapter.dev,
+			"Incorrect magic number. expected: 0x%02X found: 0x%02X",
+			(msgbuf[0] & 0xF0), MAC_EE_MAGIC_NUM);
+		return -EINVAL;
+	}
+
+	parity = z87_calc_mac_parity(((u8 *)msgbuf) + 1);
+	if ((msgbuf[0] & 0x0F) != parity) {
+		if ((msgbuf[0] & 0x0F) == MAC_EE_LEGACY_PARITY) {
+			legacy_parity = true;
+		} else {
+			dev_err(&i2c->adapter.dev,
+				"Incorrect MAC parity. expected: 0x%01x found: 0x%01x\n",
+				parity, msgbuf[0] & 0x0F);
+			return -EINVAL;
+		}
+	}
+
+	/* Accept legacy parity without rewriting EEPROM; the caller validates the MAC. */
+	memcpy(mac, ((u8 *)msgbuf) + 1, MAC_ADDR_SIZE);
+
+	dev_info(&i2c->adapter.dev,
+		 "MAC %02x:%02x:%02x:%02x:%02x:%02x read OK from MAC EEPROM. Parity check: %s\n",
+		 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
+		 legacy_parity ? "legacy (accepted)" : "OK");
+
+	return 0;
+}
diff --git a/drivers/net/ethernet/men/z87/men_z87_i2c.h b/drivers/net/ethernet/men/z87/men_z87_i2c.h
new file mode 100644
index 000000000000..691ac3c96f86
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_i2c.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#ifndef _MEN_Z87_ETH_I2C_
+#define _MEN_Z87_ETH_I2C_
+
+#include <linux/types.h>
+
+struct z87_i2c *z87_i2c_alloc(struct device *dev, unsigned long addr);
+void z87_i2c_free(struct z87_i2c *priv_data);
+int z87_i2c_load_mac_from_eeprom(struct z87_i2c *i2c, u8 *mac);
+
+#endif //_MEN_Z87_ETH_I2C_
diff --git a/drivers/net/ethernet/men/z87/men_z87_main.c b/drivers/net/ethernet/men/z87/men_z87_main.c
new file mode 100644
index 000000000000..d6d43e8ec8ab
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_main.c
@@ -0,0 +1,1539 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* men_z87_main.c: MEN Z087 ethernet driver.
+ *
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#include <linux/mcb.h>
+#include <linux/dma-mapping.h>
+#include <linux/device.h>
+#include <linux/etherdevice.h>
+#include <linux/netdevice.h>
+#include <linux/workqueue.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/if_ether.h>
+#include <linux/if_vlan.h>
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#include <linux/skbuff.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/i2c.h>
+#include <linux/pci.h>
+#include <asm/page.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/crc32.h>
+#include <net/netdev_queues.h>
+
+#include "men_z87_main.h"
+#include "men_z87_hw.h"
+#include "men_z87_i2c.h"
+#include "men_z87_phy.h"
+
+/* Typedefs */
+static int z87_open(struct net_device *dev);
+static int z87_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static irqreturn_t z87_irq(int irq, void *dev_id);
+static int z87_close(struct net_device *dev);
+static void z87_tx_timeout(struct net_device *dev, unsigned int txqueue);
+static int z87_poll(struct napi_struct *napi, int budget);
+static void z87_pass_packet(struct napi_struct *napi, unsigned int idx);
+static int z87_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+static void z87_hash_table_setup(struct net_device *dev);
+static int z87_ether_gen_crc(const u8 *data);
+static const struct board_config *z87_get_board_config(struct mcb_device *mdev);
+static void z87_load_mac_addr(struct net_device *dev);
+static int z87_alloc_rx_bd(struct net_device *dev);
+static void z87_free_rx_bd(struct net_device *dev);
+static int z87_hw_stop(struct net_device *dev);
+static int z87_hw_start(struct net_device *dev);
+
+/* common driver defines */
+#define MAX_DEVS_PER_BOARD	2
+#define UNDEF			0xff
+#define MEN_ETH_ID_Z087		0x57
+#define TX_TIMER_INTERVAL_NSEC	10000
+#define ETH_SA_DA_MAC_HLEN	12	/* combined length or source and dest MAC addr */
+#define Z087_IDLE_POLL_US	10
+#define Z087_IDLE_TIMEOUT_US	10000
+
+/* MCAST defines */
+#define MCAST_MULT_SHFT		26	/* bit shift to calculate hash bin */
+#define MCAST_HASH_MASK		0x3f	/* pass up only lower 6 bit */
+
+/* IRQ defines */
+#define Z087_IRQ_TX		(OETH_INT_TXF | OETH_INT_TXE)
+#define Z087_IRQ_RX		(OETH_INT_RXF | OETH_INT_RXE)
+#define Z087_IRQ_ALL		(Z087_IRQ_TX | Z087_IRQ_RX)
+
+struct board_config {
+	u8 board_id;
+	char board_name[10];
+	u8 num_devs;
+	u8 dev_phy_mode[MAX_DEVS_PER_BOARD];
+	u8 dev_phy_addr[MAX_DEVS_PER_BOARD];
+};
+
+/**
+ * Set of prefixed boards with specific
+ * configuration of phyadr and mode
+ */
+static const struct board_config supported_boards[] = {
+	{
+		.board_id = F218,
+		.board_name = "F218",
+		.num_devs = 1,
+		.dev_phy_mode = { phymode_100fd, UNDEF },
+		.dev_phy_addr = { 0, UNDEF },
+	},
+	{
+		.board_id = F301,
+		.board_name = "F301",
+		.num_devs = 1,
+		.dev_phy_mode = { phymode_auto, UNDEF },
+		.dev_phy_addr = { 0, UNDEF },
+	},
+	{
+		.board_id = F614,
+		.board_name = "F614",
+		.num_devs = 2,
+		.dev_phy_mode = { phymode_auto, phymode_auto },
+		.dev_phy_addr = { 1, 2 },
+	}
+};
+
+/*
+ * helper structs for more comfortable dumping of Registers\n
+ * used to maintain info about the current PHY settings
+ */
+struct z087_reg_info {
+	const char *name;	/* clear Register name */
+	unsigned int addr;	/* offset of the Register */
+};
+
+/* helper to keep Register descriptions in a comfortable struct */
+static const struct z087_reg_info z87_reginfo[] = {
+	{"MODER     ", Z087_REG_MODER		},
+	{"INT_SRC   ", Z087_REG_INT_SRC		},
+	{"INT_MASK  ", Z087_REG_INT_MASK	},
+	{"PACKLEN   ", Z087_REG_PACKLEN		},
+	{"COLLCONF  ", Z087_REG_COLLCONF	},
+	{"CTRLMODER ", Z087_REG_CTRLMODER	},
+	{"MIIMODER  ", Z087_REG_MIIMODER	},
+	{"MIICMD    ", Z087_REG_MIICMD		},
+	{"MIIADR    ", Z087_REG_MIIADR		},
+	{"MIITX_DATA", Z087_REG_MIITX_DATA	},
+	{"MIIRX_DATA", Z087_REG_MIIRX_DATA	},
+	{"MIISTATUS ", Z087_REG_MIISTATUS	},
+	{"MAC_ADDR0 ", Z087_REG_MAC_ADDR0	},
+	{"MAC_ADDR1 ", Z087_REG_MAC_ADDR1	},
+	{"HASH_ADDR0", Z087_REG_HASH_ADDR0	},
+	{"HASH_ADDR1", Z087_REG_HASH_ADDR1	},
+	{"TXCTRL    ", Z087_REG_TXCTRL		},
+	{"BD_START  ", Z087_REG_BDSTART		},
+	{"RX_EMPTY0 ", Z087_REG_RXEMPTY0	},
+	{"RX_EMPTY1 ", Z087_REG_RXEMPTY1	},
+	{"TX_EMPTY0 ", Z087_REG_TXEMPTY0	},
+	{"TX_EMPTY1 ", Z087_REG_TXEMPTY1	},
+	{"RX_BDSTAT ", Z087_REG_RXBDSTAT	},
+	{"SMBCTRL   ", Z087_REG_SMBCTRL		},
+	{"COREREV   ", Z087_REG_COREREV		},
+	{"RXERRCNT1 ", Z087_REG_RXERRCNT1	},
+	{"RXERRCNT2 ", Z087_REG_RXERRCNT2	},
+	{"TXERRCNT1 ", Z087_REG_TXERRCNT1	},
+	{"TXERRCNT2 ", Z087_REG_TXERRCNT2	},
+	{NULL, 0xffff} /* end mark */
+};
+
+static void z87_save_mac(struct net_device *dev, const u8 *mac)
+{
+	z87_write32(dev, Z087_REG_MAC_ADDR0,
+		    mac[2] << 24 |
+		    mac[3] << 16 |
+		    mac[4] << 8 |
+		    mac[5]
+	);
+
+	z87_write32(dev, Z087_REG_MAC_ADDR1, mac[0] << 8 | mac[1]);
+}
+
+static void z87_load_mac(struct net_device *dev, u8 *mac)
+{
+	u32 mac0_reg = 0, mac1_reg = 0;
+
+	mac0_reg = z87_read32(dev, Z087_REG_MAC_ADDR0);
+	mac1_reg = z87_read32(dev, Z087_REG_MAC_ADDR1);
+
+	mac[0] = (mac1_reg >> 8) & 0xff;
+	mac[1] = (mac1_reg >> 0) & 0xff;
+	mac[2] = (mac0_reg >> 24) & 0xff;
+	mac[3] = (mac0_reg >> 16) & 0xff;
+	mac[4] = (mac0_reg >> 8) & 0xff;
+	mac[5] = (mac0_reg >> 0) & 0xff;
+}
+
+static void z87_set_rx_mode(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+
+	if (dev->flags & IFF_PROMISC) {
+		if (!(z87_read32(dev, Z087_REG_MODER) & OETH_MODER_PRO))
+			z87_set_mode_flags(dev, OETH_MODER_PRO);
+	} else {
+		if (z87_read32(dev, Z087_REG_MODER) & OETH_MODER_PRO)
+			z87_clear_mode_flags(dev, OETH_MODER_PRO);
+	}
+
+	z87_hash_table_setup(dev);
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+}
+
+static int z87_ether_gen_crc(const u8 *data)
+{
+	u32 crc;
+
+	if (!data)
+		return -1;
+
+	crc = ether_crc(ETH_ALEN, data);
+
+	return (int)((crc >> MCAST_MULT_SHFT) & MCAST_HASH_MASK);
+}
+
+static void z87_hash_table_setup(struct net_device *dev)
+{
+	struct netdev_hw_addr *ha = NULL;
+	u32 bin_pos = 0;
+	u32 hash0 = 0;
+	u32 hash1 = 0;
+
+	if (dev->flags & IFF_ALLMULTI) {
+		/* Every multicast hash bin must match in all-multicast mode. */
+		hash0 = 0xffffffff;
+		hash1 = 0xffffffff;
+	} else {
+		netdev_for_each_mc_addr(ha, dev) {
+			bin_pos = z87_ether_gen_crc(ha->addr);
+
+			if (bin_pos > 31)
+				hash1 |= BIT(bin_pos - 32);
+			else
+				hash0 |= BIT(bin_pos);
+		}
+	}
+
+	z87_write32(dev, Z087_REG_HASH_ADDR0, hash0);
+	z87_write32(dev, Z087_REG_HASH_ADDR1, hash1);
+}
+
+static inline int z87_tx_full(struct net_device *dev, int idx)
+{
+	if (idx < 32)
+		return ~z87_read32(dev, Z087_REG_TXEMPTY0) & (BIT(idx));
+	else
+		return ~z87_read32(dev, Z087_REG_TXEMPTY1) & (BIT(idx - 32));
+}
+
+static inline void z87_tx_doorbell(struct net_device *dev, int idx)
+{
+	if (idx < 32)
+		z87_write32(dev, Z087_REG_TXEMPTY0, BIT(idx));
+	else
+		z87_write32(dev, Z087_REG_TXEMPTY1, BIT(idx - 32));
+}
+
+static inline void z87_rx_complete(struct net_device *dev, int idx)
+{
+	if (idx < 32)
+		z87_write32(dev, Z087_REG_RXEMPTY0, BIT(idx));
+	else
+		z87_write32(dev, Z087_REG_RXEMPTY1, BIT(idx - 32));
+}
+
+static int z87_set_mac_address(struct net_device *dev, void *p)
+{
+	struct sockaddr *addr = p;
+	int res;
+
+	res = eth_prepare_mac_addr_change(dev, p);
+	if (res < 0) {
+		netdev_err(dev, "Failed to prepare MAC address change\n");
+		return res;
+	}
+
+	z87_save_mac(dev, addr->sa_data);
+
+	eth_commit_mac_addr_change(dev, p);
+
+	return 0;
+}
+
+static int z87_change_mtu(struct net_device *netdev, int new_mtu)
+{
+	if (new_mtu < ETH_MIN_MTU || new_mtu > ETH_DATA_LEN)
+		return -EINVAL;
+
+	netdev->mtu = new_mtu;
+
+	return 0;
+}
+
+static const struct net_device_ops z87_netdev_ops = {
+	.ndo_open		= z87_open,
+	.ndo_stop		= z87_close,
+	.ndo_start_xmit		= z87_start_xmit,
+	.ndo_eth_ioctl		= z87_ioctl,
+	.ndo_tx_timeout		= z87_tx_timeout,
+	.ndo_set_rx_mode	= z87_set_rx_mode,
+	.ndo_change_mtu		= z87_change_mtu,
+	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_set_mac_address	= z87_set_mac_address,
+	.ndo_get_stats64	= dev_get_tstats64,
+};
+
+static void z87_regdump(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct z87_desc tx_desc[Z087_TBD_NUM];
+	u32 cur_tx, dty_tx, cur_rx;
+	unsigned long i = 0;
+	u32 tmp = 0;
+
+	/* Snapshot software TX state; hardware may still update descriptors. */
+	spin_lock_bh(&np->tx_lock);
+	cur_tx = np->cur_tx;
+	dty_tx = np->dty_tx;
+	cur_rx = READ_ONCE(np->cur_rx);
+
+	spin_unlock_bh(&np->tx_lock);
+
+	netdev_info(dev, "(netdevice '%s') base Addr: 0x%08lx\n",
+		    dev->name, dev->base_addr);
+
+	while (z87_reginfo[i].addr != 0xffff) {
+		tmp = z87_read32(dev, z87_reginfo[i].addr);
+		netdev_info(dev, "%s   0x%08x\n", z87_reginfo[i].name, tmp);
+		i++;
+	}
+
+	z87_phy_regdump(dev);
+
+	netdev_info(dev, "cur_tx 0x%02x, dty_tx 0x%02x, cur_rx 0x%02x\n",
+		    cur_tx, dty_tx, cur_rx);
+
+	if (READ_ONCE(np->msg_enable) > 0) {
+		netdev_info(dev,
+			    "------------------ TX BDs: -------------------\n");
+		for (i = 0; i < Z087_TBD_NUM; i++) {
+			tx_desc[i].flags = READ_ONCE(np->tx_desc[i].flags);
+			tx_desc[i].addr = READ_ONCE(np->tx_desc[i].addr);
+
+			netdev_info(dev,
+				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
+				    i,
+				    z87_bd_get_flags(np, &tx_desc[i], 0xffff),
+				    z87_bd_get_len(np, &tx_desc[i]),
+				    z87_bd_get_addr(np, &tx_desc[i]));
+		}
+
+		netdev_info(dev,
+			    "------------------ RX BDs: -------------------\n");
+		for (i = 0; i < Z087_RBD_NUM; i++) {
+			netdev_info(dev,
+				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
+				    i,
+				    z87_rbd_get_flags(np, i, 0xffff),
+				    z87_rbd_get_len(np, i),
+				    z87_rbd_get_addr(np, i));
+		}
+	}
+}
+
+static int z87_alloc_rx_bd(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	u32 i = 0, failed_idx = 0;
+	dma_addr_t mem_hw_dma = 0;
+	void *mem_virt_dma = NULL;
+
+	/* Setup Receive BDs */
+	for (i = 0; i < Z087_RBD_NUM; i++) {
+		mem_virt_dma = dma_alloc_coherent(np->dma_dev, Z087_ETHBUF_SIZE,
+						  &mem_hw_dma, GFP_KERNEL);
+		if (!mem_virt_dma) {
+			failed_idx = i;
+			netdev_err(dev, "Failed to allocate Rx buffer %d\n", i);
+			goto free_previous_rx_bd;
+		}
+
+		np->rx_bd[i].addr = mem_virt_dma;
+		np->rx_bd[i].dma = mem_hw_dma;
+
+		z87_rbd_set_addr(np, i, mem_hw_dma);
+	}
+
+	return 0;
+
+free_previous_rx_bd:
+	/* free all previous allocated BDs */
+	for (i = 0; i < failed_idx; i++) {
+		if (np->rx_bd[i].addr) {
+			dma_free_coherent(np->dma_dev, Z087_ETHBUF_SIZE,
+					  (void *)np->rx_bd[i].addr, np->rx_bd[i].dma);
+			np->rx_bd[i].addr = NULL;
+			np->rx_bd[i].dma = 0;
+		}
+	}
+
+	return -ENOMEM;
+}
+
+static void z87_free_rx_bd(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	u32 i = 0;
+
+	for (i = 0; i < Z087_RBD_NUM; i++) {
+		/* Complete any pending RX for this BD */
+		z87_rx_complete(dev, i);
+		z87_rbd_set_addr(np, i, 0);
+		if (np->rx_bd[i].addr) {
+			dma_free_coherent(np->dma_dev, Z087_ETHBUF_SIZE,
+					  (void *)np->rx_bd[i].addr, np->rx_bd[i].dma);
+			np->rx_bd[i].addr = NULL;
+			np->rx_bd[i].dma = 0;
+		}
+	}
+	/* Ensure all previous writes are visible before continuing */
+	wmb();
+}
+
+static int z87_bd_setup(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int res;
+
+	memset((char *)np->bd_base, 0x00, Z087_BD_AREA_SIZE);
+
+	/* Alloc Receive BDs */
+	res = z87_alloc_rx_bd(dev);
+	if (res < 0) {
+		netdev_err(dev, "Failed to allocate Rx BDs\n");
+		return res;
+	}
+
+	return 0;
+}
+
+static int z87_dev_register(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int res;
+
+	/* Tell the stack that the hardware handles the FCS */
+	dev->hw_features |= NETIF_F_RXFCS;
+
+	/* Tell explicitly the stack not support SG, FRAGLIST, and GSO */
+	dev->hw_features &= ~(NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_GSO_MASK);
+	dev->vlan_features |= dev->hw_features;
+	dev->features |= (dev->hw_features & ~NETIF_F_RXFCS);
+
+	dev->watchdog_timeo = WD_TX_TIMEOUT;
+
+	/* Tell the stack the maximum number of segments for TSO */
+	netif_set_tso_max_segs(dev, 1);
+
+	res = register_netdev(dev);
+	if (res < 0)
+		return res;
+
+	netdev_info(dev,
+		    "register %s as %s mode %d phys.addr 0x%08x irq 0x%x\n",
+		    np->model_name, dev->name, np->phy_mode, (u32)np->mem->start, dev->irq);
+
+	return 0;
+}
+
+static void z87_reset_task(struct work_struct *work)
+{
+	struct z87_private *np = container_of(work,
+					      struct z87_private,
+					      reset_task);
+	struct net_device *dev = np->dev;
+	bool queue_stopped, tx_full;
+
+	/* On contention, the next watchdog timeout calls us again */
+	if (!rtnl_trylock())
+		return;
+
+	if (!netif_running(dev) || !netif_carrier_ok(dev))
+		goto unlock;
+
+	spin_lock_bh(&np->tx_lock);
+	queue_stopped = netif_queue_stopped(dev);
+	tx_full = z87_tx_full(dev, np->cur_tx & (Z087_TBD_NUM - 1));
+	spin_unlock_bh(&np->tx_lock);
+
+	netdev_info(dev, "%s: NETDEV WATCHDOG timeout! (queue %s, %s)\n",
+		    dev->name,
+		    queue_stopped ? "stopped" : "running",
+		    tx_full ? "full" : "empty");
+
+	if (READ_ONCE(np->msg_enable)) {
+		netdev_warn(dev,
+			    "Current register settings before restart:\n");
+
+		z87_regdump(dev);
+	}
+
+	if (z87_hw_stop(dev) < 0) {
+		netdev_err(dev, "Failed to stop hardware safely, aborting restart\n");
+		netif_carrier_off(dev);
+		goto unlock;
+	}
+	if (z87_hw_start(dev) < 0) {
+		netdev_err(dev, "Failed to restart hardware after watchdog timeout\n");
+		netif_carrier_off(dev);
+		goto unlock;
+	}
+
+	spin_lock_bh(&np->tx_lock);
+	DEV_STATS_INC(dev, tx_errors);
+	spin_unlock_bh(&np->tx_lock);
+
+	if (netif_queue_stopped(dev))
+		netif_wake_queue(dev);
+
+unlock:
+	rtnl_unlock();
+}
+
+static void z87_tx_timeout(struct net_device *dev, unsigned int txqueue)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	schedule_work(&np->reset_task);
+}
+
+static inline bool z87_rx_bd_is_full(u32 rx0, u32 rx1, unsigned int pos)
+{
+	return (pos < 32) ? !!(rx0 & BIT(pos)) : !!(rx1 & BIT(pos - 32));
+}
+
+static inline int z87_next_bd(int pos, int width)
+{
+	return (pos + 1) % width;
+}
+
+static int z87_process_rx(struct napi_struct *napi, int weight)
+{
+	struct z87_private *np = container_of(napi, struct z87_private, napi);
+	u32 cur_rx = READ_ONCE(np->cur_rx);
+	struct net_device *dev = np->dev;
+	unsigned int rx0, rx1;
+	int i, frames = 0;
+	u64 rx_reg;
+
+	rx0 = z87_read32(dev, Z087_REG_RXEMPTY0);
+	rx1 = z87_read32(dev, Z087_REG_RXEMPTY1);
+	rx_reg = ((u64)rx1 << 32) | rx0;
+
+	if (rx_reg & BIT_ULL(cur_rx))
+		return 0;
+
+	for (i = 0; i < weight; i++) {
+		z87_pass_packet(napi, cur_rx);
+		frames++;
+
+		cur_rx = z87_next_bd(cur_rx, Z087_RBD_NUM);
+		WRITE_ONCE(np->cur_rx, cur_rx);
+
+		/* are we done ? */
+		if (rx_reg & BIT_ULL(cur_rx))
+			break;
+	}
+
+	return frames;
+}
+
+static void z87_tx_bd_errors(struct net_device *dev, int idx)
+{
+	const u16 tx_err_mask = OETH_TX_BD_DEFER | OETH_TX_BD_CARRIER |
+		OETH_TX_BD_UNDERRUN | OETH_TX_BD_RETLIM |
+		OETH_TX_BD_LATECOL | OETH_TX_BD_RETRY;
+	struct z87_private *np = netdev_priv(dev);
+	u16 tx_bd_flags;
+
+	tx_bd_flags = z87_tbd_get_flags(np, idx, tx_err_mask);
+	if (!tx_bd_flags)
+		return;
+
+	if (tx_bd_flags & OETH_TX_BD_DEFER)
+		netdev_warn(dev, "*** TX: defered frame[%d]\n", idx);
+
+	if (tx_bd_flags & OETH_TX_BD_CARRIER) {
+		netdev_warn(dev, "*** TX: Carrier lost[%d]\n", idx);
+		DEV_STATS_INC(dev, tx_carrier_errors);
+	}
+
+	if (tx_bd_flags & OETH_TX_BD_UNDERRUN) {
+		netdev_warn(dev, "*** TX: underrun[%d]\n", idx);
+		DEV_STATS_INC(dev, tx_fifo_errors);
+	}
+
+	if (tx_bd_flags & OETH_TX_BD_RETLIM) {
+		netdev_warn(dev, "*** TX: retrans limit[%d]\n", idx);
+		DEV_STATS_INC(dev, tx_aborted_errors);
+	}
+
+	if (tx_bd_flags & OETH_TX_BD_LATECOL) {
+		netdev_warn(dev, "*** TX: late coll[%d]\n", idx);
+		DEV_STATS_INC(dev, tx_window_errors);
+	}
+
+	DEV_STATS_INC(dev, tx_errors);
+	DEV_STATS_ADD(dev, collisions, (tx_bd_flags & OETH_TX_BD_RETRY) >> 4);
+
+	z87_tbd_clear_flags(np, idx, tx_err_mask);
+}
+
+static int z87_release_tx(struct net_device *dev, int idx, int budget)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct sk_buff *skb;
+	int bytes = 0;
+
+	/*
+	 * Ensure that all previous DMA writes are
+	 * visible before checking TX BD errors
+	 */
+	dma_rmb();
+
+	z87_tx_bd_errors(dev, idx);
+
+	skb = np->tx_bd[idx].skb;
+
+	if (likely(skb)) {
+		dma_unmap_single(np->dma_dev, np->tx_bd[idx].dma,
+				 (size_t)skb->len, DMA_TO_DEVICE);
+		bytes = skb->len;
+		np->tx_bd[idx].skb = NULL;
+		napi_consume_skb(skb, budget);
+	}
+
+	return bytes;
+}
+
+static void z87_reclaim_tx(struct net_device *dev, int budget)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned int tx0, tx1;
+	int released = 0;
+	int bytes = 0;
+	u64 tx_reg;
+
+	spin_lock_bh(&np->tx_lock);
+
+	/* read the current state of the Tx BDs */
+	tx0 = z87_read32(dev, Z087_REG_TXEMPTY0);
+	tx1 = z87_read32(dev, Z087_REG_TXEMPTY1);
+
+	tx_reg = ((u64)tx1 << 32) | tx0;
+
+	while (np->dty_tx != READ_ONCE(np->cur_tx)) {
+		unsigned int entry = np->dty_tx & (Z087_TBD_NUM - 1);
+
+		if (!(tx_reg & BIT_ULL(entry)))
+			break;
+
+		bytes += z87_release_tx(dev, entry, budget);
+		released++;
+		np->dty_tx++;
+	}
+
+	if (released)
+		netdev_completed_queue(dev, released, bytes);
+
+	if (!test_bit(__Z87_DOWN, &np->state) && netif_queue_stopped(dev) &&
+	    (READ_ONCE(np->cur_tx) - np->dty_tx) <= (Z087_TBD_NUM / 2))
+		netif_wake_queue(dev);
+
+	spin_unlock_bh(&np->tx_lock);
+}
+
+static void z87_clean_tx_ring(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int i;
+
+	spin_lock_bh(&np->tx_lock);
+
+	for (i = 0; i < Z087_TBD_NUM; i++) {
+		if (np->tx_bd[i].skb) {
+			dma_unmap_single(np->dma_dev, np->tx_bd[i].dma,
+					 (size_t)np->tx_bd[i].skb->len, DMA_TO_DEVICE);
+			dev_kfree_skb_any(np->tx_bd[i].skb);
+			np->tx_bd[i].skb = NULL;
+			np->tx_bd[i].dma = 0;
+			DEV_STATS_INC(dev, tx_dropped);
+		}
+	}
+
+	np->cur_tx = 0;
+	np->dty_tx = 0;
+
+	netdev_reset_queue(dev);
+
+	spin_unlock_bh(&np->tx_lock);
+}
+
+static int z87_poll(struct napi_struct *napi, int budget)
+{
+	struct z87_private *np = container_of(napi, struct z87_private, napi);
+	struct net_device *dev = np->dev;
+	unsigned long flags;
+	int npackets = 0;
+
+	z87_reclaim_tx(dev, budget);
+
+	npackets = z87_process_rx(napi, budget);
+
+	if (npackets < budget && napi_complete_done(napi, npackets)) {
+		raw_spin_lock_irqsave(&np->lock, flags);
+		if (!test_bit(__Z87_DOWN, &np->state))
+			z87_enable_irqs(dev, Z087_IRQ_ALL);
+		raw_spin_unlock_irqrestore(&np->lock, flags);
+	}
+
+	return npackets;
+}
+
+static int z87_open(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int res;
+
+	netif_carrier_off(dev);
+
+	res = request_irq(dev->irq, z87_irq, IRQF_SHARED, np->model_name, dev);
+	if (res < 0) {
+		netdev_err(dev, "*** unable to get IRQ %d.\n", dev->irq);
+		return res;
+	}
+
+	res = z87_hw_start(dev);
+	if (res < 0) {
+		netdev_err(dev, "*** hardware start failed!\n");
+		goto release_irq;
+	}
+
+	return 0;
+
+release_irq:
+	free_irq(dev->irq, dev);
+	return res;
+}
+
+static int z87_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	dma_addr_t dma_hndler = 0;
+	unsigned int tx_idx = 0;
+
+	spin_lock_bh(&np->tx_lock);
+
+	if (unlikely(test_bit(__Z87_DOWN, &np->state))) {
+		netif_stop_queue(dev);
+		spin_unlock_bh(&np->tx_lock);
+		return NETDEV_TX_BUSY;
+	}
+
+	if (unlikely(np->cur_tx - np->dty_tx >= Z087_TBD_NUM)) {
+		netdev_warn(dev, "tx ring full, stopping queue\n");
+		netif_stop_queue(dev);
+		spin_unlock_bh(&np->tx_lock);
+		return NETDEV_TX_BUSY;
+	}
+
+	tx_idx = np->cur_tx & (Z087_TBD_NUM - 1);
+
+	if (unlikely(skb->len > Z087_ETHBUF_SIZE)) {
+		netdev_warn(dev, "tx frame too long (%d bytes)\n", skb->len);
+		goto drop;
+	}
+
+	if (skb_put_padto(skb, ETH_ZLEN))
+		goto unlock;
+
+	dma_hndler = dma_map_single(np->dma_dev, skb->data, skb->len, DMA_TO_DEVICE);
+	if (unlikely(dma_mapping_error(np->dma_dev, dma_hndler))) {
+		netdev_err(dev, "DMA mapping error for tx buffer %d\n", tx_idx);
+		goto drop;
+	}
+
+	z87_tbd_set_addr(np, tx_idx, dma_hndler);
+	z87_tbd_set_len(np, tx_idx, skb->len);
+
+	/* Ensure descriptor updates are visible before ringing the doorbell */
+	dma_wmb();
+
+	skb_tx_timestamp(skb);
+
+	z87_tx_doorbell(dev, tx_idx);
+
+	/* Update net statistics */
+	dev_sw_netstats_tx_add(dev, 1, skb->len);
+
+	np->tx_bd[tx_idx].skb = skb;
+	np->tx_bd[tx_idx].dma = dma_hndler;
+
+	netdev_sent_queue(dev, skb->len);
+
+	WRITE_ONCE(np->cur_tx, np->cur_tx + 1);
+
+	/* congestion: is tx ring full now? */
+	if (unlikely(np->cur_tx - np->dty_tx >= Z087_TBD_NUM))
+		netif_stop_queue(dev);
+
+	spin_unlock_bh(&np->tx_lock);
+
+	return NETDEV_TX_OK;
+
+drop:
+	dev_kfree_skb_any(skb);
+unlock:
+	DEV_STATS_INC(dev, tx_dropped);
+	spin_unlock_bh(&np->tx_lock);
+	return NETDEV_TX_OK;
+}
+
+static void z87_load_mac_addr(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	u8 mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
+	struct sockaddr addr;
+	int res;
+
+	z87_load_mac(dev, mac);
+
+	if (is_valid_ether_addr(mac)) {
+		netdev_info(dev,
+			    "using MAC %02x:%02x:%02x:%02x:%02x:%02x from registers.\n",
+			    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		memcpy(addr.sa_data, mac, ETH_ALEN);
+		goto end;
+	}
+
+	res = z87_i2c_load_mac_from_eeprom(np->i2c, mac);
+	if (!res && is_valid_ether_addr(mac)) {
+		netdev_info(dev,
+			    "using MAC %02x:%02x:%02x:%02x:%02x:%02x from MAC EEPROM.\n",
+			    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		memcpy(addr.sa_data, mac, ETH_ALEN);
+		goto end;
+	}
+
+	eth_hw_addr_random(dev);
+
+	netdev_info(dev,
+		    "using random MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
+		    dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+		    dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	memcpy(addr.sa_data, dev->dev_addr, ETH_ALEN);
+
+end:
+	z87_set_mac_address(dev, &addr);
+}
+
+static int z87_wait_core_idle(struct net_device *dev)
+{
+	const u32 idle_mask = OETH_MODER_RX_IDLE | OETH_MODER_TX_IDLE;
+	u32 status;
+	int res;
+
+	res = read_poll_timeout(z87_read32, status,
+				(status & idle_mask) == idle_mask,
+				Z087_IDLE_POLL_US, Z087_IDLE_TIMEOUT_US,
+				false, dev, Z087_REG_MODER);
+	if (res)
+		netdev_err(dev, "Core idle timeout: MODER=0x%08x\n", status);
+
+	return res;
+}
+
+static int z87_core_reset(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+	int res;
+
+	/*
+	 * Clearing RXEN/TXEN resets the RX/TX areas. Both IDLE bits must
+	 * be set before the Wishbone area can safely be reconfigured.
+	 * Pending descriptors need not be consumed while reset is asserted.
+	 */
+	raw_spin_lock_irqsave(&np->lock, flags);
+	z87_clear_mode_flags(dev, OETH_MODER_RXEN | OETH_MODER_TXEN);
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+
+	res = z87_wait_core_idle(dev);
+	if (res < 0)
+		return res;
+
+	z87_write32(dev, Z087_REG_BDSTART, 0);
+
+	/* Flush the descriptor-table detach before releasing DMA memory. */
+	z87_read32(dev, Z087_REG_BDSTART);
+
+	/* Confirm both engines are still idle after the table detach. */
+	return z87_wait_core_idle(dev);
+}
+
+static int z87_chipset_init(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+	int res;
+
+	res = z87_core_reset(dev);
+	if (res < 0) {
+		netdev_err(dev, "Failed to reset core\n");
+		return res;
+	}
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+
+	z87_set_mode_flags(dev, np->features);
+
+	z87_write32(dev, Z087_REG_PACKLEN, Z87_PACKLEN_DEFAULT);
+
+	/* attach BD desc table address to hardware */
+	z87_write32(dev, Z087_REG_BDSTART, np->bd_hw);
+
+	/* initialize all 64 Rx BDs as empty (ready for hardware) */
+	z87_write32(dev, Z087_REG_RXEMPTY0, 0xffffffff);
+	z87_write32(dev, Z087_REG_RXEMPTY1, 0xffffffff);
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+
+	/* set management indices */
+	np->cur_tx = 0;
+	np->dty_tx = 0;
+	np->cur_rx = 0;
+
+	return 0;
+}
+
+static bool z87_rx_bd_errors(struct net_device *dev, unsigned int idx)
+{
+	const u16 rx_err_mask = OETH_RX_BD_OVERRUN | OETH_RX_BD_INVSYMB |
+		OETH_RX_BD_DRIBBLE | OETH_RX_BD_TOOLONG |
+		OETH_RX_BD_SHORT | OETH_RX_BD_CRCERR |
+		OETH_RX_BD_LATECOL;
+	struct z87_private *np = netdev_priv(dev);
+	u16 rx_err_flags;
+
+	rx_err_flags = z87_rbd_get_flags(np, idx, rx_err_mask);
+	if (!rx_err_flags)
+		return false;
+
+	if (rx_err_flags & OETH_RX_BD_OVERRUN) {
+		netdev_warn(dev, "*** RX: overrun[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_over_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_INVSYMB) {
+		netdev_warn(dev, "*** RX: inv symbol[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_frame_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_DRIBBLE) {
+		netdev_warn(dev, "*** RX: dribble[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_frame_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_TOOLONG) {
+		netdev_warn(dev, "*** RX: too long[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_length_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_SHORT) {
+		netdev_warn(dev, "*** RX: too short[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_length_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_CRCERR) {
+		netdev_warn(dev, "*** RX: CRC err[%u]\n", idx);
+		DEV_STATS_INC(dev, rx_crc_errors);
+	}
+
+	if (rx_err_flags & OETH_RX_BD_LATECOL) {
+		netdev_warn(dev, "*** RX: late coll[%u]\n", idx);
+		DEV_STATS_INC(dev, collisions);
+	}
+
+	DEV_STATS_INC(dev, rx_errors);
+
+	z87_rbd_clear_flags(np, idx, rx_err_mask);
+
+	return true;
+}
+
+static void z87_pass_packet(struct napi_struct *napi, unsigned int idx)
+{
+	struct z87_private *np = container_of(napi, struct z87_private, napi);
+	struct net_device *dev = np->dev;
+	struct sk_buff *skb = NULL;
+	u32 pkt_len = 0;
+
+	/* Ensure packet data and BD length written by HW DMA are visible */
+	dma_rmb();
+
+	if (unlikely(z87_rx_bd_errors(dev, idx)))
+		goto out_err;
+
+	pkt_len	= z87_rbd_get_len(np, idx);
+
+	if (unlikely(!np->rx_bd[idx].addr)) {
+		if (net_ratelimit())
+			netdev_warn(dev, "invalid rx_bd[%d] buffer\n", idx);
+
+		DEV_STATS_INC(dev, rx_errors);
+		goto out_err;
+	}
+
+	if (likely(!(dev->features & NETIF_F_RXFCS))) {
+		if (unlikely(pkt_len <= ETH_FCS_LEN)) {
+			if (net_ratelimit())
+				netdev_warn(dev, "invalid length of pkt %d (len=%u)!\n",
+					    idx, pkt_len);
+
+			DEV_STATS_INC(dev, rx_length_errors);
+			DEV_STATS_INC(dev, rx_errors);
+			goto out_err;
+		}
+		pkt_len -= ETH_FCS_LEN;
+	}
+
+	if (unlikely(pkt_len < ETH_HLEN) ||
+	    unlikely(pkt_len > Z087_ETHBUF_SIZE)) {
+		if (net_ratelimit())
+			netdev_warn(dev, "invalid length of pkt %d (len=%u)!\n",
+				    idx, pkt_len);
+
+		DEV_STATS_INC(dev, rx_length_errors);
+		DEV_STATS_INC(dev, rx_errors);
+		goto out_err;
+	}
+
+	skb = dev_alloc_skb(pkt_len + NET_IP_ALIGN);
+
+	if (unlikely(!skb)) {
+		netdev_warn(dev, "*** Mem squeeze! drop packet\n");
+		DEV_STATS_INC(dev, rx_dropped);
+		goto out_err;
+	}
+
+	skb->dev = dev;
+
+	/* 16 byte align the IP fields. */
+	skb_reserve(skb, NET_IP_ALIGN);
+	skb_copy_to_linear_data(skb, (np->rx_bd[idx].addr), pkt_len);
+
+	skb_put(skb, pkt_len);
+	skb->protocol = eth_type_trans(skb, dev);
+
+	/* tell network stack... */
+	dev_sw_netstats_rx_add(dev, pkt_len);
+	napi_gro_receive(napi, skb);
+
+out_err:
+	/* clean processed Rx BD nonempty Flag */
+	z87_rx_complete(dev, idx);
+}
+
+static int z87_hw_stop(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+	int res;
+
+	/* already stopped by a previous failed attempt (napi disabled, phy stopped) */
+	if (test_bit(__Z87_HW_DEAD, &np->state))
+		return -EIO;
+
+	spin_lock_bh(&np->tx_lock);
+	set_bit(__Z87_DOWN, &np->state);
+	spin_unlock_bh(&np->tx_lock);
+	netif_tx_disable(dev);
+
+	netif_carrier_off(dev);
+
+	if (dev->phydev)
+		phy_stop(dev->phydev);
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+
+	/* disable all IRQs */
+	z87_disable_irqs(dev, Z087_IRQ_ALL);
+	z87_read32(dev, Z087_REG_INT_MASK);
+
+	/* clean spurious left IRQs */
+	z87_write32(dev, Z087_REG_INT_SRC, 0x7f);
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+
+	synchronize_irq(dev->irq);
+	napi_disable(&np->napi);
+
+	/* reset the core, leave DMA engine idle prior to freeing buffers */
+	res = z87_core_reset(dev);
+	if (res < 0) {
+		netdev_err(dev, "Hardware failed to enter idle state! Retaining DMA buffers to prevent memory corruption.\n");
+		set_bit(__Z87_HW_DEAD, &np->state);
+
+		/* Do not free DMA memory: hardware might still be accessing it */
+		return res;
+	}
+
+	/* reclaim any completed Tx BDs */
+	z87_reclaim_tx(dev, 0);
+
+	/* clean and free any uncompleted Tx BDs */
+	z87_clean_tx_ring(dev);
+
+	/* free all Rx buffers */
+	z87_free_rx_bd(dev);
+
+	return 0;
+}
+
+/* Retry quiescing a core that failed to stop; release retained DMA buffers on success */
+static int z87_hw_recover(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int res;
+
+	if (!test_bit(__Z87_HW_DEAD, &np->state))
+		return 0;
+
+	res = z87_core_reset(dev);
+	if (res < 0)
+		return res;
+
+	z87_clean_tx_ring(dev);
+	z87_free_rx_bd(dev);
+
+	clear_bit(__Z87_HW_DEAD, &np->state);
+
+	return 0;
+}
+
+static int z87_hw_start(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+	int res;
+
+	res = z87_hw_recover(dev);
+	if (res < 0) {
+		netdev_err(dev, "Hardware still not idle, refusing to start\n");
+		return res;
+	}
+
+	res = z87_phy_init(dev);
+	if (res < 0) {
+		netdev_err(dev, "*** PHY Initialization failed!\n");
+		return res;
+	}
+
+	phy_start(dev->phydev);
+
+	res = z87_chipset_init(dev);
+	if (res < 0) {
+		netdev_err(dev, "Failed to initialize chipset\n");
+		goto err_stop_phy;
+	}
+
+	/* setup the Tx/Rx buffer descriptors */
+	res = z87_bd_setup(dev);
+	if (res < 0) {
+		netdev_err(dev, "Failed to setup BDs\n");
+		goto err_stop_phy;
+	}
+
+	napi_enable(&np->napi);
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+	clear_bit(__Z87_DOWN, &np->state);
+
+	/* clear any pending spurious IRQs */
+	z87_write32(dev, Z087_REG_INT_SRC, Z087_IRQ_ALL);
+	z87_enable_irqs(dev, Z087_IRQ_ALL);
+
+	/* tell hardware we are ready */
+	z87_set_mode_flags(dev, OETH_MODER_RXEN | OETH_MODER_TXEN);
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+
+	netif_start_queue(dev);
+
+	return 0;
+
+err_stop_phy:
+	phy_stop(dev->phydev);
+	return res;
+}
+
+static int z87_close(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	cancel_work_sync(&np->reset_task);
+
+	z87_hw_stop(dev);
+
+	free_irq(dev->irq, dev);
+
+	return 0;
+}
+
+/*******************************************************************/
+/** central IRQ handler
+ *
+ * \param irq		\IN INTB interrupt
+ * \param dev_id	\IN unique identifier
+ *
+ * \return if IRQ was handled or not
+ */
+static irqreturn_t z87_irq(int irq, void *dev_id)
+{
+	struct net_device *dev = (struct net_device *)dev_id;
+	struct z87_private *np = netdev_priv(dev);
+	u32 status, mask;
+
+	raw_spin_lock(&np->lock);
+
+	status = z87_read32(dev, Z087_REG_INT_SRC) & Z087_IRQ_ALL;
+	mask = z87_read32(dev, Z087_REG_INT_MASK);
+
+	status &= mask;
+
+	if (unlikely(!status)) {
+		raw_spin_unlock(&np->lock);
+		return IRQ_NONE;
+	}
+
+	/* acknowledge interrupts */
+	z87_write32(dev, Z087_REG_INT_SRC, status);
+
+	/* disable interrupts */
+	z87_disable_irqs(dev, Z087_IRQ_ALL);
+
+	if (likely(!test_bit(__Z87_DOWN, &np->state) &&
+		   napi_schedule_prep(&np->napi)))
+		__napi_schedule(&np->napi);
+
+	raw_spin_unlock(&np->lock);
+
+	return IRQ_HANDLED;
+}
+
+static int z87_probe(struct mcb_device *mdev,
+		     const struct mcb_device_id *id)
+{
+	const struct board_config *cfg = NULL;
+	struct net_device *dev = NULL;
+	struct z87_private *np = NULL;
+	void *mem_virt_dma = NULL;
+	dma_addr_t mem_hw_dma;
+	struct resource *mem;
+	int res = -ENXIO;
+
+	cfg = z87_get_board_config(mdev);
+	if (!cfg)
+		return -EOPNOTSUPP;
+
+	/**
+	 * mdev->inst is defined in a per-board basis, so lets check
+	 * if there are more devices that defined for the board. In that
+	 * case, something is wrong.
+	 */
+	if (mdev->inst >= cfg->num_devs) {
+		return dev_err_probe(&mdev->dev, -EINVAL,
+				     "detected more devices than configured for board: %s",
+				     cfg->board_name);
+	}
+
+	mem = mcb_request_mem(mdev, dev_name(&mdev->dev));
+	if (IS_ERR(mem))
+		return PTR_ERR(mem);
+
+	dev = devm_alloc_etherdev(&mdev->dev, sizeof(struct z87_private));
+	if (!dev) {
+		res = -ENOMEM;
+		goto err_mem;
+	}
+
+	dev->tstats = devm_netdev_alloc_pcpu_stats(&mdev->dev, struct pcpu_sw_netstats);
+	if (!dev->tstats) {
+		res = -ENOMEM;
+		goto err_mem;
+	}
+
+	if (dma_set_mask_and_coherent(mdev->dma_dev, DMA_BIT_MASK(32))) {
+		netdev_err(dev, "can't set 32bit DMA mask, aborting\n");
+		res = -ENOMEM;
+		goto err_mem;
+	}
+
+	dev->base_addr = (unsigned long)devm_ioremap(&mdev->dev, mem->start, Z087_CFGREG_SIZE);
+	if (!dev->base_addr) {
+		res = -ENOMEM;
+		goto err_mem;
+	}
+
+	dev->irq = mcb_get_irq(mdev);
+
+	/*
+	 * if more than one Z87 ethernet core is implemented in one PCI function
+	 * on one chameleon FPGA, the device port is important for distinct ethernet
+	 * device identification during interface renaming via systemd/udev. We start
+	 * counting at 1 to have a constant naming scheme; 0 is omitted during renaming
+	 */
+	dev->dev_port = mdev->inst + 1;
+
+	SET_NETDEV_DEV(dev, &mdev->dev);
+
+	dev->netdev_ops = &z87_netdev_ops;
+	dev->ethtool_ops = z87_get_ethtool_ops();
+
+	/* setup the phy Info within the private z87_private struct */
+	np = netdev_priv(dev);
+	np->parent = &mdev->dev;
+	np->mem = mem;
+	np->dma_dev = mdev->dma_dev;
+
+	raw_spin_lock_init(&np->lock);
+	spin_lock_init(&np->tx_lock);
+	set_bit(__Z87_DOWN, &np->state);
+
+	/* Ensure core is in a quiescent state and IRQs disabled from the start */
+	z87_disable_irqs(dev, Z087_IRQ_ALL);
+	z87_write32(dev, Z087_REG_INT_SRC, 0x7f);
+
+	res = z87_core_reset(dev);
+	if (res < 0) {
+		netdev_err(dev, "unable to perform core reset on probe: %d\n", res);
+		goto err_mem;
+	}
+
+	mcb_set_drvdata(mdev, dev);
+
+	netif_napi_add(dev, &np->napi, z87_poll);
+
+	np->dev = dev;
+	np->board = cfg->board_id;
+	np->instance = mdev->inst;
+	np->phy_mode = cfg->dev_phy_mode[mdev->inst];
+	np->phy.phy_addr = cfg->dev_phy_addr[mdev->inst];
+	np->phy.phy_interface = PHY_INTERFACE_MODE_MII;
+
+	/* set the default features for the Z87 device */
+	np->features = OETH_MODER_IFG | OETH_MODER_EXDFREN | OETH_MODER_CRCEN |
+		       OETH_MODER_BRO | OETH_MODER_PAD | OETH_MODER_RECSMALL;
+
+	np->phy.hf_supported = z87_read32(dev, Z087_REG_MODER) & OETH_MODER_HD_AVAL;
+
+	/* pass initial debug level */
+	np->msg_enable = 0;
+
+	/*
+	 * get a coherent DMAable memory region for the BDs to have
+	 * the 64 Rx/Tx BD static in sync with IP core
+	 */
+	mem_virt_dma = dma_alloc_coherent(mdev->dma_dev,
+					  Z087_BD_AREA_SIZE, &mem_hw_dma, GFP_KERNEL);
+	if (!mem_virt_dma) {
+		res = -ENOMEM;
+		goto err_napi;
+	}
+
+	/* store for dma_free_coherent at module remove */
+	np->bd_base = (unsigned long)mem_virt_dma;
+	np->rx_desc = (struct z87_desc *)np->bd_base;
+	np->tx_desc = np->rx_desc + Z087_RBD_NUM;
+	np->bd_hw = mem_hw_dma;
+
+	/* clean BD Area */
+	memset((void *)np->bd_base, 0, Z087_BD_AREA_SIZE);
+	snprintf(np->model_name, MODELNAME_LEN, "16Z%03u", id->device);
+
+	/* force new interrupt behavior */
+	z87_write32(dev, Z087_REG_COREREV,
+		    z87_read32(dev, Z087_REG_COREREV) | REG_COREREV_IRQNEWEN);
+
+	if (!(z87_read32(dev, Z087_REG_COREREV)
+		  & REG_COREREV_IRQNEWEN)) {
+		netdev_info(dev, "%s: Couldn't set to new IRQ behavior\n", __func__);
+	}
+
+	/* init the process context work queue function to restart Z87 */
+	INIT_WORK(&np->reset_task, z87_reset_task);
+
+	/* Initialize i2c core */
+	np->i2c = z87_i2c_alloc(&mdev->dev, dev->base_addr);
+	if (IS_ERR(np->i2c)) {
+		res = PTR_ERR(np->i2c);
+		goto err_dma;
+	}
+
+	z87_load_mac_addr(dev);
+
+	res = z87_phy_register_mdio(dev);
+	if (res < 0) {
+		netdev_err(dev, "Unable to register MDIO bus\n");
+		goto err_i2c;
+	}
+
+	res = z87_phy_connect(dev);
+	if (res < 0) {
+		netdev_err(dev, "Unable to connect PHY\n");
+		goto err_unregister_mdio;
+	}
+
+	res = z87_dev_register(dev);
+	if (res < 0) {
+		netdev_err(dev, "Unable to register netdev\n");
+		goto err_disconnect_phy;
+	}
+
+	return 0;
+
+err_disconnect_phy:
+	z87_phy_disconnect(dev);
+err_unregister_mdio:
+	z87_phy_unregister_mdio(dev);
+err_i2c:
+	z87_i2c_free(np->i2c);
+err_dma:
+	dma_free_coherent(mdev->dma_dev, Z087_BD_AREA_SIZE, (void *)np->bd_base, np->bd_hw);
+err_napi:
+	netif_napi_del(&np->napi);
+err_mem:
+	mcb_set_drvdata(mdev, NULL);
+	mcb_release_mem(mem);
+
+	return res;
+}
+
+static void z87_remove(struct mcb_device *mdev)
+{
+	struct net_device *dev = mcb_get_drvdata(mdev);
+	struct z87_private *np = netdev_priv(dev);
+
+	/* disable reset task first */
+	cancel_work_sync(&np->reset_task);
+	unregister_netdev(dev);
+	z87_phy_disconnect(dev);
+	z87_phy_unregister_mdio(dev);
+	netif_napi_del(&np->napi);
+	z87_i2c_free(np->i2c);
+	mcb_set_drvdata(mdev, NULL);
+
+	if (z87_hw_recover(dev) < 0) {
+		/*
+		 * The reset could not be confirmed and no hardware reset
+		 * mechanism is available through MCB. DMA may still be active,
+		 * so intentionally leak the DMA allocations until reboot.
+		 * Release the MMIO reservation so a later probe can retry
+		 * quiescing the core before allocating new DMA memory.
+		 */
+		dev_err(&mdev->dev, "Hardware still not idle, leaking DMA buffers\n");
+	} else {
+		dma_free_coherent(mdev->dma_dev, Z087_BD_AREA_SIZE,
+				  (void *)np->bd_base, np->bd_hw);
+	}
+
+	mcb_release_mem(np->mem);
+}
+
+static void z87_shutdown(struct mcb_device *mdev)
+{
+	struct net_device *dev = mcb_get_drvdata(mdev);
+	struct z87_private *np = netdev_priv(dev);
+
+	netdev_info(dev, "Shutting down\n");
+	cancel_work_sync(&np->reset_task);
+
+	rtnl_lock();
+	netif_device_detach(dev);
+	dev_close(dev);
+	if (z87_hw_recover(dev) < 0)
+		netdev_err(dev, "Hardware still not idle at shutdown, retaining DMA buffers\n");
+	rtnl_unlock();
+}
+
+static int z87_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	switch (cmd) {
+	case SIOCGMIIPHY:
+	case SIOCGMIIREG:
+	case SIOCSMIIREG:
+		return z87_phy_ioctl(dev, ifr, cmd);
+	default:
+		break;
+	}
+
+	return -EOPNOTSUPP;
+}
+
+static const struct board_config *z87_get_board_config(struct mcb_device *mdev)
+{
+	int i;
+
+	dev_info(&mdev->dev, "%s on board %s\n", dev_name(&mdev->dev), mdev->bus->name);
+
+	for (i = 0; i < ARRAY_SIZE(supported_boards); i++)
+		if (strstr(mdev->bus->name, supported_boards[i].board_name))
+			return &supported_boards[i];
+
+	dev_err(&mdev->dev, "board %s not supported\n", mdev->bus->name);
+	return NULL;
+}
+
+static const struct mcb_device_id men_z87_ids[] = {
+	{ .device = MEN_ETH_ID_Z087 },
+	{ }
+};
+MODULE_DEVICE_TABLE(mcb, men_z87_ids);
+
+static struct mcb_driver mcb_driver = {
+	.driver = {
+		.name = "z087-eth",
+	},
+	.probe = z87_probe,
+	.remove = z87_remove,
+	.shutdown = z87_shutdown,
+	.id_table = men_z87_ids,
+};
+module_mcb_driver(mcb_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("duagon Ethernet IP Core driver");
+MODULE_AUTHOR("Thomas Schnuerer");
+MODULE_AUTHOR("Javier Rodriguez");
+MODULE_IMPORT_NS("MCB");
diff --git a/drivers/net/ethernet/men/z87/men_z87_main.h b/drivers/net/ethernet/men/z87/men_z87_main.h
new file mode 100644
index 000000000000..cd7ec47b1432
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_main.h
@@ -0,0 +1,133 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* men_z87_main.h: MEN Z087 ethernet driver.
+ *
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#ifndef _MEN_Z87_MAIN_
+#define _MEN_Z87_MAIN_
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/skbuff.h>
+#include <linux/mii.h>
+#include <linux/phy.h>
+#include <linux/i2c.h>
+#include <linux/bits.h>
+#include <linux/bitops.h>
+#include <linux/i2c-algo-bit.h>
+
+#define MODELNAME_LEN		12
+
+#define Z087_ETHBUF_SIZE	0x1000		/* size of 1 BD, PAGESZ aligned */
+#define Z087_CFGREG_SIZE	0x800		/* all from MODER to last Rx BD */
+#define WD_TX_TIMEOUT		(5 * HZ)	/* 5 seconds TX wait timeout */
+#define Z87_PACKLEN_DEFAULT	0x003c05fc	/* packet length defaults (without FCS) */
+
+/* BDDEF Buffer Descriptor defines
+ * Buffer Descriptor defines. ETH MAC can maintain up to 128 BDs in total.
+ * (0x80) BD location = base + 0x400 - base + 0x7ff ( =0x400 )
+ */
+#define Z087_BDSIZE		0x8		/* size in bytes of one BD */
+#define Z087_TBD_NUM		0x40		/* default number of TBDs */
+#define Z087_RBD_NUM		0x40		/* Z087_TBD_NUM make both equal	*/
+
+/* BDAREA address defines within one Buffer descriptor */
+#define Z087_BD_OFFS_LEN	0x2		/* offset of length within  BD */
+#define Z087_BD_OFFS_ADR	0x4		/* offset of Tx/Rx frame within this BD */
+
+enum boards {
+	F218,	/* 0 */
+	F301,	/* 1 */
+	F614	/* 2 */
+};
+
+enum z87_state {
+	__Z87_DOWN,	/* block TX and NAPI IRQ rearming while down */
+	__Z87_HW_DEAD,	/* core failed to idle, DMA buffers retained */
+};
+
+/*
+ * TX/RX Buffer Descriptors
+ * located between z87_base+0x400 and z87_base+0x800
+ */
+struct z87_bd {
+	void *addr;		/* pointer to buffer (cpu addr) */
+	dma_addr_t dma;		/* dma handle from dma_map_single or dma_alloc_coherent */
+	struct sk_buff *skb;	/* pointer to skb for this BD */
+};
+
+/*
+ * z87_i2c: structure for i2c core
+ */
+struct z87_i2c {
+	unsigned long base_addr;
+	struct i2c_adapter adapter;
+	struct i2c_algo_bit_data algo_bit;
+	unsigned int i2c_bug;
+};
+
+/*
+ * z87_desc: structure for a single buffer descriptor used by the hardware.
+ * They are located between z87_base+0x400 and z87_base+0x800.
+ * This structure represents a single buffer descriptor used by the Z87 hardware.
+ * It contains the flags and the address of the buffer associated with this descriptor.
+ * It is used by the driver to manage the transmission and reception of network packets.
+ */
+struct z87_desc {
+	__le32 flags;	/* flags for the buffer descriptor */
+	__le32 addr;	/* address of the buffer */
+};
+
+#define Z087_BD_AREA_SIZE	((Z087_TBD_NUM + Z087_RBD_NUM) * sizeof(struct z87_desc))
+
+struct z87_phy {
+	struct mii_bus *mdiobus;
+	struct phy_device *phydev;
+	phy_interface_t phy_interface;
+	int phy_addr;
+	bool link;
+	int speed;
+	int duplex;
+	bool hf_supported;		/* half/full duplex capability */
+};
+
+/*
+ * z087_private: main data struct for the driver
+ */
+struct z87_private {
+	u32 cur_rx;				/* current position of the Rx Bd */
+	u32 instance;				/* chameleon instance if more Z87  */
+	u32 phy_mode;				/* phy_mode  */
+	u32 phy_addr;				/* phy_addr */
+	u32 cur_tx;				/* next Tx BD to be filled */
+	u32 dty_tx;				/* oldest dirty Tx BD */
+	unsigned long bd_base;			/* start address of BDs in RAM */
+	dma_addr_t bd_hw;			/* DMA address of BDs in RAM */
+	u32 board;				/* board identifier of this eth */
+	u32 features;				/* feature flags for the driver */
+	struct work_struct reset_task;		/* process context resetting (ndo_tx_timeout) */
+	struct z87_bd tx_bd[Z087_TBD_NUM];	/* Tx Buffer Descriptor address */
+	struct z87_bd rx_bd[Z087_RBD_NUM];	/* Rx Buffer Descriptor address */
+	struct z87_desc *tx_desc;		/* pointer to Tx descriptors */
+	struct z87_desc *rx_desc;		/* pointer to Rx descriptors */
+	raw_spinlock_t lock;			/* main lock, taken in hardirq */
+	spinlock_t tx_lock;			/* lock for TX */
+	struct device *dma_dev;			/* the device we belong to */
+	struct device *parent;			/* parent device */
+	struct z87_phy phy;			/* PHY device information */
+	u32 msg_enable;				/* debug message level */
+	struct napi_struct napi;		/* NAPI struct */
+	struct net_device *dev;			/* net device */
+	struct z87_i2c *i2c;			/* i2c private data */
+	char model_name[MODELNAME_LEN];		/* model_name */
+	struct resource *mem;			/* memory resource */
+	unsigned long state;
+};
+
+const struct ethtool_ops *z87_get_ethtool_ops(void);
+
+#endif /* _MEN_Z87_MAIN_ */
diff --git a/drivers/net/ethernet/men/z87/men_z87_phy.c b/drivers/net/ethernet/men/z87/men_z87_phy.c
new file mode 100644
index 000000000000..355eca9a3409
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_phy.c
@@ -0,0 +1,673 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#include <linux/mii.h>
+#include "men_z87_main.h"
+#include "men_z87_hw.h"
+#include "men_z87_phy.h"
+
+/* timeout to wait for reply from MII */
+#define MII_ACCESS_TIMEOUT	10000
+
+/* The expected values for a Micrel KSZ8041 PHY in the PHY Identifier Register #2 (PHYIDR2). */
+#define PHY_ID2_KSZ8041_1	0x1512
+#define PHY_ID2_KSZ8041_2	0x1513
+
+/* The expected value for a TI DP83822 PHY in the PHY Identifier Register #1 (PHYIDR1). */
+#define PHY_DP83822_PHY_ID1	0x2000
+
+/*
+ * The device address to be set in the REGCR register of a a TI DP83822 PHY to direct any
+ * accesses of the ADDAR register to MMD.
+ */
+#define PHY_DP83822_DEVAD_MMD	0x1f
+
+/* TI DP83822 PHY specific MII registers */
+#define PHY_DP83822_MII_MLEDCR	0x25	/* The Multi-LED Control Register address */
+#define PHY_DP83822_MII_LEDCFG1	0x460	/* The LEDs Configuration Register #1 address */
+#define PHY_DP83822_MII_IOCTRL1	0x462	/* The IO MUX GPIO Control Register #1 address */
+
+#define Z087_PHY_IDLE_POLL_US	10
+#define Z087_PHY_IDLE_TOUT_US	10000
+
+static int z87_phy_reset(struct net_device *dev);
+static int z87_phy_set_defaults(struct net_device *dev);
+static int z87_phy_init_mode(struct net_device *dev);
+static int __mdio_read(struct net_device *dev, int phy_id, int location);
+static int __mdio_write(struct net_device *dev, int phy_id, int location, int val);
+static int z87_wait_status_busy_change(struct net_device *dev);
+
+static int z87_wait_status_busy_change(struct net_device *dev)
+{
+	u32 miival;
+	int res;
+
+	res = read_poll_timeout_atomic(z87_read32, miival,
+				       !(miival & OETH_MIISTATUS_BUSY),
+				       Z087_PHY_IDLE_POLL_US, Z087_PHY_IDLE_TOUT_US,
+				       false, dev, Z087_REG_MIISTATUS);
+
+	if (res) {
+		netdev_err(dev, "*** MII Read timeout!\n");
+		return -ETIMEDOUT;
+	}
+
+	return 0;
+}
+
+static int __mdio_read(struct net_device *dev, int phy_id, int location)
+{
+	int res;
+
+	/* wait until a previous BUSY disappears */
+	res = z87_wait_status_busy_change(dev);
+	if (res < 0)
+		goto mdio_read_out;
+
+	/*
+	 * set up combined PHY and Register within Phy,
+	 * then kick off read cmd
+	 */
+	z87_write32(dev, Z087_REG_MIIADR, (location & 0xff) << 8 | phy_id);
+	z87_write32(dev, Z087_REG_MIICMD, OETH_MIICMD_RSTAT);
+
+	/* wait until the PHY finished */
+	res = z87_wait_status_busy_change(dev);
+	if (res < 0)
+		goto mdio_read_out;
+
+	/* fetch read Value from MIIRX_DATA */
+	res = z87_read32(dev, Z087_REG_MIIRX_DATA);
+
+mdio_read_out:
+	return res;
+}
+
+static int __mdio_write(struct net_device *dev, int phy_id, int location, int val)
+{
+	int res;
+
+	/* wait until a previous BUSY disappears */
+	res = z87_wait_status_busy_change(dev);
+	if (res < 0)
+		goto mdio_write_out;
+
+	z87_write32(dev, Z087_REG_MIIADR, (location & 0xff) << 8 | phy_id);
+	z87_write32(dev, Z087_REG_MIITX_DATA, val);
+	z87_write32(dev, Z087_REG_MIICMD, OETH_MIICMD_WCTRLDATA);
+
+	/* wait until a previous BUSY disappears */
+	res = z87_wait_status_busy_change(dev);
+
+mdio_write_out:
+	return res;
+}
+
+static int z87_mdio_read(struct mii_bus *bus, int addr, int regnum)
+{
+	struct net_device *dev = bus->priv;
+
+	return __mdio_read(dev, addr, regnum);
+}
+
+static int z87_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
+{
+	struct net_device *dev = bus->priv;
+
+	return __mdio_write(dev, addr, regnum, val);
+}
+
+static int dp83822_conf_led(struct net_device *dev, u16 val)
+{
+	int res;
+
+	res = phy_write(dev->phydev, MII_MMD_CTRL, MII_MMD_CTRL_ADDR | PHY_DP83822_DEVAD_MMD);
+	if (res < 0)
+		return res;
+
+	res = phy_write(dev->phydev, MII_MMD_DATA, val);
+	if (res < 0)
+		return res;
+
+	res = phy_write(dev->phydev, MII_MMD_CTRL, MII_MMD_CTRL_NOINCR | PHY_DP83822_DEVAD_MMD);
+	if (res < 0)
+		return res;
+
+	return 0;
+}
+
+static int dp83822_conf_leds(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	int reg_val, res;
+
+	netdev_info(dev, "configure leds of dp83822 phy @ 0x%04x\n", np->phy.phy_addr);
+
+	/*
+	 * LED 0 configuration
+	 * Reference manual table 8-44: Multi-LED Control Register (MLEDCR)
+	 * Bits 1:0 = 0b11 (MLED routed to LED_0), bits 6:3 = 0b0001 (RX/TX Activity),
+	 * bit 9 = 0b1 (MLED Polarity Swap active high)
+	 */
+
+	res = dp83822_conf_led(dev, PHY_DP83822_MII_MLEDCR);
+	if (res < 0)
+		return res;
+
+	reg_val = phy_read(dev->phydev, MII_MMD_DATA);
+	if (reg_val < 0) {
+		netdev_err(dev, "unable to read MLEDCR phy register\n");
+		return reg_val;
+	}
+
+	res = phy_write(dev->phydev, MII_MMD_DATA, ((u16)reg_val & 0xfd84) | 0x020b);
+	if (res < 0)
+		return res;
+
+	/*
+	 * LED 1 configuration
+	 * Reference manual table 8-92: LEDs Configuration Register #1 (LEDCFG1)
+	 * Bits 11:8 = 0000 (LINK OK)
+	 */
+	res = dp83822_conf_led(dev, PHY_DP83822_MII_LEDCFG1);
+	if (res < 0)
+		return res;
+
+	reg_val = phy_read(dev->phydev, MII_MMD_DATA);
+	if (reg_val < 0) {
+		netdev_err(dev, "unable to read LEDCFG1 phy register\n");
+		return reg_val;
+	}
+
+	res = phy_write(dev->phydev, MII_MMD_DATA, (u16)reg_val & 0xf0ff);
+	if (res < 0)
+		return res;
+
+	/*
+	 * Reference manual table 8-94: IO MUX GPIO Control Register #1 (IOCTRL1)
+	 * Bits 2:0 = 001 (LED_1)
+	 */
+	res = dp83822_conf_led(dev, PHY_DP83822_MII_IOCTRL1);
+	if (res < 0)
+		return res;
+
+	/*
+	 * The dp83822_conf_led function already handles
+	 * the MMD address and control writes
+	 */
+	reg_val = phy_read(dev->phydev, MII_MMD_DATA);
+	if (reg_val < 0) {
+		netdev_err(dev, "unable to read IOCTRL1 phy register\n");
+		return reg_val;
+	}
+
+	res = phy_write(dev->phydev, MII_MMD_DATA, ((u16)reg_val & 0xfff8) | 0x0001);
+	if (res < 0)
+		return res;
+
+	return 0;
+}
+
+static int ksz8041_disable_leds(struct net_device *dev)
+{
+	s16 reg_val;
+
+	reg_val = phy_read(dev->phydev, 0x1e);
+	if (reg_val >= 0) {
+		/* just set bit14, bit 15 is reserved (datasheet p.29) */
+		reg_val |= BIT(14);
+		return phy_write(dev->phydev, 0x1e, (u16)reg_val);
+	}
+
+	return reg_val;
+}
+
+static inline void z87_phy_up(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	spin_lock_bh(&np->tx_lock);
+	if (!test_bit(__Z87_DOWN, &np->state))
+		netif_wake_queue(dev);
+	spin_unlock_bh(&np->tx_lock);
+	netif_carrier_on(dev);
+}
+
+static inline void z87_phy_down(struct net_device *dev)
+{
+	netif_stop_queue(dev);
+	netif_carrier_off(dev);
+}
+
+static int z87_set_duplex(struct net_device *dev, int duplex)
+{
+	struct z87_private *np = netdev_priv(dev);
+	unsigned long flags;
+	int res = 0;
+
+	raw_spin_lock_irqsave(&np->lock, flags);
+
+	if (duplex == DUPLEX_FULL)
+		z87_set_mode_flags(dev, OETH_MODER_FULLD);
+	else if (np->phy.hf_supported)
+		z87_clear_mode_flags(dev, OETH_MODER_FULLD);
+	else
+		res = -EOPNOTSUPP;
+
+	raw_spin_unlock_irqrestore(&np->lock, flags);
+
+	return res;
+}
+
+static void z87_adjust_link(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct phy_device *phydev;
+	bool changed;
+	int res;
+
+	phydev = np->phy.phydev;
+
+	if (!phydev)
+		return;
+
+	changed = (np->phy.link != phydev->link);
+
+	if (phydev->link) {
+		if (changed ||
+		    np->phy.speed != phydev->speed ||
+		    np->phy.duplex != phydev->duplex) {
+			/*
+			 * Reconfigure the MAC when relevant parameters change.
+			 */
+			np->phy.speed = phydev->speed;
+			np->phy.duplex = phydev->duplex;
+			res = z87_set_duplex(dev, phydev->duplex);
+			if (res < 0) {
+				netdev_warn(dev, "half duplex not supported. link down\n");
+				z87_phy_down(dev);
+				return;
+			}
+
+			netdev_info(dev, "link up, %d Mbps, %s duplex\n",
+				    phydev->speed,
+				    phydev->duplex == DUPLEX_FULL ?
+				    "full" : "half");
+		}
+		if (changed)
+			z87_phy_up(dev);
+
+	} else if (changed) {
+		z87_phy_down(dev);
+		netdev_info(dev, "link down\n");
+	}
+
+	np->phy.link = phydev->link;
+}
+
+int z87_phy_register_mdio(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct mii_bus *bus;
+	int ret;
+
+	bus = mdiobus_alloc();
+	if (!bus)
+		return -ENOMEM;
+
+	bus->name = "men-z87-mdio";
+	bus->read = z87_mdio_read;
+	bus->write = z87_mdio_write;
+	bus->parent = np->parent;
+	bus->priv = dev;
+
+	snprintf(bus->id, MII_BUS_ID_SIZE, "phy-%s", dev_name(np->parent));
+
+	if (np->phy.phy_addr >= 0 && np->phy.phy_addr < 32)
+		bus->phy_mask = ~BIT(np->phy.phy_addr);
+
+	ret = mdiobus_register(bus);
+	if (ret) {
+		dev_err(np->parent, "Unable to register MDIO: %d\n", ret);
+		mdiobus_free(bus);
+		return ret;
+	}
+
+	dev_info(np->parent, "MDIO bus registered with ID: %s\n", bus->id);
+
+	np->phy.mdiobus = bus;
+
+	return 0;
+}
+
+int z87_phy_unregister_mdio(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	if (np->phy.mdiobus) {
+		mdiobus_unregister(np->phy.mdiobus);
+		mdiobus_free(np->phy.mdiobus);
+		np->phy.mdiobus = NULL;
+	}
+
+	return 0;
+}
+
+int z87_phy_connect(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct phy_device *phydev;
+	int ret;
+
+	phydev = mdiobus_get_phy(np->phy.mdiobus, np->phy.phy_addr);
+	if (!phydev) {
+		netdev_err(dev, "PHY not found at MDIO address: %d\n",
+			   np->phy.phy_addr);
+		return -ENODEV;
+	}
+
+	ret = phy_connect_direct(dev, phydev,
+				 z87_adjust_link,
+				 np->phy.phy_interface);
+	if (ret) {
+		netdev_err(dev, "Unable to connect PHY: %d\n", ret);
+		return ret;
+	}
+
+	np->phy.phydev = phydev;
+
+	/* Limit to the actual MAC capability */
+	phy_set_max_speed(phydev, SPEED_100);
+
+	if (!np->phy.hf_supported) {
+		phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
+		phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
+	}
+
+	/* Set board defaults before users can configure the link through phylib. */
+	ret = z87_phy_set_defaults(dev);
+	if (ret) {
+		z87_phy_disconnect(dev);
+		return ret;
+	}
+
+	return 0;
+}
+
+int z87_phy_disconnect(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+
+	if (np->phy.phydev) {
+		phy_disconnect(np->phy.phydev);
+		np->phy.phydev = NULL;
+	}
+
+	return 0;
+}
+
+int z87_phy_init(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct phy_device *phydev = dev->phydev;
+	u8 phy_addr = np->phy.phy_addr;
+	u16 dat = 0;
+	int reg_val;
+	int res;
+
+	if (!phydev)
+		return -ENODEV;
+
+	/* reset the PHY */
+	res = z87_phy_reset(dev);
+	if (res < 0)
+		return res;
+
+	netdev_dbg(dev, "init PHY %s (ID 0x%08x) @ 0x%04x\n",
+		   phydev_name(phydev), phydev->phy_id, phy_addr);
+
+	switch (np->board) {
+	case F614:
+		if ((phydev->phy_id >> 16) == PHY_DP83822_PHY_ID1) {
+			res = dp83822_conf_leds(dev);
+			if (res < 0) {
+				netdev_warn(dev, "Failed to configure DP83822 LEDs: %d\n", res);
+				return res;
+			}
+		}
+		break;
+	case F218:
+		dat = phydev->phy_id & 0xffff;
+
+		/* on F218 revert the Link and activity LED */
+		if (dat == PHY_ID2_KSZ8041_1 || dat == PHY_ID2_KSZ8041_2) {
+			res = ksz8041_disable_leds(dev);
+			if (res < 0) {
+				netdev_warn(dev, "Failed to disable KSZ8041 LEDs: %d\n", res);
+				return res;
+			}
+		}
+	}
+
+	/* disable powerdown mode */
+	reg_val = phy_read(dev->phydev, MII_100_BASE_TX_PHY);
+	if (reg_val >= 0) {
+		reg_val &= ~(MII_100BASE_PWR);
+		res = phy_write(dev->phydev, MII_100_BASE_TX_PHY, reg_val);
+		if (res < 0) {
+			netdev_warn(dev, "Failed to write PHY powerdown register: %d\n", res);
+			return res;
+		}
+	} else {
+		netdev_warn(dev, "Failed to read PHY powerdown register: %d\n", reg_val);
+		return reg_val;
+	}
+
+	/* Reapply the current phylib settings after the PHY reset. */
+	return z87_phy_init_mode(dev);
+}
+
+static int z87_phy_reset(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	u8 phy_addr = np->phy.phy_addr;
+	unsigned int wait_cnt = 1000;
+	s16 reg_val;
+	int res;
+
+	phy_read(dev->phydev, MII_BMCR);
+	z87_read32(dev, Z087_REG_MIISTATUS);
+	res = phy_write(dev->phydev, MII_BMCR, BMCR_RESET);
+	if (res < 0) {
+		netdev_err(dev, "PHY %d reset failed!\n", phy_addr);
+		return res;
+	}
+
+	msleep(300);
+
+	while (--wait_cnt > 0) {
+		reg_val = phy_read(dev->phydev, MII_BMCR);
+		if (reg_val >= 0 && (reg_val & BMCR_RESET) == 0)
+			break;
+
+		usleep_range(10, 20);
+	}
+
+	if (wait_cnt == 0) {
+		netdev_err(dev, "PHY %d reset never completed!\n", phy_addr);
+		return -EIO;
+	}
+
+	usleep_range(40, 50);
+
+	phy_read(dev->phydev, MII_BMCR);
+
+	return 0;
+}
+
+static int z87_phy_set_defaults(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct phy_device *phydev = dev->phydev;
+
+	if (!phydev)
+		return -ENODEV;
+
+	switch (np->phy_mode) {
+	case phymode_10hd:
+		phydev->autoneg = AUTONEG_DISABLE;
+		phydev->speed = SPEED_10;
+		phydev->duplex = DUPLEX_HALF;
+		break;
+
+	case phymode_10fd:
+		phydev->autoneg = AUTONEG_DISABLE;
+		phydev->speed = SPEED_10;
+		phydev->duplex = DUPLEX_FULL;
+		break;
+
+	case phymode_100hd:
+		phydev->autoneg = AUTONEG_DISABLE;
+		phydev->speed = SPEED_100;
+		phydev->duplex = DUPLEX_HALF;
+		break;
+
+	case phymode_100fd:
+		phydev->autoneg = AUTONEG_DISABLE;
+		phydev->speed = SPEED_100;
+		phydev->duplex = DUPLEX_FULL;
+		break;
+
+	case phymode_auto:
+		phydev->autoneg = AUTONEG_ENABLE;
+		break;
+
+	default:
+		netdev_err(dev, "invalid PHY mode parameter %d\n",
+			   np->phy_mode);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int z87_phy_init_mode(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	struct phy_device *phydev = dev->phydev;
+	int ret;
+
+	if (!phydev)
+		return -ENODEV;
+
+	if (phydev->duplex == DUPLEX_HALF && !np->phy.hf_supported) {
+		netdev_warn(dev, "Half-duplex not supported by hardware, aborting\n");
+		return -EOPNOTSUPP;
+	}
+
+	/*
+	 * Tell phylib to apply the configured autoneg, speed, and duplex settings.
+	 */
+	ret = phy_start_aneg(phydev);
+	if (ret)
+		netdev_err(dev, "could not configure PHY mode: %d\n", ret);
+
+	return ret;
+}
+
+int z87_phy_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	if (!dev->phydev)
+		return -ENODEV;
+
+	return phy_mii_ioctl(dev->phydev, ifr, cmd);
+}
+
+void z87_phy_regdump(struct net_device *dev)
+{
+	struct z87_private *np = netdev_priv(dev);
+	const char *link_type;
+	s16 dat = 0;
+
+	netdev_info(dev, "----- MII Registers -----\n");
+	netdev_info(dev, "instance\t\t\t0x%02x\n", np->instance);
+	netdev_info(dev, "PHY ADR\t\t\t0x%02x\n", np->phy.phy_addr);
+
+	dat = phy_read(dev->phydev, MII_BMCR);
+	if (dat >= 0)
+		netdev_info(dev, "MII_BMCR\t\t\t0x%04x\n", dat);
+	else
+		netdev_info(dev, "MII_BMCR\t\t\tError (%d)\n", dat);
+
+	/* initially the link status isn't up to date, read it twice.. */
+	dat = phy_read(dev->phydev, MII_BMSR);
+	dat = phy_read(dev->phydev, MII_BMSR);
+
+	if (dat >= 0)
+		netdev_info(dev, "MII_BMSR\t\t0x%04x\tLink: %s\n",
+			    dat, (dat & BMSR_LSTATUS) ? "up" : "down");
+	else
+		netdev_info(dev, "MII_BMSR\t\tError (%d)\n", dat);
+
+	dat = phy_read(dev->phydev, MII_PHYSID1);
+	if (dat >= 0)
+		netdev_info(dev, "MII_PHYSID1\t\t0x%04x\n", dat);
+	else
+		netdev_info(dev, "MII_PHYSID1\t\tError (%d)\n", dat);
+
+	dat = phy_read(dev->phydev, MII_PHYSID2);
+	if (dat >= 0)
+		netdev_info(dev, "MII_PHYSID2\t\t0x%04x\n", dat);
+	else
+		netdev_info(dev, "MII_PHYSID2\t\tError (%d)\n", dat);
+
+	dat = phy_read(dev->phydev, MII_ADVERTISE);
+	if (dat >= 0)
+		netdev_info(dev, "MII_ADVERTISE\t\t0x%04x\n", dat);
+	else
+		netdev_info(dev, "MII_ADVERTISE\t\tError (%d)\n", dat);
+
+	dat = phy_read(dev->phydev, MII_LPA);
+	if (dat >= 0)
+		netdev_info(dev, "MII_LPA\t\t\t0x%04x\n", dat);
+	else
+		netdev_info(dev, "MII_LPA\t\t\tError (%d)\n", dat);
+
+	dat = phy_read(dev->phydev, MII_100_BASE_TX_PHY);
+	if (dat >= 0) {
+		/* dump PHY Op Mode Indication Reg. Bits [4..2] */
+		switch ((dat & 0x1c) >> 2) {
+		case 0x0:
+			link_type = "Autoneg";
+			break;
+		case 0x1:
+			link_type = "10MB HD";
+			break;
+		case 0x2:
+			link_type = "100MB HD";
+			break;
+		case 0x3:
+			link_type = "Default";
+			break;
+		case 0x5:
+			link_type = "10MB FD";
+			break;
+		case 0x6:
+			link_type = "100MB FD";
+			break;
+		case 0x7:
+			link_type = "PHY Isolated";
+			break;
+		default:
+			link_type = "unknown";
+			break;
+		}
+		netdev_info(dev, "MII_100_BASE_TX_PHY\t0x%04x (%s)\n", dat, link_type);
+	} else {
+		netdev_info(dev, "MII_100_BASE_TX_PHY\tError (%d)\n", dat);
+	}
+}
diff --git a/drivers/net/ethernet/men/z87/men_z87_phy.h b/drivers/net/ethernet/men/z87/men_z87_phy.h
new file mode 100644
index 000000000000..0f6fe68b3510
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_phy.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#ifndef _MEN_Z87_PHY_
+#define _MEN_Z87_PHY_
+
+enum phymodes {
+	phymode_auto,		/* 0 */
+	phymode_10hd,		/* 1 */
+	phymode_10fd,		/* 2 */
+	phymode_100hd,		/* 3 */
+	phymode_100fd		/* 4 */
+};
+
+int z87_phy_register_mdio(struct net_device *dev);
+int z87_phy_unregister_mdio(struct net_device *dev);
+int z87_phy_connect(struct net_device *dev);
+int z87_phy_disconnect(struct net_device *dev);
+int z87_phy_init(struct net_device *dev);
+int z87_phy_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+void z87_phy_regdump(struct net_device *dev);
+
+#endif /* _MEN_Z87_PHY_ */
diff --git a/drivers/net/ethernet/men/z87/men_z87_regs.h b/drivers/net/ethernet/men/z87/men_z87_regs.h
new file mode 100644
index 000000000000..681b62ced243
--- /dev/null
+++ b/drivers/net/ethernet/men/z87/men_z87_regs.h
@@ -0,0 +1,98 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2026 duagon Germany GmbH
+ *
+ * See MAINTAINERS file for support contact information.
+ */
+
+#ifndef _MEN_Z87_REGS_H_
+#define _MEN_Z87_REGS_H_
+
+#include <linux/bits.h>
+
+/* Z087_REGISTERS */
+#define Z087_REG_MODER		0x00	/* Mode control */
+#define Z087_REG_INT_SRC	0x04	/* IRQ source */
+#define Z087_REG_INT_MASK	0x08	/* IRQ Masking */
+#define Z087_REG_PACKLEN	0x18	/* Packet Len (min/max) */
+#define Z087_REG_COLLCONF	0x1c	/* Collision/Retry Conf */
+#define Z087_REG_CTRLMODER	0x24	/* Control Module Mode */
+#define Z087_REG_MIIMODER	0x28	/* MII Mode Register */
+#define Z087_REG_MIICMD		0x2c	/* MII command */
+#define Z087_REG_MIIADR		0x30	/* MII Address */
+#define Z087_REG_MIITX_DATA	0x34	/* MII Transmit Data */
+#define Z087_REG_MIIRX_DATA	0x38	/* MII Receive Data */
+#define Z087_REG_MIISTATUS	0x3c	/* MII Status */
+#define Z087_REG_MAC_ADDR0	0x40	/* MAC Addr[0-3] */
+#define Z087_REG_MAC_ADDR1	0x44	/* MAC Addr[4-5] */
+#define Z087_REG_HASH_ADDR0	0x48	/* Hash Reg 0 */
+#define Z087_REG_HASH_ADDR1	0x4c	/* Hash Reg 1 */
+#define Z087_REG_TXCTRL		0x50	/* TX control */
+#define Z087_REG_BDSTART	0x5c	/* Startaddr of TxRx BDs */
+#define Z087_REG_RXEMPTY0	0x60	/* RxBD[31:0] empty Flag */
+#define Z087_REG_RXEMPTY1	0x64	/* RxBD[63:32]empty Flag */
+#define Z087_REG_TXEMPTY0	0x68	/* TxBD[31:0] empty Flag */
+#define Z087_REG_TXEMPTY1	0x6c	/* TxBD[63:32]empty Flag */
+#define Z087_REG_RXBDSTAT	0x70	/* RxBD count and status */
+#define Z087_REG_SMBCTRL	0x74	/* SMBus bitbang interface */
+#define Z087_REG_COREREV	0x78	/* core revision register */
+#define Z087_REG_RXERRCNT1	0x7c	/* Symbol/CRC errors count */
+#define Z087_REG_RXERRCNT2	0x80	/* # of rcvd Frames/busy Err count */
+#define Z087_REG_TXERRCNT1	0x84	/* FIFO underrun/Late coll. count */
+#define Z087_REG_TXERRCNT2	0x88	/* # of sent frames/TxBD full count */
+
+/* TXDB Tx Buffer Descriptor Bits */
+#define OETH_TX_BD_UNDERRUN	BIT(8)		/* Tx BD Underrun Status */
+#define OETH_TX_BD_RETRY	GENMASK(7, 4)	/* Tx BD Retry Status */
+#define OETH_TX_BD_RETLIM	BIT(3)		/* Tx BD Retransm Limit Stat */
+#define OETH_TX_BD_LATECOL	BIT(2)		/* Tx BD Late Collision Stat */
+#define OETH_TX_BD_DEFER	BIT(1)		/* Tx BD Defer Status */
+#define OETH_TX_BD_CARRIER	BIT(0)		/* Tx BD Carrier Sense Lost Status */
+
+/* RXDB Rx Buffer Descriptor Bits */
+#define OETH_RX_BD_EMPTY	BIT(15)		/* Rx BD Empty */
+#define OETH_RX_BD_OVERRUN	BIT(6)		/* Rx BD Overrun Status */
+#define OETH_RX_BD_INVSYMB	BIT(5)		/* Rx BD Invalid Symbol Status */
+#define OETH_RX_BD_DRIBBLE	BIT(4)		/* Rx BD Dribble Nibble Status */
+#define OETH_RX_BD_TOOLONG	BIT(3)		/* Rx BD Too Long Status */
+#define OETH_RX_BD_SHORT	BIT(2)		/* Rx BD Too Short Frame Status */
+#define OETH_RX_BD_CRCERR	BIT(1)		/* Rx BD CRC Error Status */
+#define OETH_RX_BD_LATECOL	BIT(0)		/* Rx BD Late Collision Status */
+
+/* COREREV Core Revision Bits */
+#define REG_COREREV_IRQNEWEN	BIT(8)		/* Enable new interrupt behavior */
+
+/* MODER Register bits description */
+#define OETH_MODER_RXEN		BIT(0)		/* Receive Enable */
+#define OETH_MODER_TXEN		BIT(1)		/* Transmit Enable */
+#define OETH_MODER_BRO		BIT(3)		/* Broadcast Enable*/
+#define OETH_MODER_IAM		BIT(4)		/* Use Individual Hash */
+#define OETH_MODER_PRO		BIT(5)		/* Promisc Mode */
+#define OETH_MODER_IFG		BIT(6)		/* Min. IFG not required  REV01:NA */
+#define OETH_MODER_EXDFREN	BIT(9)		/* Excess Defer REV01:NA	*/
+#define OETH_MODER_FULLD	BIT(10)		/* Full Duplex */
+#define OETH_MODER_CRCEN	BIT(13)		/* CRC Enable */
+#define OETH_MODER_PAD		BIT(15)		/* Pad Enable */
+#define OETH_MODER_RECSMALL	BIT(16)		/* Receive Small REV01:NA */
+#define OETH_MODER_RX_IDLE	BIT(17)		/* RX Idle Status */
+#define OETH_MODER_TX_IDLE	BIT(18)		/* TX Idle Status */
+#define OETH_MODER_HD_AVAL	BIT(19)		/* Half duplex available */
+
+/* INTS Interrupt Source Register bits description */
+#define OETH_INT_TXF            BIT(0)          /* Transmit Frame IRQ */
+#define OETH_INT_TXE		BIT(1)		/* Transmit Error IRQ */
+#define OETH_INT_RXF		BIT(2)		/* Receive Frame IRQ */
+#define OETH_INT_RXE		BIT(3)		/* Receive Error IRQ */
+
+/* CMDR MII Command Register */
+#define OETH_MIICMD_RSTAT	BIT(1)		/* Read Status */
+#define OETH_MIICMD_WCTRLDATA	BIT(2)		/* Write Control Data */
+
+/* MIISR MII Status Register */
+#define OETH_MIISTATUS_BUSY	BIT(1)		/* MII Busy */
+
+/* MISCR Misc defines */
+#define MII_100_BASE_TX_PHY	0x1f
+#define MII_100BASE_PWR		BIT(10)
+
+#endif /* _MEN_Z87_REGS_H_ */
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RFC net-next 2/2] net: ethernet: add build support for MEN Z87 driver
  2026-12-01 15:40 [RFC net-next 0/2] net: ethernet: add MEN Z087 driver Jose Javier Rodriguez Barbarin
  2026-12-01 15:40 ` [RFC net-next 1/2] net: ethernet: add MEN Z87 driver Jose Javier Rodriguez Barbarin
@ 2026-12-01 15:40 ` Jose Javier Rodriguez Barbarin
  2026-12-01 18:28   ` Andrew Lunn
  1 sibling, 1 reply; 6+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2026-12-01 15:40 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel,
	Jose Javier Rodriguez Barbarin, Filip Jensen

Add the MEN Ethernet Kconfig and Makefile entries and hook them into
the top-level ethernet build system.

Reviewed-by: Filip Jensen <dev-Felipe.Jensen@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
---
 drivers/net/ethernet/Kconfig  | 1 +
 drivers/net/ethernet/Makefile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index c2b0161d0bec..15ccaa66a3d4 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -110,6 +110,7 @@ source "drivers/net/ethernet/litex/Kconfig"
 source "drivers/net/ethernet/marvell/Kconfig"
 source "drivers/net/ethernet/mediatek/Kconfig"
 source "drivers/net/ethernet/mellanox/Kconfig"
+source "drivers/net/ethernet/men/Kconfig"
 source "drivers/net/ethernet/meta/Kconfig"
 source "drivers/net/ethernet/micrel/Kconfig"
 source "drivers/net/ethernet/microchip/Kconfig"
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index a306dae23bcb..84cdd52cb1eb 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -58,6 +58,7 @@ obj-$(CONFIG_NET_VENDOR_LITEX) += litex/
 obj-$(CONFIG_NET_VENDOR_MARVELL) += marvell/
 obj-$(CONFIG_NET_VENDOR_MEDIATEK) += mediatek/
 obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/
+obj-$(CONFIG_NET_VENDOR_MEN) += men/
 obj-$(CONFIG_NET_VENDOR_META) += meta/
 obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/
 obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC net-next 1/2] net: ethernet: add MEN Z87 driver
  2026-12-01 15:40 ` [RFC net-next 1/2] net: ethernet: add MEN Z87 driver Jose Javier Rodriguez Barbarin
@ 2026-12-01 18:27   ` Andrew Lunn
  2026-12-02 14:43     ` Jose Javier Rodriguez Barbarin
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2026-12-01 18:27 UTC (permalink / raw)
  To: Jose Javier Rodriguez Barbarin
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
	linux-kernel, Filip Jensen

> +static void z87_ethtool_get_drvinfo(struct net_device *dev,
> +				    struct ethtool_drvinfo *info)
> +{
> +	struct z87_private  *np = netdev_priv(dev);
> +	unsigned long flags;
> +
> +	raw_spin_lock_irqsave(&np->lock, flags);
> +
> +	strscpy(info->driver, np->model_name, sizeof(info->driver));
> +	strscpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
> +
> +	raw_spin_unlock_irqrestore(&np->lock, flags);

Why is locking needed here? I don't know of any other driver which
does this.

> +static const struct ethtool_ops men_z87_ethtool_ops = {
> +	.get_drvinfo		= z87_ethtool_get_drvinfo,
> +	.get_link_ksettings	= phy_ethtool_get_link_ksettings,
> +	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
> +	.nway_reset		= phy_ethtool_nway_reset,

Ideally you should use phylink, not phylib. The API is better, you are
less likely to make the errors everybody else does with pause, WoL,
EEE etc.

> +const struct ethtool_ops *z87_get_ethtool_ops(void)
> +{
> +	return &men_z87_ethtool_ops;
> +}

Global function vs global structure. I would keep it KISS and just
make men_z87_ethtool_ops global.

> +/* Generic BD accessors */
> +
> +static inline void z87_bd_set_addr(const struct z87_private *np, struct z87_desc *desc, u32 addr)
> +{
> +	WRITE_ONCE(desc->addr, cpu_to_le32(addr));
> +	/* ensure DMA ordering */
> +	dma_wmb();

Getting the memory barrier correct is not simple. So they should not
be hidden in include files. Please put them in the C code where they
can be seen and reviewed easily.

> +struct z87_i2c *z87_i2c_alloc(struct device *dev, unsigned long addr)
> +{
> +	struct z87_i2c *i2c;
> +	int ret;
> +
> +	i2c = kzalloc_obj(struct z87_i2c);
> +
> +	if (!i2c)
> +		return ERR_PTR(-ENOMEM);
> +
> +	// Initialize z87_i2c stuff
> +	i2c->base_addr = addr;
> +	i2c->i2c_bug = 0;
> +
> +	// Prepare i2c adapter
> +	i2c->adapter.owner = THIS_MODULE;
> +	i2c->adapter.dev.parent = dev;
> +	i2c->adapter.algo_data = &i2c->algo_bit;
> +	snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
> +		 "I2C adapter at %s", dev_name(dev));
> +
> +	// Prepare i2c bit-banging functions, parameters and private data.
> +	i2c->algo_bit.setsda = z87_set_sda;
> +	i2c->algo_bit.setscl = z87_set_scl;
> +	i2c->algo_bit.getsda = z87_get_sda;
> +	i2c->algo_bit.getscl = z87_get_scl;
> +	i2c->algo_bit.udelay = 10; /* Recommended for SMBus */
> +	i2c->algo_bit.timeout = usecs_to_jiffies(1000);
> +	i2c->algo_bit.data = i2c;

Is this an existing open cores I2C bus master? Or is it specific to
this device? I'm just wondering if the whole thing exists somewhere
else and you just need to instantiate the driver.

> +/* Typedefs */
> +static int z87_open(struct net_device *dev);
> +static int z87_start_xmit(struct sk_buff *skb, struct net_device *dev);
> +static irqreturn_t z87_irq(int irq, void *dev_id);
> +static int z87_close(struct net_device *dev);
> +static void z87_tx_timeout(struct net_device *dev, unsigned int txqueue);
> +static int z87_poll(struct napi_struct *napi, int budget);
> +static void z87_pass_packet(struct napi_struct *napi, unsigned int idx);
> +static int z87_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
> +static void z87_hash_table_setup(struct net_device *dev);
> +static int z87_ether_gen_crc(const u8 *data);
> +static const struct board_config *z87_get_board_config(struct mcb_device *mdev);
> +static void z87_load_mac_addr(struct net_device *dev);
> +static int z87_alloc_rx_bd(struct net_device *dev);
> +static void z87_free_rx_bd(struct net_device *dev);
> +static int z87_hw_stop(struct net_device *dev);
> +static int z87_hw_start(struct net_device *dev);

Don't do this. Put the functions in the correct order so they are
declared before they are used. That allows the compiler to inline, so
you get better executable code.

> +static int z87_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> +	if (new_mtu < ETH_MIN_MTU || new_mtu > ETH_DATA_LEN)
> +		return -EINVAL;

If you set netdev->max_mtu and netdev->min_mtu, the core will do this
validation for you.

> +static void z87_regdump(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	struct z87_desc tx_desc[Z087_TBD_NUM];
> +	u32 cur_tx, dty_tx, cur_rx;
> +	unsigned long i = 0;
> +	u32 tmp = 0;
> +
> +	/* Snapshot software TX state; hardware may still update descriptors. */
> +	spin_lock_bh(&np->tx_lock);
> +	cur_tx = np->cur_tx;
> +	dty_tx = np->dty_tx;
> +	cur_rx = READ_ONCE(np->cur_rx);
> +
> +	spin_unlock_bh(&np->tx_lock);
> +
> +	netdev_info(dev, "(netdevice '%s') base Addr: 0x%08lx\n",
> +		    dev->name, dev->base_addr);
> +
> +	while (z87_reginfo[i].addr != 0xffff) {
> +		tmp = z87_read32(dev, z87_reginfo[i].addr);
> +		netdev_info(dev, "%s   0x%08x\n", z87_reginfo[i].name, tmp);
> +		i++;
> +	}
> +
> +	z87_phy_regdump(dev);
> +
> +	netdev_info(dev, "cur_tx 0x%02x, dty_tx 0x%02x, cur_rx 0x%02x\n",
> +		    cur_tx, dty_tx, cur_rx);
> +
> +	if (READ_ONCE(np->msg_enable) > 0) {
> +		netdev_info(dev,
> +			    "------------------ TX BDs: -------------------\n");
> +		for (i = 0; i < Z087_TBD_NUM; i++) {
> +			tx_desc[i].flags = READ_ONCE(np->tx_desc[i].flags);
> +			tx_desc[i].addr = READ_ONCE(np->tx_desc[i].addr);
> +
> +			netdev_info(dev,
> +				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
> +				    i,
> +				    z87_bd_get_flags(np, &tx_desc[i], 0xffff),
> +				    z87_bd_get_len(np, &tx_desc[i]),
> +				    z87_bd_get_addr(np, &tx_desc[i]));
> +		}
> +
> +		netdev_info(dev,
> +			    "------------------ RX BDs: -------------------\n");
> +		for (i = 0; i < Z087_RBD_NUM; i++) {
> +			netdev_info(dev,
> +				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
> +				    i,
> +				    z87_rbd_get_flags(np, i, 0xffff),
> +				    z87_rbd_get_len(np, i),
> +				    z87_rbd_get_addr(np, i));
> +		}
> +	}
> +}

This seems like debug code. It should not be in a mainline driver.

> +static void z87_load_mac_addr(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	u8 mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
> +	struct sockaddr addr;
> +	int res;
> +
> +	z87_load_mac(dev, mac);
> +
> +	if (is_valid_ether_addr(mac)) {
> +		netdev_info(dev,
> +			    "using MAC %02x:%02x:%02x:%02x:%02x:%02x from registers.\n",
> +			    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);

This driver seems to be quite verbose. Generally, there is maybe one
call to netdev_info() in a driver. Consider change some of these to
netdev_dbg(), or removing them.

> +static bool z87_rx_bd_errors(struct net_device *dev, unsigned int idx)
> +{
> +	const u16 rx_err_mask = OETH_RX_BD_OVERRUN | OETH_RX_BD_INVSYMB |
> +		OETH_RX_BD_DRIBBLE | OETH_RX_BD_TOOLONG |
> +		OETH_RX_BD_SHORT | OETH_RX_BD_CRCERR |
> +		OETH_RX_BD_LATECOL;
> +	struct z87_private *np = netdev_priv(dev);
> +	u16 rx_err_flags;
> +
> +	rx_err_flags = z87_rbd_get_flags(np, idx, rx_err_mask);
> +	if (!rx_err_flags)
> +		return false;
> +
> +	if (rx_err_flags & OETH_RX_BD_OVERRUN) {
> +		netdev_warn(dev, "*** RX: overrun[%u]\n", idx);

These sorts of prints can spam the log, act as a DoS, if they can be
triggered from a remote device.

> +		DEV_STATS_INC(dev, rx_over_errors);

The counter should be sufficient.

> +static int z87_hw_stop(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	unsigned long flags;
> +	int res;
> +
> +	/* already stopped by a previous failed attempt (napi disabled, phy stopped) */
> +	if (test_bit(__Z87_HW_DEAD, &np->state))
> +		return -EIO;
> +
> +	spin_lock_bh(&np->tx_lock);
> +	set_bit(__Z87_DOWN, &np->state);
> +	spin_unlock_bh(&np->tx_lock);
> +	netif_tx_disable(dev);
> +
> +	netif_carrier_off(dev);
> +
> +	if (dev->phydev)
> +		phy_stop(dev->phydev);

It seems like z87_hw_start() always assumes there is a PHY, or it
errors out. So there is no need for the test.

> +static int z87_hw_start(struct net_device *dev)
> +{

> +	res = z87_phy_init(dev);
> +	if (res < 0) {
> +		netdev_err(dev, "*** PHY Initialization failed!\n");
> +		return res;
> +	}
> +
> +	phy_start(dev->phydev);


> +static int z87_probe(struct mcb_device *mdev,
> +		     const struct mcb_device_id *id)
> +{
> +	const struct board_config *cfg = NULL;
> +	struct net_device *dev = NULL;
> +	struct z87_private *np = NULL;
> +	void *mem_virt_dma = NULL;
> +	dma_addr_t mem_hw_dma;
> +	struct resource *mem;
> +	int res = -ENXIO;
> +
> +	cfg = z87_get_board_config(mdev);
> +	if (!cfg)
> +		return -EOPNOTSUPP;
> +
> +	/**
> +	 * mdev->inst is defined in a per-board basis, so lets check
> +	 * if there are more devices that defined for the board. In that
> +	 * case, something is wrong.
> +	 */
> +	if (mdev->inst >= cfg->num_devs) {
> +		return dev_err_probe(&mdev->dev, -EINVAL,
> +				     "detected more devices than configured for board: %s",
> +				     cfg->board_name);
> +	}

Does something actually go wrong if there are more?

> +	 * if more than one Z87 ethernet core is implemented in one PCI function
> +	 * on one chameleon FPGA, the device port is important for distinct ethernet
> +	 * device identification during interface renaming via systemd/udev. We start
> +	 * counting at 1 to have a constant naming scheme; 0 is omitted during renaming
> +	 */
> +	dev->dev_port = mdev->inst + 1;

This often goes wrong, if the module can be unloaded, or the device
unbound and bound again. We also see LLM generated patches changing
code like this, because in theory, it cover wrap around and then bad
things happened. The fact it will take years does not stop the script
kiddies using the LLM from submitting the patches.

> diff --git a/drivers/net/ethernet/men/z87/men_z87_phy.c b/drivers/net/ethernet/men/z87/men_z87_phy.c
> new file mode 100644
> index 000000000000..355eca9a3409
> --- /dev/null
> +++ b/drivers/net/ethernet/men/z87/men_z87_phy.c
> @@ -0,0 +1,673 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2026 duagon Germany GmbH
> + *
> + * See MAINTAINERS file for support contact information.
> + */
> +
> +#include <linux/mii.h>
> +#include "men_z87_main.h"
> +#include "men_z87_hw.h"
> +#include "men_z87_phy.h"
> +
> +/* timeout to wait for reply from MII */
> +#define MII_ACCESS_TIMEOUT	10000
> +
> +/* The expected values for a Micrel KSZ8041 PHY in the PHY Identifier Register #2 (PHYIDR2). */
> +#define PHY_ID2_KSZ8041_1	0x1512
> +#define PHY_ID2_KSZ8041_2	0x1513

The MAC driver should not care about what the PHY is. phylib drivers
driver the PHY, the MAC driver should not touch it.

> +static int z87_mdio_read(struct mii_bus *bus, int addr, int regnum)
> +{
> +	struct net_device *dev = bus->priv;
> +
> +	return __mdio_read(dev, addr, regnum);

Pointless wrapper.

> +static int dp83822_conf_led(struct net_device *dev, u16 val)

Sorry, but no. The PHY driver should export the LEDs via
/sys/class/leds.

> +static void z87_adjust_link(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	struct phy_device *phydev;
> +	bool changed;
> +	int res;
> +
> +	phydev = np->phy.phydev;
> +
> +	if (!phydev)
> +		return;
> +
> +	changed = (np->phy.link != phydev->link);
> +
> +	if (phydev->link) {
> +		if (changed ||
> +		    np->phy.speed != phydev->speed ||
> +		    np->phy.duplex != phydev->duplex) {
> +			/*
> +			 * Reconfigure the MAC when relevant parameters change.
> +			 */
> +			np->phy.speed = phydev->speed;
> +			np->phy.duplex = phydev->duplex;
> +			res = z87_set_duplex(dev, phydev->duplex);
> +			if (res < 0) {
> +				netdev_warn(dev, "half duplex not supported. link down\n");

Something is broken if you get asked to do half duplex and it is not
supported.

> +int z87_phy_register_mdio(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	struct mii_bus *bus;
> +	int ret;
> +
> +	bus = mdiobus_alloc();
> +	if (!bus)
> +		return -ENOMEM;
> +
> +	bus->name = "men-z87-mdio";
> +	bus->read = z87_mdio_read;
> +	bus->write = z87_mdio_write;
> +	bus->parent = np->parent;
> +	bus->priv = dev;
> +
> +	snprintf(bus->id, MII_BUS_ID_SIZE, "phy-%s", dev_name(np->parent));
> +
> +	if (np->phy.phy_addr >= 0 && np->phy.phy_addr < 32)
> +		bus->phy_mask = ~BIT(np->phy.phy_addr);

This condition should never happen. If it does, something is broken,
and you probably want to error out.

> +int z87_phy_unregister_mdio(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +
> +	if (np->phy.mdiobus) {

Can this be false?

> +		mdiobus_unregister(np->phy.mdiobus);
> +		mdiobus_free(np->phy.mdiobus);
> +		np->phy.mdiobus = NULL;
> +	}
> +
> +	return 0;
> +}
> +
> +int z87_phy_connect(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	struct phy_device *phydev;
> +	int ret;
> +
> +	phydev = mdiobus_get_phy(np->phy.mdiobus, np->phy.phy_addr);
> +	if (!phydev) {
> +		netdev_err(dev, "PHY not found at MDIO address: %d\n",
> +			   np->phy.phy_addr);
> +		return -ENODEV;
> +	}
> +
> +	ret = phy_connect_direct(dev, phydev,
> +				 z87_adjust_link,
> +				 np->phy.phy_interface);
> +	if (ret) {
> +		netdev_err(dev, "Unable to connect PHY: %d\n", ret);
> +		return ret;
> +	}
> +
> +	np->phy.phydev = phydev;
> +
> +	/* Limit to the actual MAC capability */
> +	phy_set_max_speed(phydev, SPEED_100);

Do the PHYs actually support > 100Mbps? Generally, this is not
needed. Occasionally you see a Fast Ethernet device using RGMII,
because the PHYs can be cheaper, but it is not common. In that case,
calling phy_set_max_speed() does make sense.

> +int z87_phy_disconnect(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +
> +	if (np->phy.phydev) {

Can this be false?

Kernel code generally does not have such tests. If z87_phy_connect()
works, you know you have a PHY, there is no need to do this test. If
z87_phy_connect() fails, z87_phy_disconnect() should never be called.

So we don't like defensive code like this, it hides bugs.

> +	/* disable powerdown mode */
> +	reg_val = phy_read(dev->phydev, MII_100_BASE_TX_PHY);

The PHY driver should do this. If it does not, something is broken in
the PHY driver.

> +static int z87_phy_reset(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	u8 phy_addr = np->phy.phy_addr;
> +	unsigned int wait_cnt = 1000;
> +	s16 reg_val;
> +	int res;
> +
> +	phy_read(dev->phydev, MII_BMCR);
> +	z87_read32(dev, Z087_REG_MIISTATUS);

All this code should go. Let phylink/phylib drives the PHY.

> +int z87_phy_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> +{
> +	if (!dev->phydev)
> +		return -ENODEV;
> +
> +	return phy_mii_ioctl(dev->phydev, ifr, cmd);

There is a helper which does the dev->phydev test. However, is that
even possible?

> +}
> +
> +void z87_phy_regdump(struct net_device *dev)
> +{
> +	struct z87_private *np = netdev_priv(dev);
> +	const char *link_type;
> +	s16 dat = 0;
> +
> +	netdev_info(dev, "----- MII Registers -----\n");
> +	netdev_info(dev, "instance\t\t\t0x%02x\n", np->instance);
> +	netdev_info(dev, "PHY ADR\t\t\t0x%02x\n", np->phy.phy_addr);

With the ioctl handler, you can use miitool(1) to dump the PHY
registers.

	Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC net-next 2/2] net: ethernet: add build support for MEN Z87 driver
  2026-12-01 15:40 ` [RFC net-next 2/2] net: ethernet: add build support for " Jose Javier Rodriguez Barbarin
@ 2026-12-01 18:28   ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2026-12-01 18:28 UTC (permalink / raw)
  To: Jose Javier Rodriguez Barbarin
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
	linux-kernel, Filip Jensen

On Tue, Dec 01, 2026 at 04:40:09PM +0100, Jose Javier Rodriguez Barbarin wrote:
> Add the MEN Ethernet Kconfig and Makefile entries and hook them into
> the top-level ethernet build system.
> 
> Reviewed-by: Filip Jensen <dev-Felipe.Jensen@duagon.com>
> Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>

Squash this into the previous patch.

       Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC net-next 1/2] net: ethernet: add MEN Z87 driver
  2026-12-01 18:27   ` Andrew Lunn
@ 2026-12-02 14:43     ` Jose Javier Rodriguez Barbarin
  0 siblings, 0 replies; 6+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2026-12-02 14:43 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
	linux-kernel, Filip Jensen

Dear Andrew Lunn,

First of all, thank you for your answer. I really appreciate
all your suggestions.

On Tue, Dec 01, 2026 at 07:27:10PM +0100, Andrew Lunn wrote:
> > +static void z87_ethtool_get_drvinfo(struct net_device *dev,
> > +				    struct ethtool_drvinfo *info)
> > +{
> > +	struct z87_private  *np = netdev_priv(dev);
> > +	unsigned long flags;
> > +
> > +	raw_spin_lock_irqsave(&np->lock, flags);
> > +
> > +	strscpy(info->driver, np->model_name, sizeof(info->driver));
> > +	strscpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
> > +
> > +	raw_spin_unlock_irqrestore(&np->lock, flags);
> 
> Why is locking needed here? I don't know of any other driver which
> does this.
> 
> > +static const struct ethtool_ops men_z87_ethtool_ops = {
> > +	.get_drvinfo		= z87_ethtool_get_drvinfo,
> > +	.get_link_ksettings	= phy_ethtool_get_link_ksettings,
> > +	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
> > +	.nway_reset		= phy_ethtool_nway_reset,
> 
> Ideally you should use phylink, not phylib. The API is better, you are
> less likely to make the errors everybody else does with pause, WoL,
> EEE etc.

I had the doubt of using phylink or phylib, I used phylib because I thought
it would fit better with how my driver is implemented but I can study how to
move from phylib to phylink.

> 
> > +const struct ethtool_ops *z87_get_ethtool_ops(void)
> > +{
> > +	return &men_z87_ethtool_ops;
> > +}
> 
> Global function vs global structure. I would keep it KISS and just
> make men_z87_ethtool_ops global.
> 
> > +/* Generic BD accessors */
> > +
> > +static inline void z87_bd_set_addr(const struct z87_private *np, struct z87_desc *desc, u32 addr)
> > +{
> > +	WRITE_ONCE(desc->addr, cpu_to_le32(addr));
> > +	/* ensure DMA ordering */
> > +	dma_wmb();
> 
> Getting the memory barrier correct is not simple. So they should not
> be hidden in include files. Please put them in the C code where they
> can be seen and reviewed easily.
> 
> > +struct z87_i2c *z87_i2c_alloc(struct device *dev, unsigned long addr)
> > +{
> > +	struct z87_i2c *i2c;
> > +	int ret;
> > +
> > +	i2c = kzalloc_obj(struct z87_i2c);
> > +
> > +	if (!i2c)
> > +		return ERR_PTR(-ENOMEM);
> > +
> > +	// Initialize z87_i2c stuff
> > +	i2c->base_addr = addr;
> > +	i2c->i2c_bug = 0;
> > +
> > +	// Prepare i2c adapter
> > +	i2c->adapter.owner = THIS_MODULE;
> > +	i2c->adapter.dev.parent = dev;
> > +	i2c->adapter.algo_data = &i2c->algo_bit;
> > +	snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
> > +		 "I2C adapter at %s", dev_name(dev));
> > +
> > +	// Prepare i2c bit-banging functions, parameters and private data.
> > +	i2c->algo_bit.setsda = z87_set_sda;
> > +	i2c->algo_bit.setscl = z87_set_scl;
> > +	i2c->algo_bit.getsda = z87_get_sda;
> > +	i2c->algo_bit.getscl = z87_get_scl;
> > +	i2c->algo_bit.udelay = 10; /* Recommended for SMBus */
> > +	i2c->algo_bit.timeout = usecs_to_jiffies(1000);
> > +	i2c->algo_bit.data = i2c;
> 
> Is this an existing open cores I2C bus master? Or is it specific to
> this device? I'm just wondering if the whole thing exists somewhere
> else and you just need to instantiate the driver.
>

It is specific to this device. There is no i2c controller behind it so I
cannot use i2c-ocores, it is just a simple SMBus bit-bang register.

> > +/* Typedefs */
> > +static int z87_open(struct net_device *dev);
> > +static int z87_start_xmit(struct sk_buff *skb, struct net_device *dev);
> > +static irqreturn_t z87_irq(int irq, void *dev_id);
> > +static int z87_close(struct net_device *dev);
> > +static void z87_tx_timeout(struct net_device *dev, unsigned int txqueue);
> > +static int z87_poll(struct napi_struct *napi, int budget);
> > +static void z87_pass_packet(struct napi_struct *napi, unsigned int idx);
> > +static int z87_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
> > +static void z87_hash_table_setup(struct net_device *dev);
> > +static int z87_ether_gen_crc(const u8 *data);
> > +static const struct board_config *z87_get_board_config(struct mcb_device *mdev);
> > +static void z87_load_mac_addr(struct net_device *dev);
> > +static int z87_alloc_rx_bd(struct net_device *dev);
> > +static void z87_free_rx_bd(struct net_device *dev);
> > +static int z87_hw_stop(struct net_device *dev);
> > +static int z87_hw_start(struct net_device *dev);
> 
> Don't do this. Put the functions in the correct order so they are
> declared before they are used. That allows the compiler to inline, so
> you get better executable code.
> 
> > +static int z87_change_mtu(struct net_device *netdev, int new_mtu)
> > +{
> > +	if (new_mtu < ETH_MIN_MTU || new_mtu > ETH_DATA_LEN)
> > +		return -EINVAL;
> 
> If you set netdev->max_mtu and netdev->min_mtu, the core will do this
> validation for you.
> 
> > +static void z87_regdump(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	struct z87_desc tx_desc[Z087_TBD_NUM];
> > +	u32 cur_tx, dty_tx, cur_rx;
> > +	unsigned long i = 0;
> > +	u32 tmp = 0;
> > +
> > +	/* Snapshot software TX state; hardware may still update descriptors. */
> > +	spin_lock_bh(&np->tx_lock);
> > +	cur_tx = np->cur_tx;
> > +	dty_tx = np->dty_tx;
> > +	cur_rx = READ_ONCE(np->cur_rx);
> > +
> > +	spin_unlock_bh(&np->tx_lock);
> > +
> > +	netdev_info(dev, "(netdevice '%s') base Addr: 0x%08lx\n",
> > +		    dev->name, dev->base_addr);
> > +
> > +	while (z87_reginfo[i].addr != 0xffff) {
> > +		tmp = z87_read32(dev, z87_reginfo[i].addr);
> > +		netdev_info(dev, "%s   0x%08x\n", z87_reginfo[i].name, tmp);
> > +		i++;
> > +	}
> > +
> > +	z87_phy_regdump(dev);
> > +
> > +	netdev_info(dev, "cur_tx 0x%02x, dty_tx 0x%02x, cur_rx 0x%02x\n",
> > +		    cur_tx, dty_tx, cur_rx);
> > +
> > +	if (READ_ONCE(np->msg_enable) > 0) {
> > +		netdev_info(dev,
> > +			    "------------------ TX BDs: -------------------\n");
> > +		for (i = 0; i < Z087_TBD_NUM; i++) {
> > +			tx_desc[i].flags = READ_ONCE(np->tx_desc[i].flags);
> > +			tx_desc[i].addr = READ_ONCE(np->tx_desc[i].addr);
> > +
> > +			netdev_info(dev,
> > +				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
> > +				    i,
> > +				    z87_bd_get_flags(np, &tx_desc[i], 0xffff),
> > +				    z87_bd_get_len(np, &tx_desc[i]),
> > +				    z87_bd_get_addr(np, &tx_desc[i]));
> > +		}
> > +
> > +		netdev_info(dev,
> > +			    "------------------ RX BDs: -------------------\n");
> > +		for (i = 0; i < Z087_RBD_NUM; i++) {
> > +			netdev_info(dev,
> > +				    "%02lx STAT: 0x%04x LEN: 0x%04x  ADR 0x%08x\n",
> > +				    i,
> > +				    z87_rbd_get_flags(np, i, 0xffff),
> > +				    z87_rbd_get_len(np, i),
> > +				    z87_rbd_get_addr(np, i));
> > +		}
> > +	}
> > +}
> 
> This seems like debug code. It should not be in a mainline driver.
> 
> > +static void z87_load_mac_addr(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	u8 mac[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
> > +	struct sockaddr addr;
> > +	int res;
> > +
> > +	z87_load_mac(dev, mac);
> > +
> > +	if (is_valid_ether_addr(mac)) {
> > +		netdev_info(dev,
> > +			    "using MAC %02x:%02x:%02x:%02x:%02x:%02x from registers.\n",
> > +			    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
> 
> This driver seems to be quite verbose. Generally, there is maybe one
> call to netdev_info() in a driver. Consider change some of these to
> netdev_dbg(), or removing them.
> 
> > +static bool z87_rx_bd_errors(struct net_device *dev, unsigned int idx)
> > +{
> > +	const u16 rx_err_mask = OETH_RX_BD_OVERRUN | OETH_RX_BD_INVSYMB |
> > +		OETH_RX_BD_DRIBBLE | OETH_RX_BD_TOOLONG |
> > +		OETH_RX_BD_SHORT | OETH_RX_BD_CRCERR |
> > +		OETH_RX_BD_LATECOL;
> > +	struct z87_private *np = netdev_priv(dev);
> > +	u16 rx_err_flags;
> > +
> > +	rx_err_flags = z87_rbd_get_flags(np, idx, rx_err_mask);
> > +	if (!rx_err_flags)
> > +		return false;
> > +
> > +	if (rx_err_flags & OETH_RX_BD_OVERRUN) {
> > +		netdev_warn(dev, "*** RX: overrun[%u]\n", idx);
> 
> These sorts of prints can spam the log, act as a DoS, if they can be
> triggered from a remote device.
> 
> > +		DEV_STATS_INC(dev, rx_over_errors);
> 
> The counter should be sufficient.
> 
> > +static int z87_hw_stop(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	unsigned long flags;
> > +	int res;
> > +
> > +	/* already stopped by a previous failed attempt (napi disabled, phy stopped) */
> > +	if (test_bit(__Z87_HW_DEAD, &np->state))
> > +		return -EIO;
> > +
> > +	spin_lock_bh(&np->tx_lock);
> > +	set_bit(__Z87_DOWN, &np->state);
> > +	spin_unlock_bh(&np->tx_lock);
> > +	netif_tx_disable(dev);
> > +
> > +	netif_carrier_off(dev);
> > +
> > +	if (dev->phydev)
> > +		phy_stop(dev->phydev);
> 
> It seems like z87_hw_start() always assumes there is a PHY, or it
> errors out. So there is no need for the test.
> 
> > +static int z87_hw_start(struct net_device *dev)
> > +{
> 
> > +	res = z87_phy_init(dev);
> > +	if (res < 0) {
> > +		netdev_err(dev, "*** PHY Initialization failed!\n");
> > +		return res;
> > +	}
> > +
> > +	phy_start(dev->phydev);
> 
> 
> > +static int z87_probe(struct mcb_device *mdev,
> > +		     const struct mcb_device_id *id)
> > +{
> > +	const struct board_config *cfg = NULL;
> > +	struct net_device *dev = NULL;
> > +	struct z87_private *np = NULL;
> > +	void *mem_virt_dma = NULL;
> > +	dma_addr_t mem_hw_dma;
> > +	struct resource *mem;
> > +	int res = -ENXIO;
> > +
> > +	cfg = z87_get_board_config(mdev);
> > +	if (!cfg)
> > +		return -EOPNOTSUPP;
> > +
> > +	/**
> > +	 * mdev->inst is defined in a per-board basis, so lets check
> > +	 * if there are more devices that defined for the board. In that
> > +	 * case, something is wrong.
> > +	 */
> > +	if (mdev->inst >= cfg->num_devs) {
> > +		return dev_err_probe(&mdev->dev, -EINVAL,
> > +				     "detected more devices than configured for board: %s",
> > +				     cfg->board_name);
> > +	}
> 
> Does something actually go wrong if there are more?

Yes, It could crash as it tries to access to an array index that does not exist. However
I am pretty sure this condition hardly could happens so I just could remove it.

> 
> > +	 * if more than one Z87 ethernet core is implemented in one PCI function
> > +	 * on one chameleon FPGA, the device port is important for distinct ethernet
> > +	 * device identification during interface renaming via systemd/udev. We start
> > +	 * counting at 1 to have a constant naming scheme; 0 is omitted during renaming
> > +	 */
> > +	dev->dev_port = mdev->inst + 1;
> 
> This often goes wrong, if the module can be unloaded, or the device
> unbound and bound again. We also see LLM generated patches changing
> code like this, because in theory, it cover wrap around and then bad
> things happened. The fact it will take years does not stop the script
> kiddies using the LLM from submitting the patches.

mdev->inst is not a counter, it is a value read by MCB from chameleon table and it
identifies the physical Z87 core in the table. It is constant and stable across module
reload and unbind/bind. I guess the comment could lead to mistake so I will just rewrite it.

> 
> > diff --git a/drivers/net/ethernet/men/z87/men_z87_phy.c b/drivers/net/ethernet/men/z87/men_z87_phy.c
> > new file mode 100644
> > index 000000000000..355eca9a3409
> > --- /dev/null
> > +++ b/drivers/net/ethernet/men/z87/men_z87_phy.c
> > @@ -0,0 +1,673 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Copyright (c) 2026 duagon Germany GmbH
> > + *
> > + * See MAINTAINERS file for support contact information.
> > + */
> > +
> > +#include <linux/mii.h>
> > +#include "men_z87_main.h"
> > +#include "men_z87_hw.h"
> > +#include "men_z87_phy.h"
> > +
> > +/* timeout to wait for reply from MII */
> > +#define MII_ACCESS_TIMEOUT	10000
> > +
> > +/* The expected values for a Micrel KSZ8041 PHY in the PHY Identifier Register #2 (PHYIDR2). */
> > +#define PHY_ID2_KSZ8041_1	0x1512
> > +#define PHY_ID2_KSZ8041_2	0x1513
> 
> The MAC driver should not care about what the PHY is. phylib drivers
> driver the PHY, the MAC driver should not touch it.
> 
> > +static int z87_mdio_read(struct mii_bus *bus, int addr, int regnum)
> > +{
> > +	struct net_device *dev = bus->priv;
> > +
> > +	return __mdio_read(dev, addr, regnum);
> 
> Pointless wrapper.
> 
> > +static int dp83822_conf_led(struct net_device *dev, u16 val)
> 
> Sorry, but no. The PHY driver should export the LEDs via
> /sys/class/leds.

Understood. I would like to agree on this approach. 

PHY driver dp83822 already implements the mechanism to handle LEDs
in the correct way using DT nodes. My hardware (FPGA) is a PCI device
that typically runs on x86 so there is DT node for the PCI function,
the MCB devices or the PHYs yet.

Another solution could be transforming of_phy_led()/of_phy_leds()
functions on phy_device to fwnodes thus my driver just could create
a subnode describing leds.

Please could you help me with that? which could be the best approach?

Anyway, both are out of scope of this patch series so for V2 I will just
remove the LEDs handling.

> 
> > +static void z87_adjust_link(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	struct phy_device *phydev;
> > +	bool changed;
> > +	int res;
> > +
> > +	phydev = np->phy.phydev;
> > +
> > +	if (!phydev)
> > +		return;
> > +
> > +	changed = (np->phy.link != phydev->link);
> > +
> > +	if (phydev->link) {
> > +		if (changed ||
> > +		    np->phy.speed != phydev->speed ||
> > +		    np->phy.duplex != phydev->duplex) {
> > +			/*
> > +			 * Reconfigure the MAC when relevant parameters change.
> > +			 */
> > +			np->phy.speed = phydev->speed;
> > +			np->phy.duplex = phydev->duplex;
> > +			res = z87_set_duplex(dev, phydev->duplex);
> > +			if (res < 0) {
> > +				netdev_warn(dev, "half duplex not supported. link down\n");
> 
> Something is broken if you get asked to do half duplex and it is not
> supported.
> 
> > +int z87_phy_register_mdio(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	struct mii_bus *bus;
> > +	int ret;
> > +
> > +	bus = mdiobus_alloc();
> > +	if (!bus)
> > +		return -ENOMEM;
> > +
> > +	bus->name = "men-z87-mdio";
> > +	bus->read = z87_mdio_read;
> > +	bus->write = z87_mdio_write;
> > +	bus->parent = np->parent;
> > +	bus->priv = dev;
> > +
> > +	snprintf(bus->id, MII_BUS_ID_SIZE, "phy-%s", dev_name(np->parent));
> > +
> > +	if (np->phy.phy_addr >= 0 && np->phy.phy_addr < 32)
> > +		bus->phy_mask = ~BIT(np->phy.phy_addr);
> 
> This condition should never happen. If it does, something is broken,
> and you probably want to error out.
> 
> > +int z87_phy_unregister_mdio(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +
> > +	if (np->phy.mdiobus) {
> 
> Can this be false?
> 
> > +		mdiobus_unregister(np->phy.mdiobus);
> > +		mdiobus_free(np->phy.mdiobus);
> > +		np->phy.mdiobus = NULL;
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> > +int z87_phy_connect(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	struct phy_device *phydev;
> > +	int ret;
> > +
> > +	phydev = mdiobus_get_phy(np->phy.mdiobus, np->phy.phy_addr);
> > +	if (!phydev) {
> > +		netdev_err(dev, "PHY not found at MDIO address: %d\n",
> > +			   np->phy.phy_addr);
> > +		return -ENODEV;
> > +	}
> > +
> > +	ret = phy_connect_direct(dev, phydev,
> > +				 z87_adjust_link,
> > +				 np->phy.phy_interface);
> > +	if (ret) {
> > +		netdev_err(dev, "Unable to connect PHY: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	np->phy.phydev = phydev;
> > +
> > +	/* Limit to the actual MAC capability */
> > +	phy_set_max_speed(phydev, SPEED_100);
> 
> Do the PHYs actually support > 100Mbps? Generally, this is not
> needed. Occasionally you see a Fast Ethernet device using RGMII,
> because the PHYs can be cheaper, but it is not common. In that case,
> calling phy_set_max_speed() does make sense.
> 
> > +int z87_phy_disconnect(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +
> > +	if (np->phy.phydev) {
> 
> Can this be false?
> 
> Kernel code generally does not have such tests. If z87_phy_connect()
> works, you know you have a PHY, there is no need to do this test. If
> z87_phy_connect() fails, z87_phy_disconnect() should never be called.
> 
> So we don't like defensive code like this, it hides bugs.
> 
> > +	/* disable powerdown mode */
> > +	reg_val = phy_read(dev->phydev, MII_100_BASE_TX_PHY);
> 
> The PHY driver should do this. If it does not, something is broken in
> the PHY driver.
> 
> > +static int z87_phy_reset(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	u8 phy_addr = np->phy.phy_addr;
> > +	unsigned int wait_cnt = 1000;
> > +	s16 reg_val;
> > +	int res;
> > +
> > +	phy_read(dev->phydev, MII_BMCR);
> > +	z87_read32(dev, Z087_REG_MIISTATUS);
> 
> All this code should go. Let phylink/phylib drives the PHY.
> 
> > +int z87_phy_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> > +{
> > +	if (!dev->phydev)
> > +		return -ENODEV;
> > +
> > +	return phy_mii_ioctl(dev->phydev, ifr, cmd);
> 
> There is a helper which does the dev->phydev test. However, is that
> even possible?
> 
> > +}
> > +
> > +void z87_phy_regdump(struct net_device *dev)
> > +{
> > +	struct z87_private *np = netdev_priv(dev);
> > +	const char *link_type;
> > +	s16 dat = 0;
> > +
> > +	netdev_info(dev, "----- MII Registers -----\n");
> > +	netdev_info(dev, "instance\t\t\t0x%02x\n", np->instance);
> > +	netdev_info(dev, "PHY ADR\t\t\t0x%02x\n", np->phy.phy_addr);
> 
> With the ioctl handler, you can use miitool(1) to dump the PHY
> registers.
> 
> 	Andrew

Regards,

	Javier R.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-02 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 15:40 [RFC net-next 0/2] net: ethernet: add MEN Z087 driver Jose Javier Rodriguez Barbarin
2026-12-01 15:40 ` [RFC net-next 1/2] net: ethernet: add MEN Z87 driver Jose Javier Rodriguez Barbarin
2026-12-01 18:27   ` Andrew Lunn
2026-12-02 14:43     ` Jose Javier Rodriguez Barbarin
2026-12-01 15:40 ` [RFC net-next 2/2] net: ethernet: add build support for " Jose Javier Rodriguez Barbarin
2026-12-01 18:28   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox