linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Introduce ICSSG based ethernet Driver
@ 2023-02-10 11:49 MD Danish Anwar
  2023-02-10 11:49 ` [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: MD Danish Anwar @ 2023-02-10 11:49 UTC (permalink / raw)
  To: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	MD Danish Anwar, Vignesh Raghavendra, Krzysztof Kozlowski,
	Rob Herring, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, andrew
  Cc: nm, ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

The Programmable Real-time Unit and Industrial Communication Subsystem
Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI
SoCs. This subsystem is provided for the use cases like the implementation
of custom peripheral interfaces, offloading of tasks from the other
processor cores of the SoC, etc.

The subsystem includes many accelerators for data processing like
multiplier and multiplier-accumulator. It also has peripherals like
UART, MII/RGMII, MDIO, etc. Every ICSSG core includes two 32-bit
load/store RISC CPU cores called PRUs.

The above features allow it to be used for implementing custom firmware
based peripherals like ethernet.

This series adds the YAML documentation and the driver with basic EMAC
support for TI AM654 Silicon Rev 2 SoC with the PRU_ICSSG Sub-system.
running dual-EMAC firmware.
This currently supports basic EMAC with 1Gbps and 100Mbps link. 10M and
half-duplex modes are not yet supported because they require the support
of an IEP, which will be added later.
Advanced features like switch-dev and timestamping will be added later.

This series depends on two patch series that are not yet merged, one in
the remoteproc tree and another in the soc tree. the first one is titled
Introduce PRU remoteproc consumer API and the second one is titled
Introduce PRU platform consumer API.
Both of these are required for this driver.

To explain this dependency and to get reviews, I had earlier posted all
three of these as an RFC[1], this can be seen for understanding the
dependencies.

The two series remoteproc[2] and soc[3] have been posted separately to 
their respective trees.

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

Changes from v4 to v5 :
*) Re-arranged properties section in ti,icssg-prueth.yaml file.
*) Added requirement for minimum one ethernet port.
*) Fixed some minor formatting errors as asked by Krzysztof.
*) Dropped SGMII mode from enum mii_mode as SGMII mode is not currently
   supported by the driver.
*) Added switch-case block to handle different phy modes by ICSSG driver.

Changes from v3 to v4 :
*) Addressed Krzysztof's comments and fixed dt_binding_check errors in 
   patch 1/2.
*) Added interrupt-extended property in ethernet-ports properties section.
*) Fixed comments in file icssg_switch_map.h according to the Linux coding
   style in patch 2/2. Added Documentation of structures in patch 2/2.

Changes from v2 to v3 :
*) Addressed Rob and Krzysztof's comments on patch 1 of this series.
   Fixed indentation. Removed description and pinctrl section from 
   ti,icssg-prueth.yaml file.
*) Addressed Krzysztof, Paolo, Randy, Andrew and Christophe's comments on 
   patch 2 of this seires.
*) Fixed blanklines in Kconfig and Makefile. Changed structures to const 
   as suggested by Krzysztof.
*) Fixed while loop logic in emac_tx_complete_packets() API as suggested 
   by Paolo. Previously in the loop's last iteration 'budget' was 0 and 
   napi_consume_skb would wrongly assume the caller is not in NAPI context
   Now, budget won't be zero in last iteration of loop. 
*) Removed inline functions addr_to_da1() and addr_to_da0() as asked by 
   Andrew.
*) Added dev_err_probe() instead of dev_err() as suggested by Christophe.
*) In ti,icssg-prueth.yaml file, in the patternProperties section of 
   ethernet-ports, kept the port name as "port" instead of "ethernet-port" 
   as all other drivers were using "port". Will change it if is compulsory 
   to use "ethernet-port".

[1] https://lore.kernel.org/all/20220406094358.7895-1-p-mohan@ti.com/
[2] https://patchwork.kernel.org/project/linux-remoteproc/cover/20220418104118.12878-1-p-mohan@ti.com/
[3] https://patchwork.kernel.org/project/linux-remoteproc/cover/20220418123004.9332-1-p-mohan@ti.com/

[v1] https://lore.kernel.org/all/20220506052433.28087-1-p-mohan@ti.com/
[v2] https://lore.kernel.org/all/20220531095108.21757-1-p-mohan@ti.com/
[v3] https://lore.kernel.org/all/20221223110930.1337536-1-danishanwar@ti.com/
[v4] https://lore.kernel.org/all/20230206060708.3574472-1-danishanwar@ti.com/

Thanks and Regards,
Md Danish Anwar

Puranjay Mohan (1):
  dt-bindings: net: Add ICSSG Ethernet

Roger Quadros (1):
  net: ti: icssg-prueth: Add ICSSG ethernet driver

 .../bindings/net/ti,icssg-prueth.yaml         |  184 ++
 drivers/net/ethernet/ti/Kconfig               |   13 +
 drivers/net/ethernet/ti/Makefile              |    2 +
 drivers/net/ethernet/ti/icssg_classifier.c    |  369 ++++
 drivers/net/ethernet/ti/icssg_config.c        |  449 ++++
 drivers/net/ethernet/ti/icssg_config.h        |  200 ++
 drivers/net/ethernet/ti/icssg_ethtool.c       |  326 +++
 drivers/net/ethernet/ti/icssg_mii_cfg.c       |  104 +
 drivers/net/ethernet/ti/icssg_mii_rt.h        |  150 ++
 drivers/net/ethernet/ti/icssg_prueth.c        | 1863 +++++++++++++++++
 drivers/net/ethernet/ti/icssg_prueth.h        |  246 +++
 drivers/net/ethernet/ti/icssg_switch_map.h    |  234 +++
 include/linux/remoteproc/pruss.h              |    1 +
 13 files changed, 4141 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
 create mode 100644 drivers/net/ethernet/ti/icssg_classifier.c
 create mode 100644 drivers/net/ethernet/ti/icssg_config.c
 create mode 100644 drivers/net/ethernet/ti/icssg_config.h
 create mode 100644 drivers/net/ethernet/ti/icssg_ethtool.c
 create mode 100644 drivers/net/ethernet/ti/icssg_mii_cfg.c
 create mode 100644 drivers/net/ethernet/ti/icssg_mii_rt.h
 create mode 100644 drivers/net/ethernet/ti/icssg_prueth.c
 create mode 100644 drivers/net/ethernet/ti/icssg_prueth.h
 create mode 100644 drivers/net/ethernet/ti/icssg_switch_map.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 11:49 [PATCH v5 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
@ 2023-02-10 11:49 ` MD Danish Anwar
  2023-02-10 13:58   ` Rob Herring
  2023-02-10 19:20   ` Rob Herring
  2023-02-11  0:38 ` [PATCH v5 0/2] Introduce ICSSG based ethernet Driver Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: MD Danish Anwar @ 2023-02-10 11:49 UTC (permalink / raw)
  To: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	MD Danish Anwar, Vignesh Raghavendra, Krzysztof Kozlowski,
	Rob Herring, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, andrew
  Cc: nm, ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

From: Puranjay Mohan <p-mohan@ti.com>

Add a YAML binding document for the ICSSG Programmable real time unit
based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
APIs to interface the PRUs and load/run the firmware for supporting
ethernet functionality.

Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
---
 .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml

diff --git a/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
new file mode 100644
index 000000000000..8b860f29ecc0
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
@@ -0,0 +1,184 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/ti,icssg-prueth.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments ICSSG PRUSS Ethernet
+
+maintainers:
+  - Md Danish Anwar <danishanwar@ti.com>
+
+description:
+  Ethernet based on the Programmable Real-Time
+  Unit and Industrial Communication Subsystem.
+
+allOf:
+  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
+
+properties:
+  compatible:
+    enum:
+      - ti,am654-icssg-prueth  # for AM65x SoC family
+
+  ti,sram:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to MSMC SRAM node
+
+  dmas:
+    maxItems: 10
+
+  dma-names:
+    items:
+      - const: tx0-0
+      - const: tx0-1
+      - const: tx0-2
+      - const: tx0-3
+      - const: tx1-0
+      - const: tx1-1
+      - const: tx1-2
+      - const: tx1-3
+      - const: rx0
+      - const: rx1
+
+  ti,mii-g-rt:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: |
+      phandle to MII_G_RT module's syscon regmap.
+
+  ti,mii-rt:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: |
+      phandle to MII_RT module's syscon regmap
+
+  interrupts:
+    maxItems: 2
+    description: |
+      Interrupt specifiers to TX timestamp IRQ.
+
+  interrupt-names:
+    items:
+      - const: tx_ts0
+      - const: tx_ts1
+
+  ethernet-ports:
+    type: object
+    additionalProperties: false
+
+    properties:
+      '#address-cells':
+        const: 1
+      '#size-cells':
+        const: 0
+
+    patternProperties:
+      ^port@[0-1]$:
+        type: object
+        description: ICSSG PRUETH external ports
+        $ref: ethernet-controller.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          reg:
+            items:
+              - enum: [0, 1]
+            description: ICSSG PRUETH port number
+
+          interrupts:
+            maxItems: 1
+
+          ti,syscon-rgmii-delay:
+            items:
+              - items:
+                  - description: phandle to system controller node
+                  - description: The offset to ICSSG control register
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+            description:
+              phandle to system controller node and register offset
+              to ICSSG control register for RGMII transmit delay
+
+        required:
+          - reg
+    anyOf:
+      - required:
+          - port@0
+      - required:
+          - port@1
+
+required:
+  - compatible
+  - ti,sram
+  - dmas
+  - dma-names
+  - ethernet-ports
+  - ti,mii-g-rt
+  - interrupts
+  - interrupt-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    /* Example k3-am654 base board SR2.0, dual-emac */
+    pruss2_eth: ethernet {
+        compatible = "ti,am654-icssg-prueth";
+        pinctrl-names = "default";
+        pinctrl-0 = <&icssg2_rgmii_pins_default>;
+        ti,sram = <&msmc_ram>;
+
+        ti,prus = <&pru2_0>, <&rtu2_0>, <&tx_pru2_0>,
+                  <&pru2_1>, <&rtu2_1>, <&tx_pru2_1>;
+        firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
+                        "ti-pruss/am65x-rtu0-prueth-fw.elf",
+                        "ti-pruss/am65x-txpru0-prueth-fw.elf",
+                        "ti-pruss/am65x-pru1-prueth-fw.elf",
+                        "ti-pruss/am65x-rtu1-prueth-fw.elf",
+                        "ti-pruss/am65x-txpru1-prueth-fw.elf";
+        ti,pruss-gp-mux-sel = <2>,      /* MII mode */
+                              <2>,
+                              <2>,
+                              <2>,      /* MII mode */
+                              <2>,
+                              <2>;
+        dmas = <&main_udmap 0xc300>, /* egress slice 0 */
+               <&main_udmap 0xc301>, /* egress slice 0 */
+               <&main_udmap 0xc302>, /* egress slice 0 */
+               <&main_udmap 0xc303>, /* egress slice 0 */
+               <&main_udmap 0xc304>, /* egress slice 1 */
+               <&main_udmap 0xc305>, /* egress slice 1 */
+               <&main_udmap 0xc306>, /* egress slice 1 */
+               <&main_udmap 0xc307>, /* egress slice 1 */
+               <&main_udmap 0x4300>, /* ingress slice 0 */
+               <&main_udmap 0x4301>; /* ingress slice 1 */
+        dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
+                    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
+                    "rx0", "rx1";
+        ti,mii-g-rt = <&icssg2_mii_g_rt>;
+        interrupt-parent = <&icssg2_intc>;
+        interrupts = <24 0 2>, <25 1 3>;
+        interrupt-names = "tx_ts0", "tx_ts1";
+        ethernet-ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            pruss2_emac0: port@0 {
+                reg = <0>;
+                phy-handle = <&pruss2_eth0_phy>;
+                phy-mode = "rgmii-id";
+                interrupts-extended = <&icssg2_intc 24>;
+                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
+                /* 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 = "rgmii-id";
+                interrupts-extended = <&icssg2_intc 25>;
+                ti,syscon-rgmii-delay = <&scm_conf 0x4124>;
+                /* Filled in by bootloader */
+                local-mac-address = [00 00 00 00 00 00];
+            };
+        };
+    };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 11:49 ` [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
@ 2023-02-10 13:58   ` Rob Herring
  2023-02-10 15:30     ` [EXTERNAL] " Md Danish Anwar
  2023-02-10 19:20   ` Rob Herring
  1 sibling, 1 reply; 14+ messages in thread
From: Rob Herring @ 2023-02-10 13:58 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Paolo Abeni, srk, andrew, Eric Dumazet,
	Jakub Kicinski, devicetree, Rob Herring, ssantosh,
	Krzysztof Kozlowski, nm, David S. Miller, Vignesh Raghavendra,
	netdev, linux-omap, linux-kernel, linux-arm-kernel, Suman Anna,
	YueHaibing, Roger Quadros


On Fri, 10 Feb 2023 17:19:56 +0530, MD Danish Anwar wrote:
> From: Puranjay Mohan <p-mohan@ti.com>
> 
> Add a YAML binding document for the ICSSG Programmable real time unit
> based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
> APIs to interface the PRUs and load/run the firmware for supporting
> ethernet functionality.
> 
> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
> ---
>  .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
>  1 file changed, 184 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/remoteproc/ti,pru-consumer.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: False schema does not allow {'compatible': ['ti,am654-icssg-prueth'], 'pinctrl-names': ['default'], 'pinctrl-0': [[4294967295]], 'ti,sram': [[4294967295]], 'ti,prus': [[4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295]], 'firmware-name': ['ti-pruss/am65x-pru0-prueth-fw.elf', 'ti-pruss/am65x-rtu0-prueth-fw.elf', 'ti-pruss/am65x-txpru0-prueth-fw.elf', 'ti-pruss/am65x-pru1-prueth-fw.elf', 'ti-pruss/am65x-rtu1-prueth-fw.elf', 'ti-pruss/am65x-txpru1-prueth-fw.elf'], 'ti,pruss-gp-mux-sel': [[2, 2, 2, 2, 2, 2]], 'dmas': [[4294967295, 49920], [4294967295, 49921], [4294967295, 49922], [4294967295, 49923], [4294967295, 49924], [4294967295, 49925], [4294967295, 49926], [4294967295, 49927], [4294967295, 17152], [4294967295, 17153]], 'dma-names': ['tx0-0', 'tx0-1', 'tx0-2', 'tx0-3', 'tx1-0', 'tx1-1', 'tx1-2', 'tx1-3', 'rx0', 'rx1'], 'ti,mii-g-rt': [[4294967295]]
 , 'interrupts': [[24, 0, 2], [25, 1, 3]], 'interrupt-names': ['tx_ts0', 'tx_ts1'], 'ethernet-ports': {'#address-cells': [[1]], '#size-cells': [[0]], 'port@0': {'reg': [[0]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 24]], 'ti,syscon-rgmii-delay': [[4294967295, 16672]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}, 'port@1': {'reg': [[1]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 25]], 'ti,syscon-rgmii-delay': [[4294967295, 16676]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}}, '$nodename': ['ethernet']}
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: Unevaluated properties are not allowed ('firmware-name', 'ti,prus', 'ti,pruss-gp-mux-sel' were unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230210114957.2667963-2-danishanwar@ti.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 13:58   ` Rob Herring
@ 2023-02-10 15:30     ` Md Danish Anwar
  2023-02-10 18:37       ` Rob Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Md Danish Anwar @ 2023-02-10 15:30 UTC (permalink / raw)
  To: Rob Herring, MD Danish Anwar
  Cc: Andrew F. Davis, Paolo Abeni, srk, andrew, Eric Dumazet,
	Jakub Kicinski, devicetree, Rob Herring, ssantosh,
	Krzysztof Kozlowski, nm, David S. Miller, Vignesh Raghavendra,
	netdev, linux-omap, linux-kernel, linux-arm-kernel, Suman Anna,
	YueHaibing, Roger Quadros



On 10/02/23 19:28, Rob Herring wrote:
> 
> On Fri, 10 Feb 2023 17:19:56 +0530, MD Danish Anwar wrote:
>> From: Puranjay Mohan <p-mohan@ti.com>
>>
>> Add a YAML binding document for the ICSSG Programmable real time unit
>> based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
>> APIs to interface the PRUs and load/run the firmware for supporting
>> ethernet functionality.
>>
>> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
>> Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
>> ---
>>  .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
>>  1 file changed, 184 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
>>
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> ./Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/remoteproc/ti,pru-consumer.yaml
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: False schema does not allow {'compatible': ['ti,am654-icssg-prueth'], 'pinctrl-names': ['default'], 'pinctrl-0': [[4294967295]], 'ti,sram': [[4294967295]], 'ti,prus': [[4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295]], 'firmware-name': ['ti-pruss/am65x-pru0-prueth-fw.elf', 'ti-pruss/am65x-rtu0-prueth-fw.elf', 'ti-pruss/am65x-txpru0-prueth-fw.elf', 'ti-pruss/am65x-pru1-prueth-fw.elf', 'ti-pruss/am65x-rtu1-prueth-fw.elf', 'ti-pruss/am65x-txpru1-prueth-fw.elf'], 'ti,pruss-gp-mux-sel': [[2, 2, 2, 2, 2, 2]], 'dmas': [[4294967295, 49920], [4294967295, 49921], [4294967295, 49922], [4294967295, 49923], [4294967295, 49924], [4294967295, 49925], [4294967295, 49926], [4294967295, 49927], [4294967295, 17152], [4294967295, 17153]], 'dma-names': ['tx0-0', 'tx0-1', 'tx0-2', 'tx0-3', 'tx1-0', 'tx1-1', 'tx1-2', 'tx1-3', 'rx0', 'rx1'], 'ti,mii-g-rt': [[429!
>  4967295]], 'interrupts': [[24, 0, 2], [25, 1, 3]], 'interrupt-names': ['tx_ts0', 'tx_ts1'], 'ethernet-ports': {'#address-cells': [[1]], '#size-cells': [[0]], 'port@0': {'reg': [[0]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 24]], 'ti,syscon-rgmii-delay': [[4294967295, 16672]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}, 'port@1': {'reg': [[1]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 25]], 'ti,syscon-rgmii-delay': [[4294967295, 16676]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}}, '$nodename': ['ethernet']}
> 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: Unevaluated properties are not allowed ('firmware-name', 'ti,prus', 'ti,pruss-gp-mux-sel' were unexpected)
> 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> 
> doc reference errors (make refcheckdocs):
> 
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230210114957.2667963-2-danishanwar@ti.com

Hi Rob,
This patch depends on the patch [1] which is posted through series [2]. Patch
[1] is currently approved, reviewed and will soon be merged to mainline Linux.
Once it is merged this patch won't throw the above error.

In the meantime I have posted this patch to get it reviewed so that once patch
[1] gets merged, this will be ready to be merged.

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

> 
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your schema.
> 

-- 
Thanks and Regards,
Danish.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 15:30     ` [EXTERNAL] " Md Danish Anwar
@ 2023-02-10 18:37       ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2023-02-10 18:37 UTC (permalink / raw)
  To: Md Danish Anwar
  Cc: MD Danish Anwar, Andrew F. Davis, Paolo Abeni, srk, andrew,
	Eric Dumazet, Jakub Kicinski, devicetree, ssantosh,
	Krzysztof Kozlowski, nm, David S. Miller, Vignesh Raghavendra,
	netdev, linux-omap, linux-kernel, linux-arm-kernel, Suman Anna,
	YueHaibing, Roger Quadros

On Fri, Feb 10, 2023 at 09:00:59PM +0530, Md Danish Anwar wrote:
> 
> 
> On 10/02/23 19:28, Rob Herring wrote:
> > 
> > On Fri, 10 Feb 2023 17:19:56 +0530, MD Danish Anwar wrote:
> >> From: Puranjay Mohan <p-mohan@ti.com>
> >>
> >> Add a YAML binding document for the ICSSG Programmable real time unit
> >> based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
> >> APIs to interface the PRUs and load/run the firmware for supporting
> >> ethernet functionality.
> >>
> >> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> >> Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
> >> ---
> >>  .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
> >>  1 file changed, 184 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> >>
> > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > ./Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/remoteproc/ti,pru-consumer.yaml
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: False schema does not allow {'compatible': ['ti,am654-icssg-prueth'], 'pinctrl-names': ['default'], 'pinctrl-0': [[4294967295]], 'ti,sram': [[4294967295]], 'ti,prus': [[4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295]], 'firmware-name': ['ti-pruss/am65x-pru0-prueth-fw.elf', 'ti-pruss/am65x-rtu0-prueth-fw.elf', 'ti-pruss/am65x-txpru0-prueth-fw.elf', 'ti-pruss/am65x-pru1-prueth-fw.elf', 'ti-pruss/am65x-rtu1-prueth-fw.elf', 'ti-pruss/am65x-txpru1-prueth-fw.elf'], 'ti,pruss-gp-mux-sel': [[2, 2, 2, 2, 2, 2]], 'dmas': [[4294967295, 49920], [4294967295, 49921], [4294967295, 49922], [4294967295, 49923], [4294967295, 49924], [4294967295, 49925], [4294967295, 49926], [4294967295, 49927], [4294967295, 17152], [4294967295, 17153]], 'dma-names': ['tx0-0', 'tx0-1', 'tx0-2', 'tx0-3', 'tx1-0', 'tx1-1', 'tx1-2', 'tx1-3', 'rx0', 'rx1'], 'ti,mii-g-rt': [[429!
> >  4967295]], 'interrupts': [[24, 0, 2], [25, 1, 3]], 'interrupt-names': ['tx_ts0', 'tx_ts1'], 'ethernet-ports': {'#address-cells': [[1]], '#size-cells': [[0]], 'port@0': {'reg': [[0]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 24]], 'ti,syscon-rgmii-delay': [[4294967295, 16672]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}, 'port@1': {'reg': [[1]], 'phy-handle': [[4294967295]], 'phy-mode': ['rgmii-id'], 'interrupts-extended': [[4294967295, 25]], 'ti,syscon-rgmii-delay': [[4294967295, 16676]], 'local-mac-address': [[0, 0, 0, 0, 0, 0]]}}, '$nodename': ['ethernet']}
> > 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.example.dtb: ethernet: Unevaluated properties are not allowed ('firmware-name', 'ti,prus', 'ti,pruss-gp-mux-sel' were unexpected)
> > 	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> > 
> > doc reference errors (make refcheckdocs):
> > 
> > See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230210114957.2667963-2-danishanwar@ti.com
> 
> Hi Rob,
> This patch depends on the patch [1] which is posted through series [2]. Patch
> [1] is currently approved, reviewed and will soon be merged to mainline Linux.
> Once it is merged this patch won't throw the above error.
> 
> In the meantime I have posted this patch to get it reviewed so that once patch
> [1] gets merged, this will be ready to be merged.
> 
> [1] https://lore.kernel.org/all/20230106121046.886863-2-danishanwar@ti.com/
> [2] https://lore.kernel.org/all/20230106121046.886863-1-danishanwar@ti.com/

State that in *this* patch if you don't want to get the report.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 11:49 ` [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
  2023-02-10 13:58   ` Rob Herring
@ 2023-02-10 19:20   ` Rob Herring
  2023-03-07  4:57     ` [EXTERNAL] " Md Danish Anwar
  1 sibling, 1 reply; 14+ messages in thread
From: Rob Herring @ 2023-02-10 19:20 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, andrew, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

On Fri, Feb 10, 2023 at 05:19:56PM +0530, MD Danish Anwar wrote:
> From: Puranjay Mohan <p-mohan@ti.com>
> 
> Add a YAML binding document for the ICSSG Programmable real time unit
> based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
> APIs to interface the PRUs and load/run the firmware for supporting
> ethernet functionality.
> 
> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
> ---
>  .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
>  1 file changed, 184 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> new file mode 100644
> index 000000000000..8b860f29ecc0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
> @@ -0,0 +1,184 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/ti,icssg-prueth.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments ICSSG PRUSS Ethernet
> +
> +maintainers:
> +  - Md Danish Anwar <danishanwar@ti.com>
> +
> +description:
> +  Ethernet based on the Programmable Real-Time
> +  Unit and Industrial Communication Subsystem.

Odd line wrap length. It should be 80 chars.

> +
> +allOf:
> +  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ti,am654-icssg-prueth  # for AM65x SoC family
> +
> +  ti,sram:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      phandle to MSMC SRAM node

I believe we have a standard 'sram' property to point to SRAM nodes 
assuming this is just mmio-sram or similar.

> +
> +  dmas:
> +    maxItems: 10
> +
> +  dma-names:
> +    items:
> +      - const: tx0-0
> +      - const: tx0-1
> +      - const: tx0-2
> +      - const: tx0-3
> +      - const: tx1-0
> +      - const: tx1-1
> +      - const: tx1-2
> +      - const: tx1-3
> +      - const: rx0
> +      - const: rx1
> +
> +  ti,mii-g-rt:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: |
> +      phandle to MII_G_RT module's syscon regmap.
> +
> +  ti,mii-rt:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: |
> +      phandle to MII_RT module's syscon regmap
> +
> +  interrupts:
> +    maxItems: 2
> +    description: |

Don't need '|'

> +      Interrupt specifiers to TX timestamp IRQ.
> +
> +  interrupt-names:
> +    items:
> +      - const: tx_ts0
> +      - const: tx_ts1
> +
> +  ethernet-ports:
> +    type: object
> +    additionalProperties: false
> +
> +    properties:
> +      '#address-cells':
> +        const: 1
> +      '#size-cells':
> +        const: 0
> +
> +    patternProperties:
> +      ^port@[0-1]$:
> +        type: object
> +        description: ICSSG PRUETH external ports
> +        $ref: ethernet-controller.yaml#
> +        unevaluatedProperties: false
> +
> +        properties:
> +          reg:
> +            items:
> +              - enum: [0, 1]
> +            description: ICSSG PRUETH port number
> +
> +          interrupts:
> +            maxItems: 1
> +
> +          ti,syscon-rgmii-delay:
> +            items:
> +              - items:
> +                  - description: phandle to system controller node
> +                  - description: The offset to ICSSG control register
> +            $ref: /schemas/types.yaml#/definitions/phandle-array
> +            description:
> +              phandle to system controller node and register offset
> +              to ICSSG control register for RGMII transmit delay
> +
> +        required:
> +          - reg
> +    anyOf:
> +      - required:
> +          - port@0
> +      - required:
> +          - port@1
> +
> +required:
> +  - compatible
> +  - ti,sram
> +  - dmas
> +  - dma-names
> +  - ethernet-ports
> +  - ti,mii-g-rt
> +  - interrupts
> +  - interrupt-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    /* Example k3-am654 base board SR2.0, dual-emac */
> +    pruss2_eth: ethernet {
> +        compatible = "ti,am654-icssg-prueth";
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&icssg2_rgmii_pins_default>;
> +        ti,sram = <&msmc_ram>;
> +
> +        ti,prus = <&pru2_0>, <&rtu2_0>, <&tx_pru2_0>,
> +                  <&pru2_1>, <&rtu2_1>, <&tx_pru2_1>;
> +        firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
> +                        "ti-pruss/am65x-rtu0-prueth-fw.elf",
> +                        "ti-pruss/am65x-txpru0-prueth-fw.elf",
> +                        "ti-pruss/am65x-pru1-prueth-fw.elf",
> +                        "ti-pruss/am65x-rtu1-prueth-fw.elf",
> +                        "ti-pruss/am65x-txpru1-prueth-fw.elf";
> +        ti,pruss-gp-mux-sel = <2>,      /* MII mode */
> +                              <2>,
> +                              <2>,
> +                              <2>,      /* MII mode */
> +                              <2>,
> +                              <2>;
> +        dmas = <&main_udmap 0xc300>, /* egress slice 0 */
> +               <&main_udmap 0xc301>, /* egress slice 0 */
> +               <&main_udmap 0xc302>, /* egress slice 0 */
> +               <&main_udmap 0xc303>, /* egress slice 0 */
> +               <&main_udmap 0xc304>, /* egress slice 1 */
> +               <&main_udmap 0xc305>, /* egress slice 1 */
> +               <&main_udmap 0xc306>, /* egress slice 1 */
> +               <&main_udmap 0xc307>, /* egress slice 1 */
> +               <&main_udmap 0x4300>, /* ingress slice 0 */
> +               <&main_udmap 0x4301>; /* ingress slice 1 */
> +        dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
> +                    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
> +                    "rx0", "rx1";
> +        ti,mii-g-rt = <&icssg2_mii_g_rt>;
> +        interrupt-parent = <&icssg2_intc>;
> +        interrupts = <24 0 2>, <25 1 3>;
> +        interrupt-names = "tx_ts0", "tx_ts1";
> +        ethernet-ports {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            pruss2_emac0: port@0 {
> +                reg = <0>;
> +                phy-handle = <&pruss2_eth0_phy>;
> +                phy-mode = "rgmii-id";
> +                interrupts-extended = <&icssg2_intc 24>;
> +                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
> +                /* 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 = "rgmii-id";
> +                interrupts-extended = <&icssg2_intc 25>;
> +                ti,syscon-rgmii-delay = <&scm_conf 0x4124>;
> +                /* Filled in by bootloader */
> +                local-mac-address = [00 00 00 00 00 00];
> +            };
> +        };
> +    };
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 0/2] Introduce ICSSG based ethernet Driver
  2023-02-10 11:49 [PATCH v5 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
  2023-02-10 11:49 ` [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
@ 2023-02-11  0:38 ` Jakub Kicinski
  2023-03-07  5:00   ` [EXTERNAL] " Md Danish Anwar
       [not found] ` <20230210114957.2667963-3-danishanwar@ti.com>
  2023-03-21  8:51 ` [PATCH v5 0/2] Introduce ICSSG based ethernet Driver Christian Gmeiner
  3 siblings, 1 reply; 14+ messages in thread
From: Jakub Kicinski @ 2023-02-11  0:38 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Rob Herring,
	Paolo Abeni, Eric Dumazet, David S. Miller, andrew, nm, ssantosh,
	srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

On Fri, 10 Feb 2023 17:19:55 +0530 MD Danish Anwar wrote:
> This series depends on two patch series that are not yet merged, one in
> the remoteproc tree and another in the soc tree. the first one is titled
> Introduce PRU remoteproc consumer API and the second one is titled
> Introduce PRU platform consumer API.
> Both of these are required for this driver.
> 
> To explain this dependency and to get reviews, I had earlier posted all
> three of these as an RFC[1], this can be seen for understanding the
> dependencies.

And please continue to post them as RFC :( If there are dependencies
which the networking tree doesn't have we can't possibly merge these :(

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 2/2] net: ti: icssg-prueth: Add ICSSG ethernet driver
       [not found] ` <20230210114957.2667963-3-danishanwar@ti.com>
@ 2023-02-11 15:29   ` Andrew Lunn
  0 siblings, 0 replies; 14+ messages in thread
From: Andrew Lunn @ 2023-02-11 15:29 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Rob Herring,
	Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

On Fri, Feb 10, 2023 at 05:19:57PM +0530, MD Danish Anwar wrote:
> From: Roger Quadros <rogerq@ti.com>
> 
> This is the Ethernet driver for TI AM654 Silicon rev. 2
> with the ICSSG PRU Sub-system running dual-EMAC firmware.
> 
> The Programmable Real-time Unit and Industrial Communication Subsystem
> Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI
> SoCs. This subsystem is provided for the use cases like implementation of
> custom peripheral interfaces, offloading of tasks from the other
> processor cores of the SoC, etc.
> 
> Every ICSSG core has two Programmable Real-Time Unit(PRUs),
> two auxiliary Real-Time Transfer Unit (RT_PRUs), and
> two Transmit Real-Time Transfer Units (TX_PRUs). Each one of these runs
> its own firmware. Every ICSSG core has two MII ports connect to these
> PRUs and also a MDIO port.
> 
> The cores can run different firmwares to support different protocols and
> features like switch-dev, timestamping, etc.
> 
> It uses System DMA to transfer and receive packets and
> shared memory register emulation between the firmware and
> driver for control and configuration.
> 
> This patch adds support for basic EMAC functionality with 1Gbps
> and 100Mbps link speed. 10M and half duplex mode are not supported
> currently as they require IEP, the support for which will be added later.
> Support for switch-dev, timestamp, etc. will be added later
> by subsequent patch series.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> [Vignesh Raghavendra: add 10M full duplex support]
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> [Grygorii Strashko: add support for half duplex operation]
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>

The PHY handling looks correct now.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-02-10 19:20   ` Rob Herring
@ 2023-03-07  4:57     ` Md Danish Anwar
  2023-03-07  8:58       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 14+ messages in thread
From: Md Danish Anwar @ 2023-03-07  4:57 UTC (permalink / raw)
  To: Rob Herring, MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, andrew, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

Hi Rob,

On 11/02/23 00:50, Rob Herring wrote:
> On Fri, Feb 10, 2023 at 05:19:56PM +0530, MD Danish Anwar wrote:
>> From: Puranjay Mohan <p-mohan@ti.com>
>>
>> Add a YAML binding document for the ICSSG Programmable real time unit
>> based Ethernet hardware. The ICSSG driver uses the PRU and PRUSS consumer
>> APIs to interface the PRUs and load/run the firmware for supporting
>> ethernet functionality.
>>
>> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
>> Signed-off-by: Md Danish Anwar <danishanwar@ti.com>
>> ---
>>  .../bindings/net/ti,icssg-prueth.yaml         | 184 ++++++++++++++++++
>>  1 file changed, 184 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
>> new file mode 100644
>> index 000000000000..8b860f29ecc0
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml
>> @@ -0,0 +1,184 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/ti,icssg-prueth.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Texas Instruments ICSSG PRUSS Ethernet
>> +
>> +maintainers:
>> +  - Md Danish Anwar <danishanwar@ti.com>
>> +
>> +description:
>> +  Ethernet based on the Programmable Real-Time
>> +  Unit and Industrial Communication Subsystem.
> 
> Odd line wrap length. It should be 80 chars.
> 

Sure, I will modify it.

>> +
>> +allOf:
>> +  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - ti,am654-icssg-prueth  # for AM65x SoC family
>> +
>> +  ti,sram:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description:
>> +      phandle to MSMC SRAM node
> 
> I believe we have a standard 'sram' property to point to SRAM nodes 
> assuming this is just mmio-sram or similar.
> 

Yes, we have standard 'sram' property but Krzysztof had asked me to make the
sram property vendor specific in last revision of this series.

>> +
>> +  dmas:
>> +    maxItems: 10
>> +
>> +  dma-names:
>> +    items:
>> +      - const: tx0-0
>> +      - const: tx0-1
>> +      - const: tx0-2
>> +      - const: tx0-3
>> +      - const: tx1-0
>> +      - const: tx1-1
>> +      - const: tx1-2
>> +      - const: tx1-3
>> +      - const: rx0
>> +      - const: rx1
>> +
>> +  ti,mii-g-rt:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description: |
>> +      phandle to MII_G_RT module's syscon regmap.
>> +
>> +  ti,mii-rt:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description: |
>> +      phandle to MII_RT module's syscon regmap
>> +
>> +  interrupts:
>> +    maxItems: 2
>> +    description: |
> 
> Don't need '|'
> 

Sure, I will drop this.

>> +      Interrupt specifiers to TX timestamp IRQ.
>> +
>> +  interrupt-names:
>> +    items:
>> +      - const: tx_ts0
>> +      - const: tx_ts1
>> +
>> +  ethernet-ports:
>> +    type: object
>> +    additionalProperties: false
>> +
>> +    properties:
>> +      '#address-cells':
>> +        const: 1
>> +      '#size-cells':
>> +        const: 0
>> +
>> +    patternProperties:
>> +      ^port@[0-1]$:
>> +        type: object
>> +        description: ICSSG PRUETH external ports
>> +        $ref: ethernet-controller.yaml#
>> +        unevaluatedProperties: false
>> +
>> +        properties:
>> +          reg:
>> +            items:
>> +              - enum: [0, 1]
>> +            description: ICSSG PRUETH port number
>> +
>> +          interrupts:
>> +            maxItems: 1
>> +
>> +          ti,syscon-rgmii-delay:
>> +            items:
>> +              - items:
>> +                  - description: phandle to system controller node
>> +                  - description: The offset to ICSSG control register
>> +            $ref: /schemas/types.yaml#/definitions/phandle-array
>> +            description:
>> +              phandle to system controller node and register offset
>> +              to ICSSG control register for RGMII transmit delay
>> +
>> +        required:
>> +          - reg
>> +    anyOf:
>> +      - required:
>> +          - port@0
>> +      - required:
>> +          - port@1
>> +
>> +required:
>> +  - compatible
>> +  - ti,sram
>> +  - dmas
>> +  - dma-names
>> +  - ethernet-ports
>> +  - ti,mii-g-rt
>> +  - interrupts
>> +  - interrupt-names
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> +  - |
>> +    /* Example k3-am654 base board SR2.0, dual-emac */
>> +    pruss2_eth: ethernet {
>> +        compatible = "ti,am654-icssg-prueth";
>> +        pinctrl-names = "default";
>> +        pinctrl-0 = <&icssg2_rgmii_pins_default>;
>> +        ti,sram = <&msmc_ram>;
>> +
>> +        ti,prus = <&pru2_0>, <&rtu2_0>, <&tx_pru2_0>,
>> +                  <&pru2_1>, <&rtu2_1>, <&tx_pru2_1>;
>> +        firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
>> +                        "ti-pruss/am65x-rtu0-prueth-fw.elf",
>> +                        "ti-pruss/am65x-txpru0-prueth-fw.elf",
>> +                        "ti-pruss/am65x-pru1-prueth-fw.elf",
>> +                        "ti-pruss/am65x-rtu1-prueth-fw.elf",
>> +                        "ti-pruss/am65x-txpru1-prueth-fw.elf";
>> +        ti,pruss-gp-mux-sel = <2>,      /* MII mode */
>> +                              <2>,
>> +                              <2>,
>> +                              <2>,      /* MII mode */
>> +                              <2>,
>> +                              <2>;
>> +        dmas = <&main_udmap 0xc300>, /* egress slice 0 */
>> +               <&main_udmap 0xc301>, /* egress slice 0 */
>> +               <&main_udmap 0xc302>, /* egress slice 0 */
>> +               <&main_udmap 0xc303>, /* egress slice 0 */
>> +               <&main_udmap 0xc304>, /* egress slice 1 */
>> +               <&main_udmap 0xc305>, /* egress slice 1 */
>> +               <&main_udmap 0xc306>, /* egress slice 1 */
>> +               <&main_udmap 0xc307>, /* egress slice 1 */
>> +               <&main_udmap 0x4300>, /* ingress slice 0 */
>> +               <&main_udmap 0x4301>; /* ingress slice 1 */
>> +        dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
>> +                    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
>> +                    "rx0", "rx1";
>> +        ti,mii-g-rt = <&icssg2_mii_g_rt>;
>> +        interrupt-parent = <&icssg2_intc>;
>> +        interrupts = <24 0 2>, <25 1 3>;
>> +        interrupt-names = "tx_ts0", "tx_ts1";
>> +        ethernet-ports {
>> +            #address-cells = <1>;
>> +            #size-cells = <0>;
>> +            pruss2_emac0: port@0 {
>> +                reg = <0>;
>> +                phy-handle = <&pruss2_eth0_phy>;
>> +                phy-mode = "rgmii-id";
>> +                interrupts-extended = <&icssg2_intc 24>;
>> +                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
>> +                /* 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 = "rgmii-id";
>> +                interrupts-extended = <&icssg2_intc 25>;
>> +                ti,syscon-rgmii-delay = <&scm_conf 0x4124>;
>> +                /* Filled in by bootloader */
>> +                local-mac-address = [00 00 00 00 00 00];
>> +            };
>> +        };
>> +    };
>> -- 
>> 2.25.1
>>

-- 
Thanks and Regards,
Danish.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 0/2] Introduce ICSSG based ethernet Driver
  2023-02-11  0:38 ` [PATCH v5 0/2] Introduce ICSSG based ethernet Driver Jakub Kicinski
@ 2023-03-07  5:00   ` Md Danish Anwar
  0 siblings, 0 replies; 14+ messages in thread
From: Md Danish Anwar @ 2023-03-07  5:00 UTC (permalink / raw)
  To: Jakub Kicinski, MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Rob Herring,
	Paolo Abeni, Eric Dumazet, David S. Miller, andrew, nm, ssantosh,
	srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

Hi Jakub,

On 11/02/23 06:08, Jakub Kicinski wrote:
> On Fri, 10 Feb 2023 17:19:55 +0530 MD Danish Anwar wrote:
>> This series depends on two patch series that are not yet merged, one in
>> the remoteproc tree and another in the soc tree. the first one is titled
>> Introduce PRU remoteproc consumer API and the second one is titled
>> Introduce PRU platform consumer API.
>> Both of these are required for this driver.
>>
>> To explain this dependency and to get reviews, I had earlier posted all
>> three of these as an RFC[1], this can be seen for understanding the
>> dependencies.
> 
> And please continue to post them as RFC :( If there are dependencies
> which the networking tree doesn't have we can't possibly merge these :(

Sure, I will post the next revision of this series as RFC. Once the
dependencies are merged, I will send this series to networking tree so that
this series can be merged.

-- 
Thanks and Regards,
Danish.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-03-07  4:57     ` [EXTERNAL] " Md Danish Anwar
@ 2023-03-07  8:58       ` Krzysztof Kozlowski
  2023-03-09 11:44         ` Md Danish Anwar
  0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-07  8:58 UTC (permalink / raw)
  To: Md Danish Anwar, Rob Herring, MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, andrew, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

On 07/03/2023 05:57, Md Danish Anwar wrote:
>>> +allOf:
>>> +  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - ti,am654-icssg-prueth  # for AM65x SoC family
>>> +
>>> +  ti,sram:
>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>> +    description:
>>> +      phandle to MSMC SRAM node
>>
>> I believe we have a standard 'sram' property to point to SRAM nodes 
>> assuming this is just mmio-sram or similar.
>>
> 
> Yes, we have standard 'sram' property but Krzysztof had asked me to make the
> sram property vendor specific in last revision of this series.

Sorry about that. I missed that we already have a 'sram'. The question
remains whether this is a phandle to MMIO SRAM or similar (sram.yaml).

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-03-07  8:58       ` Krzysztof Kozlowski
@ 2023-03-09 11:44         ` Md Danish Anwar
  2023-03-09 12:53           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 14+ messages in thread
From: Md Danish Anwar @ 2023-03-09 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, andrew, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

Hi Krzysztof,

On 07/03/23 14:28, Krzysztof Kozlowski wrote:
> On 07/03/2023 05:57, Md Danish Anwar wrote:
>>>> +allOf:
>>>> +  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    enum:
>>>> +      - ti,am654-icssg-prueth  # for AM65x SoC family
>>>> +
>>>> +  ti,sram:
>>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>>> +    description:
>>>> +      phandle to MSMC SRAM node
>>>
>>> I believe we have a standard 'sram' property to point to SRAM nodes 
>>> assuming this is just mmio-sram or similar.
>>>
>>
>> Yes, we have standard 'sram' property but Krzysztof had asked me to make the
>> sram property vendor specific in last revision of this series.
> 
> Sorry about that. I missed that we already have a 'sram'. The question
> remains whether this is a phandle to MMIO SRAM or similar (sram.yaml).
> 
> Best regards,
> Krzysztof
> 

The SRAM that we are using here is phandle to MMIO-SRAM only. In the example
section you can see, sram node points to msmc_ram (ti,sram = <&msmc_ram>;) And
msmc_ram has compatible as "mmio-sram" in k3-am65-main.dtsi [1].

	msmc_ram: sram@70000000 {
		compatible = "mmio-sram";
		reg = <0x0 0x70000000 0x0 0x200000>;

So I can use 'sram' property as there is no need to make this as ti specific.
Let me know if it seems good to you.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am65-main.dtsi?h=v6.3-rc1#n11

-- 
Thanks and Regards,
Danish.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet
  2023-03-09 11:44         ` Md Danish Anwar
@ 2023-03-09 12:53           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-09 12:53 UTC (permalink / raw)
  To: Md Danish Anwar, Rob Herring, MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, andrew, nm,
	ssantosh, srk, linux-kernel, devicetree, netdev, linux-omap,
	linux-arm-kernel

On 09/03/2023 12:44, Md Danish Anwar wrote:

> 
> The SRAM that we are using here is phandle to MMIO-SRAM only. In the example
> section you can see, sram node points to msmc_ram (ti,sram = <&msmc_ram>;) And
> msmc_ram has compatible as "mmio-sram" in k3-am65-main.dtsi [1].
> 
> 	msmc_ram: sram@70000000 {
> 		compatible = "mmio-sram";
> 		reg = <0x0 0x70000000 0x0 0x200000>;
> 
> So I can use 'sram' property as there is no need to make this as ti specific.
> Let me know if it seems good to you.

Yes, it's fine, thanks.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v5 0/2] Introduce ICSSG based ethernet Driver
  2023-02-10 11:49 [PATCH v5 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
                   ` (2 preceding siblings ...)
       [not found] ` <20230210114957.2667963-3-danishanwar@ti.com>
@ 2023-03-21  8:51 ` Christian Gmeiner
  3 siblings, 0 replies; 14+ messages in thread
From: Christian Gmeiner @ 2023-03-21  8:51 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, YueHaibing,
	Vignesh Raghavendra, Krzysztof Kozlowski, Rob Herring,
	Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller,
	andrew, nm, ssantosh, srk, linux-kernel, devicetree, netdev,
	linux-omap, linux-arm-kernel

Hi

Am Fr., 10. Feb. 2023 um 13:02 Uhr schrieb MD Danish Anwar <danishanwar@ti.com>:
>
> The Programmable Real-time Unit and Industrial Communication Subsystem
> Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI
> SoCs. This subsystem is provided for the use cases like the implementation
> of custom peripheral interfaces, offloading of tasks from the other
> processor cores of the SoC, etc.
>
> The subsystem includes many accelerators for data processing like
> multiplier and multiplier-accumulator. It also has peripherals like
> UART, MII/RGMII, MDIO, etc. Every ICSSG core includes two 32-bit
> load/store RISC CPU cores called PRUs.
>
> The above features allow it to be used for implementing custom firmware
> based peripherals like ethernet.
>
> This series adds the YAML documentation and the driver with basic EMAC
> support for TI AM654 Silicon Rev 2 SoC with the PRU_ICSSG Sub-system.
> running dual-EMAC firmware.
> This currently supports basic EMAC with 1Gbps and 100Mbps link. 10M and
> half-duplex modes are not yet supported because they require the support
> of an IEP, which will be added later.
> Advanced features like switch-dev and timestamping will be added later.

What are TI plans to support TI AM642 Silicon Rev 2?

-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info/privacypolicy

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-03-21  8:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10 11:49 [PATCH v5 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
2023-02-10 11:49 ` [PATCH v5 1/2] dt-bindings: net: Add ICSSG Ethernet MD Danish Anwar
2023-02-10 13:58   ` Rob Herring
2023-02-10 15:30     ` [EXTERNAL] " Md Danish Anwar
2023-02-10 18:37       ` Rob Herring
2023-02-10 19:20   ` Rob Herring
2023-03-07  4:57     ` [EXTERNAL] " Md Danish Anwar
2023-03-07  8:58       ` Krzysztof Kozlowski
2023-03-09 11:44         ` Md Danish Anwar
2023-03-09 12:53           ` Krzysztof Kozlowski
2023-02-11  0:38 ` [PATCH v5 0/2] Introduce ICSSG based ethernet Driver Jakub Kicinski
2023-03-07  5:00   ` [EXTERNAL] " Md Danish Anwar
     [not found] ` <20230210114957.2667963-3-danishanwar@ti.com>
2023-02-11 15:29   ` [PATCH v5 2/2] net: ti: icssg-prueth: Add ICSSG ethernet driver Andrew Lunn
2023-03-21  8:51 ` [PATCH v5 0/2] Introduce ICSSG based ethernet Driver Christian Gmeiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).