From: Mathias Kresin Date: Sat, 21 May 2016 10:13:38 +0000 (+0200) Subject: uboot-lantiq: VGV7510KW22 - use leds to indicate boot status X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=382282eca922e106f5b01597e4676bab8c7176db;p=librecmc%2Flibrecmc.git uboot-lantiq: VGV7510KW22 - use leds to indicate boot status Switch on the red power led if kernel image can't be loaded. Otherwise switch the green led on. Signed-off-by: Mathias Kresin --- diff --git a/package/boot/uboot-lantiq/patches/0112-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch b/package/boot/uboot-lantiq/patches/0112-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch index b532f410f9..e46d374dc0 100644 --- a/package/boot/uboot-lantiq/patches/0112-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch +++ b/package/boot/uboot-lantiq/patches/0112-MIPS-add-board-support-for-Arcadyan-VGV7510KW22.patch @@ -30,7 +30,7 @@ +######################################################################### --- /dev/null +++ b/board/arcadyan/vgv7510kw22/vgv7510kw22.c -@@ -0,0 +1,98 @@ +@@ -0,0 +1,120 @@ +/* + * Copyright (C) 2015 Martin Blumenstingl + * @@ -63,11 +63,15 @@ +#endif + +#define GPIO_POWER_GREEN 14 ++#define GPIO_POWER_RED 28 + +static void gpio_init(void) +{ + /* Turn on the green power LED */ + gpio_direction_output(GPIO_POWER_GREEN, 0); ++ ++ /* Turn off the red power LED */ ++ gpio_direction_output(GPIO_POWER_RED, 1); +} + +int board_early_init_f(void) @@ -92,6 +96,24 @@ + return 0; +} + ++void show_boot_progress(int arg) ++{ ++ if (!do_gpio_init) ++ return 0; ++ ++ if (arg >= 0) { ++ /* Success - turn off the red power LED and turn on the green power LED */ ++ gpio_set_value(GPIO_POWER_RED, 1); ++ gpio_set_value(GPIO_POWER_GREEN, 0); ++ } else { ++ /* Failure - turn off green power LED and turn on red power LED */ ++ gpio_set_value(GPIO_POWER_GREEN, 1); ++ gpio_set_value(GPIO_POWER_RED, 0); ++ } ++ ++ return 0; ++} ++ +static const struct ltq_eth_port_config eth_port_config[] = { + /* unused */ + { 0, 0x0, LTQ_ETH_PORT_NONE, PHY_INTERFACE_MODE_NONE },