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