OMAP3: igep00x0: Fix boot hang and add support for status LED.

Use the STATUS_LED APIs for indicating a boot progress instead of
show_boot_progress.

This patch also fixes a problem introduced with commit b3f4ca1135 (dm: omap3:
Move to driver model for GPIO and serial). After that commit the board doesn't
boot. Looks like the problem is the gpio_request call inside the function
show_boot_progress.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
This commit is contained in:
Enric Balletbo i Serra 2015-01-28 15:01:32 +01:00 committed by Tom Rini
parent 212324a9d4
commit f3b4bc458d
3 changed files with 19 additions and 25 deletions

View file

@ -5,6 +5,7 @@
* SPDX-License-Identifier: GPL-2.0+ * SPDX-License-Identifier: GPL-2.0+
*/ */
#include <common.h> #include <common.h>
#include <status_led.h>
#include <dm.h> #include <dm.h>
#include <ns16550.h> #include <ns16550.h>
#include <twl4030.h> #include <twl4030.h>
@ -53,22 +54,13 @@ int board_init(void)
/* boot param addr */ /* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); 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; 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 #ifdef CONFIG_SPL_BUILD
/* /*
* Routine: omap_rev_string * Routine: omap_rev_string

View file

@ -7,14 +7,6 @@
#ifndef _IGEP00X0_H_ #ifndef _IGEP00X0_H_
#define _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 = { const omap3_sysinfo sysinfo = {
DDR_STACKED, DDR_STACKED,
#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020) #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)

View file

@ -29,11 +29,21 @@
#define CONFIG_REVISION_TAG 1 #define CONFIG_REVISION_TAG 1
/* define to enable boot progress via leds */ /* Status LED */
#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020) || \ #define CONFIG_STATUS_LED
(CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030) #define CONFIG_BOARD_SPECIFIC_LED
#define CONFIG_SHOW_BOOT_PROGRESS #define CONFIG_GPIO_LED
#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
#define RED_LED_GPIO 27
#endif #endif
#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030)
#define RED_LED_GPIO 16
#endif
#define RED_LED_DEV 0
#define STATUS_LED_BIT RED_LED_GPIO
#define STATUS_LED_STATE STATUS_LED_ON
#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
#define STATUS_LED_BOOT RED_LED_DEV
/* GPIO banks */ /* GPIO banks */
#define CONFIG_OMAP3_GPIO_3 /* GPIO64 .. 95 is in GPIO bank 3 */ #define CONFIG_OMAP3_GPIO_3 /* GPIO64 .. 95 is in GPIO bank 3 */