From 08ebe9fb54dcec58636a05ee13e92c2c96bd61a1 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 1 Jun 2013 18:45:18 +0200 Subject: [PATCH] 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. --- u-boot/common/cmd_recovery.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/u-boot/common/cmd_recovery.c b/u-boot/common/cmd_recovery.c index 108a86b4f3..4456cf8a0e 100644 --- a/u-boot/common/cmd_recovery.c +++ b/u-boot/common/cmd_recovery.c @@ -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]" );