1 LEDs connected to Broadcom BCM6328 controller
3 This controller is present on BCM6318, BCM6328, BCM6362 and BCM63268.
4 In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
5 However, on some devices there are Serial LEDs (LEDs connected to a 74x164
6 controller), which can either be controlled by software (exporting the 74x164
7 as spi-gpio. See Documentation/devicetree/bindings/gpio/gpio-74x164.txt), or
8 by hardware using this driver.
9 Some of these Serial LEDs are hardware controlled (e.g. ethernet LEDs) and
10 exporting the 74x164 as spi-gpio prevents those LEDs to be hardware
11 controlled, so the only chance to keep them working is by using this driver.
13 BCM6328 LED controller has a HWDIS register, which controls whether a LED
14 should be controlled by a hardware signal instead of the MODE register value,
15 with 0 meaning hardware control enabled and 1 hardware control disabled. This
16 is usually 1:1 for hardware to LED signals, but through the activity/link
17 registers you have some limited control over rerouting the LEDs (as
18 explained later in brcm,link-signal-sources). Even if a LED is hardware
19 controlled you are still able to make it blink or light it up if it isn't,
20 but you can't turn it off if the hardware decides to light it up. For this
21 reason, hardware controlled LEDs aren't registered as LED class devices.
24 - compatible : should be "brcm,bcm6328-leds".
25 - #address-cells : must be 1.
26 - #size-cells : must be 0.
27 - reg : BCM6328 LED controller address and size.
30 - brcm,serial-leds : Boolean, enables Serial LEDs.
32 - brcm,serial-mux : Boolean, enables Serial LEDs multiplexing.
34 - brcm,serial-clk-low : Boolean, makes clock signal active low.
36 - brcm,serial-dat-low : Boolean, makes data signal active low.
38 - brcm,serial-shift-inv : Boolean, inverts Serial LEDs shift direction.
41 Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
43 LED sub-node required properties:
44 - reg : LED pin number (only LEDs 0 to 23 are valid).
46 LED sub-node optional properties:
47 a) Optional properties for sub-nodes related to software controlled LEDs:
48 - label : see Documentation/devicetree/bindings/leds/common.txt
49 - active-low : Boolean, makes LED active low.
52 Documentation/devicetree/bindings/leds/common.txt
53 - linux,default-trigger : see
54 Documentation/devicetree/bindings/leds/common.txt
56 b) Optional properties for sub-nodes related to hardware controlled LEDs:
57 - brcm,hardware-controlled : Boolean, makes this LED hardware controlled.
59 - brcm,link-signal-sources : An array of hardware link
60 signal sources. Up to four link hardware signals can get muxed into
61 these LEDs. Only valid for LEDs 0 to 7, where LED signals 0 to 3 may
62 be muxed to LEDs 0 to 3, and signals 4 to 7 may be muxed to LEDs
63 4 to 7. A signal can be muxed to more than one LED, and one LED can
64 have more than one source signal.
65 - brcm,activity-signal-sources : An array of hardware activity
66 signal sources. Up to four activity hardware signals can get muxed into
67 these LEDs. Only valid for LEDs 0 to 7, where LED signals 0 to 3 may
68 be muxed to LEDs 0 to 3, and signals 4 to 7 may be muxed to LEDs
69 4 to 7. A signal can be muxed to more than one LED, and one LED can
70 have more than one source signal.
73 Scenario 1 : BCM6328 with 4 EPHY LEDs
74 leds0: led-controller@10000800 {
75 compatible = "brcm,bcm6328-leds";
78 reg = <0x10000800 0x24>;
93 label = "green:power";
98 brcm,hardware-controlled;
102 brcm,hardware-controlled;
106 brcm,hardware-controlled;
110 brcm,hardware-controlled;
114 Scenario 2 : BCM63268 with Serial/GPHY0 LEDs
115 leds0: led-controller@10001900 {
116 compatible = "brcm,bcm6328-leds";
117 #address-cells = <1>;
119 reg = <0x10001900 0x24>;
122 brcm,serial-shift-inv;
126 brcm,hardware-controlled;
127 brcm,link-signal-sources = <0>;
131 brcm,hardware-controlled;
132 brcm,link-signal-sources = <1>;
157 label = "green:inet";
161 brcm,hardware-controlled;
165 brcm,hardware-controlled;
169 brcm,hardware-controlled;
173 brcm,hardware-controlled;
177 brcm,hardware-controlled;
181 brcm,hardware-controlled;
185 brcm,hardware-controlled;
190 label = "green:power";
191 default-state = "on";
195 Scenario 3 : BCM6362 with 1 LED for each EPHY
196 leds0: led-controller@10001900 {
197 compatible = "brcm,bcm6328-leds";
198 #address-cells = <1>;
200 reg = <0x10001900 0x24>;
204 brcm,hardware-controlled;
205 brcm,link-signal-sources = <0>;
206 brcm,activity-signal-sources = <0>;
207 /* USB link/activity routed to USB LED */
211 brcm,hardware-controlled;
212 brcm,activity-signal-sources = <1>;
213 /* INET activity routed to INET LED */
217 brcm,hardware-controlled;
218 brcm,link-signal-sources = <4>;
219 /* EPHY0 link routed to EPHY0 LED */
223 brcm,hardware-controlled;
224 brcm,link-signal-sources = <5>;
225 /* EPHY1 link routed to EPHY1 LED */
229 brcm,hardware-controlled;
230 brcm,link-signal-sources = <6>;
231 /* EPHY2 link routed to EPHY2 LED */
235 brcm,hardware-controlled;
236 brcm,link-signal-sources = <7>;
237 /* EPHY3 link routed to EPHY3 LED */
242 label = "green:power";
243 default-state = "on";
247 Scenario 4 : BCM6362 with 1 LED for all EPHYs
248 leds0: led-controller@10001900 {
249 compatible = "brcm,bcm6328-leds";
250 #address-cells = <1>;
252 reg = <0x10001900 0x24>;
256 brcm,hardware-controlled;
257 brcm,link-signal-sources = <0 1>;
258 brcm,activity-signal-sources = <0 1>;
259 /* USB/INET link/activity routed to USB LED */
263 brcm,hardware-controlled;
264 brcm,link-signal-sources = <4 5 6 7>;
265 /* EPHY0/1/2/3 link routed to EPHY0 LED */
270 label = "green:power";
271 default-state = "on";
275 Scenario 5 : BCM6362 with EPHY LEDs swapped
276 leds0: led-controller@10001900 {
277 compatible = "brcm,bcm6328-leds";
278 #address-cells = <1>;
280 reg = <0x10001900 0x24>;
284 brcm,hardware-controlled;
285 brcm,link-signal-sources = <0>;
286 brcm,activity-signal-sources = <0 1>;
287 /* USB link/act and INET act routed to USB LED */
291 brcm,hardware-controlled;
292 brcm,link-signal-sources = <7>;
293 /* EPHY3 link routed to EPHY0 LED */
297 brcm,hardware-controlled;
298 brcm,link-signal-sources = <6>;
299 /* EPHY2 link routed to EPHY1 LED */
303 brcm,hardware-controlled;
304 brcm,link-signal-sources = <5>;
305 /* EPHY1 link routed to EPHY2 LED */
309 brcm,hardware-controlled;
310 brcm,link-signal-sources = <4>;
311 /* EPHY0 link routed to EPHY3 LED */
316 label = "green:power";
317 default-state = "on";