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