Commit 2d8d190c authored by Uri Mashiach's avatar Uri Mashiach Committed by Tom Rini

status_led: Kconfig migration

Move all of the status LED feature to drivers/led/Kconfig.
The LED status definitions were moved from the board configuration
files to the defconfig files.

TBD: Move all of the definitions in the include/status_led.h to the
relevant board's defconfig files.

Tested boards: CL-SOM-AM57x, CM-T335
Signed-off-by: default avatarUri Mashiach <uri.mashiach@compulab.co.il>
parent 79267edd
......@@ -9,16 +9,16 @@
#include <config.h>
#include <status_led.h>
static uint8_t saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF};
static uint32_t gpio_pin[2] = {1 << STATUS_LED_GREEN,
1 << STATUS_LED_RED};
static uint8_t saved_state[2] = {CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF};
static uint32_t gpio_pin[2] = {1 << CONFIG_LED_STATUS_GREEN,
1 << CONFIG_LED_STATUS_RED};
static inline void switch_LED_on(uint8_t led)
{
register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
writel(readl(&gpio->pedr) | gpio_pin[led], &gpio->pedr);
saved_state[led] = STATUS_LED_ON;
saved_state[led] = CONFIG_LED_STATUS_ON;
}
static inline void switch_LED_off(uint8_t led)
......@@ -26,27 +26,27 @@ static inline void switch_LED_off(uint8_t led)
register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
writel(readl(&gpio->pedr) & ~gpio_pin[led], &gpio->pedr);
saved_state[led] = STATUS_LED_OFF;
saved_state[led] = CONFIG_LED_STATUS_OFF;
}
void red_led_on(void)
{
switch_LED_on(STATUS_LED_RED);
switch_LED_on(CONFIG_LED_STATUS_RED);
}
void red_led_off(void)
{
switch_LED_off(STATUS_LED_RED);
switch_LED_off(CONFIG_LED_STATUS_RED);
}
void green_led_on(void)
{
switch_LED_on(STATUS_LED_GREEN);
switch_LED_on(CONFIG_LED_STATUS_GREEN);
}
void green_led_off(void)
{
switch_LED_off(STATUS_LED_GREEN);
switch_LED_off(CONFIG_LED_STATUS_GREEN);
}
void __led_init(led_id_t mask, int state)
......@@ -56,13 +56,14 @@ void __led_init(led_id_t mask, int state)
void __led_toggle(led_id_t mask)
{
if (STATUS_LED_RED == mask) {
if (STATUS_LED_ON == saved_state[STATUS_LED_RED])
if (CONFIG_LED_STATUS_RED == mask) {
if (CONFIG_LED_STATUS_ON == saved_state[CONFIG_LED_STATUS_RED])
red_led_off();
else
red_led_on();
} else if (STATUS_LED_GREEN == mask) {
if (STATUS_LED_ON == saved_state[STATUS_LED_GREEN])
} else if (CONFIG_LED_STATUS_GREEN == mask) {
if (CONFIG_LED_STATUS_ON ==
saved_state[CONFIG_LED_STATUS_GREEN])
green_led_off();
else
green_led_on();
......@@ -71,13 +72,13 @@ void __led_toggle(led_id_t mask)
void __led_set(led_id_t mask, int state)
{
if (STATUS_LED_RED == mask) {
if (STATUS_LED_ON == state)
if (CONFIG_LED_STATUS_RED == mask) {
if (CONFIG_LED_STATUS_ON == state)
red_led_on();
else
red_led_off();
} else if (STATUS_LED_GREEN == mask) {
if (STATUS_LED_ON == state)
} else if (CONFIG_LED_STATUS_GREEN == mask) {
if (CONFIG_LED_STATUS_ON == state)
green_led_on();
else
green_led_off();
......
......@@ -8,7 +8,7 @@
#define __ASM_STATUS_LED_H__
/* if not overridden */
#ifndef CONFIG_BOARD_SPECIFIC_LED
#ifndef CONFIG_LED_STATUS_BOARD_SPECIFIC
# if defined(CONFIG_8xx)
# include <mpc8xx.h>
# elif defined(CONFIG_MPC8260)
......@@ -34,12 +34,12 @@ static inline void __led_init (led_id_t mask, int state)
#endif
#if (STATUS_LED_ACTIVE == 0)
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
immr->STATUS_LED_DAT &= ~mask;
else
immr->STATUS_LED_DAT |= mask;
#else
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
immr->STATUS_LED_DAT |= mask;
else
immr->STATUS_LED_DAT &= ~mask;
......@@ -59,12 +59,12 @@ static inline void __led_set (led_id_t mask, int state)
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
#if (STATUS_LED_ACTIVE == 0)
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
immr->STATUS_LED_DAT &= ~mask;
else
immr->STATUS_LED_DAT |= mask;
#else
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
immr->STATUS_LED_DAT |= mask;
else
immr->STATUS_LED_DAT &= ~mask;
......
......@@ -11,7 +11,7 @@
#include <common.h>
#include <asm/processor.h>
#include <watchdog.h>
#ifdef CONFIG_STATUS_LED
#ifdef CONFIG_LED_STATUS
#include <status_led.h>
#endif
......@@ -112,9 +112,9 @@ void timer_interrupt (struct pt_regs *regs)
WATCHDOG_RESET ();
#endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
#ifdef CONFIG_STATUS_LED
#ifdef CONFIG_LED_STATUS
status_led_tick (timestamp);
#endif /* CONFIG_STATUS_LED */
#endif /* CONFIG_LED_STATUS */
#ifdef CONFIG_SHOW_ACTIVITY
board_show_activity (timestamp);
......
......@@ -174,7 +174,7 @@ void __led_init(led_id_t mask, int state)
void __led_set(led_id_t mask, int state)
{
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
MCFGPTA_GPTPORT |= (1 << 3);
else
MCFGPTA_GPTPORT &= ~(1 << 3);
......
......@@ -50,8 +50,8 @@ int misc_init_r(void)
#ifdef CONFIG_SHOW_BOOT_PROGRESS
#define STATUS_LED_OFF 0
#define STATUS_LED_ON 1
#define CONFIG_LED_STATUS_OFF 0
#define CONFIG_LED_STATUS_ON 1
static int gpio_setup;
......@@ -76,24 +76,30 @@ void show_boot_progress(int status)
{
switch (status) {
case BOOTSTAGE_ID_CHECK_MAGIC:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_ON);
stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF,
CONFIG_LED_STATUS_ON);
break;
case BOOTSTAGE_ID_CHECK_HEADER:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_OFF);
stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_ON,
CONFIG_LED_STATUS_OFF);
break;
case BOOTSTAGE_ID_CHECK_CHECKSUM:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_ON);
stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_ON,
CONFIG_LED_STATUS_ON);
break;
case BOOTSTAGE_ID_CHECK_ARCH:
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_OFF);
stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_OFF,
CONFIG_LED_STATUS_OFF);
break;
case BOOTSTAGE_ID_CHECK_IMAGETYPE:
case BOOTSTAGE_ID_DECOMP_IMAGE:
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_ON);
stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_OFF,
CONFIG_LED_STATUS_ON);
break;
case BOOTSTAGE_ID_KERNEL_LOADED:
case BOOTSTAGE_ID_CHECK_BOOT_OS:
stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_OFF);
stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_ON,
CONFIG_LED_STATUS_OFF);
break;
case BOOTSTAGE_ID_BOOT_OS_RETURNED:
case BOOTSTAGE_ID_RD_MAGIC:
......@@ -102,10 +108,12 @@ void show_boot_progress(int status)
case BOOTSTAGE_ID_RAMDISK:
case BOOTSTAGE_ID_NO_RAMDISK:
case BOOTSTAGE_ID_RUN_OS:
stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_OFF);
stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF,
CONFIG_LED_STATUS_OFF);
break;
default:
stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_ON);
stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_ON,
CONFIG_LED_STATUS_ON);
break;
}
}
......
......@@ -31,8 +31,8 @@ int board_init(void)
gpmc_init();
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_OFF);
#endif
return 0;
}
......
......@@ -92,8 +92,8 @@ int board_init(void)
/* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
#endif
return 0;
......
......@@ -89,8 +89,8 @@ int board_init(void)
/* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
#endif
cm_t3517_musb_init();
......
......@@ -23,16 +23,16 @@ void __led_init(led_id_t mask, int state)
void __led_toggle(led_id_t mask)
{
int toggle_gpio = 0;
#ifdef STATUS_LED_BIT
if (!toggle_gpio && STATUS_LED_BIT & mask)
#ifdef CONFIG_LED_STATUS0
if (!toggle_gpio && CONFIG_LED_STATUS_BIT & mask)
toggle_gpio = TRICORDER_STATUS_LED_GREEN;
#endif
#ifdef STATUS_LED_BIT1
if (!toggle_gpio && STATUS_LED_BIT1 & mask)
#ifdef CONFIG_LED_STATUS1
if (!toggle_gpio && CONFIG_LED_STATUS_BIT1 & mask)
toggle_gpio = TRICORDER_STATUS_LED_YELLOW;
#endif
#ifdef STATUS_LED_BIT2
if (!toggle_gpio && STATUS_LED_BIT2 & mask) {
#ifdef CONFIG_LED_STATUS2
if (!toggle_gpio && CONFIG_LED_STATUS_BIT2 & mask) {
uint8_t val;
twl4030_i2c_read_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN,
&val);
......@@ -51,23 +51,23 @@ void __led_toggle(led_id_t mask)
void __led_set(led_id_t mask, int state)
{
#ifdef STATUS_LED_BIT
if (STATUS_LED_BIT & mask) {
#ifdef CONFIG_LED_STATUS0
if (CONFIG_LED_STATUS_BIT & mask) {
gpio_request(TRICORDER_STATUS_LED_GREEN, "");
gpio_direction_output(TRICORDER_STATUS_LED_GREEN, 0);
gpio_set_value(TRICORDER_STATUS_LED_GREEN, state);
}
#endif
#ifdef STATUS_LED_BIT1
if (STATUS_LED_BIT1 & mask) {
#ifdef CONFIG_LED_STATUS1
if (CONFIG_LED_STATUS_BIT1 & mask) {
gpio_request(TRICORDER_STATUS_LED_YELLOW, "");
gpio_direction_output(TRICORDER_STATUS_LED_YELLOW, 0);
gpio_set_value(TRICORDER_STATUS_LED_YELLOW, state);
}
#endif
#ifdef STATUS_LED_BIT2
if (STATUS_LED_BIT2 & mask) {
if (STATUS_LED_OFF == state)
#ifdef CONFIG_LED_STATUS2
if (CONFIG_LED_STATUS_BIT2 & mask) {
if (CONFIG_LED_STATUS_OFF == state)
twl4030_i2c_write_u8(TWL4030_CHIP_LED,
TWL4030_LED_LEDEN, 0);
else
......
......@@ -120,9 +120,9 @@ int misc_init_r(void)
print_hwversion(&eeprom);
twl4030_power_init();
status_led_set(0, STATUS_LED_ON);
status_led_set(1, STATUS_LED_ON);
status_led_set(2, STATUS_LED_ON);
status_led_set(0, CONFIG_LED_STATUS_ON);
status_led_set(1, CONFIG_LED_STATUS_ON);
status_led_set(2, CONFIG_LED_STATUS_ON);
omap_die_id_display();
......
......@@ -69,8 +69,8 @@ int board_init(void)
/* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
#endif
return 0;
......
......@@ -15,9 +15,9 @@
#include <miiphy.h>
#include <libfdt.h>
#if defined(CONFIG_STATUS_LED)
#if defined(CONFIG_LED_STATUS)
#include <status_led.h>
#endif /* CONFIG_STATUS_LED */
#endif /* CONFIG_LED_STATUS */
/* Kollmorgen DPR initialization data */
struct init_elem {
......@@ -194,27 +194,46 @@ int ft_board_setup(void *blob, bd_t *bd)
#endif /* CONFIG_OF_BOARD_SETUP */
#if defined(CONFIG_STATUS_LED)
void __led_init(led_id_t regaddr, int state)
#if defined(CONFIG_LED_STATUS)
vu_long *regcode_to_regaddr(led_id_t regcode)
{
*((vu_long *) regaddr) |= ENABLE_GPIO_OUT;
/* GPT Enable and Mode Select Register address */
vu_long *reg_translate[] = {
(vu_long *)MPC5XXX_GPT6_ENABLE,
(vu_long *)MPC5XXX_GPT7_ENABLE,
};
if (ARRAY_SIZE(reg_translate) <= regcode)
return NULL;
return reg_translate[regcode];
}
void __led_init(led_id_t regcode, int state)
{
vu_long *regaddr = regcode_to_regaddr(regcode);
*regaddr |= ENABLE_GPIO_OUT;
if (state == STATUS_LED_ON)
if (state == CONFIG_LED_STATUS_ON)
*((vu_long *) regaddr) |= LED_ON;
else
*((vu_long *) regaddr) &= ~LED_ON;
}
void __led_set(led_id_t regaddr, int state)
void __led_set(led_id_t regcode, int state)
{
if (state == STATUS_LED_ON)
*((vu_long *) regaddr) |= LED_ON;
vu_long *regaddr = regcode_to_regaddr(regcode);
if (state == CONFIG_LED_STATUS_ON)
*regaddr |= LED_ON;
else
*((vu_long *) regaddr) &= ~LED_ON;
*regaddr &= ~LED_ON;
}
void __led_toggle(led_id_t regaddr)
void __led_toggle(led_id_t regcode)
{
*((vu_long *) regaddr) ^= LED_ON;
vu_long *regaddr = regcode_to_regaddr(regcode);
*regaddr ^= LED_ON;
}
#endif /* CONFIG_STATUS_LED */
#endif /* CONFIG_LED_STATUS */
......@@ -13,7 +13,7 @@
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
#ifdef CONFIG_STATUS_LED
#ifdef CONFIG_LED_STATUS
#include <status_led.h>
#endif
......@@ -72,8 +72,8 @@ int board_init(void)
/* Adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_STATE);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_STATE);
#endif
return 0;
......
......@@ -21,8 +21,8 @@ int board_late_init(void)
const unsigned int usb_nrst_gpio = 35;
int ret;
status_led_set(1, STATUS_LED_ON);
status_led_set(2, STATUS_LED_ON);
status_led_set(1, CONFIG_LED_STATUS_ON);
status_led_set(2, CONFIG_LED_STATUS_ON);
/* Address of boot parameters for ATAG (if ATAG is used) */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
......
......@@ -6,4 +6,4 @@
#
obj-y := beagle.o
obj-$(CONFIG_STATUS_LED) += led.o
obj-$(CONFIG_LED_STATUS) += led.o
......@@ -16,7 +16,7 @@
#include <common.h>
#include <dm.h>
#include <ns16550.h>
#ifdef CONFIG_STATUS_LED
#ifdef CONFIG_LED_STATUS
#include <status_led.h>
#endif
#include <twl4030.h>
......@@ -96,8 +96,8 @@ int board_init(void)
/* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
#endif
return 0;
......
......@@ -15,26 +15,26 @@
#define BEAGLE_LED_USR0 150
#define BEAGLE_LED_USR1 149
#ifdef STATUS_LED_GREEN
#ifdef CONFIG_LED_STATUS_GREEN
void green_led_off(void)
{
__led_set (STATUS_LED_GREEN, 0);
__led_set(CONFIG_LED_STATUS_GREEN, 0);
}
void green_led_on(void)
{
__led_set (STATUS_LED_GREEN, 1);
__led_set(CONFIG_LED_STATUS_GREEN, 1);
}
#endif
static int get_led_gpio(led_id_t mask)
{
#ifdef STATUS_LED_BIT
if (STATUS_LED_BIT & mask)
#ifdef CONFIG_LED_STATUS0
if (CONFIG_LED_STATUS_BIT & mask)
return BEAGLE_LED_USR0;
#endif
#ifdef STATUS_LED_BIT1
if (STATUS_LED_BIT1 & mask)
#ifdef CONFIG_LED_STATUS1
if (CONFIG_LED_STATUS_BIT1 & mask)
return BEAGLE_LED_USR1;
#endif
......
......@@ -78,7 +78,7 @@ obj-$(CONFIG_CMD_ITEST) += itest.o
obj-$(CONFIG_CMD_JFFS2) += jffs2.o
obj-$(CONFIG_CMD_CRAMFS) += cramfs.o
obj-$(CONFIG_CMD_LDRINFO) += ldrinfo.o
obj-$(CONFIG_CMD_LED) += led.o
obj-$(CONFIG_LED_STATUS_CMD) += led.o
obj-$(CONFIG_CMD_LICENSE) += license.o
obj-y += load.o
obj-$(CONFIG_LOGBUFFER) += log.o
......
......@@ -25,7 +25,7 @@
#include <ide.h>
#include <ata.h>
#ifdef CONFIG_STATUS_LED
#ifdef CONFIG_LED_STATUS
# include <status_led.h>
#endif
......
......@@ -26,37 +26,38 @@ struct led_tbl_s {
typedef struct led_tbl_s led_tbl_t;
static const led_tbl_t led_commands[] = {
#ifdef CONFIG_BOARD_SPECIFIC_LED
#ifdef STATUS_LED_BIT
{ "0", STATUS_LED_BIT, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS_BOARD_SPECIFIC
#ifdef CONFIG_LED_STATUS0
{ "0", CONFIG_LED_STATUS_BIT, NULL, NULL, NULL },
#endif
#ifdef STATUS_LED_BIT1
{ "1", STATUS_LED_BIT1, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS1
{ "1", CONFIG_LED_STATUS_BIT1, NULL, NULL, NULL },
#endif
#ifdef STATUS_LED_BIT2
{ "2", STATUS_LED_BIT2, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS2
{ "2", CONFIG_LED_STATUS_BIT2, NULL, NULL, NULL },
#endif
#ifdef STATUS_LED_BIT3
{ "3", STATUS_LED_BIT3, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS3
{ "3", CONFIG_LED_STATUS_BIT3, NULL, NULL, NULL },
#endif
#ifdef STATUS_LED_BIT4
{ "4", STATUS_LED_BIT4, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS4
{ "4", CONFIG_LED_STATUS_BIT4, NULL, NULL, NULL },
#endif
#ifdef STATUS_LED_BIT5
{ "5", STATUS_LED_BIT5, NULL, NULL, NULL },
#ifdef CONFIG_LED_STATUS5
{ "5", CONFIG_LED_STATUS_BIT5, NULL, NULL, NULL },
#endif
#endif
#ifdef STATUS_LED_GREEN
{ "green", STATUS_LED_GREEN, green_led_off, green_led_on, NULL },
#ifdef CONFIG_LED_STATUS_GREEN
{ "green", CONFIG_LED_STATUS_GREEN, green_led_off, green_led_on, NULL },
#endif
#ifdef STATUS_LED_YELLOW
{ "yellow", STATUS_LED_YELLOW, yellow_led_off, yellow_led_on, NULL },
#ifdef CONFIG_LED_STATUS_YELLOW
{ "yellow", CONFIG_LED_STATUS_YELLOW, yellow_led_off, yellow_led_on,
NULL },
#endif
#ifdef STATUS_LED_RED
{ "red", STATUS_LED_RED, red_led_off, red_led_on, NULL },
#ifdef CONFIG_LED_STATUS_RED
{ "red", CONFIG_LED_STATUS_RED, red_led_off, red_led_on, NULL },
#endif
#ifdef STATUS_LED_BLUE
{ "blue", STATUS_LED_BLUE, blue_led_off, blue_led_on, NULL },
#ifdef CONFIG_LED_STATUS_BLUE
{ "blue", CONFIG_LED_STATUS_BLUE, blue_led_off, blue_led_on, NULL },
#endif
{ NULL, 0, NULL, NULL, NULL }
};
......@@ -110,14 +111,14 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
led_commands[i].on();
else
__led_set(led_commands[i].mask,
STATUS_LED_ON);
CONFIG_LED_STATUS_ON);
break;
case LED_OFF:
if (led_commands[i].off)
led_commands[i].off();
else
__led_set(led_commands[i].mask,
STATUS_LED_OFF);
CONFIG_LED_STATUS_OFF);
break;
case LED_TOGGLE:
if (led_commands[i].toggle)
......@@ -149,36 +150,36 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD(
led, 4, 1, do_led,
"["
#ifdef CONFIG_BOARD_SPECIFIC_LED
#ifdef STATUS_LED_BIT
#ifdef CONFIG_LED_STATUS_BOARD_SPECIFIC
#ifdef CONFIG_LED_STATUS0
"0|"
#endif
#ifdef STATUS_LED_BIT1
#ifdef CONFIG_LED_STATUS1
"1|"
#endif
#ifdef STATUS_LED_BIT2
#ifdef CONFIG_LED_STATUS2
"2|"
#endif
#ifdef STATUS_LED_BIT3
#ifdef CONFIG_LED_STATUS3
"3|"
#endif
#ifdef STATUS_LED_BIT4
#ifdef CONFIG_LED_STATUS4
"4|"
#endif
#ifdef STATUS_LED_BIT5
#ifdef CONFIG_LED_STATUS5
"5|"
#endif
#endif
#ifdef STATUS_LED_GREEN
#ifdef CONFIG_LED_STATUS_GREEN
"green|"
#endif
#ifdef STATUS_LED_YELLOW
#ifdef CONFIG_LED_STATUS_YELLOW
"yellow|"
#endif
#ifdef STATUS_LED_RED
#ifdef CONFIG_LED_STATUS_RED
"red|"
#endif
#ifdef STATUS_LED_BLUE
#ifdef CONFIG_LED_STATUS_BLUE
"blue|"
#endif
"all] [on|off|toggle|blink] [blink-freq in ms]",
......
......@@ -596,11 +596,11 @@ static int initr_kgdb(void)
}
#endif
#if defined(CONFIG_STATUS_LED)
#if defined(CONFIG_LED_STATUS)
static int initr_status_led(void)
{
#if defined(STATUS_LED_BOOT)
status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
#if defined(CONFIG_LED_STATUS_BOOT)
status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING);
#else
status_led_init();
#endif
......@@ -907,7 +907,7 @@ init_fnc_t init_sequence_r[] = {
#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || defined(CONFIG_M68K)
timer_init, /* initialize timer */
#endif
#if defined(CONFIG_STATUS_LED)
#if defined(CONFIG_LED_STATUS)
initr_status_led,
#endif
/* PPC has a udelay(20) here dating from 2002. Why? */
......
......@@ -10,5 +10,12 @@ CONFIG_CMD_ASKENV=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_SNTP=y
CONFIG_CMD_EXT2=y
CONFIG_LED_STATUS=y
# CONFIG_LED_STATUS_BOARD_SPECIFIC is not set
CONFIG_LED_STATUS0=y
CONFIG_LED_STATUS_BIT=1
CONFIG_LED_STATUS_STATE=1
CONFIG_LED_STATUS_BOOT_ENABLE=y
CONFIG_LED_STATUS_BOOT=0
# CONFIG_PCI is not set
CONFIG_OF_LIBFDT=y
......@@ -10,5 +10,12 @@ CONFIG_CMD_ASKENV=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_SNTP=y
CONFIG_CMD_EXT2=y
CONFIG_LED_STATUS=y
# CONFIG_LED_STATUS_BOARD_SPECIFIC is not set
CONFIG_LED_STATUS0=y
CONFIG_LED_STATUS_BIT=1
CONFIG_LED_STATUS_STATE=1
CONFIG_LED_STATUS_BOOT_ENABLE=y
CONFIG_LED_STATUS_BOOT=0
# CONFIG_PCI is not set
CONFIG_OF_LIBFDT=y
......@@ -10,5 +10,12 @@ CONFIG_CMD_ASKENV=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_SNTP=y
CONFIG_CMD_EXT2=y
CONFIG_LED_STATUS=y
# CONFIG_LED_STATUS_BOARD_SPECIFIC is not set
CONFIG_LED_STATUS0=y
CONFIG_LED_STATUS_BIT=1
CONFIG_LED_STATUS_STATE=1
CONFIG_LED_STATUS_BOOT_ENABLE=y
CONFIG_LED_STATUS_BOOT=0
# CONFIG_PCI is not set
CONFIG_OF_LIBFDT=y
......@@ -10,5 +10,12 @@ CONFIG_CMD_ASKENV=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_SNTP=y