xref: /linux/Documentation/devicetree/bindings/leds/leds-bcm6328.yaml (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/leds-bcm6328.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: LEDs connected to Broadcom BCM6328 controller
8
9maintainers:
10  - Álvaro Fernández Rojas <noltari@gmail.com>
11
12description: |
13  This controller is present on BCM6318, BCM6328, BCM6362 and BCM63268.
14  In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
15  However, on some devices there are Serial LEDs (LEDs connected to a 74x164
16  controller), which can either be controlled by software (exporting the 74x164
17  as spi-gpio. See
18  Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml), or by hardware
19  using this driver.
20  Some of these Serial LEDs are hardware controlled (e.g. ethernet LEDs) and
21  exporting the 74x164 as spi-gpio prevents those LEDs to be hardware
22  controlled, so the only chance to keep them working is by using this driver.
23
24  BCM6328 LED controller has a HWDIS register, which controls whether a LED
25  should be controlled by a hardware signal instead of the MODE register value,
26  with 0 meaning hardware control enabled and 1 hardware control disabled. This
27  is usually 1:1 for hardware to LED signals, but through the activity/link
28  registers you have some limited control over rerouting the LEDs (as
29  explained later in brcm,link-signal-sources). Even if a LED is hardware
30  controlled you are still able to make it blink or light it up if it isn't,
31  but you can't turn it off if the hardware decides to light it up. For this
32  reason, hardware controlled LEDs aren't registered as LED class devices.
33
34  Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
35
36properties:
37  compatible:
38    const: brcm,bcm6328-leds
39
40  reg:
41    maxItems: 1
42
43  brcm,serial-leds:
44    type: boolean
45    description: Enables Serial LEDs.
46
47  brcm,serial-mux:
48    type: boolean
49    description: Enables Serial LEDs multiplexing.
50
51  brcm,serial-clk-low:
52    type: boolean
53    description: Makes clock signal active low.
54
55  brcm,serial-dat-low:
56    type: boolean
57    description: Makes data signal active low.
58
59  brcm,serial-shift-inv:
60    type: boolean
61    description: Inverts Serial LEDs shift direction.
62
63  "#address-cells":
64    const: 1
65
66  "#size-cells":
67    const: 0
68
69patternProperties:
70  "@[a-f0-9]+$":
71    type: object
72
73    $ref: common.yaml#
74
75    properties:
76      reg:
77        items:
78          - maximum: 23
79        description: LED pin number (only LEDs 0 to 23 are valid).
80
81      brcm,hardware-controlled:
82        type: boolean
83        description: Makes this LED hardware controlled.
84
85      brcm,link-signal-sources:
86        $ref: /schemas/types.yaml#/definitions/uint32-array
87        minItems: 1
88        maxItems: 4
89        description: >
90          An array of hardware link signal sources. Up to four link hardware
91          signals can get muxed into these LEDs. Only valid for LEDs 0 to 7,
92          where LED signals 0 to 3 may be muxed to LEDs 0 to 3, and signals 4 to
93          7 may be muxed to LEDs 4 to 7. A signal can be muxed to more than one
94          LED, and one LED can have more than one source signal.
95
96      brcm,activity-signal-sources:
97        $ref: /schemas/types.yaml#/definitions/uint32-array
98        minItems: 1
99        maxItems: 4
100        description: >
101          An array of hardware activity signal sources. Up to four activity
102          hardware signals can get muxed into these LEDs. Only valid for LEDs 0
103          to 7, where LED signals 0 to 3 may be muxed to LEDs 0 to 3, and
104          signals 4 to 7 may be muxed to LEDs 4 to 7. A signal can be muxed to
105          more than one LED, and one LED can have more than one source signal.
106
107    required:
108      - reg
109
110    unevaluatedProperties: false
111
112required:
113  - reg
114  - "#address-cells"
115  - "#size-cells"
116
117additionalProperties: false
118
119examples:
120  - |
121    /* BCM6328 with 4 EPHY LEDs */
122    led-controller@10000800 {
123        compatible = "brcm,bcm6328-leds";
124        #address-cells = <1>;
125        #size-cells = <0>;
126        reg = <0x10000800 0x24>;
127
128        alarm_red@2 {
129            reg = <2>;
130            active-low;
131            label = "red:alarm";
132        };
133
134        inet_green@3 {
135            reg = <3>;
136            active-low;
137            label = "green:inet";
138        };
139
140        power_green@4 {
141            reg = <4>;
142            active-low;
143            label = "green:power";
144            default-state = "on";
145        };
146
147        ephy0_spd@17 {
148            reg = <17>;
149            brcm,hardware-controlled;
150        };
151
152        ephy1_spd@18 {
153            reg = <18>;
154            brcm,hardware-controlled;
155        };
156
157        ephy2_spd@19 {
158            reg = <19>;
159            brcm,hardware-controlled;
160        };
161
162        ephy3_spd@20 {
163            reg = <20>;
164            brcm,hardware-controlled;
165        };
166    };
167  - |
168    /* BCM63268 with Serial/GPHY0 LEDs */
169    led-controller@10001900 {
170        compatible = "brcm,bcm6328-leds";
171        #address-cells = <1>;
172        #size-cells = <0>;
173        reg = <0x10001900 0x24>;
174        brcm,serial-leds;
175        brcm,serial-dat-low;
176        brcm,serial-shift-inv;
177
178        gphy0_spd0@0 {
179            reg = <0>;
180            brcm,hardware-controlled;
181            brcm,link-signal-sources = <0>;
182        };
183
184        gphy0_spd1@1 {
185            reg = <1>;
186            brcm,hardware-controlled;
187            brcm,link-signal-sources = <1>;
188        };
189
190        inet_red@2 {
191            reg = <2>;
192            active-low;
193            label = "red:inet";
194        };
195
196        dsl_green@3 {
197            reg = <3>;
198            active-low;
199            label = "green:dsl";
200        };
201
202        usb_green@4 {
203            reg = <4>;
204            active-low;
205            label = "green:usb";
206        };
207
208        wps_green@7 {
209            reg = <7>;
210            active-low;
211            label = "green:wps";
212        };
213
214        inet_green@8 {
215            reg = <8>;
216            active-low;
217            label = "green:inet";
218        };
219
220        ephy0_act@9 {
221            reg = <9>;
222            brcm,hardware-controlled;
223        };
224
225        ephy1_act@10 {
226            reg = <10>;
227            brcm,hardware-controlled;
228        };
229
230        ephy2_act@11 {
231            reg = <11>;
232            brcm,hardware-controlled;
233        };
234
235        gphy0_act@12 {
236            reg = <12>;
237            brcm,hardware-controlled;
238        };
239
240        ephy0_spd@13 {
241            reg = <13>;
242            brcm,hardware-controlled;
243        };
244
245        ephy1_spd@14 {
246            reg = <14>;
247            brcm,hardware-controlled;
248        };
249
250        ephy2_spd@15 {
251            reg = <15>;
252            brcm,hardware-controlled;
253        };
254
255        power_green@20 {
256            reg = <20>;
257            active-low;
258            label = "green:power";
259            default-state = "on";
260        };
261    };
262  - |
263    /* BCM6362 with 1 LED for each EPHY */
264    led-controller@10001900 {
265        compatible = "brcm,bcm6328-leds";
266        #address-cells = <1>;
267        #size-cells = <0>;
268        reg = <0x10001900 0x24>;
269
270        usb@0 {
271            reg = <0>;
272            brcm,hardware-controlled;
273            brcm,link-signal-sources = <0>;
274            brcm,activity-signal-sources = <0>;
275            /* USB link/activity routed to USB LED */
276        };
277
278        inet@1 {
279            reg = <1>;
280            brcm,hardware-controlled;
281            brcm,activity-signal-sources = <1>;
282            /* INET activity routed to INET LED */
283        };
284
285        ephy0@4 {
286            reg = <4>;
287            brcm,hardware-controlled;
288            brcm,link-signal-sources = <4>;
289            /* EPHY0 link routed to EPHY0 LED */
290        };
291
292        ephy1@5 {
293            reg = <5>;
294            brcm,hardware-controlled;
295            brcm,link-signal-sources = <5>;
296            /* EPHY1 link routed to EPHY1 LED */
297        };
298
299        ephy2@6 {
300            reg = <6>;
301            brcm,hardware-controlled;
302            brcm,link-signal-sources = <6>;
303            /* EPHY2 link routed to EPHY2 LED */
304        };
305
306        ephy3@7 {
307            reg = <7>;
308            brcm,hardware-controlled;
309            brcm,link-signal-sources = <7>;
310            /* EPHY3 link routed to EPHY3 LED */
311        };
312
313        power_green@20 {
314            reg = <20>;
315            active-low;
316            label = "green:power";
317            default-state = "on";
318        };
319    };
320  - |
321    /* BCM6362 with 1 LED for all EPHYs */
322    led-controller@10001900 {
323        compatible = "brcm,bcm6328-leds";
324        #address-cells = <1>;
325        #size-cells = <0>;
326        reg = <0x10001900 0x24>;
327
328        usb@0 {
329            reg = <0>;
330            brcm,hardware-controlled;
331            brcm,link-signal-sources = <0 1>;
332            brcm,activity-signal-sources = <0 1>;
333            /* USB/INET link/activity routed to USB LED */
334        };
335
336        ephy@4 {
337            reg = <4>;
338            brcm,hardware-controlled;
339            brcm,link-signal-sources = <4 5 6 7>;
340            /* EPHY0/1/2/3 link routed to EPHY0 LED */
341        };
342
343        power_green@20 {
344            reg = <20>;
345            active-low;
346            label = "green:power";
347            default-state = "on";
348        };
349    };
350  - |
351    /* BCM6362 with EPHY LEDs swapped */
352    led-controller@10001900 {
353        compatible = "brcm,bcm6328-leds";
354        #address-cells = <1>;
355        #size-cells = <0>;
356        reg = <0x10001900 0x24>;
357
358        usb@0 {
359            reg = <0>;
360            brcm,hardware-controlled;
361            brcm,link-signal-sources = <0>;
362            brcm,activity-signal-sources = <0 1>;
363            /* USB link/act and INET act routed to USB LED */
364        };
365
366        ephy0@4 {
367            reg = <4>;
368            brcm,hardware-controlled;
369            brcm,link-signal-sources = <7>;
370            /* EPHY3 link routed to EPHY0 LED */
371        };
372
373        ephy1@5 {
374            reg = <5>;
375            brcm,hardware-controlled;
376            brcm,link-signal-sources = <6>;
377            /* EPHY2 link routed to EPHY1 LED */
378        };
379
380        ephy2@6 {
381            reg = <6>;
382            brcm,hardware-controlled;
383            brcm,link-signal-sources = <5>;
384            /* EPHY1 link routed to EPHY2 LED */
385        };
386
387        ephy3@7 {
388            reg = <7>;
389            brcm,hardware-controlled;
390            brcm,link-signal-sources = <4>;
391            /* EPHY0 link routed to EPHY3 LED */
392        };
393
394        power_green@20 {
395            reg = <20>;
396            active-low;
397            label = "green:power";
398            default-state = "on";
399        };
400    };
401