diff options
author | Bill Richardson <wfrichar@chromium.org> | 2016-08-25 18:13:16 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2016-08-31 18:05:11 +0000 |
commit | 6c7fccf35674b09831dccd3ea8844990f041db8c (patch) | |
tree | e4d7dadd0fabc6ebcdd43e8f4b54fb52dc93b7e3 /chip/g | |
parent | 8c4421759d127f23d9745c6b495e5d69e171b9a6 (diff) | |
download | chrome-ec-6c7fccf35674b09831dccd3ea8844990f041db8c.tar.gz |
Cr50: Implement the console unlock dance
In order to disable the restricted console lock, the user has to
poke the power button repeatedly for some time. This CL
implements the logic to tell when this is happening, and whether
it is successful or not.
With this CL, unlocking only takes 10 seconds. This period will
be extended for production use. Right now we're just testing.
BUG=chrome-os-partner:55322
BUG=chrome-os-partner:55510
BRANCH=none
TEST=make buildall; test on cr50 hardware
At the console, run the "lock" command to see if it's already
disabled. If it is, run "lock enable" to lock it.
To unlock it, run "lock disable". A countdown will appear, after
which you will need to poke the Power button every 2 seconds for
10 seconds. If you do so, the console will be unlocked.
Change-Id: Ib5a94172080e627f3268d50d2587ec58bf8d9473
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/377621
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip/g')
-rw-r--r-- | chip/g/idle.c | 6 | ||||
-rw-r--r-- | chip/g/rbox.c | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/chip/g/idle.c b/chip/g/idle.c index f34525d8db..359902d94b 100644 --- a/chip/g/idle.c +++ b/chip/g/idle.c @@ -69,9 +69,15 @@ static void prepare_to_sleep(void) GR_PMU_EXITPD_MASK = GC_PMU_EXITPD_MASK_PIN_PD_EXIT_MASK | GC_PMU_EXITPD_MASK_RDD0_PD_EXIT_TIMER_MASK | + GC_PMU_EXITPD_MASK_RBOX_WAKEUP_MASK | GC_PMU_EXITPD_MASK_TIMELS0_PD_EXIT_TIMER0_MASK | GC_PMU_EXITPD_MASK_TIMELS0_PD_EXIT_TIMER1_MASK; + /* Clear the RBOX wakeup signal and status bits */ + GREG32(RBOX, WAKEUP) = GC_RBOX_WAKEUP_CLEAR_MASK; + /* Wake on RBOX interrupts */ + GREG32(RBOX, WAKEUP) = GC_RBOX_WAKEUP_ENABLE_MASK; + if (utmi_wakeup_is_enabled()) GR_PMU_EXITPD_MASK |= GC_PMU_EXITPD_MASK_UTMI_SUSPEND_N_MASK; diff --git a/chip/g/rbox.c b/chip/g/rbox.c index d4c01b27ce..85f83d33ce 100644 --- a/chip/g/rbox.c +++ b/chip/g/rbox.c @@ -22,9 +22,11 @@ static void rbox_init(void) /* Enable RBOX */ clock_enable_module(MODULE_RBOX, 1); - /* Clear existing interrupts */ - GWRITE(RBOX, WAKEUP_CLEAR, 1); - GWRITE(RBOX, WAKEUP_CLEAR, 0); - GWRITE(RBOX, INT_STATE, 1); + /* Clear any interrupt bits (write 1's to clear) */ + GREG32(RBOX, INT_STATE) = 0xffffffff; + + /* Clear any wakeup bits (write 0x2, then 0x0) */ + GREG32(RBOX, WAKEUP) = GC_RBOX_WAKEUP_CLEAR_MASK; + GREG32(RBOX, WAKEUP) = 0; } DECLARE_HOOK(HOOK_INIT, rbox_init, HOOK_PRIO_DEFAULT - 1); |