diff mbox series

[RFC,01/10] dt-bindings: net: ti: Adds device tree binding for DUAL-EMAC mode support on PRU-ICSS2 for AM57xx SOCs

Message ID 20250109105600.41297-2-basharath@couthit.com
State Superseded
Headers show
Series PRU-ICSSM Ethernet Driver | expand

Commit Message

Basharath Hussain Khaja Jan. 9, 2025, 10:55 a.m. UTC
From: Parvathi Pudi <parvathi@couthit.com>

Documentation update for the newly added "pruss2_eth" device tree
node and its dependencies along with compatibility for PRU-ICSS
Industrial Ethernet Peripheral (IEP), PRU-ICSS Enhanced Capture
(eCAP) peripheral and using YAML binding document for AM57xx SoCs.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
---
 .../devicetree/bindings/net/ti,icss-iep.yaml  |   6 +
 .../bindings/net/ti,icssm-prueth.yaml         | 153 ++++++++++++++++++
 .../bindings/net/ti,pruss-ecap.yaml           |  32 ++++
 .../devicetree/bindings/soc/ti/ti,pruss.yaml  |   9 ++
 4 files changed, 200 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
 create mode 100644 Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml

Comments

Rob Herring (Arm) Jan. 10, 2025, 4:15 p.m. UTC | #1
On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
> From: Parvathi Pudi <parvathi@couthit.com>
> 
> Documentation update for the newly added "pruss2_eth" device tree
> node and its dependencies along with compatibility for PRU-ICSS
> Industrial Ethernet Peripheral (IEP), PRU-ICSS Enhanced Capture
> (eCAP) peripheral and using YAML binding document for AM57xx SoCs.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
> ---
>  .../devicetree/bindings/net/ti,icss-iep.yaml  |   6 +
>  .../bindings/net/ti,icssm-prueth.yaml         | 153 ++++++++++++++++++
>  .../bindings/net/ti,pruss-ecap.yaml           |  32 ++++
>  .../devicetree/bindings/soc/ti/ti,pruss.yaml  |   9 ++
>  4 files changed, 200 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
>  create mode 100644 Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
> index e36e3a622904..afacdb61a84c 100644
> --- a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
> +++ b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
> @@ -8,18 +8,24 @@ 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:
>      oneOf:
>        - items:
>            - enum:
> +              - ti,am5728-icss-iep
>                - ti,am642-icss-iep
>                - ti,j721e-icss-iep
>            - const: ti,am654-icss-iep
>  
>        - const: ti,am654-icss-iep
>  
> +      - items:
> +          - enum:
> +              - ti,am5728-icss-iep

You can't have both. It's either compatible with ti,am654-icss-iep or it 
isn't.

>  
>    reg:
>      maxItems: 1
> diff --git a/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
> new file mode 100644
> index 000000000000..34d68619c086
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
> @@ -0,0 +1,153 @@
> +# 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
> +
> +  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 MII_RT module's syscon regmap
> +
> +  ti,iep:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      phandle to IEP (Industrial Ethernet Peripheral) for ICSS
> +
> +  ecap:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      phandle to Enhanced Capture (eCAP) event for ICSS
> +
> +  interrupts:
> +    maxItems: 2
> +    description:
> +      Interrupt specifiers to IRQ.

Provide a description for each entry because I can't decipher the names.

> +
> +  interrupt-names:
> +    items:
> +      - const: rx_lre_hp
> +      - const: rx_lre_lp

The same prefix or suffix on every entry is usually redundant.

> +
> +  ethernet-ports:
> +    type: object
> +    additionalProperties: false
> +
> +    properties:
> +      '#address-cells':
> +        const: 1
> +      '#size-cells':
> +        const: 0
> +
> +    patternProperties:
> +      ^port@[0-1]$:

ethernet-port

> +        type: object
> +        description: ICSSM PRUETH external ports
> +        $ref: ethernet-controller.yaml#
> +        unevaluatedProperties: false
> +
> +        properties:
> +          reg:
> +            items:
> +              - enum: [0, 1]
> +            description: ICSSG PRUETH port number
> +
> +          interrupts:
> +            maxItems: 3
> +
> +          interrupt-names:
> +            items:
> +              - const: rx
> +              - const: emac_ptp_tx
> +              - const: hsr_ptp_tx
> +
> +          ti,no-half-duplex:
> +            type: boolean
> +            description:
> +              Disable half duplex operation on ICSSM MII port.
> +
> +        required:
> +          - reg

blank line

> +    anyOf:
> +      - required:
> +          - port@0
> +      - required:
> +          - port@1
> +
> +required:
> +  - compatible
> +  - sram
> +  - ti,mii-rt
> +  - ti,iep
> +  - 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>;
> +      ecap = <&pruss2_ecap>;
> +      interrupts = <20 2 2>, <21 3 3>;
> +      interrupt-names = "rx_lre_hp", "rx_lre_lp";
> +      interrupt-parent = <&pruss2_intc>;
> +
> +      ethernet-ports {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        pruss2_emac0: 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";
> +          ti,no-half-duplex;
> +          /* Filled in by bootloader */
> +          local-mac-address = [00 00 00 00 00 00];
> +        };
> +
> +        pruss2_emac1: 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";
> +          ti,no-half-duplex;
> +          /* Filled in by bootloader */
> +          local-mac-address = [00 00 00 00 00 00];
> +        };
> +      };
> +    };
> diff --git a/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
> new file mode 100644
> index 000000000000..d42e636bf516
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
> @@ -0,0 +1,32 @@
> +# 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:
> +  - |
> +    pruss0_ecap: ecap@30000 {

Drop unused labels.

> +        compatible = "ti,pruss-ecap";
> +        reg = <0x30000 0x60>;
> +    };
> diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
> index 927b3200e29e..ddd65bd93aa1 100644
> --- a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
> +++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
> @@ -251,6 +251,15 @@ patternProperties:
>  
>      type: object
>  
> +  ecap@[a-f0-9]+$:
> +    description: |

Don't need '|'

> +      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 modeule irrespective of SOCs.
> +
> +    type: object
> +
>    mii-rt@[a-f0-9]+$:
>      description: |
>        Real-Time Ethernet to support multiple industrial communication protocols.
> -- 
> 2.34.1
>
Rob Herring (Arm) Jan. 10, 2025, 4:16 p.m. UTC | #2
On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
> From: Parvathi Pudi <parvathi@couthit.com>

Also, drop 'device tree binding for ' in the subject. 'dt-bindings' 
already says that and subject space is precious.

Rob
Basharath Hussain Khaja Jan. 22, 2025, 1:21 p.m. UTC | #3
> On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
>> From: Parvathi Pudi <parvathi@couthit.com>
>> 
>> Documentation update for the newly added "pruss2_eth" device tree
>> node and its dependencies along with compatibility for PRU-ICSS
>> Industrial Ethernet Peripheral (IEP), PRU-ICSS Enhanced Capture
>> (eCAP) peripheral and using YAML binding document for AM57xx SoCs.
> 
> If i was to do a side by side diff with the ICSSG, how much would be
> the same? Does it make sense to refactor this into a yaml file for all
> the common properties, and then yaml files for all the specific
> properties?
> 
The main difference is ICSSM follows traditional memcpy approach and ICSSG
follows DMA based packet processing so there are lot of differences in 
transmitting or receiving a packet through PRU firmware. On top of that there
are considerable changes in the configuration of MMRs as well as other run time 
parameters. We tried to reuse as much as possible and where ever reuse was not 
possible we created separate instances.

Thanks & Best Regards,
Basharath
Basharath Hussain Khaja Jan. 22, 2025, 1:26 p.m. UTC | #4
>> +          ti,no-half-duplex:
>> +            type: boolean
>> +            description:
>> +              Disable half duplex operation on ICSSM MII port.
> 
> I already asked this in the next patch, but why have this property? Is
> it because the hardware is broken? Or is this some sort of policy?
> Policy should not be in DT, DT describes the hardware, not the policy
> of how you use the hardware.
> 

This series of patches enables support for full-duplex only. Support for 
half-duplex will be added in subsequent revisions. We will clean it up in
the next version.

Thanks & Best Regards,
Basharath
Basharath Hussain Khaja Jan. 22, 2025, 1:43 p.m. UTC | #5
> On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
>> From: Parvathi Pudi <parvathi@couthit.com>
>> 
>> Documentation update for the newly added "pruss2_eth" device tree
>> node and its dependencies along with compatibility for PRU-ICSS
>> Industrial Ethernet Peripheral (IEP), PRU-ICSS Enhanced Capture
>> (eCAP) peripheral and using YAML binding document for AM57xx SoCs.
>> 
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> Signed-off-by: Andrew F. Davis <afd@ti.com>
>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>> Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
>> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
>> ---
>>  .../devicetree/bindings/net/ti,icss-iep.yaml  |   6 +
>>  .../bindings/net/ti,icssm-prueth.yaml         | 153 ++++++++++++++++++
>>  .../bindings/net/ti,pruss-ecap.yaml           |  32 ++++
>>  .../devicetree/bindings/soc/ti/ti,pruss.yaml  |   9 ++
>>  4 files changed, 200 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
>>  create mode 100644 Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
>> 
>> diff --git a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
>> b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
>> index e36e3a622904..afacdb61a84c 100644
>> --- a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
>> +++ b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
>> @@ -8,18 +8,24 @@ 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:
>>      oneOf:
>>        - items:
>>            - enum:
>> +              - ti,am5728-icss-iep
>>                - ti,am642-icss-iep
>>                - ti,j721e-icss-iep
>>            - const: ti,am654-icss-iep
>>  
>>        - const: ti,am654-icss-iep
>>  
>> +      - items:
>> +          - enum:
>> +              - ti,am5728-icss-iep
> 
> You can't have both. It's either compatible with ti,am654-icss-iep or it
> isn't.
> 

We will clean it up in the next version.

>>  
>>    reg:
>>      maxItems: 1
>> diff --git a/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
>> b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
>> new file mode 100644
>> index 000000000000..34d68619c086
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
>> @@ -0,0 +1,153 @@
>> +# 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
>> +
>> +  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 MII_RT module's syscon regmap
>> +
>> +  ti,iep:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description:
>> +      phandle to IEP (Industrial Ethernet Peripheral) for ICSS
>> +
>> +  ecap:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description:
>> +      phandle to Enhanced Capture (eCAP) event for ICSS
>> +
>> +  interrupts:
>> +    maxItems: 2
>> +    description:
>> +      Interrupt specifiers to IRQ.
> 
> Provide a description for each entry because I can't decipher the names.
> 

We will add require description as suggested in the next version.

>> +
>> +  interrupt-names:
>> +    items:
>> +      - const: rx_lre_hp
>> +      - const: rx_lre_lp
> 
> The same prefix or suffix on every entry is usually redundant.
> 

We will clean it up in the next version.

>> +
>> +  ethernet-ports:
>> +    type: object
>> +    additionalProperties: false
>> +
>> +    properties:
>> +      '#address-cells':
>> +        const: 1
>> +      '#size-cells':
>> +        const: 0
>> +
>> +    patternProperties:
>> +      ^port@[0-1]$:
> 
> ethernet-port
> 

We will address this in the next version.

>> +        type: object
>> +        description: ICSSM PRUETH external ports
>> +        $ref: ethernet-controller.yaml#
>> +        unevaluatedProperties: false
>> +
>> +        properties:
>> +          reg:
>> +            items:
>> +              - enum: [0, 1]
>> +            description: ICSSG PRUETH port number
>> +
>> +          interrupts:
>> +            maxItems: 3
>> +
>> +          interrupt-names:
>> +            items:
>> +              - const: rx
>> +              - const: emac_ptp_tx
>> +              - const: hsr_ptp_tx
>> +
>> +          ti,no-half-duplex:
>> +            type: boolean
>> +            description:
>> +              Disable half duplex operation on ICSSM MII port.
>> +
>> +        required:
>> +          - reg
> 
> blank line
> 

We will add a blank line after "-reg" in next version.

>> +    anyOf:
>> +      - required:
>> +          - port@0
>> +      - required:
>> +          - port@1
>> +
>> +required:
>> +  - compatible
>> +  - sram
>> +  - ti,mii-rt
>> +  - ti,iep
>> +  - 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>;
>> +      ecap = <&pruss2_ecap>;
>> +      interrupts = <20 2 2>, <21 3 3>;
>> +      interrupt-names = "rx_lre_hp", "rx_lre_lp";
>> +      interrupt-parent = <&pruss2_intc>;
>> +
>> +      ethernet-ports {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        pruss2_emac0: 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";
>> +          ti,no-half-duplex;
>> +          /* Filled in by bootloader */
>> +          local-mac-address = [00 00 00 00 00 00];
>> +        };
>> +
>> +        pruss2_emac1: 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";
>> +          ti,no-half-duplex;
>> +          /* Filled in by bootloader */
>> +          local-mac-address = [00 00 00 00 00 00];
>> +        };
>> +      };
>> +    };
>> diff --git a/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
>> b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
>> new file mode 100644
>> index 000000000000..d42e636bf516
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
>> @@ -0,0 +1,32 @@
>> +# 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:
>> +  - |
>> +    pruss0_ecap: ecap@30000 {
> 
> Drop unused labels.
> 

We will address this in the next version.

>> +        compatible = "ti,pruss-ecap";
>> +        reg = <0x30000 0x60>;
>> +    };
>> diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>> b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>> index 927b3200e29e..ddd65bd93aa1 100644
>> --- a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>> +++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>> @@ -251,6 +251,15 @@ patternProperties:
>>  
>>      type: object
>>  
>> +  ecap@[a-f0-9]+$:
>> +    description: |
> 
> Don't need '|'
> 

We will clean up in next version.

>> +      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 modeule irrespective of SOCs.
>> +
>> +    type: object
>> +
>>    mii-rt@[a-f0-9]+$:
>>      description: |
>>        Real-Time Ethernet to support multiple industrial communication protocols.
>> --
>> 2.34.1
Andrew Lunn Jan. 22, 2025, 1:43 p.m. UTC | #6
On Wed, Jan 22, 2025 at 06:56:14PM +0530, Basharath Hussain Khaja wrote:
> 
> >> +          ti,no-half-duplex:
> >> +            type: boolean
> >> +            description:
> >> +              Disable half duplex operation on ICSSM MII port.
> > 
> > I already asked this in the next patch, but why have this property? Is
> > it because the hardware is broken? Or is this some sort of policy?
> > Policy should not be in DT, DT describes the hardware, not the policy
> > of how you use the hardware.
> > 
> 
> This series of patches enables support for full-duplex only. Support for 
> half-duplex will be added in subsequent revisions. We will clean it up in
> the next version.

So you don't need this property. All you need to do is remove the 1/2
duplex link modes using phy_remove_link_mode() and user space will not
get the option to enable them, not will auto-neg advertise them.

	Andrew
Basharath Hussain Khaja Jan. 22, 2025, 1:46 p.m. UTC | #7
> On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
>> From: Parvathi Pudi <parvathi@couthit.com>
> 
> Also, drop 'device tree binding for ' in the subject. 'dt-bindings'
> already says that and subject space is precious.
> 

We will address this in the next version.

Thanks & Best Regards,
Basharath
Basharath Hussain Khaja Jan. 22, 2025, 3:03 p.m. UTC | #8
> On Wed, Jan 22, 2025 at 06:56:14PM +0530, Basharath Hussain Khaja wrote:
>> 
>> >> +          ti,no-half-duplex:
>> >> +            type: boolean
>> >> +            description:
>> >> +              Disable half duplex operation on ICSSM MII port.
>> > 
>> > I already asked this in the next patch, but why have this property? Is
>> > it because the hardware is broken? Or is this some sort of policy?
>> > Policy should not be in DT, DT describes the hardware, not the policy
>> > of how you use the hardware.
>> > 
>> 
>> This series of patches enables support for full-duplex only. Support for
>> half-duplex will be added in subsequent revisions. We will clean it up in
>> the next version.
> 
> So you don't need this property. All you need to do is remove the 1/2
> duplex link modes using phy_remove_link_mode() and user space will not
> get the option to enable them, not will auto-neg advertise them.

Sure. We will remove this property and make necessary changes at all places in the next version.  

Thanks & Best Regards,
Basharath
Basharath Hussain Khaja Jan. 22, 2025, 3:28 p.m. UTC | #9
> On Thu, Jan 09, 2025 at 04:25:51PM +0530, Basharath Hussain Khaja wrote:
>> From: Parvathi Pudi <parvathi@couthit.com>
> 
> Also, drop 'device tree binding for ' in the subject. 'dt-bindings'
> already says that and subject space is precious.
> 

We will change patch subject in the next version.

Thanks & Best Regards,
Basharath
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
index e36e3a622904..afacdb61a84c 100644
--- a/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
+++ b/Documentation/devicetree/bindings/net/ti,icss-iep.yaml
@@ -8,18 +8,24 @@  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:
     oneOf:
       - items:
           - enum:
+              - ti,am5728-icss-iep
               - ti,am642-icss-iep
               - ti,j721e-icss-iep
           - const: ti,am654-icss-iep
 
       - const: ti,am654-icss-iep
 
+      - items:
+          - enum:
+              - ti,am5728-icss-iep
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
new file mode 100644
index 000000000000..34d68619c086
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml
@@ -0,0 +1,153 @@ 
+# 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
+
+  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 MII_RT module's syscon regmap
+
+  ti,iep:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to IEP (Industrial Ethernet Peripheral) for ICSS
+
+  ecap:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to Enhanced Capture (eCAP) event for ICSS
+
+  interrupts:
+    maxItems: 2
+    description:
+      Interrupt specifiers to IRQ.
+
+  interrupt-names:
+    items:
+      - const: rx_lre_hp
+      - const: rx_lre_lp
+
+  ethernet-ports:
+    type: object
+    additionalProperties: false
+
+    properties:
+      '#address-cells':
+        const: 1
+      '#size-cells':
+        const: 0
+
+    patternProperties:
+      ^port@[0-1]$:
+        type: object
+        description: ICSSM PRUETH external ports
+        $ref: ethernet-controller.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          reg:
+            items:
+              - enum: [0, 1]
+            description: ICSSG PRUETH port number
+
+          interrupts:
+            maxItems: 3
+
+          interrupt-names:
+            items:
+              - const: rx
+              - const: emac_ptp_tx
+              - const: hsr_ptp_tx
+
+          ti,no-half-duplex:
+            type: boolean
+            description:
+              Disable half duplex operation on ICSSM MII port.
+
+        required:
+          - reg
+    anyOf:
+      - required:
+          - port@0
+      - required:
+          - port@1
+
+required:
+  - compatible
+  - sram
+  - ti,mii-rt
+  - ti,iep
+  - 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>;
+      ecap = <&pruss2_ecap>;
+      interrupts = <20 2 2>, <21 3 3>;
+      interrupt-names = "rx_lre_hp", "rx_lre_lp";
+      interrupt-parent = <&pruss2_intc>;
+
+      ethernet-ports {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        pruss2_emac0: 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";
+          ti,no-half-duplex;
+          /* Filled in by bootloader */
+          local-mac-address = [00 00 00 00 00 00];
+        };
+
+        pruss2_emac1: 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";
+          ti,no-half-duplex;
+          /* Filled in by bootloader */
+          local-mac-address = [00 00 00 00 00 00];
+        };
+      };
+    };
diff --git a/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
new file mode 100644
index 000000000000..d42e636bf516
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,pruss-ecap.yaml
@@ -0,0 +1,32 @@ 
+# 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:
+  - |
+    pruss0_ecap: ecap@30000 {
+        compatible = "ti,pruss-ecap";
+        reg = <0x30000 0x60>;
+    };
diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
index 927b3200e29e..ddd65bd93aa1 100644
--- a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
+++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
@@ -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 modeule irrespective of SOCs.
+
+    type: object
+
   mii-rt@[a-f0-9]+$:
     description: |
       Real-Time Ethernet to support multiple industrial communication protocols.