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    maxItems: 2
52    items:
53      - description: switch's main clock
54      - description: dividing of the switch core clock
55
56  clock-names:
57    minItems: 1
58    maxItems: 2
59    items:
60      - const: sw_switch
61      - const: sw_switch_mdiv
62
63  brcm,num-gphy:
64    $ref: /schemas/types.yaml#/definitions/uint32
65    description: maximum number of integrated gigabit PHYs in the switch
66
67  brcm,num-rgmii-ports:
68    $ref: /schemas/types.yaml#/definitions/uint32
69    description: maximum number of RGMII interfaces supported by the switch
70
71  brcm,fcb-pause-override:
72    description: if present indicates that the switch supports Failover Control
73      Block pause override capability
74    type: boolean
75
76  brcm,acb-packets-inflight:
77    description: if present indicates that the switch Admission Control Block
78      supports reporting the number of packets in-flight in a switch queue
79    type: boolean
80
81  "#address-cells":
82    const: 1
83
84  "#size-cells":
85    const: 0
86
87  ports:
88    type: object
89
90    properties:
91      brcm,use-bcm-hdr:
92        description: if present, indicates that the switch port has Broadcom
93          tags enabled (per-packet metadata)
94        type: boolean
95
96required:
97  - reg
98  - interrupts
99  - "#address-cells"
100  - "#size-cells"
101
102allOf:
103  - $ref: "dsa.yaml#"
104  - if:
105      properties:
106        compatible:
107          contains:
108            enum:
109              - brcm,bcm7278-switch-v4.0
110              - brcm,bcm7278-switch-v4.8
111    then:
112      properties:
113        clocks:
114          minItems: 1
115          maxItems: 1
116        clock-names:
117          minItems: 1
118          maxItems: 1
119      required:
120        - clocks
121        - clock-names
122  - if:
123      properties:
124        compatible:
125          contains:
126            const: brcm,bcm7445-switch-v4.0
127    then:
128      properties:
129        clocks:
130          minItems: 2
131          maxItems: 2
132        clock-names:
133          minItems: 2
134          maxItems: 2
135      required:
136        - clocks
137        - clock-names
138
139additionalProperties: false
140
141examples:
142  - |
143    switch@f0b00000 {
144            compatible = "brcm,bcm7445-switch-v4.0";
145            #address-cells = <1>;
146            #size-cells = <0>;
147            reg = <0xf0b00000 0x40000>,
148                  <0xf0b40000 0x110>,
149                  <0xf0b40340 0x30>,
150                  <0xf0b40380 0x30>,
151                  <0xf0b40400 0x34>,
152                  <0xf0b40600 0x208>;
153            reg-names = "core", "reg", "intrl2_0", "intrl2_1",
154                        "fcb", "acb";
155            interrupts = <0 0x18 0>,
156                         <0 0x19 0>;
157            clocks = <&sw_switch>, <&sw_switch_mdiv>;
158            clock-names = "sw_switch", "sw_switch_mdiv";
159            brcm,num-gphy = <1>;
160            brcm,num-rgmii-ports = <2>;
161            brcm,fcb-pause-override;
162            brcm,acb-packets-inflight;
163
164            ports {
165                    #address-cells = <1>;
166                    #size-cells = <0>;
167
168                    port@0 {
169                            label = "gphy";
170                            reg = <0>;
171                    };
172            };
173    };
174