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,sf2.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Broadcom Starfighter 2 integrated swich
8
9maintainers:
10  - Florian Fainelli <f.fainelli@gmail.com>
11
12properties:
13  compatible:
14    items:
15      - enum:
16          - brcm,bcm4908-switch
17          - brcm,bcm7278-switch-v4.0
18          - brcm,bcm7278-switch-v4.8
19          - brcm,bcm7445-switch-v4.0
20
21  reg:
22    minItems: 6
23    maxItems: 6
24
25  reg-names:
26    items:
27      - const: core
28      - const: reg
29      - const: intrl2_0
30      - const: intrl2_1
31      - const: fcb
32      - const: acb
33
34  interrupts:
35    minItems: 2
36    maxItems: 2
37
38  interrupt-names:
39    items:
40      - const: switch_0
41      - const: switch_1
42
43  resets:
44    maxItems: 1
45
46  reset-names:
47    const: switch
48
49  clocks:
50    minItems: 1
51    items:
52      - description: switch's main clock
53      - description: dividing of the switch core clock
54
55  clock-names:
56    minItems: 1
57    items:
58      - const: sw_switch
59      - const: sw_switch_mdiv
60
61  brcm,num-gphy:
62    $ref: /schemas/types.yaml#/definitions/uint32
63    description: maximum number of integrated gigabit PHYs in the switch
64
65  brcm,num-rgmii-ports:
66    $ref: /schemas/types.yaml#/definitions/uint32
67    description: maximum number of RGMII interfaces supported by the switch
68
69  brcm,fcb-pause-override:
70    description: if present indicates that the switch supports Failover Control
71      Block pause override capability
72    type: boolean
73
74  brcm,acb-packets-inflight:
75    description: if present indicates that the switch Admission Control Block
76      supports reporting the number of packets in-flight in a switch queue
77    type: boolean
78
79  "#address-cells":
80    const: 1
81
82  "#size-cells":
83    const: 0
84
85  ports:
86    type: object
87
88    patternProperties:
89      '^port@[0-9a-f]$':
90        $ref: dsa-port.yaml#
91        unevaluatedProperties: false
92
93        properties:
94          brcm,use-bcm-hdr:
95            description: if present, indicates that the switch port has Broadcom
96              tags enabled (per-packet metadata)
97            type: boolean
98
99required:
100  - reg
101  - interrupts
102  - "#address-cells"
103  - "#size-cells"
104
105allOf:
106  - $ref: "dsa.yaml#"
107  - if:
108      properties:
109        compatible:
110          contains:
111            enum:
112              - brcm,bcm7278-switch-v4.0
113              - brcm,bcm7278-switch-v4.8
114    then:
115      properties:
116        clocks:
117          minItems: 1
118          maxItems: 1
119        clock-names:
120          minItems: 1
121          maxItems: 1
122      required:
123        - clocks
124        - clock-names
125  - if:
126      properties:
127        compatible:
128          contains:
129            const: brcm,bcm7445-switch-v4.0
130    then:
131      properties:
132        clocks:
133          minItems: 2
134          maxItems: 2
135        clock-names:
136          minItems: 2
137          maxItems: 2
138      required:
139        - clocks
140        - clock-names
141
142additionalProperties: false
143
144examples:
145  - |
146    switch@f0b00000 {
147            compatible = "brcm,bcm7445-switch-v4.0";
148            #address-cells = <1>;
149            #size-cells = <0>;
150            reg = <0xf0b00000 0x40000>,
151                  <0xf0b40000 0x110>,
152                  <0xf0b40340 0x30>,
153                  <0xf0b40380 0x30>,
154                  <0xf0b40400 0x34>,
155                  <0xf0b40600 0x208>;
156            reg-names = "core", "reg", "intrl2_0", "intrl2_1",
157                        "fcb", "acb";
158            interrupts = <0 0x18 0>,
159                         <0 0x19 0>;
160            clocks = <&sw_switch>, <&sw_switch_mdiv>;
161            clock-names = "sw_switch", "sw_switch_mdiv";
162            brcm,num-gphy = <1>;
163            brcm,num-rgmii-ports = <2>;
164            brcm,fcb-pause-override;
165            brcm,acb-packets-inflight;
166
167            ports {
168                    #address-cells = <1>;
169                    #size-cells = <0>;
170
171                    port@0 {
172                            label = "gphy";
173                            reg = <0>;
174                    };
175            };
176    };
177