Skip to contentSkip to conversation

OMAP3: add boot status GPIO LED for IGEP boards

PATCH Superseded Javier Martinez Canillas 3 participants 5 messages Dec 23, 2012 – Dec 24, 2012

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 OMAP3: add boot status GPIO LED for IGEP boards

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.

---

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/Makefile   |    4 ++-
 board/isee/igep0020/igep0020.c |    7 +++++
 board/isee/igep0030/Makefile   |    4 ++-
 board/isee/igep0030/igep0030.c |    7 +++++
 board/isee/led.c               |   58 ++++++++++++++++++++++++++++++++++++++++
 include/configs/igep00x0.h     |   11 +++++++
 6 files changed, 89 insertions(+), 2 deletions(-)
 create mode 100644 board/isee/led.c
board/isee/igep0020/Makefile +3 -1
index 00463e1..5ead151 100644
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= igep0020.o
+COBJS-y := igep0020.o
+COBJS-$(CONFIG_STATUS_LED) += ../led.o
 
+COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
board/isee/igep0020/igep0020.c +7 -0
index a8257a3..c4fe138 100644
@@ -21,6 +21,9 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 #include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
@@ -55,6 +58,10 @@ int board_init(void)
 	/* boot param addr */
 	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+	status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
 	return 0;
 }
 
board/isee/igep0030/Makefile +3 -1
index cbc03d4..1ca011d 100644
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= igep0030.o
+COBJS-y := igep0030.o
+COBJS-$(CONFIG_STATUS_LED) += ../led.o
 
+COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
board/isee/igep0030/igep0030.c +7 -0
index 107cb7f..60dabcd 100644
@@ -21,6 +21,9 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mem.h>
@@ -42,6 +45,10 @@ int board_init(void)
 	/* boot param addr */
 	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+	status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
 	return 0;
 }
 
board/isee/led.c new file +58 -0

58 lines not on this page · raw message

include/configs/igep00x0.h +11 -0
index be7937d..a583be2 100644
@@ -82,6 +82,17 @@
 #define CONFIG_OMAP_HSMMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/* Status LED */
+#define CONFIG_STATUS_LED               1
+#define CONFIG_BOARD_SPECIFIC_LED       1
+#define STATUS_LED_BIT                  0x01
+#define STATUS_LED_STATE                STATUS_LED_ON
+#define STATUS_LED_PERIOD               (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BIT1                 0x02
+#define STATUS_LED_STATE1               STATUS_LED_ON
+#define STATUS_LED_PERIOD1              (CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT                 STATUS_LED_BIT
+
 /* USB */
 #define CONFIG_MUSB_UDC			1
 #define CONFIG_USB_OMAP3		1
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH v2 1/1 OMAP3: add boot status GPIO LED for IGEP boards

Quoted 9 lines · Javier Martinez Canillas

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.

Signature · 2 lines
Regards,
Igor.
#2 lore raw

PATCH v2 1/1 OMAP3: add boot status GPIO LED for IGEP boards

In reply to Javier Martinez Canillas

Dear Javier Martinez Canillas,

Quoted 9 lines · In message <1356265899-18669-1-git-send-email-javier.martinez@collabora.co.uk>…

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.

Do we really need yet another implementation of boot status signalling? I think no.

Please implement this a board specific version of the show_boot_progress() feature (see CONFIG_SHOW_BOOT_PROGRESS).

Thanks - and sorry, but NAK for this implementation.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There is nothing new under the sun, but there are lots of old things
we don't know yet."                                  - Ambrose Bierce
#3 lore raw

PATCH v2 1/1 OMAP3: add boot status GPIO LED for IGEP boards

Quoted 11 lines · Wolfgang Denk

Dear Javier Martinez Canillas,

Quoted 8 lines · In message <1356265899-18669-1-git-send-email-javier.martinez@collabora.co.uk>…

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.

Quoted 7 lines
Quoted 1 line

Do we really need yet another implementation of boot status signalling? I think no.

Please implement this a board specific version of the show_boot_progress() feature (see CONFIG_SHOW_BOOT_PROGRESS).

That sounds reasonable.
Although, I don't know if there are appropriate check points implemented, but certainly, that is the way to go.

Signature · 2 lines
Regards,
Igor.
#4 lore raw

PATCH v2 1/1 OMAP3: add boot status GPIO LED for IGEP boards

In reply to Wolfgang Denk
Quoted 2 lines · Wolfgang Denk

Dear Javier Martinez Canillas,

Hello Wolfgang,

Thanks a lot for your feedback.

Quoted 9 lines
Quoted 8 lines · In message <1356265899-18669-1-git-send-email-javier.martinez@collabora.co.uk>…

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.

Quoted 8 lines
Quoted 1 line

Do we really need yet another implementation of boot status signalling? I think no.

Please implement this a board specific version of the show_boot_progress() feature (see CONFIG_SHOW_BOOT_PROGRESS).

ok, I wasn't aware of the CONFIG_SHOW_BOOT_PROGRESS infrastructure and thought that CONFIG_STATUS_LED was the way to go.

Quoted 2 lines

Thanks - and sorry, but NAK for this implementation.

ok, I'll send a v3 using show_boot_progress().

Quoted 4 lines

Best regards,

Wolfgang Denk

Thanks a lot and merry christmas!
Javier