Masahiro Yamada | cc85b7b | 2015-07-26 02:46:26 +0900 | [diff] [blame] | 1 | menu "LED Support" |
| 2 | |
Simon Glass | cce3aed | 2015-06-23 15:38:45 -0600 | [diff] [blame] | 3 | config LED |
| 4 | bool "Enable LED support" |
| 5 | depends on DM |
| 6 | help |
| 7 | Many boards have LEDs which can be used to signal status or alerts. |
| 8 | U-Boot provides a uclass API to implement this feature. LED drivers |
| 9 | can provide access to board-specific LEDs. Use of the device tree |
| 10 | for configuration is encouraged. |
| 11 | |
Masahiro Yamada | 645dbd6 | 2015-08-12 07:31:50 +0900 | [diff] [blame] | 12 | config SPL_LED |
Simon Glass | cce3aed | 2015-06-23 15:38:45 -0600 | [diff] [blame] | 13 | bool "Enable LED support in SPL" |
Simon Glass | 965f4da | 2015-08-30 16:55:14 -0600 | [diff] [blame] | 14 | depends on SPL && SPL_DM |
Simon Glass | cce3aed | 2015-06-23 15:38:45 -0600 | [diff] [blame] | 15 | help |
| 16 | The LED subsystem adds a small amount of overhead to the image. |
| 17 | If this is acceptable and you have a need to use LEDs in SPL, |
| 18 | enable this option. You will need to enable device tree in SPL |
| 19 | for this to work. |
Simon Glass | 9267067 | 2017-04-10 11:34:52 -0600 | [diff] [blame] | 20 | |
Simon Glass | 5a9390b | 2015-06-23 15:38:46 -0600 | [diff] [blame] | 21 | config LED_GPIO |
| 22 | bool "LED support for GPIO-connected LEDs" |
| 23 | depends on LED && DM_GPIO |
| 24 | help |
| 25 | Enable support for LEDs which are connected to GPIO lines. These |
| 26 | GPIOs may be on the SoC or some other device which provides GPIOs. |
| 27 | The GPIO driver must used driver model. LEDs are configured using |
| 28 | the device tree. |
Masahiro Yamada | cc85b7b | 2015-07-26 02:46:26 +0900 | [diff] [blame] | 29 | |
Simon Glass | 965f4da | 2015-08-30 16:55:14 -0600 | [diff] [blame] | 30 | config SPL_LED_GPIO |
| 31 | bool "LED support for GPIO-connected LEDs in SPL" |
| 32 | depends on SPL_LED && DM_GPIO |
| 33 | help |
| 34 | This option is an SPL-variant of the LED_GPIO option. |
| 35 | See the help of LED_GPIO for details. |
| 36 | |
Uri Mashiach | 3dc6f65 | 2017-01-19 10:51:05 +0200 | [diff] [blame] | 37 | config LED_STATUS |
| 38 | bool "Enable status LED API" |
| 39 | help |
| 40 | Allows common u-boot commands to use a board's leds to |
| 41 | provide status for activities like booting and downloading files. |
| 42 | |
| 43 | if LED_STATUS |
| 44 | |
| 45 | # Hidden constants |
| 46 | |
| 47 | config LED_STATUS_OFF |
| 48 | int |
| 49 | default 0 |
| 50 | |
| 51 | config LED_STATUS_BLINKING |
| 52 | int |
| 53 | default 1 |
| 54 | |
| 55 | config LED_STATUS_ON |
| 56 | int |
| 57 | default 2 |
| 58 | |
| 59 | # Hidden constants end |
| 60 | |
| 61 | config LED_STATUS_GPIO |
| 62 | bool "GPIO status LED implementation" |
| 63 | help |
| 64 | The status LED can be connected to a GPIO pin. In such cases, the |
| 65 | gpio_led driver can be used as a status LED backend implementation. |
| 66 | |
| 67 | config LED_STATUS_BOARD_SPECIFIC |
| 68 | bool "Specific board" |
| 69 | default y |
| 70 | help |
| 71 | LED support is only for a specific board. |
| 72 | |
| 73 | comment "LEDs parameters" |
| 74 | |
| 75 | config LED_STATUS0 |
| 76 | bool "Enable status LED 0" |
| 77 | |
| 78 | if LED_STATUS0 |
| 79 | |
| 80 | config LED_STATUS_BIT |
| 81 | int "identification" |
| 82 | help |
| 83 | CONFIG_LED_STATUS_BIT is passed into the __led_* functions to identify |
| 84 | which LED is being acted on. As such, the chosen value must be unique |
| 85 | with respect to the other CONFIG_LED_STATUS_BIT's. Mapping the value |
| 86 | to a physical LED is the responsibility of the __led_* function. |
| 87 | |
| 88 | config LED_STATUS_STATE |
| 89 | int "initial state" |
| 90 | range LED_STATUS_OFF LED_STATUS_ON |
| 91 | default LED_STATUS_OFF |
| 92 | help |
| 93 | Should be set one of the following: |
| 94 | 0 - off |
| 95 | 1 - blinking |
| 96 | 2 - on |
| 97 | |
| 98 | config LED_STATUS_FREQ |
| 99 | int "blink frequency" |
| 100 | range 2 10 |
| 101 | default 2 |
| 102 | help |
| 103 | The LED blink period calculated from LED_STATUS_FREQ: |
| 104 | LED_STATUS_PERIOD = CONFIG_SYS_HZ/LED_STATUS_FREQ |
| 105 | Values range: 2 - 10 |
| 106 | |
| 107 | endif # LED_STATUS0 |
| 108 | |
| 109 | config LED_STATUS1 |
| 110 | bool "Enable status LED 1" |
| 111 | |
| 112 | if LED_STATUS1 |
| 113 | |
| 114 | config LED_STATUS_BIT1 |
| 115 | int "identification" |
| 116 | help |
| 117 | CONFIG_LED_STATUS_BIT1 is passed into the __led_* functions to |
| 118 | identify which LED is being acted on. As such, the chosen value must |
| 119 | be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping |
| 120 | the value to a physical LED is the responsibility of the __led_* |
| 121 | function. |
| 122 | |
| 123 | config LED_STATUS_STATE1 |
| 124 | int "initial state" |
| 125 | range LED_STATUS_OFF LED_STATUS_ON |
| 126 | default LED_STATUS_OFF |
| 127 | help |
| 128 | Should be set one of the following: |
| 129 | 0 - off |
| 130 | 1 - blinking |
| 131 | 2 - on |
| 132 | |
| 133 | config LED_STATUS_FREQ1 |
| 134 | int "blink frequency" |
| 135 | range 2 10 |
| 136 | default 2 |
| 137 | help |
| 138 | The LED blink period calculated from LED_STATUS_FREQ1: |
| 139 | LED_STATUS_PERIOD1 = CONFIG_SYS_HZ/LED_STATUS_FREQ1 |
| 140 | Values range: 2 - 10 |
| 141 | |
| 142 | endif # LED_STATUS1 |
| 143 | |
| 144 | config LED_STATUS2 |
| 145 | bool "Enable status LED 2" |
| 146 | |
| 147 | if LED_STATUS2 |
| 148 | |
| 149 | config LED_STATUS_BIT2 |
| 150 | int "identification" |
| 151 | help |
| 152 | CONFIG_LED_STATUS_BIT2 is passed into the __led_* functions to |
| 153 | identify which LED is being acted on. As such, the chosen value must |
| 154 | be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping |
| 155 | the value to a physical LED is the responsibility of the __led_* |
| 156 | function. |
| 157 | |
| 158 | config LED_STATUS_STATE2 |
| 159 | int "initial state" |
| 160 | range LED_STATUS_OFF LED_STATUS_ON |
| 161 | default LED_STATUS_OFF |
| 162 | help |
| 163 | Should be set one of the following: |
| 164 | 0 - off |
| 165 | 1 - blinking |
| 166 | 2 - on |
| 167 | |
| 168 | config LED_STATUS_FREQ2 |
| 169 | int "blink frequency" |
| 170 | range 2 10 |
| 171 | default 2 |
| 172 | help |
| 173 | The LED blink period calculated from LED_STATUS_FREQ2: |
| 174 | LED_STATUS_PERIOD2 = CONFIG_SYS_HZ/LED_STATUS_FREQ2 |
| 175 | Values range: 2 - 10 |
| 176 | |
| 177 | endif # LED_STATUS2 |
| 178 | |
| 179 | config LED_STATUS3 |
| 180 | bool "Enable status LED 3" |
| 181 | |
| 182 | if LED_STATUS3 |
| 183 | |
| 184 | config LED_STATUS_BIT3 |
| 185 | int "identification" |
| 186 | help |
| 187 | CONFIG_LED_STATUS_BIT3 is passed into the __led_* functions to |
| 188 | identify which LED is being acted on. As such, the chosen value must |
| 189 | be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping |
| 190 | the value to a physical LED is the responsibility of the __led_* |
| 191 | function. |
| 192 | |
| 193 | config LED_STATUS_STATE3 |
| 194 | int "initial state" |
| 195 | range LED_STATUS_OFF LED_STATUS_ON |
| 196 | default LED_STATUS_OFF |
| 197 | help |
| 198 | Should be set one of the following: |
| 199 | 0 - off |
| 200 | 1 - blinking |
| 201 | 2 - on |
| 202 | |
| 203 | config LED_STATUS_FREQ3 |
| 204 | int "blink frequency" |
| 205 | range 2 10 |
| 206 | default 2 |
| 207 | help |
| 208 | The LED blink period calculated from LED_STATUS_FREQ3: |
| 209 | LED_STATUS_PERIOD3 = CONFIG_SYS_HZ/LED_STATUS_FREQ3 |
| 210 | Values range: 2 - 10 |
| 211 | |
| 212 | endif # LED_STATUS3 |
| 213 | |
| 214 | config LED_STATUS4 |
| 215 | bool "Enable status LED 4" |
| 216 | |
| 217 | if LED_STATUS4 |
| 218 | |
| 219 | config LED_STATUS_BIT4 |
| 220 | int "identification" |
| 221 | help |
| 222 | CONFIG_LED_STATUS_BIT4 is passed into the __led_* functions to |
| 223 | identify which LED is being acted on. As such, the chosen value must |
| 224 | be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping |
| 225 | the value to a physical LED is the responsibility of the __led_* |
| 226 | function. |
| 227 | |
| 228 | config LED_STATUS_STATE4 |
| 229 | int "initial state" |
| 230 | range LED_STATUS_OFF LED_STATUS_ON |
| 231 | default LED_STATUS_OFF |
| 232 | help |
| 233 | Should be set one of the following: |
| 234 | 0 - off |
| 235 | 1 - blinking |
| 236 | 2 - on |
| 237 | |
| 238 | config LED_STATUS_FREQ4 |
| 239 | int "blink frequency" |
| 240 | range 2 10 |
| 241 | default 2 |
| 242 | help |
| 243 | The LED blink period calculated from LED_STATUS_FREQ4: |
| 244 | LED_STATUS_PERIOD4 = CONFIG_SYS_HZ/LED_STATUS_FREQ4 |
| 245 | Values range: 2 - 10 |
| 246 | |
| 247 | endif # LED_STATUS4 |
| 248 | |
| 249 | config LED_STATUS5 |
| 250 | bool "Enable status LED 5" |
| 251 | |
| 252 | if LED_STATUS5 |
| 253 | |
| 254 | config LED_STATUS_BIT5 |
| 255 | int "identification" |
| 256 | help |
| 257 | CONFIG_LED_STATUS_BIT5 is passed into the __led_* functions to |
| 258 | identify which LED is being acted on. As such, the chosen value must |
| 259 | be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping |
| 260 | the value to a physical LED is the responsibility of the __led_* |
| 261 | function. |
| 262 | |
| 263 | config LED_STATUS_STATE5 |
| 264 | int "initial state" |
| 265 | range LED_STATUS_OFF LED_STATUS_ON |
| 266 | default LED_STATUS_OFF |
| 267 | help |
| 268 | Should be set one of the following: |
| 269 | 0 - off |
| 270 | 1 - blinking |
| 271 | 2 - on |
| 272 | |
| 273 | config LED_STATUS_FREQ5 |
| 274 | int "blink frequency" |
| 275 | range 2 10 |
| 276 | default 2 |
| 277 | help |
| 278 | The LED blink period calculated from LED_STATUS_FREQ5: |
| 279 | LED_STATUS_PERIOD5 = CONFIG_SYS_HZ/LED_STATUS_FREQ5 |
| 280 | Values range: 2 - 10 |
| 281 | |
| 282 | endif # LED_STATUS5 |
| 283 | |
| 284 | config LED_STATUS_BOOT_ENABLE |
| 285 | bool "Enable BOOT LED" |
| 286 | help |
| 287 | Enable to turn an LED on when the board is booting. |
| 288 | |
| 289 | if LED_STATUS_BOOT_ENABLE |
| 290 | |
| 291 | config LED_STATUS_BOOT |
| 292 | int "LED to light when the board is booting" |
| 293 | help |
| 294 | Valid enabled LED device number. |
| 295 | |
| 296 | endif # LED_STATUS_BOOT_ENABLE |
| 297 | |
| 298 | config LED_STATUS_RED_ENABLE |
| 299 | bool "Enable red LED" |
| 300 | help |
| 301 | Enable red status LED. |
| 302 | |
| 303 | if LED_STATUS_RED_ENABLE |
| 304 | |
| 305 | config LED_STATUS_RED |
| 306 | int "Red LED identification" |
| 307 | help |
| 308 | Valid enabled LED device number. |
| 309 | |
| 310 | endif # LED_STATUS_RED_ENABLE |
| 311 | |
| 312 | config LED_STATUS_YELLOW_ENABLE |
| 313 | bool "Enable yellow LED" |
| 314 | help |
| 315 | Enable yellow status LED. |
| 316 | |
| 317 | if LED_STATUS_YELLOW_ENABLE |
| 318 | |
| 319 | config LED_STATUS_YELLOW |
| 320 | int "Yellow LED identification" |
| 321 | help |
| 322 | Valid enabled LED device number. |
| 323 | |
| 324 | endif # LED_STATUS_YELLOW_ENABLE |
| 325 | |
| 326 | config LED_STATUS_BLUE_ENABLE |
| 327 | bool "Enable blue LED" |
| 328 | help |
| 329 | Enable blue status LED. |
| 330 | |
| 331 | if LED_STATUS_BLUE_ENABLE |
| 332 | |
| 333 | config LED_STATUS_BLUE |
| 334 | int "Blue LED identification" |
| 335 | help |
| 336 | Valid enabled LED device number. |
| 337 | |
| 338 | endif # LED_STATUS_BLUE_ENABLE |
| 339 | |
| 340 | config LED_STATUS_GREEN_ENABLE |
| 341 | bool "Enable green LED" |
| 342 | help |
| 343 | Enable green status LED. |
| 344 | |
| 345 | if LED_STATUS_GREEN_ENABLE |
| 346 | |
| 347 | config LED_STATUS_GREEN |
| 348 | int "Green LED identification" |
| 349 | help |
| 350 | Valid enabled LED device number (0-5). |
| 351 | |
| 352 | endif # LED_STATUS_GREEN_ENABLE |
| 353 | |
| 354 | config LED_STATUS_CMD |
| 355 | bool "Enable status LED commands" |
| 356 | |
| 357 | endif # LED_STATUS |
| 358 | |
Masahiro Yamada | cc85b7b | 2015-07-26 02:46:26 +0900 | [diff] [blame] | 359 | endmenu |