leds-bcm6328.txt 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. LEDs connected to Broadcom BCM6328 controller
  2. This controller is present on BCM6318, BCM6328, BCM6362 and BCM63268.
  3. In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
  4. However, on some devices there are Serial LEDs (LEDs connected to a 74x164
  5. controller), which can either be controlled by software (exporting the 74x164
  6. as spi-gpio. See Documentation/devicetree/bindings/gpio/gpio-74x164.txt), or
  7. by hardware using this driver.
  8. Some of these Serial LEDs are hardware controlled (e.g. ethernet LEDs) and
  9. exporting the 74x164 as spi-gpio prevents those LEDs to be hardware
  10. controlled, so the only chance to keep them working is by using this driver.
  11. BCM6328 LED controller has a HWDIS register, which controls whether a LED
  12. should be controlled by a hardware signal instead of the MODE register value,
  13. with 0 meaning hardware control enabled and 1 hardware control disabled. This
  14. is usually 1:1 for hardware to LED signals, but through the activity/link
  15. registers you have some limited control over rerouting the LEDs (as
  16. explained later in brcm,link-signal-sources). Even if a LED is hardware
  17. controlled you are still able to make it blink or light it up if it isn't,
  18. but you can't turn it off if the hardware decides to light it up. For this
  19. reason, hardware controlled LEDs aren't registered as LED class devices.
  20. Required properties:
  21. - compatible : should be "brcm,bcm6328-leds".
  22. - #address-cells : must be 1.
  23. - #size-cells : must be 0.
  24. - reg : BCM6328 LED controller address and size.
  25. Optional properties:
  26. - brcm,serial-leds : Boolean, enables Serial LEDs.
  27. Default : false
  28. - brcm,serial-mux : Boolean, enables Serial LEDs multiplexing.
  29. Default : false
  30. - brcm,serial-clk-low : Boolean, makes clock signal active low.
  31. Default : false
  32. - brcm,serial-dat-low : Boolean, makes data signal active low.
  33. Default : false
  34. - brcm,serial-shift-inv : Boolean, inverts Serial LEDs shift direction.
  35. Default : false
  36. Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
  37. LED sub-node required properties:
  38. - reg : LED pin number (only LEDs 0 to 23 are valid).
  39. LED sub-node optional properties:
  40. a) Optional properties for sub-nodes related to software controlled LEDs:
  41. - label : see Documentation/devicetree/bindings/leds/common.txt
  42. - active-low : Boolean, makes LED active low.
  43. Default : false
  44. - default-state : see
  45. Documentation/devicetree/bindings/leds/common.txt
  46. - linux,default-trigger : see
  47. 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.
  50. Default : false
  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.
  63. Examples:
  64. Scenario 1 : BCM6328 with 4 EPHY LEDs
  65. leds0: led-controller@10000800 {
  66. compatible = "brcm,bcm6328-leds";
  67. #address-cells = <1>;
  68. #size-cells = <0>;
  69. reg = <0x10000800 0x24>;
  70. alarm_red@2 {
  71. reg = <2>;
  72. active-low;
  73. label = "red:alarm";
  74. };
  75. inet_green@3 {
  76. reg = <3>;
  77. active-low;
  78. label = "green:inet";
  79. };
  80. power_green@4 {
  81. reg = <4>;
  82. active-low;
  83. label = "green:power";
  84. default-state = "on";
  85. };
  86. ephy0_spd@17 {
  87. reg = <17>;
  88. brcm,hardware-controlled;
  89. };
  90. ephy1_spd@18 {
  91. reg = <18>;
  92. brcm,hardware-controlled;
  93. };
  94. ephy2_spd@19 {
  95. reg = <19>;
  96. brcm,hardware-controlled;
  97. };
  98. ephy3_spd@20 {
  99. reg = <20>;
  100. brcm,hardware-controlled;
  101. };
  102. };
  103. Scenario 2 : BCM63268 with Serial/GPHY0 LEDs
  104. leds0: led-controller@10001900 {
  105. compatible = "brcm,bcm6328-leds";
  106. #address-cells = <1>;
  107. #size-cells = <0>;
  108. reg = <0x10001900 0x24>;
  109. brcm,serial-leds;
  110. brcm,serial-dat-low;
  111. brcm,serial-shift-inv;
  112. gphy0_spd0@0 {
  113. reg = <0>;
  114. brcm,hardware-controlled;
  115. brcm,link-signal-sources = <0>;
  116. };
  117. gphy0_spd1@1 {
  118. reg = <1>;
  119. brcm,hardware-controlled;
  120. brcm,link-signal-sources = <1>;
  121. };
  122. inet_red@2 {
  123. reg = <2>;
  124. active-low;
  125. label = "red:inet";
  126. };
  127. dsl_green@3 {
  128. reg = <3>;
  129. active-low;
  130. label = "green:dsl";
  131. };
  132. usb_green@4 {
  133. reg = <4>;
  134. active-low;
  135. label = "green:usb";
  136. };
  137. wps_green@7 {
  138. reg = <7>;
  139. active-low;
  140. label = "green:wps";
  141. };
  142. inet_green@8 {
  143. reg = <8>;
  144. active-low;
  145. label = "green:inet";
  146. };
  147. ephy0_act@9 {
  148. reg = <9>;
  149. brcm,hardware-controlled;
  150. };
  151. ephy1_act@10 {
  152. reg = <10>;
  153. brcm,hardware-controlled;
  154. };
  155. ephy2_act@11 {
  156. reg = <11>;
  157. brcm,hardware-controlled;
  158. };
  159. gphy0_act@12 {
  160. reg = <12>;
  161. brcm,hardware-controlled;
  162. };
  163. ephy0_spd@13 {
  164. reg = <13>;
  165. brcm,hardware-controlled;
  166. };
  167. ephy1_spd@14 {
  168. reg = <14>;
  169. brcm,hardware-controlled;
  170. };
  171. ephy2_spd@15 {
  172. reg = <15>;
  173. brcm,hardware-controlled;
  174. };
  175. power_green@20 {
  176. reg = <20>;
  177. active-low;
  178. label = "green:power";
  179. default-state = "on";
  180. };
  181. };
  182. Scenario 3 : BCM6362 with 1 LED for each EPHY
  183. leds0: led-controller@10001900 {
  184. compatible = "brcm,bcm6328-leds";
  185. #address-cells = <1>;
  186. #size-cells = <0>;
  187. reg = <0x10001900 0x24>;
  188. usb@0 {
  189. reg = <0>;
  190. brcm,hardware-controlled;
  191. brcm,link-signal-sources = <0>;
  192. brcm,activity-signal-sources = <0>;
  193. /* USB link/activity routed to USB LED */
  194. };
  195. inet@1 {
  196. reg = <1>;
  197. brcm,hardware-controlled;
  198. brcm,activity-signal-sources = <1>;
  199. /* INET activity routed to INET LED */
  200. };
  201. ephy0@4 {
  202. reg = <4>;
  203. brcm,hardware-controlled;
  204. brcm,link-signal-sources = <4>;
  205. /* EPHY0 link routed to EPHY0 LED */
  206. };
  207. ephy1@5 {
  208. reg = <5>;
  209. brcm,hardware-controlled;
  210. brcm,link-signal-sources = <5>;
  211. /* EPHY1 link routed to EPHY1 LED */
  212. };
  213. ephy2@6 {
  214. reg = <6>;
  215. brcm,hardware-controlled;
  216. brcm,link-signal-sources = <6>;
  217. /* EPHY2 link routed to EPHY2 LED */
  218. };
  219. ephy3@7 {
  220. reg = <7>;
  221. brcm,hardware-controlled;
  222. brcm,link-signal-sources = <7>;
  223. /* EPHY3 link routed to EPHY3 LED */
  224. };
  225. power_green@20 {
  226. reg = <20>;
  227. active-low;
  228. label = "green:power";
  229. default-state = "on";
  230. };
  231. };
  232. Scenario 4 : BCM6362 with 1 LED for all EPHYs
  233. leds0: led-controller@10001900 {
  234. compatible = "brcm,bcm6328-leds";
  235. #address-cells = <1>;
  236. #size-cells = <0>;
  237. reg = <0x10001900 0x24>;
  238. usb@0 {
  239. reg = <0>;
  240. brcm,hardware-controlled;
  241. brcm,link-signal-sources = <0 1>;
  242. brcm,activity-signal-sources = <0 1>;
  243. /* USB/INET link/activity routed to USB LED */
  244. };
  245. ephy@4 {
  246. reg = <4>;
  247. brcm,hardware-controlled;
  248. brcm,link-signal-sources = <4 5 6 7>;
  249. /* EPHY0/1/2/3 link routed to EPHY0 LED */
  250. };
  251. power_green@20 {
  252. reg = <20>;
  253. active-low;
  254. label = "green:power";
  255. default-state = "on";
  256. };
  257. };
  258. Scenario 5 : BCM6362 with EPHY LEDs swapped
  259. leds0: led-controller@10001900 {
  260. compatible = "brcm,bcm6328-leds";
  261. #address-cells = <1>;
  262. #size-cells = <0>;
  263. reg = <0x10001900 0x24>;
  264. usb@0 {
  265. reg = <0>;
  266. brcm,hardware-controlled;
  267. brcm,link-signal-sources = <0>;
  268. brcm,activity-signal-sources = <0 1>;
  269. /* USB link/act and INET act routed to USB LED */
  270. };
  271. ephy0@4 {
  272. reg = <4>;
  273. brcm,hardware-controlled;
  274. brcm,link-signal-sources = <7>;
  275. /* EPHY3 link routed to EPHY0 LED */
  276. };
  277. ephy1@5 {
  278. reg = <5>;
  279. brcm,hardware-controlled;
  280. brcm,link-signal-sources = <6>;
  281. /* EPHY2 link routed to EPHY1 LED */
  282. };
  283. ephy2@6 {
  284. reg = <6>;
  285. brcm,hardware-controlled;
  286. brcm,link-signal-sources = <5>;
  287. /* EPHY1 link routed to EPHY2 LED */
  288. };
  289. ephy3@7 {
  290. reg = <7>;
  291. brcm,hardware-controlled;
  292. brcm,link-signal-sources = <4>;
  293. /* EPHY0 link routed to EPHY3 LED */
  294. };
  295. power_green@20 {
  296. reg = <20>;
  297. active-low;
  298. label = "green:power";
  299. default-state = "on";
  300. };
  301. };