diff options
-rw-r--r-- | board/snow/board.c | 11 | ||||
-rw-r--r-- | common/pmu_tps65090.c | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/board/snow/board.c b/board/snow/board.c index 7ca50704a5..14c7277a71 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -25,6 +25,8 @@ #define INT_BOTH_FLOATING (GPIO_INPUT | GPIO_INT_BOTH) #define INT_BOTH_PULL_UP (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) +#define HARD_RESET_TIMEOUT_MS 5 + /* GPIO interrupt handlers prototypes */ #ifndef CONFIG_TASK_GAIAPOWER #define gaia_power_event NULL @@ -305,9 +307,12 @@ void board_hard_reset(void) { /* Force a hard reset of tps Chrome */ gpio_set_level(GPIO_PMIC_RESET, 1); - /* Hang until the power is cut */ - while (1) - ; + + /* Delay while the power is cut */ + udelay(HARD_RESET_TIMEOUT_MS * 1000); + + /* Shouldn't get here unless the board doesn't have this capability */ + panic_puts("Hard reset failed! (this board may not be capable)\n"); } #ifdef CONFIG_PMU_BOARD_INIT diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c index faba493fb4..3af89ad5bb 100644 --- a/common/pmu_tps65090.c +++ b/common/pmu_tps65090.c @@ -561,8 +561,11 @@ static int command_pmu(int argc, char **argv) if (argc > 1) { repeat = strtoi(argv[1], &e, 0); if (*e) { - if (strlen(argv[1]) >= 1 && argv[1][0] == 'r') + if (strlen(argv[1]) >= 1 && argv[1][0] == 'r') { board_hard_reset(); + /* If this returns, there was an error */ + return EC_ERROR_UNKNOWN; + } ccputs("Invalid repeat count\n"); return EC_ERROR_INVAL; |