blob: 94e552aa03d97b99eb499d3dc58d49487cdea9f2 [file] [log] [blame]
Tom Rix65fd21c2009-05-15 23:47:12 +02001Status LED
2========================================
3
4This README describes the status LED API.
5
6The API is defined by the include file include/status_led.h
7
8The first step is to define CONFIG_STATUS_LED in the board config file.
9
10If the LED support is only for a single board, define CONFIG_BOARD_SPECIFIC_LED
11in the board config file.
12
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020013At a minimum, these macros must be defined at
Tom Rix65fd21c2009-05-15 23:47:12 +020014STATUS_LED_BIT
15STATUS_LED_STATE
16STATUS_LED_PERIOD
17
18If there are multiple status LED's define
19STATUS_LED_BIT<n>
20STATUS_LED_STATE<n>
21STATUS_LED_PERIOD<n>
22
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020023Where <n> can a integer 1 through 3.
Tom Rix65fd21c2009-05-15 23:47:12 +020024
25STATUS_LED_BIT is passed into the __led_* functions to identify which LED is
26being acted on. As such, the value choose must be unique with with respect to
27the other STATUS_LED_BIT's. Mapping the value to a physical LED is the
28reponsiblity of the __led_* function.
29
30STATUS_LED_STATE is the initial state of the LED. It should be set to one of
31these values: STATUS_LED_OFF or STATUS_LED_ON.
32
33STATUS_LED_PERIOD is how long is the LED blink period. This usually set to
34(CONFIG_SYS_HZ / <N>) where <N> is the frequency of the blink. Typical values
35range from 2 to 10.
36
37Some other LED macros
38
39STATUS_LED_BOOT is the LED to light when the board is booting. This must be a
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020040valid STATUS_LED_BIT value.
Tom Rix65fd21c2009-05-15 23:47:12 +020041
42STATUS_LED_RED is the red LED. It is used signal errors. This must be a valid
43STATUS_LED_BIT value. Other similar color LED's are STATUS_LED_YELLOW and
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020044STATUS_LED_BLUE.
Tom Rix65fd21c2009-05-15 23:47:12 +020045
46These board must define these functions
47
48__led_init is called once to initialize the LED to STATUS_LED_STATE. One time
49start up code should be placed here.
50
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020051__led_set is called to change the state of the LED.
Tom Rix65fd21c2009-05-15 23:47:12 +020052
53__led_toggle is called to toggle the current state of the LED.
54
55Colour LED
56========================================
57
Wolfgang Denk8e5e9b92009-07-07 22:35:02 +020058Colour LED's are at present only used by ARM.
Tom Rix65fd21c2009-05-15 23:47:12 +020059
60The functions names explain their purpose.
61
62coloured_LED_init
63red_LED_on
64red_LED_off
65green_LED_on
66green_LED_off
67yellow_LED_on
68yellow_LED_off
69blue_LED_on
70blue_LED_off
71
72These are weakly defined in lib_arm/board.c to noops. Where applicable, define
73these functions in the board specific source.
74
75TBD : Describe older board dependent macros similar to what is done for
76CONFIG_TQM8xxL.
77
78TBD : Describe general support via asm/status_led.h