recovery: Make it possible to force the recovery
For factory flashing it is the easiest if we can force the recovery process. Parse the "force" from a potential second argument and then skip the timeout.
This commit is contained in:
parent
5a62024695
commit
14d69e34d1
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2012 sysmocom s.f.m.c. GmbH
|
||||
* Copyright (C) 2012, 2013 sysmocom s.f.m.c. GmbH
|
||||
* Author: Holger Hans Peter Freyther
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -93,13 +93,17 @@ static int do_run_recovery(cmd_tbl_t *cmdtp, int flag, int argc, const char *arg
|
|||
printf("Starting the recovery process.\n");
|
||||
|
||||
/* Wait a bit and check if the reset button is still pressed */
|
||||
run_command("sleep 5", 0);
|
||||
if (gpio_get_value(38) != 0) {
|
||||
printf("Recovery process aborted.\n");
|
||||
run_command("dhcp", 0);
|
||||
enable_netconsole();
|
||||
BLINK_LED(4);
|
||||
return 0;
|
||||
if (argc == 2 && strcmp(argv[1], "force") == 0) {
|
||||
printf("Forcing the recovery process.\n");
|
||||
} else {
|
||||
run_command("sleep 5", 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);
|
||||
|
@ -135,5 +139,6 @@ static int do_run_recovery(cmd_tbl_t *cmdtp, int flag, int argc, const char *arg
|
|||
|
||||
U_BOOT_CMD(
|
||||
run_recovery, CONFIG_SYS_MAXARGS, 1, do_run_recovery,
|
||||
"Run the sysmocom sysmoBTS recovery process", NULL
|
||||
"Run the sysmocom sysmoBTS recovery process",
|
||||
"[force]"
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue