[PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver

Frank Sae posted 14 patches 1 month ago
Only 13 patches received!
.../device_drivers/ethernet/index.rst         |    1 +
.../ethernet/motorcomm/yt6801.rst             |   20 +
MAINTAINERS                                   |    8 +
drivers/net/ethernet/Kconfig                  |    1 +
drivers/net/ethernet/Makefile                 |    1 +
drivers/net/ethernet/motorcomm/Kconfig        |   27 +
drivers/net/ethernet/motorcomm/Makefile       |    6 +
.../net/ethernet/motorcomm/yt6801/Makefile    |    8 +
.../ethernet/motorcomm/yt6801/yt6801_desc.c   |  565 ++++
.../ethernet/motorcomm/yt6801/yt6801_desc.h   |   35 +
.../ethernet/motorcomm/yt6801/yt6801_main.c   | 3006 +++++++++++++++++
.../ethernet/motorcomm/yt6801/yt6801_type.h   |  956 ++++++
drivers/net/phy/motorcomm.c                   |    6 +
13 files changed, 4640 insertions(+)
create mode 100644 Documentation/networking/device_drivers/ethernet/motorcomm/yt6801.rst
create mode 100644 drivers/net/ethernet/motorcomm/Kconfig
create mode 100644 drivers/net/ethernet/motorcomm/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.h
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_main.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_type.h
[PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Frank Sae 1 month ago
This series includes adding Motorcomm YT6801 Gigabit ethernet driver
 and adding yt6801 ethernet driver entry in MAINTAINERS file.
YT6801 integrates a YT8531S phy.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
---

v4:
 - Redefine rges and bits
 - Reorganize the read and write function of regs
 - Replae ‘pcim_iomap_regions’ as 'pcim_iomap_region'
 - Replae ‘mutex_lock(&priv->mutex)’ as 'rtnl_lock()'
 - Replae ‘phydev_info(...YT6801.\n");’ as 'dev_info_once(...YT6801.\n");'
   in phy driver
 - Remove pcim_iomap_table
 - Use "yt6801: " and "net: phy: motorcomm: " as prefixes for these patches

v3: https://patchwork.kernel.org/project/netdevbpf/cover/20250228100020.3944-1-Frank.Sae@motor-comm.com/
 - Remove about 5000 lines of code
 - Remove statistics, ethtool, WoL, PHY handling ...
 - Reorganize this driver code and remove redundant code
 - Remove unnecessary yt_dbg information
 - Remove netif_carrier_on/netif_carrier_off
 - Remove hw_ops
 - Add PHY_INTERFACE_MODE_INTERNAL mode in phy driver to support yt6801
 - Replae '#ifdef CONFIG_PCI_MSI' as 'if (IS_ENABLED(CONFIG_PCI_MSI) {}'
 - Replae ‘fxgmac_pdata val’ as 'priv'

v2: https://patchwork.kernel.org/project/netdevbpf/cover/20241120105625.22508-1-Frank.Sae@motor-comm.com/
 - Split this driver into multiple patches.
 - Reorganize this driver code and remove redundant code
 - Remove PHY handling code and use phylib.
 - Remove writing ASPM config
 - Use generic power management instead of pci_driver.suspend()/resume()
 - Add Space before closing "*/"

v1: https://patchwork.kernel.org/project/netdevbpf/patch/20240913124113.9174-1-Frank.Sae@motor-comm.com/


This patch is to add the ethernet device driver for the PCIe interface of
 Motorcomm YT6801 Gigabit Ethernet.
We tested this driver on an Ubuntu x86 PC with YT6801 network card.

Frank Sae (14):
  yt6801: Add support for a pci table in this module
  yt6801: Implement mdio register
  yt6801: Implement pci_driver shutdown
  yt6801: Implement the fxgmac_init function
  yt6801: Implement the .ndo_open function
  yt6801: Implement the fxgmac_start function
  net:phy:motorcomm: Add PHY_INTERFACE_MODE_INTERNAL to support YT6801
  yt6801: Implement the fxgmac_hw_init function
  yt6801: Implement the poll functions
  yt6801: Implement .ndo_start_xmit function
  yt6801: Implement some net_device_ops function
  yt6801: Implement pci_driver suspend and resume
  yt6801: Add makefile and Kconfig
  yt6801: update ethernet documentation and maintainer

 .../device_drivers/ethernet/index.rst         |    1 +
 .../ethernet/motorcomm/yt6801.rst             |   20 +
 MAINTAINERS                                   |    8 +
 drivers/net/ethernet/Kconfig                  |    1 +
 drivers/net/ethernet/Makefile                 |    1 +
 drivers/net/ethernet/motorcomm/Kconfig        |   27 +
 drivers/net/ethernet/motorcomm/Makefile       |    6 +
 .../net/ethernet/motorcomm/yt6801/Makefile    |    8 +
 .../ethernet/motorcomm/yt6801/yt6801_desc.c   |  565 ++++
 .../ethernet/motorcomm/yt6801/yt6801_desc.h   |   35 +
 .../ethernet/motorcomm/yt6801/yt6801_main.c   | 3006 +++++++++++++++++
 .../ethernet/motorcomm/yt6801/yt6801_type.h   |  956 ++++++
 drivers/net/phy/motorcomm.c                   |    6 +
 13 files changed, 4640 insertions(+)
 create mode 100644 Documentation/networking/device_drivers/ethernet/motorcomm/yt6801.rst
 create mode 100644 drivers/net/ethernet/motorcomm/Kconfig
 create mode 100644 drivers/net/ethernet/motorcomm/Makefile
 create mode 100644 drivers/net/ethernet/motorcomm/yt6801/Makefile
 create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.c
 create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.h
 create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_main.c
 create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_type.h

-- 
2.34.1

Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Russell King (Oracle) 1 month ago
On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
> YT6801 integrates a YT8531S phy.

What is different between this and the Designware GMAC4 core supported
by drivers/net/ethernet/stmicro/stmmac/ ?

Looking at the register layout, it looks very similar. The layout of the
MAC control register looks similar. The RX queue and PMT registers are
at the same relative offset. The MDIO registers as well.

Can you re-use the stmmac driver?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Frank Sae 1 month ago
On 2025/4/8 18:30, Russell King (Oracle) wrote:
> On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
>> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
>>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
>> YT6801 integrates a YT8531S phy.
> 
> What is different between this and the Designware GMAC4 core supported
> by drivers/net/ethernet/stmicro/stmmac/ ?
> 

We support more features: NS, RSS, wpi, wol pattern and aspm control.

> Looking at the register layout, it looks very similar. The layout of the
> MAC control register looks similar. The RX queue and PMT registers are
> at the same relative offset. The MDIO registers as well.
> 
> Can you re-use the stmmac driver?
> 

I can not re-use the stmmac driver, because pcie and ephy can not work well on
the stmmac driver.
Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Andrew Lunn 1 month ago
On Fri, Apr 11, 2025 at 05:50:55PM +0800, Frank Sae wrote:
> 
> 
> On 2025/4/8 18:30, Russell King (Oracle) wrote:
> > On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
> >> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
> >>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
> >> YT6801 integrates a YT8531S phy.
> > 
> > What is different between this and the Designware GMAC4 core supported
> > by drivers/net/ethernet/stmicro/stmmac/ ?
> > 
> 
> We support more features: NS, RSS, wpi, wol pattern and aspm control.

Details please as to why these preventing the stmmac driver from being
used? Our default opinion will be that you will extend that stmmac
driver. In order to change that, you need to give us deep technical
arguments why it cannot be done.

> > Looking at the register layout, it looks very similar. The layout of the
> > MAC control register looks similar. The RX queue and PMT registers are
> > at the same relative offset. The MDIO registers as well.
> > 
> > Can you re-use the stmmac driver?
> > 
> 
> I can not re-use the stmmac driver, because pcie and ephy can not work well on
> the stmmac driver.

Please could you explain that in detail. What exactly does not work?
What is stmmac_pci.c about if not PCI?

	Andrew
Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Frank Sae 3 weeks, 5 days ago
On 2025/4/14 04:33, Andrew Lunn wrote:
> On Fri, Apr 11, 2025 at 05:50:55PM +0800, Frank Sae wrote:
>>
>>
>> On 2025/4/8 18:30, Russell King (Oracle) wrote:
>>> On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
>>>> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
>>>>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
>>>> YT6801 integrates a YT8531S phy.
>>>
>>> What is different between this and the Designware GMAC4 core supported
>>> by drivers/net/ethernet/stmicro/stmmac/ ?
>>>
>>
>> We support more features: NS, RSS, wpi, wol pattern and aspm control.
> 
> Details please as to why these preventing the stmmac driver from being
> used? Our default opinion will be that you will extend that stmmac
> driver. In order to change that, you need to give us deep technical
> arguments why it cannot be done.
> 

After internal discussion, we have decided to temporarily suspend upstream.
Thanks again!

>>> Looking at the register layout, it looks very similar. The layout of the
>>> MAC control register looks similar. The RX queue and PMT registers are
>>> at the same relative offset. The MDIO registers as well.
>>>
>>> Can you re-use the stmmac driver?
>>>
>>
>> I can not re-use the stmmac driver, because pcie and ephy can not work well on
>> the stmmac driver.
> 
> Please could you explain that in detail. What exactly does not work?
> What is stmmac_pci.c about if not PCI?
> 
> 	Andrew
Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Russell King (Oracle) 3 weeks, 5 days ago
On Thu, Apr 17, 2025 at 02:06:05PM +0800, Frank Sae wrote:
> 
> 
> On 2025/4/14 04:33, Andrew Lunn wrote:
> > On Fri, Apr 11, 2025 at 05:50:55PM +0800, Frank Sae wrote:
> >>
> >>
> >> On 2025/4/8 18:30, Russell King (Oracle) wrote:
> >>> On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
> >>>> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
> >>>>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
> >>>> YT6801 integrates a YT8531S phy.
> >>>
> >>> What is different between this and the Designware GMAC4 core supported
> >>> by drivers/net/ethernet/stmicro/stmmac/ ?
> >>>
> >>
> >> We support more features: NS, RSS, wpi, wol pattern and aspm control.
> > 
> > Details please as to why these preventing the stmmac driver from being
> > used? Our default opinion will be that you will extend that stmmac
> > driver. In order to change that, you need to give us deep technical
> > arguments why it cannot be done.
> > 
> 
> After internal discussion, we have decided to temporarily suspend upstream.
> Thanks again!

Sorry, but please understand the issue from our side, because the more
code that's in the kernel tree, the more work that gives maintainers
who stick around for the long term. Therefore, it is desirable not to
collect lots of driver code that is only subtly different from each
other, but require re-use and/or adaption of what is already present.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH net-next v4 00/14] yt6801: Add Motorcomm yt6801 PCIe driver
Posted by Russell King (Oracle) 1 month ago
On Fri, Apr 11, 2025 at 05:50:55PM +0800, Frank Sae wrote:
> 
> 
> On 2025/4/8 18:30, Russell King (Oracle) wrote:
> > On Tue, Apr 08, 2025 at 05:28:21PM +0800, Frank Sae wrote:
> >> This series includes adding Motorcomm YT6801 Gigabit ethernet driver
> >>  and adding yt6801 ethernet driver entry in MAINTAINERS file.
> >> YT6801 integrates a YT8531S phy.
> > 
> > What is different between this and the Designware GMAC4 core supported
> > by drivers/net/ethernet/stmicro/stmmac/ ?
> > 
> 
> We support more features: NS, RSS, wpi, wol pattern and aspm control.

Is it not possible to add those features?

> > Looking at the register layout, it looks very similar. The layout of the
> > MAC control register looks similar. The RX queue and PMT registers are
> > at the same relative offset. The MDIO registers as well.
> > 
> > Can you re-use the stmmac driver?
> > 
> 
> I can not re-use the stmmac driver, because pcie and ephy can not work well on
> the stmmac driver.

Doesn't the stmmac driver support PCIe already (e.g. for Intel
platforms?) Can't it be fixed?

We shouldn't be duplicating what we already have, but fixing it if
there are problems.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!