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 <dev@kresin.me>
This commit is contained in:
Mathias Kresin 2016-05-21 12:13:38 +02:00 committed by John Crispin
parent 9e8edcff99
commit 382282eca9

View File

@ -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 <martin.blumenstingl@googlemail.com>
+ *
@ -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 },