diff options
author | nagendra modadugu <ngm@google.com> | 2015-11-04 18:00:55 -0800 |
---|---|---|
committer | Nagendra Modadugu <ngm@google.com> | 2015-11-06 20:23:10 +0000 |
commit | e97da2f17c8eb188c09177b821521bebf5d830ea (patch) | |
tree | e5d64ab0f338499c384aad38eb5573b0e87de9bc /board/cr50 | |
parent | e99775311728eb01e47d5c5d29156f13842ca721 (diff) | |
download | chrome-ec-e97da2f17c8eb188c09177b821521bebf5d830ea.tar.gz |
Fix soft reboot to handle dropped permissions.
Permission registers only reset on power cycle,
so a soft reboot will fail unless a minimum power
cycle is performed.
BRANCH=none
BUG=chrome-os-partner:47289,chrome-os-partner:43025
TEST=hard / soft reboot from ec shell
Signed-off-by: nagendra modadugu <ngm@google.com>
Change-Id: I8f0f1bc80a2748b031a9b7a3715485577f2b5b3b
Reviewed-on: https://chromium-review.googlesource.com/310975
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Nagendra Modadugu <ngm@google.com>
Commit-Queue: Nagendra Modadugu <ngm@google.com>
Trybot-Ready: Nagendra Modadugu <ngm@google.com>
Diffstat (limited to 'board/cr50')
-rw-r--r-- | board/cr50/board.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index b90234d02d..972506e383 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -65,7 +65,25 @@ void button_event(enum gpio_signal signal) gpio_set_level(signal - GPIO_SW_N + GPIO_LED_4, v); } -static void init_interrutps(void) +static void init_pmu(void) +{ + /* This boot sequence may be a result of previous soft reset, + * in which case the PMU low power sequence register needs to + * be reset. */ + GREG32(PMU, LOW_POWER_DIS) = 0; +} + +static void init_timers(void) +{ + /* Cancel low speed timers that may have + * been initialized prior to soft reset. */ + GREG32(TIMELS, TIMER0_CONTROL) = 0; + GREG32(TIMELS, TIMER0_LOAD) = 0; + GREG32(TIMELS, TIMER1_CONTROL) = 0; + GREG32(TIMELS, TIMER1_LOAD) = 0; +} + +static void init_interrupts(void) { int i; static const enum gpio_signal gpio_signals[] = { @@ -113,7 +131,9 @@ static void init_runlevel(const enum permission_level desired_level) /* Initialize board. */ static void board_init(void) { - init_interrutps(); + init_pmu(); + init_timers(); + init_interrupts(); init_trng(); init_runlevel(PERMISSION_MEDIUM); } |