1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/ti,icssg-prueth.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Texas Instruments ICSSG PRUSS Ethernet
8
9maintainers:
10  - Md Danish Anwar <danishanwar@ti.com>
11
12description:
13  Ethernet based on the Programmable Real-Time Unit and Industrial
14  Communication Subsystem.
15
16properties:
17  compatible:
18    enum:
19      - ti,am642-icssg-prueth      # for AM64x SoC family
20      - ti,am654-icssg-prueth      # for AM65x SoC family
21      - ti,am654-sr1-icssg-prueth  # for AM65x SoC family, SR1.0
22
23  sram:
24    $ref: /schemas/types.yaml#/definitions/phandle
25    description:
26      phandle to MSMC SRAM node
27
28  dmas:
29    minItems: 10
30    maxItems: 12
31
32  dma-names:
33    minItems: 10
34    items:
35      - const: tx0-0
36      - const: tx0-1
37      - const: tx0-2
38      - const: tx0-3
39      - const: tx1-0
40      - const: tx1-1
41      - const: tx1-2
42      - const: tx1-3
43      - const: rx0
44      - const: rx1
45      - const: rxmgm0
46      - const: rxmgm1
47
48  ti,mii-g-rt:
49    $ref: /schemas/types.yaml#/definitions/phandle
50    description:
51      phandle to MII_G_RT module's syscon regmap.
52
53  ti,mii-rt:
54    $ref: /schemas/types.yaml#/definitions/phandle
55    description:
56      phandle to MII_RT module's syscon regmap
57
58  ti,pa-stats:
59    $ref: /schemas/types.yaml#/definitions/phandle
60    description:
61      phandle to PA_STATS module's syscon regmap. PA_STATS is a set of
62      registers where different statistics related to ICSSG, are dumped by
63      ICSSG firmware. PA_STATS module's syscon regmap will help the device to
64      access/read/write those statistics.
65
66  ti,iep:
67    $ref: /schemas/types.yaml#/definitions/phandle-array
68    maxItems: 2
69    items:
70      maxItems: 1
71    description:
72      phandle to IEP (Industrial Ethernet Peripheral) for ICSSG
73
74  interrupts:
75    maxItems: 2
76    description:
77      Interrupt specifiers to TX timestamp IRQ.
78
79  interrupt-names:
80    items:
81      - const: tx_ts0
82      - const: tx_ts1
83
84  ethernet-ports:
85    type: object
86    additionalProperties: false
87
88    properties:
89      '#address-cells':
90        const: 1
91      '#size-cells':
92        const: 0
93
94    patternProperties:
95      ^port@[0-1]$:
96        type: object
97        description: ICSSG PRUETH external ports
98        $ref: ethernet-controller.yaml#
99        unevaluatedProperties: false
100
101        properties:
102          reg:
103            items:
104              - enum: [0, 1]
105            description: ICSSG PRUETH port number
106
107          interrupts:
108            maxItems: 1
109
110          ti,syscon-rgmii-delay:
111            items:
112              - items:
113                  - description: phandle to system controller node
114                  - description: The offset to ICSSG control register
115            $ref: /schemas/types.yaml#/definitions/phandle-array
116            description:
117              phandle to system controller node and register offset
118              to ICSSG control register for RGMII transmit delay
119
120          ti,half-duplex-capable:
121            type: boolean
122            description:
123              Indicates that the PHY output pin COL is routed to ICSSG GPIO pin
124              (PRGx_PRU0/1_GPIO10) as input so that the ICSSG MII port is
125              capable of half duplex operations.
126
127        required:
128          - reg
129    anyOf:
130      - required:
131          - port@0
132      - required:
133          - port@1
134
135required:
136  - compatible
137  - sram
138  - dmas
139  - dma-names
140  - ethernet-ports
141  - ti,mii-g-rt
142  - interrupts
143  - interrupt-names
144
145allOf:
146  - $ref: /schemas/remoteproc/ti,pru-consumer.yaml#
147
148  - if:
149      properties:
150        compatible:
151          contains:
152            const: ti,am654-sr1-icssg-prueth
153    then:
154      properties:
155        dmas:
156          minItems: 12
157        dma-names:
158          minItems: 12
159    else:
160      properties:
161        dmas:
162          maxItems: 10
163        dma-names:
164          maxItems: 10
165
166unevaluatedProperties: false
167
168examples:
169  - |
170    /* Example k3-am654 base board SR2.0, dual-emac */
171    pruss2_eth: ethernet {
172        compatible = "ti,am654-icssg-prueth";
173        pinctrl-names = "default";
174        pinctrl-0 = <&icssg2_rgmii_pins_default>;
175        sram = <&msmc_ram>;
176
177        ti,prus = <&pru2_0>, <&rtu2_0>, <&tx_pru2_0>,
178                  <&pru2_1>, <&rtu2_1>, <&tx_pru2_1>;
179        firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf",
180                        "ti-pruss/am65x-rtu0-prueth-fw.elf",
181                        "ti-pruss/am65x-txpru0-prueth-fw.elf",
182                        "ti-pruss/am65x-pru1-prueth-fw.elf",
183                        "ti-pruss/am65x-rtu1-prueth-fw.elf",
184                        "ti-pruss/am65x-txpru1-prueth-fw.elf";
185        ti,pruss-gp-mux-sel = <2>,      /* MII mode */
186                              <2>,
187                              <2>,
188                              <2>,      /* MII mode */
189                              <2>,
190                              <2>;
191        dmas = <&main_udmap 0xc300>, /* egress slice 0 */
192               <&main_udmap 0xc301>, /* egress slice 0 */
193               <&main_udmap 0xc302>, /* egress slice 0 */
194               <&main_udmap 0xc303>, /* egress slice 0 */
195               <&main_udmap 0xc304>, /* egress slice 1 */
196               <&main_udmap 0xc305>, /* egress slice 1 */
197               <&main_udmap 0xc306>, /* egress slice 1 */
198               <&main_udmap 0xc307>, /* egress slice 1 */
199               <&main_udmap 0x4300>, /* ingress slice 0 */
200               <&main_udmap 0x4301>; /* ingress slice 1 */
201        dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
202                    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
203                    "rx0", "rx1";
204        ti,mii-g-rt = <&icssg2_mii_g_rt>;
205        ti,pa-stats = <&icssg2_pa_stats>;
206        ti,iep = <&icssg2_iep0>, <&icssg2_iep1>;
207        interrupt-parent = <&icssg2_intc>;
208        interrupts = <24 0 2>, <25 1 3>;
209        interrupt-names = "tx_ts0", "tx_ts1";
210        ethernet-ports {
211            #address-cells = <1>;
212            #size-cells = <0>;
213            pruss2_emac0: port@0 {
214                reg = <0>;
215                phy-handle = <&pruss2_eth0_phy>;
216                phy-mode = "rgmii-id";
217                interrupts-extended = <&icssg2_intc 24>;
218                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
219                /* Filled in by bootloader */
220                local-mac-address = [00 00 00 00 00 00];
221            };
222
223            pruss2_emac1: port@1 {
224                reg = <1>;
225                phy-handle = <&pruss2_eth1_phy>;
226                phy-mode = "rgmii-id";
227                interrupts-extended = <&icssg2_intc 25>;
228                ti,syscon-rgmii-delay = <&scm_conf 0x4124>;
229                /* Filled in by bootloader */
230                local-mac-address = [00 00 00 00 00 00];
231            };
232        };
233    };
234