summaryrefslogtreecommitdiff
path: root/chip/g/idle.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-08-25 18:13:16 -0700
committerBill Richardson <wfrichar@chromium.org>2016-08-31 18:05:11 +0000
commit6c7fccf35674b09831dccd3ea8844990f041db8c (patch)
treee4d7dadd0fabc6ebcdd43e8f4b54fb52dc93b7e3 /chip/g/idle.c
parent8c4421759d127f23d9745c6b495e5d69e171b9a6 (diff)
downloadchrome-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/idle.c')
-rw-r--r--chip/g/idle.c6
1 files changed, 6 insertions, 0 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;