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

Wolfgang Denk wd at denx.de
Tue Dec 25 20:57:24 CET 2012


Dear Javier Martinez Canillas,

In message <1356349896-11693-1-git-send-email-javier.martinez at collabora.co.uk> you wrote:
> 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>
...
> --- a/board/isee/igep0020/igep0020.c
> +++ b/board/isee/igep0020/igep0020.c
...
> +#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
...
> --- a/board/isee/igep0030/igep0030.c
> +++ b/board/isee/igep0030/igep0030.c
...
> +#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

Can we not avoid duplicating this code?   If you change
IGEP0020_GPIO_LED and IGEP0030_GPIO_LED into some common name like
IGEP00XX_GPIO_LED, you can use common code for all such boards.

Thanks.

Best regards,

Wolfgang Denk

-- 
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
Whenever people agree with me, I always think I must be wrong.
- Oscar Wilde


More information about the U-Boot mailing list