[U-Boot] [PATCH v3 1/1] OMAP3: add boot status GPIO LED for IGEP boards

Javier Martinez Canillas javier at dowhile0.org
Mon Dec 24 12:51:36 CET 2012


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 at collabora.co.uk>
---

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/igep0020/igep0020.c |   15 +++++++++++++++
 board/isee/igep0020/igep0020.h |    2 ++
 board/isee/igep0030/igep0030.c |   15 +++++++++++++++
 board/isee/igep0030/igep0030.h |    2 ++
 include/configs/igep00x0.h     |    3 +++
 5 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/board/isee/igep0020/igep0020.c b/board/isee/igep0020/igep0020.c
index a8257a3..5b6afa9 100644
--- a/board/isee/igep0020/igep0020.c
+++ b/board/isee/igep0020/igep0020.c
@@ -58,6 +58,21 @@ 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(IGEP0020_GPIO_LED, "")) {
+		gpio_direction_output(IGEP0020_GPIO_LED, 0);
+		gpio_set_value(IGEP0020_GPIO_LED, 1);
+	}
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: omap_rev_string
diff --git a/board/isee/igep0020/igep0020.h b/board/isee/igep0020/igep0020.h
index 3335ecc..1958bdd 100644
--- a/board/isee/igep0020/igep0020.h
+++ b/board/isee/igep0020/igep0020.h
@@ -23,6 +23,8 @@
 #ifndef _IGEP0020_H_
 #define _IGEP0020_H_
 
+#define IGEP0020_GPIO_LED   27
+
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 	"IGEP v2 board",
diff --git a/board/isee/igep0030/igep0030.c b/board/isee/igep0030/igep0030.c
index 107cb7f..91aff8c 100644
--- a/board/isee/igep0030/igep0030.c
+++ b/board/isee/igep0030/igep0030.c
@@ -45,6 +45,21 @@ 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(IGEP0030_GPIO_LED, "")) {
+		gpio_direction_output(IGEP0030_GPIO_LED, 0);
+		gpio_set_value(IGEP0030_GPIO_LED, 1);
+	}
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: omap_rev_string
diff --git a/board/isee/igep0030/igep0030.h b/board/isee/igep0030/igep0030.h
index a93339d..42c2d9c 100644
--- a/board/isee/igep0030/igep0030.h
+++ b/board/isee/igep0030/igep0030.h
@@ -23,6 +23,8 @@
 #ifndef _IGEP0030_H_
 #define _IGEP0030_H_
 
+#define IGEP0030_GPIO_LED 16
+
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 	"OMAP3 IGEP module",
diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index be7937d..07b1d3a 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



More information about the U-Boot mailing list