Commit 617d53f7 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'pru-icssm-ethernet-driver'

Parvathi Pudi says:

====================
PRU-ICSSM Ethernet Driver

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 using ICSSM on the TI AM57xx,
AM437x and AM335x devices.

AM335x, AM437x and AM57xx devices may have either one or two PRU-ICSS instances
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 add support for basic RX and TX  functionality over PRU Ethernet
ports in Dual-EMAC mode.

Further, note that these are the initial set of patches for a single instance of
PRU-ICSS Ethernet.  Additional features such as Ethtool support, VLAN Filtering,
Multicast Filtering, Promiscuous mode, Storm prevention, Interrupt coalescing,
Linux PTP (ptp4l) Ordinary clock and Switch mode support for AM335x, AM437x
and AM57x along with support for a second instance of  PRU-ICSS on AM57x
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 obtained from AM33x,
AM43x and AM57x verifying the functionality on Linux next kernel are available here:

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

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

[Iperf Testing](https://gist.github.com/ParvathiPudi/9bb4fa42410fbc757a93f65ecb45e4f3)

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

Link: https://patch.msgid.link/20250912104741.528721-1-parvathi@couthit.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 16116668 7d4b5217
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ title: Texas Instruments ICSS Industrial Ethernet Peripheral (IEP) module

maintainers:
  - Md Danish Anwar <danishanwar@ti.com>
  - Parvathi Pudi <parvathi@couthit.com>
  - Basharath Hussain Khaja <basharath@couthit.com>

properties:
  compatible:
@@ -17,9 +19,11 @@ properties:
              - ti,am642-icss-iep
              - ti,j721e-icss-iep
          - const: ti,am654-icss-iep

      - const: ti,am654-icss-iep

      - enum:
          - ti,am654-icss-iep
          - ti,am5728-icss-iep
          - ti,am4376-icss-iep
          - ti,am3356-icss-iep

  reg:
    maxItems: 1
+233 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/ti,icssm-prueth.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments ICSSM PRUSS Ethernet

maintainers:
  - Roger Quadros <rogerq@ti.com>
  - Andrew F. Davis <afd@ti.com>
  - Parvathi Pudi <parvathi@couthit.com>
  - Basharath Hussain Khaja <basharath@couthit.com>

description:
  Ethernet based on the Programmable Real-Time Unit and Industrial
  Communication Subsystem.

properties:
  compatible:
    enum:
      - ti,am57-prueth     # for AM57x SoC family
      - ti,am4376-prueth   # for AM43x SoC family
      - ti,am3359-prueth   # for AM33x SoC family

  sram:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      phandle to OCMC SRAM node

  ti,mii-rt:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      phandle to the MII_RT peripheral for ICSS

  ti,iep:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      phandle to IEP (Industrial Ethernet Peripheral) for ICSS

  ti,ecap:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      phandle to Enhanced Capture (eCAP) event for ICSS

  interrupts:
    items:
      - description: High priority Rx Interrupt specifier.
      - description: Low priority Rx Interrupt specifier.

  interrupt-names:
    items:
      - const: rx_hp
      - const: rx_lp

  ethernet-ports:
    type: object
    additionalProperties: false

    properties:
      '#address-cells':
        const: 1
      '#size-cells':
        const: 0

    patternProperties:
      ^ethernet-port@[0-1]$:
        type: object
        description: ICSSM PRUETH external ports
        $ref: ethernet-controller.yaml#
        unevaluatedProperties: false

        properties:
          reg:
            items:
              - enum: [0, 1]
            description: ICSSM PRUETH port number

          interrupts:
            maxItems: 3

          interrupt-names:
            items:
              - const: rx
              - const: emac_ptp_tx
              - const: hsr_ptp_tx

        required:
          - reg

    anyOf:
      - required:
          - ethernet-port@0
      - required:
          - ethernet-port@1

required:
  - compatible
  - sram
  - ti,mii-rt
  - ti,iep
  - ti,ecap
  - ethernet-ports
  - interrupts
  - interrupt-names

allOf:
  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#

unevaluatedProperties: false

examples:
  - |
    /* Dual-MAC Ethernet application node on PRU-ICSS2 */
    pruss2_eth: pruss2-eth {
      compatible = "ti,am57-prueth";
      ti,prus = <&pru2_0>, <&pru2_1>;
      sram = <&ocmcram1>;
      ti,mii-rt = <&pruss2_mii_rt>;
      ti,iep = <&pruss2_iep>;
      ti,ecap = <&pruss2_ecap>;
      interrupts = <20 2 2>, <21 3 3>;
      interrupt-names = "rx_hp", "rx_lp";
      interrupt-parent = <&pruss2_intc>;

      ethernet-ports {
        #address-cells = <1>;
        #size-cells = <0>;
        pruss2_emac0: ethernet-port@0 {
          reg = <0>;
          phy-handle = <&pruss2_eth0_phy>;
          phy-mode = "mii";
          interrupts = <20 2 2>, <26 6 6>, <23 6 6>;
          interrupt-names = "rx", "emac_ptp_tx", "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };

        pruss2_emac1: ethernet-port@1 {
          reg = <1>;
          phy-handle = <&pruss2_eth1_phy>;
          phy-mode = "mii";
          interrupts = <21 3 3>, <27 9 7>, <24 9 7>;
          interrupt-names = "rx", "emac_ptp_tx", "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };
      };
    };
  - |
    /* Dual-MAC Ethernet application node on PRU-ICSS1 */
    pruss1_eth: pruss1-eth {
      compatible = "ti,am4376-prueth";
      ti,prus = <&pru1_0>, <&pru1_1>;
      sram = <&ocmcram>;
      ti,mii-rt = <&pruss1_mii_rt>;
      ti,iep = <&pruss1_iep>;
      ti,ecap = <&pruss1_ecap>;
      interrupts = <20 2 2>, <21 3 3>;
      interrupt-names = "rx_hp", "rx_lp";
      interrupt-parent = <&pruss1_intc>;

      pinctrl-0 = <&pruss1_eth_default>;
      pinctrl-names = "default";

      ethernet-ports {
        #address-cells = <1>;
        #size-cells = <0>;
        pruss1_emac0: ethernet-port@0 {
          reg = <0>;
          phy-handle = <&pruss1_eth0_phy>;
          phy-mode = "mii";
          interrupts = <20 2 2>, <26 6 6>, <23 6 6>;
          interrupt-names = "rx", "emac_ptp_tx",
                                          "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };

        pruss1_emac1: ethernet-port@1 {
          reg = <1>;
          phy-handle = <&pruss1_eth1_phy>;
          phy-mode = "mii";
          interrupts = <21 3 3>, <27 9 7>, <24 9 7>;
          interrupt-names = "rx", "emac_ptp_tx",
                                          "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };
      };
    };
  - |
    /* Dual-MAC Ethernet application node on PRU-ICSS */
    pruss_eth: pruss-eth {
      compatible = "ti,am3359-prueth";
      ti,prus = <&pru0>, <&pru1>;
      sram = <&ocmcram>;
      ti,mii-rt = <&pruss_mii_rt>;
      ti,iep = <&pruss_iep>;
      ti,ecap = <&pruss_ecap>;
      interrupts = <20 2 2>, <21 3 3>;
      interrupt-names = "rx_hp", "rx_lp";
      interrupt-parent = <&pruss_intc>;

      pinctrl-0 = <&pruss_eth_default>;
      pinctrl-names = "default";

      ethernet-ports {
        #address-cells = <1>;
        #size-cells = <0>;
        pruss_emac0: ethernet-port@0 {
          reg = <0>;
          phy-handle = <&pruss_eth0_phy>;
          phy-mode = "mii";
          interrupts = <20 2 2>, <26 6 6>, <23 6 6>;
          interrupt-names = "rx", "emac_ptp_tx",
                                          "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };

        pruss_emac1: ethernet-port@1 {
          reg = <1>;
          phy-handle = <&pruss_eth1_phy>;
          phy-mode = "mii";
          interrupts = <21 3 3>, <27 9 7>, <24 9 7>;
          interrupt-names = "rx", "emac_ptp_tx",
                                          "hsr_ptp_tx";
          /* Filled in by bootloader */
          local-mac-address = [00 00 00 00 00 00];
        };
      };
    };
+32 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/ti,pruss-ecap.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments PRU-ICSS Enhanced Capture (eCAP) event module

maintainers:
  - Murali Karicheri <m-karicheri2@ti.com>
  - Parvathi Pudi <parvathi@couthit.com>
  - Basharath Hussain Khaja <basharath@couthit.com>

properties:
  compatible:
    const: ti,pruss-ecap

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    pruss2_ecap: ecap@30000 {
        compatible = "ti,pruss-ecap";
        reg = <0x30000 0x60>;
    };
+9 −0
Original line number Diff line number Diff line
@@ -251,6 +251,15 @@ patternProperties:

    type: object

  ecap@[a-f0-9]+$:
    description:
      PRU-ICSS has a Enhanced Capture (eCAP) event module which can generate
      and capture periodic timer based events which will be used for features
      like RX Pacing to rise interrupt when the timer event has occurred.
      Each PRU-ICSS instance has one eCAP module irrespective of SOCs.
    $ref: /schemas/net/ti,pruss-ecap.yaml#
    type: object

  mii-rt@[a-f0-9]+$:
    description: |
      Real-Time Ethernet to support multiple industrial communication protocols.
+12 −0
Original line number Diff line number Diff line
@@ -25319,6 +25319,18 @@ S: Maintained
F:	Documentation/devicetree/bindings/net/ti,icss*.yaml
F:	drivers/net/ethernet/ti/icssg/*
TI ICSSM ETHERNET DRIVER (ICSSM)
M:	MD Danish Anwar <danishanwar@ti.com>
M:	Parvathi Pudi <parvathi@couthit.com>
R:	Roger Quadros <rogerq@kernel.org>
R:	Mohan Reddy Putluru <pmohan@couthit.com>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L:	netdev@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/net/ti,icssm*.yaml
F:	Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
F:	drivers/net/ethernet/ti/icssm/*
TI J721E CSI2RX DRIVER
M:	Jai Luthra <jai.luthra@linux.dev>
L:	linux-media@vger.kernel.org
Loading