summaryrefslogtreecommitdiff
path: root/common/pmu_tps65090.c
diff options
context:
space:
mode:
authorCharlie Mooney <charliemooney@chromium.org>2012-08-31 11:31:12 -0700
committerGerrit <chrome-bot@google.com>2012-08-31 15:41:45 -0700
commit7d1ffde50818b6a0eb1ccb58f571a6f7bcd65a4c (patch)
tree42f71f912e2902d2fc33b61d7c90c303501da5bc /common/pmu_tps65090.c
parent96103ab32d9a2c4f6651c83e3993385ed346917a (diff)
downloadchrome-ec-7d1ffde50818b6a0eb1ccb58f571a6f7bcd65a4c.tar.gz
Snow: Dont hang when trying to pmic-reset board
Old Snow board (non-MP) don't have the capability to hard-reset their pmics unless they've been manually fixed to do so. This means that if you have an old board, with a new copy of the EC on it and it tries to hard-reset the system, it will hang forever and trigger the watchdog. Since there's no way for the EC to check if the hardware fix exists on its board, this adds a timeout after trying to reset. If the board has the fix, it will reset before the timeout expires. Otherwise, it will print a warning message before returning, to prevent it hanging. Additionally, it also fixes the places board_hard_reset() is called to deal with the new possibility of it returning. BUG=chrome-os-partner:13508 TEST=On a machine with the hardware rework and one without it, go to the EC console and run "pmu reset" to try and force a reset. The one with the fix should reset immediately, and the one without should warn you that it tried (and failed) to reset. BRANCH=snow Change-Id: I493122ee4da539f363a31f624ab9dd7db8068ec8 Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/32043 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/pmu_tps65090.c')
-rw-r--r--common/pmu_tps65090.c5
1 files changed, 4 insertions, 1 deletions
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;