From 6c7fccf35674b09831dccd3ea8844990f041db8c Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 25 Aug 2016 18:13:16 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/377621 Reviewed-by: Mary Ruthven --- chip/g/idle.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chip/g/idle.c') 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; -- cgit v1.2.1