mx23_olinuxino: Add support for status LED
authorOtavio Salvador <otavio@ossystems.com.br>
Sat, 23 Feb 2013 02:43:09 +0000 (02:43 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 7 Mar 2013 16:22:57 +0000 (17:22 +0100)
This allow user to know if the bootloader is running, even without a
serial console.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
board/olimex/mx23_olinuxino/mx23_olinuxino.c
board/olimex/mx23_olinuxino/spl_boot.c
include/configs/mx23_olinuxino.h

index 6a6053b3855584ddb2a1389d4c38aa5d787bb004..250141761309541e482b1ec180ebf6a93d48a883 100644 (file)
@@ -28,6 +28,9 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -67,5 +70,9 @@ 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);
+#endif
+
        return 0;
 }
index 7def8bc3e9a3304cf58f714eaa55b737ee476b40..3bbf5ad7a36ae3532a7d9f1d0d94cd49d22e506a 100644 (file)
@@ -84,6 +84,10 @@ const iomux_cfg_t iomux_setup[] = {
        MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
        MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
 
+       /* Green LED */
+       MX23_PAD_SSP1_DETECT__GPIO_2_1 |
+               (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL),
+
        /* MMC 0 */
        MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP,
        MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP,
index 7983c5d55f6de42750c4bfeef3124bf165c95014..d01994400a46d66f5c53cd13da7486daf4b793ed 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef __MX23_OLINUXINO_CONFIG_H__
 #define __MX23_OLINUXINO_CONFIG_H__
 
+#include <asm/arch/iomux-mx23.h>
+
 /*
  * SoC configurations
  */
@@ -56,6 +58,7 @@
 #define        CONFIG_CMD_EXT2
 #define        CONFIG_CMD_FAT
 #define        CONFIG_CMD_GPIO
+#define        CONFIG_CMD_LED
 #define        CONFIG_CMD_MMC
 
 /*
 #define        CONFIG_CONS_INDEX               0
 #define        CONFIG_BAUDRATE                 115200  /* Default baud rate */
 
+/*
+ * Status LED
+ */
+#define        CONFIG_STATUS_LED
+#define        CONFIG_GPIO_LED
+#define        CONFIG_BOARD_SPECIFIC_LED
+#define        STATUS_LED_BOOT 0
+#define        STATUS_LED_BIT  MX23_PAD_SSP1_DETECT__GPIO_2_1
+#define        STATUS_LED_STATE        STATUS_LED_ON
+#define        STATUS_LED_PERIOD       (CONFIG_SYS_HZ / 2)
+
 /*
  * MMC Driver
  */