mbox series

[net-next,v3,00/10] PRU-ICSSM Ethernet Driver

Message ID 20250214054702.1073139-1-parvathi@couthit.com (mailing list archive)
Headers show
Series PRU-ICSSM Ethernet Driver | expand

Message

Parvathi Pudi Feb. 14, 2025, 5:46 a.m. UTC
Hi,

The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
Megabit ICSS (ICSSM).

Support for ICSSG Dual-EMAC mode has already been mainlined [1] and the
fundamental components/drivers such as PRUSS driver, Remoteproc driver,
PRU-ICSS INTC, and PRU-ICSS IEP drivers are already available in the mainline
Linux kernel. The current set of patch series builds on top of these components
and introduces changes to support the Dual-EMAC mode on ICSSM, especially on
the TI AM57xx devices.

TI AM57xx series of devices have two identical PRU-ICSS instances (PRU-ICSS1
and PRU-ICSS2), each with two 32-bit RISC PRU cores. Each PRU core has
(a) dedicated Ethernet interface (MII, MDIO), timers, capture modules, and
serial communication interfaces, and (b) dedicated data and instruction RAM as
well as shared RAM for inter PRU communication within the PRU-ICSS.

These patches have a dependency on an SOC patch, which we are including at the
end of this series for reference. The SOC patch has been submitted in a separate
thread [2] and we are awaiting for it to be merged.

These patches add support for the following features:
- RX and TX over PRU Ethernet ports in Dual-EMAC mode
- Full duplex with 100 Mbps link speed.
- VLAN Filtering
- Multicast Filtering
- Promiscuous mode
- Storm prevention
- Interrupt coalescing
- Linux PTP (ptp4l) Ordinary clock

Further, note that these are the first set of patches for PRU-ICSS2 Ethernet.
Switch mode support, PRU-ICSS1 support, PRU Ethernet for AM437x and AM335x in
Dual-EMAC and Switch mode support with full feature set changes will be posted
subsequently.

The patches presented in this series have gone through the patch verification
tools and no warnings or errors are reported. Sample test logs verifying the
functionality on Linux next kernel are available here:

[Interface up Testing](https://gist.github.com/ParvathiPudi/f481837cc6994e400284cb4b58972804)

[Ping Testing](https://gist.github.com/ParvathiPudi/a121aad402defcef389e93f303d79317)

[Iperf Testing](https://gist.github.com/ParvathiPudi/581db46b0e9814ddb5903bdfee73fc6f)

[1] https://lore.kernel.org/all/20230106121046.886863-1-danishanwar@ti.com/
[2] https://lore.kernel.org/all/20250108125937.10604-1-basharath@couthit.com/


This is the v3 of the patch series [v1]. This version of the patchset
addresses the comments made on [v2] of the series.

Changes from v2 to v3 :

*) Addressed Conor Dooley comments on patch 1 of the series.
*) Addressed Simon Horman comments on patch 2, 3, 4, 5 and 6 of the series.
*) Addressed Joe Damato comments on patch 4 of the series.
*) Rebased the series on latest net-next.

Changes from v1 to v2 :

*) Addressed Andrew Lunn, Rob Herring comments on patch 1 of the series.
*) Addressed Andrew Lunn comments on patch 2, 3, and 4 of the series.
*) Addressed Richard Cochran, Jason Xing comments on patch 6 of the series.
*) Rebased patchset on next-202401xx linux-next.

[v1] https://lore.kernel.org/all/20250109105600.41297-1-basharath@couthit.com/
[v2] https://lore.kernel.org/all/20250124122353.1457174-1-basharath@couthit.com/

Thanks and Regards,
Parvathi.

Murali Karicheri (1):
  net: ti: prueth: Adds support for RX interrupt coalescing/pacing

Parvathi Pudi (1):
  dt-bindings: net: ti: Adds DUAL-EMAC mode support on PRU-ICSS2 for
    AM57xx SOCs

Roger Quadros (8):
  net: ti: prueth: Adds ICSSM Ethernet driver
  net: ti: prueth: Adds PRUETH HW and SW configuration
  net: ti: prueth: Adds link detection, RX and TX support.
  net: ti: prueth: Adds ethtool support for ICSSM PRUETH Driver
  net: ti: prueth: Adds HW timestamping support for PTP using PRU-ICSS
    IEP module
  net: ti: prueth: Adds support for network filters for traffic control
    supported by PRU-ICSS
  net: ti: prueth: Adds power management support for PRU-ICSS
  soc: ti: PRUSS OCP configuration

 .../devicetree/bindings/net/ti,icss-iep.yaml  |    4 +-
 .../bindings/net/ti,icssm-prueth.yaml         |  147 +
 .../bindings/net/ti,pruss-ecap.yaml           |   32 +
 .../devicetree/bindings/soc/ti/ti,pruss.yaml  |    9 +
 drivers/net/ethernet/ti/Kconfig               |   24 +
 drivers/net/ethernet/ti/Makefile              |    5 +
 drivers/net/ethernet/ti/icssg/icss_iep.c      |   42 +
 drivers/net/ethernet/ti/icssm/icssm_ethtool.c |  357 +++
 drivers/net/ethernet/ti/icssm/icssm_prueth.c  | 2418 +++++++++++++++++
 drivers/net/ethernet/ti/icssm/icssm_prueth.h  |  437 +++
 .../net/ethernet/ti/icssm/icssm_prueth_dos.c  |  225 ++
 .../net/ethernet/ti/icssm/icssm_prueth_ecap.c |  312 +++
 .../net/ethernet/ti/icssm/icssm_prueth_ecap.h |   47 +
 .../net/ethernet/ti/icssm/icssm_prueth_ptp.h  |   85 +
 drivers/net/ethernet/ti/icssm/icssm_switch.h  |  285 ++
 .../ti/icssm/icssm_vlan_mcast_filter_mmap.h   |  120 +
 drivers/soc/ti/pruss.c                        |   77 +-
 include/linux/pruss_driver.h                  |    6 +
 18 files changed, 4630 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
 create mode 100644 Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_ethtool.c
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth.c
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth.h
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth_dos.c
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth_ecap.c
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth_ecap.h
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_prueth_ptp.h
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_switch.h
 create mode 100644 drivers/net/ethernet/ti/icssm/icssm_vlan_mcast_filter_mmap.h

Comments

Jakub Kicinski Feb. 15, 2025, 1:02 a.m. UTC | #1
On Fri, 14 Feb 2025 11:16:52 +0530 parvathi wrote:
> The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
> is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
> Megabit ICSS (ICSSM).

Every individual patch must build cleanly with W=1.
Otherwise doing git bisections is a miserable experience.
Parvathi Pudi Feb. 18, 2025, 10:06 a.m. UTC | #2
Hi,

> On Fri, 14 Feb 2025 11:16:52 +0530 parvathi wrote:
>> The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
>> is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
>> Megabit ICSS (ICSSM).
> 
> Every individual patch must build cleanly with W=1.
> Otherwise doing git bisections is a miserable experience.
> --

As we mentioned in cover letter we have dependency with SOC patch.

"These patches have a dependency on an SOC patch, which we are including at the
end of this series for reference. The SOC patch has been submitted in a separate
thread [2] and we are awaiting for it to be merged."

SOC patch need to be applied prior applying the "net" patches. We have changed the 
order and appended the SOC patch at the end, because SOC changes need to go into 
linux-next but not into net-next. 

We have make sure every individual patch has compiled successfully with W=1 if we 
apply SOC patch prior to the "net" patches.


Thanks and Regards,
Parvathi.
Jakub Kicinski Feb. 18, 2025, 2:40 p.m. UTC | #3
On Tue, 18 Feb 2025 15:36:20 +0530 (IST) Parvathi Pudi wrote:
> > On Fri, 14 Feb 2025 11:16:52 +0530 parvathi wrote:  
> >> The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
> >> is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
> >> Megabit ICSS (ICSSM).  
> > 
> > Every individual patch must build cleanly with W=1.
> > Otherwise doing git bisections is a miserable experience.
> > --  
> 
> As we mentioned in cover letter we have dependency with SOC patch.
> 
> "These patches have a dependency on an SOC patch, which we are including at the
> end of this series for reference. The SOC patch has been submitted in a separate
> thread [2] and we are awaiting for it to be merged."
> 
> SOC patch need to be applied prior applying the "net" patches. We have changed the 
> order and appended the SOC patch at the end, because SOC changes need to go into 
> linux-next but not into net-next. 
> 
> We have make sure every individual patch has compiled successfully with W=1 if we 
> apply SOC patch prior to the "net" patches.

Please resubmit after the merge window.
MD Danish Anwar Feb. 24, 2025, 6:56 a.m. UTC | #4
Hi Parvathi,

On 18/02/25 3:36 pm, Parvathi Pudi wrote:
> 
> Hi,
> 
>> On Fri, 14 Feb 2025 11:16:52 +0530 parvathi wrote:
>>> The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
>>> is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
>>> Megabit ICSS (ICSSM).
>>
>> Every individual patch must build cleanly with W=1.
>> Otherwise doing git bisections is a miserable experience.
>> --
> 
> As we mentioned in cover letter we have dependency with SOC patch.
> 
> "These patches have a dependency on an SOC patch, which we are including at the
> end of this series for reference. The SOC patch has been submitted in a separate
> thread [2] and we are awaiting for it to be merged."
> 
> SOC patch need to be applied prior applying the "net" patches. We have changed the 
> order and appended the SOC patch at the end, because SOC changes need to go into 
> linux-next but not into net-next. 
> 
> We have make sure every individual patch has compiled successfully with W=1 if we 
> apply SOC patch prior to the "net" patches.
> 

If there is any dependency in the series, the pre-requisite patch should
come before the dependent patch. In this series, SoC Patch should have
been the patch 1/10 and the warnings could have been avoided.

> 
> Thanks and Regards,
> Parvathi.
Nishanth Menon Feb. 26, 2025, 6:44 p.m. UTC | #5
On 11:16-20250214, parvathi wrote:
[...]
> The patches presented in this series have gone through the patch verification
> tools and no warnings or errors are reported. Sample test logs verifying the
> functionality on Linux next kernel are available here:
> 
> [Interface up Testing](https://gist.github.com/ParvathiPudi/f481837cc6994e400284cb4b58972804)
> 
> [Ping Testing](https://gist.github.com/ParvathiPudi/a121aad402defcef389e93f303d79317)
> 
> [Iperf Testing](https://gist.github.com/ParvathiPudi/581db46b0e9814ddb5903bdfee73fc6f)
> 


I am looking at https://lore.kernel.org/all/20250214085315.1077108-11-parvathi@couthit.com/
and wondering if i can see the test log for am335x and am47xx to make
sure that PRUs are functional on those two?
Parvathi Pudi Feb. 28, 2025, 10:55 a.m. UTC | #6
Hi,
 
> On 18/02/25 3:36 pm, Parvathi Pudi wrote:
>> 
>> Hi,
>> 
>>> On Fri, 14 Feb 2025 11:16:52 +0530 parvathi wrote:
>>>> The Programmable Real-Time Unit Industrial Communication Sub-system (PRU-ICSS)
>>>> is available on the TI SOCs in two flavors: Gigabit ICSS (ICSSG) and the older
>>>> Megabit ICSS (ICSSM).
>>>
>>> Every individual patch must build cleanly with W=1.
>>> Otherwise doing git bisections is a miserable experience.
>>> --
>> 
>> As we mentioned in cover letter we have dependency with SOC patch.
>> 
>> "These patches have a dependency on an SOC patch, which we are including at the
>> end of this series for reference. The SOC patch has been submitted in a separate
>> thread [2] and we are awaiting for it to be merged."
>> 
>> SOC patch need to be applied prior applying the "net" patches. We have changed
>> the
>> order and appended the SOC patch at the end, because SOC changes need to go into
>> linux-next but not into net-next.
>> 
>> We have make sure every individual patch has compiled successfully with W=1 if
>> we
>> apply SOC patch prior to the "net" patches.
>> 
> 
> If there is any dependency in the series, the pre-requisite patch should
> come before the dependent patch. In this series, SoC Patch should have
> been the patch 1/10 and the warnings could have been avoided.
> 

Sure, we will change the order and resubmit the patches in the next version.

Thanks and Regards,
Parvathi.
Parvathi Pudi Feb. 28, 2025, 10:58 a.m. UTC | #7
Hi,

> On 11:16-20250214, parvathi wrote:
> [...]
>> The patches presented in this series have gone through the patch verification
>> tools and no warnings or errors are reported. Sample test logs verifying the
>> functionality on Linux next kernel are available here:
>> 
>> [Interface up
>> Testing](https://gist.github.com/ParvathiPudi/f481837cc6994e400284cb4b58972804)
>> 
>> [Ping
>> Testing](https://gist.github.com/ParvathiPudi/a121aad402defcef389e93f303d79317)
>> 
>> [Iperf
>> Testing](https://gist.github.com/ParvathiPudi/581db46b0e9814ddb5903bdfee73fc6f)
>> 
> 
> 
> I am looking at
> https://lore.kernel.org/all/20250214085315.1077108-11-parvathi@couthit.com/
> and wondering if i can see the test log for am335x and am47xx to make
> sure that PRUs are functional on those two?
> 

In this patch series we have added support for PRU-ICSS on the AM57x SOC.
Hence the test log was only included for the AM57x SOC. We are working in parallel
to add support for PRU-ICSS on the AM33x and AM43x SOC's as well. We will send it as
a separate patch series at a later time.


Thanks and Regards,
Parvathi.
Parvathi Pudi March 6, 2025, 1:43 p.m. UTC | #8
Hi,

>> On 11:16-20250214, parvathi wrote:
>> [...]
>>> The patches presented in this series have gone through the patch verification
>>> tools and no warnings or errors are reported. Sample test logs verifying the
>>> functionality on Linux next kernel are available here:
>>> 
>>> [Interface up
>>> Testing](https://gist.github.com/ParvathiPudi/f481837cc6994e400284cb4b58972804)
>>> 
>>> [Ping
>>> Testing](https://gist.github.com/ParvathiPudi/a121aad402defcef389e93f303d79317)
>>> 
>>> [Iperf
>>> Testing](https://gist.github.com/ParvathiPudi/581db46b0e9814ddb5903bdfee73fc6f)
>>> 
>> 
>> 
>> I am looking at
>> https://lore.kernel.org/all/20250214085315.1077108-11-parvathi@couthit.com/
>> and wondering if i can see the test log for am335x and am47xx to make
>> sure that PRUs are functional on those two?
>> 
> 
> In this patch series we have added support for PRU-ICSS on the AM57x SOC.
> Hence the test log was only included for the AM57x SOC. We are working in
> parallel
> to add support for PRU-ICSS on the AM33x and AM43x SOC's as well. We will send
> it as
> a separate patch series at a later time.
> 

Further update:

We have successfully cross compiled the kernel (linux-next) with this patch series
for AM335x and AM437x SOC respectively.

Kernel is booting well on both the SOCs and we have verified PRU functionality by
loading simple example application (pru_addition.elf) on the PRU cores, by using
"remoteproc" driver from mainline kernel.

Below are the logs for the SOCs with boot log and running PRU with elf file specified
above:

AM335x test log: <https://gist.github.com/ParvathiPudi/87d7ddf949913b80f022ed99706337ac>
AM437x test log: <https://gist.github.com/ParvathiPudi/b2d556829cb4a9e3b6b4c5656dbdd594>


Thanks and Regards,
Parvathi.
Nishanth Menon March 7, 2025, 7:47 p.m. UTC | #9
On 19:13-20250306, Parvathi Pudi wrote:
> Hi,
> 
> >> On 11:16-20250214, parvathi wrote:
> >> [...]
> >>> The patches presented in this series have gone through the patch verification
> >>> tools and no warnings or errors are reported. Sample test logs verifying the
> >>> functionality on Linux next kernel are available here:
> >>> 
> >>> [Interface up
> >>> Testing](https://gist.github.com/ParvathiPudi/f481837cc6994e400284cb4b58972804)
> >>> 
> >>> [Ping
> >>> Testing](https://gist.github.com/ParvathiPudi/a121aad402defcef389e93f303d79317)
> >>> 
> >>> [Iperf
> >>> Testing](https://gist.github.com/ParvathiPudi/581db46b0e9814ddb5903bdfee73fc6f)
> >>> 
> >> 
> >> 
> >> I am looking at
> >> https://lore.kernel.org/all/20250214085315.1077108-11-parvathi@couthit.com/
> >> and wondering if i can see the test log for am335x and am47xx to make
> >> sure that PRUs are functional on those two?
> >> 
> > 
> > In this patch series we have added support for PRU-ICSS on the AM57x SOC.
> > Hence the test log was only included for the AM57x SOC. We are working in
> > parallel
> > to add support for PRU-ICSS on the AM33x and AM43x SOC's as well. We will send
> > it as
> > a separate patch series at a later time.
> > 
> 
> Further update:
> 
> We have successfully cross compiled the kernel (linux-next) with this patch series
> for AM335x and AM437x SOC respectively.
> 
> Kernel is booting well on both the SOCs and we have verified PRU functionality by
> loading simple example application (pru_addition.elf) on the PRU cores, by using
> "remoteproc" driver from mainline kernel.
> 
> Below are the logs for the SOCs with boot log and running PRU with elf file specified
> above:
> 
> AM335x test log: <https://gist.github.com/ParvathiPudi/87d7ddf949913b80f022ed99706337ac>
> AM437x test log: <https://gist.github.com/ParvathiPudi/b2d556829cb4a9e3b6b4c5656dbdd594>


Thanks for testing this, I just got some time to dig further, I will
respond on the standalone patch
https://lore.kernel.org/all/20250108125937.10604-2-basharath@couthit.com/