]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cm_t335: add support for status LED
authorIlya Ledvich <ilya@compulab.co.il>
Thu, 7 Nov 2013 05:57:34 +0000 (07:57 +0200)
committerTom Rini <trini@ti.com>
Wed, 4 Dec 2013 13:11:26 +0000 (08:11 -0500)
Add support for status LED. Use the STATUS_LED APIs for indicating a
boot progress.

Signed-off-by: Ilya Ledvich <ilya@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
board/compulab/cm_t335/cm_t335.c
board/compulab/cm_t335/mux.c
include/configs/cm_t335.h

index a3189628934d407f3ca8839fba384d4e67d91656..01019e8eb2fec00ef924c035bb2b70a8b9feb07c 100644 (file)
@@ -31,6 +31,9 @@ int board_init(void)
 
        gpmc_init();
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+       status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
+#endif
        return 0;
 }
 
index 998d30457e35d3d8cb78eafd34a51a9d79265985..7d2beb01e553acb0cc4258d47e89c4aede6516d2 100644 (file)
@@ -94,6 +94,11 @@ static struct module_pin_mux eth_phy_rst_pin_mux[] = {
        {-1},
 };
 
+static struct module_pin_mux status_led_pin_mux[] = {
+       {OFFSET(gpmc_csn3), (MODE(7) | PULLUDEN)},      /* GPIO2_0 */
+       {-1},
+};
+
 void set_uart_mux_conf(void)
 {
        configure_module_pin_mux(uart0_pin_mux);
@@ -108,4 +113,5 @@ void set_mux_conf_regs(void)
        configure_module_pin_mux(eth_phy_rst_pin_mux);
        configure_module_pin_mux(mmc0_pin_mux);
        configure_module_pin_mux(nand_pin_mux);
+       configure_module_pin_mux(status_led_pin_mux);
 }
index e4eba02addf70a8d84c3e2bb2f46ca1f365cc3f1..fbdead27946809cbf4b60869c1ced8a98bf53a12 100644 (file)
 /* GPIO pin + bank to pin ID mapping */
 #define GPIO_PIN(_bank, _pin)          ((_bank << 5) + _pin)
 
+/* Status LED */
+#define CONFIG_STATUS_LED
+#define CONFIG_GPIO_LED
+#define CONFIG_BOARD_SPECIFIC_LED
+#define STATUS_LED_BIT                 GPIO_PIN(2, 0)
+/* Status LED polarity is inversed, so init it in the "off" state */
+#define STATUS_LED_STATE               STATUS_LED_OFF
+#define STATUS_LED_PERIOD              (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT                        0
+
 #endif /* __CONFIG_CM_T335_H */