From 206476570d8d025710cee7624da361c8af0e9204 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Wed, 4 Apr 2012 12:16:14 -0700 Subject: [PATCH] Only check for recovery key if reset was triggered by reset pin Signed-off-by: Randall Spangler BUG=chrome-os-partner:8573 TEST=manual 1) Hold down refresh key and type 'reboot' from EC console. Console should not show "[KB recovery key pressed at init!]" 2) Press power+esc+refresh. Console SHOULD show the message. 3) Press power+esc. Console should NOT show the message. Change-Id: I642a7667b81c8d90c9490b23ce0f3519364427e4 --- chip/lm4/keyboard_scan.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chip/lm4/keyboard_scan.c b/chip/lm4/keyboard_scan.c index 380c9c4974..0387f93435 100644 --- a/chip/lm4/keyboard_scan.c +++ b/chip/lm4/keyboard_scan.c @@ -13,6 +13,7 @@ #include "lpc.h" #endif #include "registers.h" +#include "system.h" #include "task.h" #include "timer.h" #include "uart.h" @@ -355,9 +356,13 @@ int keyboard_scan_init(void) * key mask properly */ actual_key_mask = actual_key_masks[0]; - /* Initialize raw state and check if the recovery key is pressed. */ + /* Initialize raw state */ update_key_state(); - recovery_key_pressed = check_recovery_key(); + + /* If we're booting due to a reset-pin-caused reset, check if the + * recovery key is pressed. */ + if (system_get_reset_cause() == SYSTEM_RESET_RESET_PIN) + recovery_key_pressed = check_recovery_key(); return EC_SUCCESS; }