cmd_recovery: remove gpio and leds

This commit is contained in:
Alexander Couzens 2015-03-03 01:20:40 +01:00
parent c000ad0f7a
commit 613625ad89
1 changed files with 6 additions and 16 deletions

View File

@ -21,20 +21,10 @@
#include <common.h>
#include <command.h>
#include <status_led.h>
#include <asm-generic/gpio.h>
#include <asm/gpio.h>
#define BLINK_LED
#define BLINK_LED(LEN) \
do { \
int i; \
for (i = 0; i < LEN; ++i) { \
status_led_set(0, STATUS_LED_OFF); \
udelay(900); \
status_led_set(0, STATUS_LED_ON); \
} \
status_led_set(0, STATUS_LED_OFF); \
} while(0);
static int enable_netconsole(void)
{
printf("Enabling the network console.\n");
@ -89,7 +79,7 @@ static int do_run_recovery(cmd_tbl_t *cmdtp, int flag, int argc, const char *arg
{
int rc;
status_led_set(0, STATUS_LED_ON);
//status_led_set(0, STATUS_LED_ON);
printf("Starting the recovery process.\n");
/* Wait a bit and check if the reset button is still pressed */
@ -97,17 +87,17 @@ static int do_run_recovery(cmd_tbl_t *cmdtp, int flag, int argc, const char *arg
printf("Forcing the recovery process.\n");
} else {
run_command("sleep 5", 0);
if (gpio_get_value(38) != 0) {
//if (gpio_get_value(38) != 0) {
printf("Recovery process aborted.\n");
run_command("dhcp", 0);
enable_netconsole();
BLINK_LED(4);
return 0;
}
//}
}
BLINK_LED(5);
status_led_set(0, STATUS_LED_ON);
//status_led_set(0, STATUS_LED_ON);
rc = run_command("erase 0x9f040000 +0x10000", 0);
if (rc < 0)