xref: /freebsd/sys/contrib/device-tree/Bindings/net/ti,cpsw-switch.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/ti,cpsw-switch.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: TI SoC Ethernet Switch Controller (CPSW)
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Grygorii Strashko <grygorii.strashko@ti.com>
11c66ec88fSEmmanuel Vadot  - Sekhar Nori <nsekhar@ti.com>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription:
14c66ec88fSEmmanuel Vadot  The 3-port switch gigabit ethernet subsystem provides ethernet packet
15c66ec88fSEmmanuel Vadot  communication and can be configured as an ethernet switch. It provides the
16c66ec88fSEmmanuel Vadot  gigabit media independent interface (GMII),reduced gigabit media
17c66ec88fSEmmanuel Vadot  independent interface (RGMII), reduced media independent interface (RMII),
18c66ec88fSEmmanuel Vadot  the management data input output (MDIO) for physical layer device (PHY)
19c66ec88fSEmmanuel Vadot  management.
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadotproperties:
22c66ec88fSEmmanuel Vadot  compatible:
23c66ec88fSEmmanuel Vadot    oneOf:
24c66ec88fSEmmanuel Vadot      - const: ti,cpsw-switch
25c66ec88fSEmmanuel Vadot      - items:
26c66ec88fSEmmanuel Vadot          - const: ti,am335x-cpsw-switch
27c66ec88fSEmmanuel Vadot          - const: ti,cpsw-switch
28c66ec88fSEmmanuel Vadot      - items:
29c66ec88fSEmmanuel Vadot          - const: ti,am4372-cpsw-switch
30c66ec88fSEmmanuel Vadot          - const: ti,cpsw-switch
31c66ec88fSEmmanuel Vadot      - items:
32c66ec88fSEmmanuel Vadot          - const: ti,dra7-cpsw-switch
33c66ec88fSEmmanuel Vadot          - const: ti,cpsw-switch
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  reg:
36c66ec88fSEmmanuel Vadot    maxItems: 1
37c66ec88fSEmmanuel Vadot    description:
38c66ec88fSEmmanuel Vadot      The physical base address and size of full the CPSW module IO range
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  '#address-cells':
41c66ec88fSEmmanuel Vadot    const: 1
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  '#size-cells':
44c66ec88fSEmmanuel Vadot    const: 1
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  ranges: true
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot  clocks:
49c66ec88fSEmmanuel Vadot    maxItems: 1
50c66ec88fSEmmanuel Vadot    description: CPSW functional clock
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot  clock-names:
53c66ec88fSEmmanuel Vadot    items:
54c66ec88fSEmmanuel Vadot      - const: fck
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadot  interrupts:
57c66ec88fSEmmanuel Vadot    items:
58c66ec88fSEmmanuel Vadot      - description: RX_THRESH interrupt
59c66ec88fSEmmanuel Vadot      - description: RX interrupt
60c66ec88fSEmmanuel Vadot      - description: TX interrupt
61c66ec88fSEmmanuel Vadot      - description: MISC interrupt
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot  interrupt-names:
64c66ec88fSEmmanuel Vadot    items:
65fac71e4eSEmmanuel Vadot      - const: rx_thresh
66fac71e4eSEmmanuel Vadot      - const: rx
67fac71e4eSEmmanuel Vadot      - const: tx
68fac71e4eSEmmanuel Vadot      - const: misc
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot  pinctrl-names: true
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  syscon:
735def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
74c66ec88fSEmmanuel Vadot    description:
75c66ec88fSEmmanuel Vadot      Phandle to the system control device node which provides access to
76c66ec88fSEmmanuel Vadot      efuse IO range with MAC addresses
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot  ethernet-ports:
79c66ec88fSEmmanuel Vadot    type: object
807ef62cebSEmmanuel Vadot    additionalProperties: false
817ef62cebSEmmanuel Vadot
82c66ec88fSEmmanuel Vadot    properties:
83c66ec88fSEmmanuel Vadot      '#address-cells':
84c66ec88fSEmmanuel Vadot        const: 1
85c66ec88fSEmmanuel Vadot      '#size-cells':
86c66ec88fSEmmanuel Vadot        const: 0
87c66ec88fSEmmanuel Vadot
88c66ec88fSEmmanuel Vadot    patternProperties:
89*84943d6fSEmmanuel Vadot      "^port@[12]$":
90c66ec88fSEmmanuel Vadot        type: object
91c66ec88fSEmmanuel Vadot        description: CPSW external ports
92c66ec88fSEmmanuel Vadot
93c9ccf3a3SEmmanuel Vadot        $ref: ethernet-controller.yaml#
947ef62cebSEmmanuel Vadot        unevaluatedProperties: false
95c66ec88fSEmmanuel Vadot
96c66ec88fSEmmanuel Vadot        properties:
97c66ec88fSEmmanuel Vadot          reg:
98c66ec88fSEmmanuel Vadot            items:
99c66ec88fSEmmanuel Vadot              - enum: [1, 2]
100c66ec88fSEmmanuel Vadot            description: CPSW port number
101c66ec88fSEmmanuel Vadot
102c66ec88fSEmmanuel Vadot          phys:
103c66ec88fSEmmanuel Vadot            maxItems: 1
104c66ec88fSEmmanuel Vadot            description: phandle on phy-gmii-sel PHY
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot          label:
107c66ec88fSEmmanuel Vadot            description: label associated with this port
108c66ec88fSEmmanuel Vadot
109c66ec88fSEmmanuel Vadot          ti,dual-emac-pvid:
110c66ec88fSEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
111c66ec88fSEmmanuel Vadot            minimum: 1
112c66ec88fSEmmanuel Vadot            maximum: 1024
113c66ec88fSEmmanuel Vadot            description:
114c66ec88fSEmmanuel Vadot              Specifies default PORT VID to be used to segregate
115c66ec88fSEmmanuel Vadot              ports. Default value - CPSW port number.
116c66ec88fSEmmanuel Vadot
117c66ec88fSEmmanuel Vadot        required:
118c66ec88fSEmmanuel Vadot          - reg
119c66ec88fSEmmanuel Vadot          - phys
120c66ec88fSEmmanuel Vadot
121c66ec88fSEmmanuel Vadot  cpts:
122c66ec88fSEmmanuel Vadot    type: object
1237ef62cebSEmmanuel Vadot    unevaluatedProperties: false
124c66ec88fSEmmanuel Vadot    description:
125c66ec88fSEmmanuel Vadot      The Common Platform Time Sync (CPTS) module
126c66ec88fSEmmanuel Vadot
127c66ec88fSEmmanuel Vadot    properties:
128c66ec88fSEmmanuel Vadot      clocks:
129c66ec88fSEmmanuel Vadot        maxItems: 1
130c66ec88fSEmmanuel Vadot        description: CPTS reference clock
131c66ec88fSEmmanuel Vadot
132c66ec88fSEmmanuel Vadot      clock-names:
133c66ec88fSEmmanuel Vadot        items:
134c66ec88fSEmmanuel Vadot          - const: cpts
135c66ec88fSEmmanuel Vadot
136c66ec88fSEmmanuel Vadot      cpts_clock_mult:
137c66ec88fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
138c66ec88fSEmmanuel Vadot        description:
139c66ec88fSEmmanuel Vadot          Numerator to convert input clock ticks into ns
140c66ec88fSEmmanuel Vadot
141c66ec88fSEmmanuel Vadot      cpts_clock_shift:
142c66ec88fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
143c66ec88fSEmmanuel Vadot        description:
144c66ec88fSEmmanuel Vadot          Denominator to convert input clock ticks into ns.
145c66ec88fSEmmanuel Vadot          Mult and shift will be calculated basing on CPTS rftclk frequency if
146c66ec88fSEmmanuel Vadot          both cpts_clock_shift and cpts_clock_mult properties are not provided.
147c66ec88fSEmmanuel Vadot
148c66ec88fSEmmanuel Vadot    required:
149c66ec88fSEmmanuel Vadot      - clocks
150c66ec88fSEmmanuel Vadot      - clock-names
151c66ec88fSEmmanuel Vadot
152c66ec88fSEmmanuel VadotpatternProperties:
153c66ec88fSEmmanuel Vadot  "^mdio@":
154c66ec88fSEmmanuel Vadot    type: object
155c66ec88fSEmmanuel Vadot    description:
156c66ec88fSEmmanuel Vadot      CPSW MDIO bus.
157fac71e4eSEmmanuel Vadot    $ref: ti,davinci-mdio.yaml#
158c66ec88fSEmmanuel Vadot
159c66ec88fSEmmanuel Vadot
160c66ec88fSEmmanuel Vadotrequired:
161c66ec88fSEmmanuel Vadot  - compatible
162c66ec88fSEmmanuel Vadot  - reg
163c66ec88fSEmmanuel Vadot  - ranges
164c66ec88fSEmmanuel Vadot  - clocks
165c66ec88fSEmmanuel Vadot  - clock-names
166c66ec88fSEmmanuel Vadot  - interrupts
167c66ec88fSEmmanuel Vadot  - interrupt-names
168c66ec88fSEmmanuel Vadot  - '#address-cells'
169c66ec88fSEmmanuel Vadot  - '#size-cells'
170c66ec88fSEmmanuel Vadot
171c66ec88fSEmmanuel VadotadditionalProperties: false
172c66ec88fSEmmanuel Vadot
173c66ec88fSEmmanuel Vadotexamples:
174c66ec88fSEmmanuel Vadot  - |
175c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
176c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
177c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/dra7.h>
178c66ec88fSEmmanuel Vadot
179c66ec88fSEmmanuel Vadot    mac_sw: switch@0 {
180c66ec88fSEmmanuel Vadot        compatible = "ti,dra7-cpsw-switch","ti,cpsw-switch";
181c66ec88fSEmmanuel Vadot        reg = <0x0 0x4000>;
182c66ec88fSEmmanuel Vadot        ranges = <0 0 0x4000>;
183c66ec88fSEmmanuel Vadot        clocks = <&gmac_main_clk>;
184c66ec88fSEmmanuel Vadot        clock-names = "fck";
185c66ec88fSEmmanuel Vadot        #address-cells = <1>;
186c66ec88fSEmmanuel Vadot        #size-cells = <1>;
187c66ec88fSEmmanuel Vadot        syscon = <&scm_conf>;
188c66ec88fSEmmanuel Vadot
189c66ec88fSEmmanuel Vadot        interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>,
190c66ec88fSEmmanuel Vadot                     <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>,
191c66ec88fSEmmanuel Vadot                     <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>,
192c66ec88fSEmmanuel Vadot                     <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>;
193c66ec88fSEmmanuel Vadot        interrupt-names = "rx_thresh", "rx", "tx", "misc";
194c66ec88fSEmmanuel Vadot
195c66ec88fSEmmanuel Vadot        ethernet-ports {
196c66ec88fSEmmanuel Vadot                #address-cells = <1>;
197c66ec88fSEmmanuel Vadot                #size-cells = <0>;
198c66ec88fSEmmanuel Vadot
199c66ec88fSEmmanuel Vadot                cpsw_port1: port@1 {
200c66ec88fSEmmanuel Vadot                        reg = <1>;
201c66ec88fSEmmanuel Vadot                        label = "port1";
202c66ec88fSEmmanuel Vadot                        mac-address = [ 00 00 00 00 00 00 ];
203c66ec88fSEmmanuel Vadot                        phys = <&phy_gmii_sel 1>;
204c66ec88fSEmmanuel Vadot                        phy-handle = <&ethphy0_sw>;
205c66ec88fSEmmanuel Vadot                        phy-mode = "rgmii";
206c66ec88fSEmmanuel Vadot                        ti,dual-emac-pvid = <1>;
207c66ec88fSEmmanuel Vadot                };
208c66ec88fSEmmanuel Vadot
209c66ec88fSEmmanuel Vadot                cpsw_port2: port@2 {
210c66ec88fSEmmanuel Vadot                        reg = <2>;
211c66ec88fSEmmanuel Vadot                        label = "wan";
212c66ec88fSEmmanuel Vadot                        mac-address = [ 00 00 00 00 00 00 ];
213c66ec88fSEmmanuel Vadot                        phys = <&phy_gmii_sel 2>;
214c66ec88fSEmmanuel Vadot                        phy-handle = <&ethphy1_sw>;
215c66ec88fSEmmanuel Vadot                        phy-mode = "rgmii";
216c66ec88fSEmmanuel Vadot                        ti,dual-emac-pvid = <2>;
217c66ec88fSEmmanuel Vadot                };
218c66ec88fSEmmanuel Vadot        };
219c66ec88fSEmmanuel Vadot
220c66ec88fSEmmanuel Vadot        davinci_mdio_sw: mdio@1000 {
221c66ec88fSEmmanuel Vadot                compatible = "ti,cpsw-mdio","ti,davinci_mdio";
222c66ec88fSEmmanuel Vadot                reg = <0x1000 0x100>;
223c66ec88fSEmmanuel Vadot                clocks = <&gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0>;
224c66ec88fSEmmanuel Vadot                clock-names = "fck";
225c66ec88fSEmmanuel Vadot                #address-cells = <1>;
226c66ec88fSEmmanuel Vadot                #size-cells = <0>;
227c66ec88fSEmmanuel Vadot                bus_freq = <1000000>;
228c66ec88fSEmmanuel Vadot
229c66ec88fSEmmanuel Vadot                ethphy0_sw: ethernet-phy@0 {
230c66ec88fSEmmanuel Vadot                        reg = <0>;
231c66ec88fSEmmanuel Vadot                };
232c66ec88fSEmmanuel Vadot
233c66ec88fSEmmanuel Vadot                ethphy1_sw: ethernet-phy@1 {
234c66ec88fSEmmanuel Vadot                        reg = <1>;
235c66ec88fSEmmanuel Vadot                };
236c66ec88fSEmmanuel Vadot        };
237c66ec88fSEmmanuel Vadot
238c66ec88fSEmmanuel Vadot        cpts {
239c66ec88fSEmmanuel Vadot                clocks = <&gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 25>;
240c66ec88fSEmmanuel Vadot                clock-names = "cpts";
241c66ec88fSEmmanuel Vadot        };
242c66ec88fSEmmanuel Vadot    };
243