[U-Boot] [PATCH v3 1/1] OMAP3: add boot status GPIO LED for IGEP boards
Javier Martinez Canillas
javier at dowhile0.org
Wed Dec 26 04:20:01 CET 2012
On Tue, Dec 25, 2012 at 8:57 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Javier Martinez Canillas,
>
Hello Wolfang,
Thanks a lot for your suggestions.
> 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.
>
Yes, in fact I'm going to send a patch that removes the code
duplication between igep0020 and igep0030 by using a single board file
for both devices and a following patch that adds a single GPIO LED
support function for both boards.
> Thanks.
>
> Best regards,
>
> Wolfgang Denk
>
Thanks a lot and best regards,
Javier
More information about the U-Boot
mailing list