1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/dsa/brcm,b53.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Broadcom BCM53xx Ethernet switches
8
9maintainers:
10  - Florian Fainelli <f.fainelli@gmail.com>
11
12description:
13  Broadcom BCM53xx Ethernet switches
14
15properties:
16  compatible:
17    oneOf:
18      - const: brcm,bcm5325
19      - const: brcm,bcm53101
20      - const: brcm,bcm53115
21      - const: brcm,bcm53125
22      - const: brcm,bcm53128
23      - const: brcm,bcm53134
24      - const: brcm,bcm5365
25      - const: brcm,bcm5395
26      - const: brcm,bcm5389
27      - const: brcm,bcm5397
28      - const: brcm,bcm5398
29      - items:
30          - const: brcm,bcm11360-srab
31          - const: brcm,cygnus-srab
32      - items:
33          - enum:
34              - brcm,bcm53010-srab
35              - brcm,bcm53011-srab
36              - brcm,bcm53012-srab
37              - brcm,bcm53018-srab
38              - brcm,bcm53019-srab
39          - const: brcm,bcm5301x-srab
40      - items:
41          - enum:
42              - brcm,bcm11404-srab
43              - brcm,bcm11407-srab
44              - brcm,bcm11409-srab
45              - brcm,bcm58310-srab
46              - brcm,bcm58311-srab
47              - brcm,bcm58313-srab
48          - const: brcm,omega-srab
49      - items:
50          - enum:
51              - brcm,bcm58522-srab
52              - brcm,bcm58523-srab
53              - brcm,bcm58525-srab
54              - brcm,bcm58622-srab
55              - brcm,bcm58623-srab
56              - brcm,bcm58625-srab
57              - brcm,bcm88312-srab
58          - const: brcm,nsp-srab
59      - items:
60          - enum:
61              - brcm,bcm3384-switch
62              - brcm,bcm6318-switch
63              - brcm,bcm6328-switch
64              - brcm,bcm6362-switch
65              - brcm,bcm6368-switch
66              - brcm,bcm63268-switch
67          - const: brcm,bcm63xx-switch
68
69required:
70  - compatible
71  - reg
72
73allOf:
74  - $ref: dsa.yaml#/$defs/ethernet-ports
75  - if:
76      properties:
77        compatible:
78          contains:
79            enum:
80              - brcm,bcm5325
81              - brcm,bcm53101
82              - brcm,bcm53115
83              - brcm,bcm53125
84              - brcm,bcm53128
85              - brcm,bcm5365
86              - brcm,bcm5395
87              - brcm,bcm5397
88              - brcm,bcm5398
89    then:
90      $ref: /schemas/spi/spi-peripheral-props.yaml
91
92    # BCM585xx/586xx/88312 SoCs
93  - if:
94      properties:
95        compatible:
96          contains:
97            enum:
98              - brcm,bcm58522-srab
99              - brcm,bcm58523-srab
100              - brcm,bcm58525-srab
101              - brcm,bcm58622-srab
102              - brcm,bcm58623-srab
103              - brcm,bcm58625-srab
104              - brcm,bcm88312-srab
105    then:
106      properties:
107        reg:
108          minItems: 3
109          maxItems: 3
110        reg-names:
111          items:
112            - const: srab
113            - const: mux_config
114            - const: sgmii_config
115        interrupts:
116          minItems: 13
117          maxItems: 13
118        interrupt-names:
119          items:
120            - const: link_state_p0
121            - const: link_state_p1
122            - const: link_state_p2
123            - const: link_state_p3
124            - const: link_state_p4
125            - const: link_state_p5
126            - const: link_state_p7
127            - const: link_state_p8
128            - const: phy
129            - const: ts
130            - const: imp_sleep_timer_p5
131            - const: imp_sleep_timer_p7
132            - const: imp_sleep_timer_p8
133      required:
134        - interrupts
135    else:
136      properties:
137        reg:
138          maxItems: 1
139
140unevaluatedProperties: false
141
142examples:
143  - |
144    mdio {
145        #address-cells = <1>;
146        #size-cells = <0>;
147
148        ethernet-switch@1e {
149            compatible = "brcm,bcm53125";
150            reg = <30>;
151
152            ethernet-ports {
153                #address-cells = <1>;
154                #size-cells = <0>;
155
156                port@0 {
157                    reg = <0>;
158                    label = "lan1";
159                };
160
161                port@1 {
162                    reg = <1>;
163                    label = "lan2";
164                };
165
166                port@5 {
167                    reg = <5>;
168                    label = "cable-modem";
169                    phy-mode = "rgmii-txid";
170                    fixed-link {
171                        speed = <1000>;
172                        full-duplex;
173                    };
174                };
175
176                port@8 {
177                    reg = <8>;
178                    phy-mode = "rgmii-txid";
179                    ethernet = <&eth0>;
180                    fixed-link {
181                        speed = <1000>;
182                        full-duplex;
183                    };
184                };
185            };
186        };
187    };
188  - |
189    #include <dt-bindings/interrupt-controller/arm-gic.h>
190    #include <dt-bindings/interrupt-controller/irq.h>
191
192    axi {
193        #address-cells = <1>;
194        #size-cells = <1>;
195
196        switch@36000 {
197            compatible = "brcm,bcm58623-srab", "brcm,nsp-srab";
198            reg = <0x36000 0x1000>,
199                  <0x3f308 0x8>,
200                  <0x3f410 0xc>;
201            reg-names = "srab", "mux_config", "sgmii_config";
202            interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
203                         <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
204                         <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
205                         <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
206                         <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
207                         <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
208                         <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
209                         <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
210                         <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
211                         <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
212                         <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
213                         <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
214                         <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
215            interrupt-names = "link_state_p0",
216                              "link_state_p1",
217                              "link_state_p2",
218                              "link_state_p3",
219                              "link_state_p4",
220                              "link_state_p5",
221                              "link_state_p7",
222                              "link_state_p8",
223                              "phy",
224                              "ts",
225                              "imp_sleep_timer_p5",
226                              "imp_sleep_timer_p7",
227                              "imp_sleep_timer_p8";
228
229            ethernet-ports {
230                #address-cells = <1>;
231                #size-cells = <0>;
232
233                port@0 {
234                    label = "port0";
235                    reg = <0>;
236                };
237
238                port@1 {
239                    label = "port1";
240                    reg = <1>;
241                };
242
243                port@2 {
244                    label = "port2";
245                    reg = <2>;
246                };
247
248                port@3 {
249                    label = "port3";
250                    reg = <3>;
251                };
252
253                port@4 {
254                    label = "port4";
255                    reg = <4>;
256                };
257
258                port@8 {
259                    ethernet = <&amac2>;
260                    reg = <8>;
261                    phy-mode = "internal";
262
263                    fixed-link {
264                        speed = <1000>;
265                        full-duplex;
266                    };
267                };
268            };
269        };
270    };
271