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.
33 Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
35 LED sub-node required properties:
36 - reg : LED pin number (only LEDs 0 to 23 are valid).
38 LED sub-node optional properties:
39 a) Optional properties for sub-nodes related to software controlled LEDs:
40 - label : see Documentation/devicetree/bindings/leds/common.txt
41 - active-low : Boolean, makes LED active low.
44 Documentation/devicetree/bindings/leds/leds-gpio.txt
45 - linux,default-trigger : see
46 Documentation/devicetree/bindings/leds/common.txt
48 b) Optional properties for sub-nodes related to hardware controlled LEDs:
49 - brcm,hardware-controlled : Boolean, makes this LED hardware controlled.
51 - brcm,link-signal-sources : An array of hardware link
52 signal sources. Up to four link hardware signals can get muxed into
53 these LEDs. Only valid for LEDs 0 to 7, where LED signals 0 to 3 may
54 be muxed to LEDs 0 to 3, and signals 4 to 7 may be muxed to LEDs
55 4 to 7. A signal can be muxed to more than one LED, and one LED can
56 have more than one source signal.
57 - brcm,activity-signal-sources : An array of hardware activity
58 signal sources. Up to four activity hardware signals can get muxed into
59 these LEDs. Only valid for LEDs 0 to 7, where LED signals 0 to 3 may
60 be muxed to LEDs 0 to 3, and signals 4 to 7 may be muxed to LEDs
61 4 to 7. A signal can be muxed to more than one LED, and one LED can
62 have more than one source signal.
65 Scenario 1 : BCM6328 with 4 EPHY LEDs
66 leds0: led-controller@10000800 {
67 compatible = "brcm,bcm6328-leds";
70 reg = <0x10000800 0x24>;
85 label = "green:power";
90 brcm,hardware-controlled;
94 brcm,hardware-controlled;
98 brcm,hardware-controlled;
102 brcm,hardware-controlled;
106 Scenario 2 : BCM63268 with Serial/GPHY0 LEDs
107 leds0: led-controller@10001900 {
108 compatible = "brcm,bcm6328-leds";
109 #address-cells = <1>;
111 reg = <0x10001900 0x24>;
116 brcm,hardware-controlled;
117 brcm,link-signal-sources = <0>;
121 brcm,hardware-controlled;
122 brcm,link-signal-sources = <1>;
147 label = "green:inet";
151 brcm,hardware-controlled;
155 brcm,hardware-controlled;
159 brcm,hardware-controlled;
163 brcm,hardware-controlled;
167 brcm,hardware-controlled;
171 brcm,hardware-controlled;
175 brcm,hardware-controlled;
180 label = "green:power";
181 default-state = "on";
185 Scenario 3 : BCM6362 with 1 LED for each EPHY
186 leds0: led-controller@10001900 {
187 compatible = "brcm,bcm6328-leds";
188 #address-cells = <1>;
190 reg = <0x10001900 0x24>;
194 brcm,hardware-controlled;
195 brcm,link-signal-sources = <0>;
196 brcm,activity-signal-sources = <0>;
197 /* USB link/activity routed to USB LED */
201 brcm,hardware-controlled;
202 brcm,activity-signal-sources = <1>;
203 /* INET activity routed to INET LED */
207 brcm,hardware-controlled;
208 brcm,link-signal-sources = <4>;
209 /* EPHY0 link routed to EPHY0 LED */
213 brcm,hardware-controlled;
214 brcm,link-signal-sources = <5>;
215 /* EPHY1 link routed to EPHY1 LED */
219 brcm,hardware-controlled;
220 brcm,link-signal-sources = <6>;
221 /* EPHY2 link routed to EPHY2 LED */
225 brcm,hardware-controlled;
226 brcm,link-signal-sources = <7>;
227 /* EPHY3 link routed to EPHY3 LED */
232 label = "green:power";
233 default-state = "on";
237 Scenario 4 : BCM6362 with 1 LED for all EPHYs
238 leds0: led-controller@10001900 {
239 compatible = "brcm,bcm6328-leds";
240 #address-cells = <1>;
242 reg = <0x10001900 0x24>;
246 brcm,hardware-controlled;
247 brcm,link-signal-sources = <0 1>;
248 brcm,activity-signal-sources = <0 1>;
249 /* USB/INET link/activity routed to USB LED */
253 brcm,hardware-controlled;
254 brcm,link-signal-sources = <4 5 6 7>;
255 /* EPHY0/1/2/3 link routed to EPHY0 LED */
260 label = "green:power";
261 default-state = "on";
265 Scenario 5 : BCM6362 with EPHY LEDs swapped
266 leds0: led-controller@10001900 {
267 compatible = "brcm,bcm6328-leds";
268 #address-cells = <1>;
270 reg = <0x10001900 0x24>;
274 brcm,hardware-controlled;
275 brcm,link-signal-sources = <0>;
276 brcm,activity-signal-sources = <0 1>;
277 /* USB link/act and INET act routed to USB LED */
281 brcm,hardware-controlled;
282 brcm,link-signal-sources = <7>;
283 /* EPHY3 link routed to EPHY0 LED */
287 brcm,hardware-controlled;
288 brcm,link-signal-sources = <6>;
289 /* EPHY2 link routed to EPHY1 LED */
293 brcm,hardware-controlled;
294 brcm,link-signal-sources = <5>;
295 /* EPHY1 link routed to EPHY2 LED */
299 brcm,hardware-controlled;
300 brcm,link-signal-sources = <4>;
301 /* EPHY0 link routed to EPHY3 LED */
306 label = "green:power";
307 default-state = "on";