diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2013-07-29 11:38:14 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-29 14:04:10 -0700 |
commit | 2e9d175ed13c18209ff17d498fd6d06f5c6024ae (patch) | |
tree | e9445704f7da528a9d15c70d5efb951d8080b80d | |
parent | e42e81e7eb0474b89198277c59e704ded24b99d4 (diff) | |
download | chrome-ec-2e9d175ed13c18209ff17d498fd6d06f5c6024ae.tar.gz |
spring: record TPS65090 reset
When we are doing a TPS65090 hard reset to recover from a bad situation,
we record a bit in the backup memory.
This information will be available in the chip revision information,
it will return "TPSRESET" if the bit has been flipped.
The bit is never cleared, but the "scratchpad" command is now activated
on the EC console : doing "scratchpad 0" on the EC serial port will
reset it.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:21107
TEST=on Spring, run "ectool chipinfo | grep revision"
before and after having run "pmu reset" on the EC console.
Change-Id: I9ebdeba59b978cd974b0ec268cba698b8cab0bf9
Reviewed-on: https://gerrit.chromium.org/gerrit/63608
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/spring/board.c | 4 | ||||
-rw-r--r-- | board/spring/board.h | 3 | ||||
-rw-r--r-- | chip/stm32/system.c | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/board/spring/board.c b/board/spring/board.c index be25f59d86..0e6c66cc9f 100644 --- a/board/spring/board.c +++ b/board/spring/board.c @@ -19,6 +19,7 @@ #include "registers.h" #include "smart_battery.h" #include "stm32_adc.h" +#include "system.h" #include "timer.h" #include "util.h" @@ -247,6 +248,9 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_shutdown_hook, HOOK_PRIO_DEFAULT); */ void board_hard_reset(void) { + /* record the TPS65090 reset in a backup register */ + system_set_scratchpad(system_get_scratchpad() | 0x8000); + /* Force a hard reset of tps Chrome */ gpio_set_level(GPIO_PMIC_RESET, 1); diff --git a/board/spring/board.h b/board/spring/board.h index baee52d947..440a7d27c9 100644 --- a/board/spring/board.h +++ b/board/spring/board.h @@ -47,6 +47,9 @@ /* Smart battery and TPSchrome are on a private I2C bus behind the EC */ #define CONFIG_I2C_PASSTHROUGH +/* allow to reset scratchpad from the EC command-line */ +#define CONFIG_CMD_SCRATCHPAD + #ifndef __ASSEMBLER__ /* By default, enable all console messages except keyboard */ diff --git a/chip/stm32/system.c b/chip/stm32/system.c index e89c024d12..ebf9109e4b 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -248,7 +248,11 @@ const char *system_get_chip_name(void) const char *system_get_chip_revision(void) { - return ""; + uint32_t has_reset = system_get_scratchpad() & 0x8000; + if (has_reset) + return "TPSRESET"; + else + return ""; } int system_get_vbnvcontext(uint8_t *block) |