diff mbox

[U-Boot,2/3] cm_t335: add support for status LED

Message ID 1383803855-12256-3-git-send-email-ilya@compulab.co.il
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Ilya Ledvich Nov. 7, 2013, 5:57 a.m. UTC
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 |    3 +++
 board/compulab/cm_t335/mux.c     |    6 ++++++
 include/configs/cm_t335.h        |   10 ++++++++++
 3 files changed, 19 insertions(+)

Comments

Tom Rini Dec. 4, 2013, 10:03 p.m. UTC | #1
On Thu, Nov 07, 2013 at 07:57:34AM +0200, Ilya Ledvich wrote:

> 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>

Applied to u-boot-ti/master, thanks!
diff mbox

Patch

diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c
index a318962..01019e8 100644
--- a/board/compulab/cm_t335/cm_t335.c
+++ b/board/compulab/cm_t335/cm_t335.c
@@ -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;
 }
 
diff --git a/board/compulab/cm_t335/mux.c b/board/compulab/cm_t335/mux.c
index 998d304..7d2beb0 100644
--- a/board/compulab/cm_t335/mux.c
+++ b/board/compulab/cm_t335/mux.c
@@ -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);
 }
diff --git a/include/configs/cm_t335.h b/include/configs/cm_t335.h
index e4eba02..fbdead2 100644
--- a/include/configs/cm_t335.h
+++ b/include/configs/cm_t335.h
@@ -156,5 +156,15 @@ 
 /* 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 */