mbox series

[net-next,v1,0/5] add ethernet driver for Tehuti Networks TN40xx chips

Message ID 20240415104352.4685-1-fujita.tomonori@gmail.com (mailing list archive)
Headers show
Series add ethernet driver for Tehuti Networks TN40xx chips | expand

Message

FUJITA Tomonori April 15, 2024, 10:43 a.m. UTC
This patchset adds a new 10G ethernet driver for Tehuti Networks
TN40xx chips. Note in mainline, there is a driver for Tehuti Networks
(drivers/net/ethernet/tehuti/tehuti.[hc]), which supports TN30xx
chips.

Multiple vendors (DLink, Asus, Edimax, QNAP, etc) developed adapters
based on TN40xx chips. Tehuti Networks went out of business but the
drivers are still distributed with some of the hardware (and also
available on some sites). With some changes, I try to upstream this
driver with a new PHY driver in Rust.

The major change is replacing a PHY abstraction layer with
PHYLIB. TN40xx chips are used with various PHY hardware (AMCC QT2025,
TI TLK10232, Aqrate AQR105, and Marvell MV88X3120, MV88X3310, and
MV88E2010). So the original driver has the own PHY abstraction layer
to handle them.

I'll submit a new PHY driver for QT2025 in Rust shortly. For now, I
enable only adapters using QT2025 PHY in the PCI ID table of this
driver. I've tested this driver and the QT2025 PHY driver with Edimax
EN-9320 10G adapter. In mainline, there are PHY drivers for AQR105 and
Marvell PHYs, which could work for some TN40xx adapters with this
driver.

The other changes are replacing the embedded firmware in a header file
with the firmware APIs, handling dma mapping errors, removing many
ifdef, fixing lots of style issues, etc.

To make reviewing easier, this patchset has only basic functions. Once
merged, I'll submit features like ethtool support.


FUJITA Tomonori (5):
  net: tn40xx: add pci driver for Tehuti Networks TN40xx chips
  net: tn40xx: add register defines
  net: tn40xx: add basic Tx handling
  net: tn40xx: add basic Rx handling
  net: tn40xx: add PHYLIB support

 MAINTAINERS                             |    8 +-
 drivers/net/ethernet/tehuti/Kconfig     |   14 +
 drivers/net/ethernet/tehuti/Makefile    |    3 +
 drivers/net/ethernet/tehuti/tn40.c      | 1981 +++++++++++++++++++++++
 drivers/net/ethernet/tehuti/tn40.h      |  291 ++++
 drivers/net/ethernet/tehuti/tn40_mdio.c |  141 ++
 drivers/net/ethernet/tehuti/tn40_regs.h |  279 ++++
 7 files changed, 2716 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ethernet/tehuti/tn40.c
 create mode 100644 drivers/net/ethernet/tehuti/tn40.h
 create mode 100644 drivers/net/ethernet/tehuti/tn40_mdio.c
 create mode 100644 drivers/net/ethernet/tehuti/tn40_regs.h


base-commit: 32affa5578f0e6b9abef3623d3976395afbd265c

Comments

Florian Fainelli April 15, 2024, 11:21 p.m. UTC | #1
Hi Fujita-san,

On 4/15/2024 3:43 AM, FUJITA Tomonori wrote:
> This patchset adds a new 10G ethernet driver for Tehuti Networks
> TN40xx chips. Note in mainline, there is a driver for Tehuti Networks
> (drivers/net/ethernet/tehuti/tehuti.[hc]), which supports TN30xx
> chips.
> 
> Multiple vendors (DLink, Asus, Edimax, QNAP, etc) developed adapters
> based on TN40xx chips. Tehuti Networks went out of business but the
> drivers are still distributed with some of the hardware (and also
> available on some sites). With some changes, I try to upstream this
> driver with a new PHY driver in Rust.
> 
> The major change is replacing a PHY abstraction layer with
> PHYLIB. TN40xx chips are used with various PHY hardware (AMCC QT2025,
> TI TLK10232, Aqrate AQR105, and Marvell MV88X3120, MV88X3310, and
> MV88E2010). So the original driver has the own PHY abstraction layer
> to handle them.
> 
> I'll submit a new PHY driver for QT2025 in Rust shortly. For now, I
> enable only adapters using QT2025 PHY in the PCI ID table of this
> driver. I've tested this driver and the QT2025 PHY driver with Edimax
> EN-9320 10G adapter. In mainline, there are PHY drivers for AQR105 and
> Marvell PHYs, which could work for some TN40xx adapters with this
> driver.
> 
> The other changes are replacing the embedded firmware in a header file
> with the firmware APIs, handling dma mapping errors, removing many
> ifdef, fixing lots of style issues, etc.
> 
> To make reviewing easier, this patchset has only basic functions. Once
> merged, I'll submit features like ethtool support.

Thanks a lot for attempting to upstream support for the TN40xx chips, 
those are extremely popular 10GbE PCIe cards under USD 100. Last I 
checked the vendor driver, it was not entirely clear however whether it 
would be possible to get the various PHY firmwares included in 
linux-firmware, that is the licensing was not very specific either way 
(redistribution allowed or not).
FUJITA Tomonori April 16, 2024, 10:59 a.m. UTC | #2
Hi,

On Mon, 15 Apr 2024 16:21:35 -0700
Florian Fainelli <f.fainelli@gmail.com> wrote:

> Thanks a lot for attempting to upstream support for the TN40xx chips,
> those are extremely popular 10GbE PCIe cards under USD 100. Last I
> checked the vendor driver, it was not entirely clear however whether
> it would be possible to get the various PHY firmwares included in
> linux-firmware, that is the licensing was not very specific either way
> (redistribution allowed or not).

The code of the original driver has MODULE_LICENSE("GPL"). The
firmware of QT2025 PHY is embedded in a header file in the source code
in the binary format. So I assume that it's also under GPL.

Unlike QT2025 firmware file, firmware files for Marvell PHYs aren't
included in the original driver code. The README says you need to get
Marvell firmware files and compile the code with them. So I guess that
they can't be redistributed.