public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5 2/2] OMAP3: igep00x0: add boot status GPIO LED
@ 2012-12-27 13:36 Javier Martinez Canillas
  2012-12-27 14:25 ` Igor Grinberg
  2013-01-25 22:13 ` [U-Boot] [U-Boot, v5, " Tom Rini
  0 siblings, 2 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2012-12-27 13:36 UTC (permalink / raw)
  To: u-boot

This patch adds an GPIO LED boot status for IGEP boards.

The GPIO LED used is the red LED0 while the Linux kernel
uses the green LED0 as the boot status.

By using different GPIO LEDs, the user can know in which
step of the boot process the board currently is.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---

Changes since v4:
    - Since gpio_direction_output() sets the value, there is no need
      to call gpio_set_value() as suggested by Igor Grinberg.

Changes since v3:
    - Avoid code duplication but having a single show_boot_progress()
      function as suggested by Wolfgang Denk.

Changes since v2:
    - Use show_boot_progress() instead implementing yet another boot status
      signalling as suggested by Wolfgang Denk.

Changes since v1:
    - Don't set gd->bd->bi_arch_number since is done in arch/arm/lib/board.c
    - Use CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020 instead of check bi_arch_number
      as suggested by Igor Grinberg.

 board/isee/igep00x0/igep00x0.c |   13 +++++++++++++
 board/isee/igep00x0/igep00x0.h |    8 ++++++++
 include/configs/igep00x0.h     |    3 +++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index fe3522a..931416a 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -60,6 +60,19 @@ int board_init(void)
 	return 0;
 }
 
+#if defined(CONFIG_SHOW_BOOT_PROGRESS) && !defined(CONFIG_SPL_BUILD)
+void show_boot_progress(int val)
+{
+	if (val < 0) {
+		/* something went wrong */
+		return;
+	}
+
+	if (!gpio_request(IGEP00X0_GPIO_LED, ""))
+		gpio_direction_output(IGEP00X0_GPIO_LED, 1);
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: omap_rev_string
diff --git a/board/isee/igep00x0/igep00x0.h b/board/isee/igep00x0/igep00x0.h
index 3133e41..fefdb89 100644
--- a/board/isee/igep00x0/igep00x0.h
+++ b/board/isee/igep00x0/igep00x0.h
@@ -23,6 +23,14 @@
 #ifndef _IGEP00X0_H_
 #define _IGEP00X0_H_
 
+#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
+#define IGEP00X0_GPIO_LED 27
+#endif
+
+#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030)
+#define IGEP00X0_GPIO_LED 16
+#endif
+
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index 15e233b..47f637e 100644
--- a/include/configs/igep00x0.h
+++ b/include/configs/igep00x0.h
@@ -82,6 +82,9 @@
 #define CONFIG_OMAP_HSMMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/* define to enable boot progress via leds */
+#define CONFIG_SHOW_BOOT_PROGRESS
+
 /* USB */
 #define CONFIG_MUSB_UDC			1
 #define CONFIG_USB_OMAP3		1
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-25 22:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-27 13:36 [U-Boot] [PATCH v5 2/2] OMAP3: igep00x0: add boot status GPIO LED Javier Martinez Canillas
2012-12-27 14:25 ` Igor Grinberg
2013-01-10  9:43   ` Javier Martinez Canillas
2013-01-10 15:35     ` Tom Rini
2013-01-10 16:16       ` Javier Martinez Canillas
2013-01-10 17:26         ` Tom Rini
2013-01-10 19:26           ` Javier Martinez Canillas
2013-01-10 19:40             ` Tom Rini
2013-01-25 22:13 ` [U-Boot] [U-Boot, v5, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox