diff --git a/u-boot/common/cmd_bootcycle.c b/u-boot/common/cmd_bootcycle.c index 368afc081b..323daa5803 100644 --- a/u-boot/common/cmd_bootcycle.c +++ b/u-boot/common/cmd_bootcycle.c @@ -82,6 +82,17 @@ int do_inccycle(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { /* report failure when we need to go to rescue */ int do_checkcycle(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { + uint32_t threshold = MAX_REBOOTS; + + if (argc == 2) { + int given_threshold = (int)simple_strtol(argv[1], NULL, 10); + if (given_threshold > 0) { + threshold = given_threshold; + } else { + printf("Ignoring invalid argument %s\n", argv[1]); + } + } + struct sram_boot_cycle *sram = (void *) SRAM_BOOT_CYCLE; /* when called we should ever have a valid boot cycle entry * if it's invalid we have most likely a broken bootloader or hw? */ @@ -100,8 +111,8 @@ int do_checkcycle(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - checkcycle, 1, 0, do_checkcycle, - "checkcycle - check if we need to boot rescue system\n", + checkcycle, 2, 0, do_checkcycle, + "checkcycle [max_reboots] - check if maximum reboots reached.\n", NULL );