From 4e0de324ebf9c0586695901aed19b2d4545cf0c6 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Tue, 17 Mar 2015 15:37:54 -0700 Subject: i2c/ww_ring: decouple LED display from vboot The patterns displayed on the LED ring while under the coreboot control are not driven by the vboot, but by the board code instead, The four distinct states of the LED display are: - all off - recovery button push detected, waiting for it to be released - wipeout request pending - recovery button was pushed long enough to trigger this request - recovery request pending - recovery button was pushed long enough to trigger this request. BRANCH=storm BUG=chrome-os-partner:36059 TEST=no functional changes Change-Id: I38d9a3028013b902a7a67ccd4eb1c5d533bf071c Signed-off-by: Patrick Georgi Original-Commit-Id: bdfff0e646283da6a2faaacf33e0179d2fea221c Original-Change-Id: Ie279151b6060a2888268a2e9a0d4dc22ecaba460 Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/260649 Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/9868 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/storm/chromeos.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mainboard/google/storm/chromeos.c') diff --git a/src/mainboard/google/storm/chromeos.c b/src/mainboard/google/storm/chromeos.c index d424f30842..044820640d 100644 --- a/src/mainboard/google/storm/chromeos.c +++ b/src/mainboard/google/storm/chromeos.c @@ -84,6 +84,12 @@ enum switch_state { wipeout_req }; +static void display_pattern(int pattern) +{ + if (board_id() == BOARD_ID_WHIRLWIND_SP5) + ww_ring_display_pattern(GSBI_ID_7, pattern); +} + #define WIPEOUT_MODE_DELAY_MS (8 * 1000) #define RECOVERY_MODE_EXTRA_DELAY_MS (8 * 1000) @@ -103,7 +109,9 @@ static enum switch_state get_switch_state(void) return saved_state; } + display_pattern(WWR_RECOVERY_PUSHED); printk(BIOS_INFO, "recovery button pressed\n"); + stopwatch_init_msecs_expire(&sw, WIPEOUT_MODE_DELAY_MS); do { @@ -113,9 +121,7 @@ static enum switch_state get_switch_state(void) } while (!stopwatch_expired(&sw)); if (sampled_value) { - if (board_id() == BOARD_ID_WHIRLWIND_SP5) - ww_ring_display_pattern(GSBI_ID_7, 0); - + display_pattern(WWR_WIPEOUT_REQUEST); printk(BIOS_INFO, "wipeout requested, checking recovery\n"); stopwatch_init_msecs_expire(&sw, RECOVERY_MODE_EXTRA_DELAY_MS); do { @@ -126,12 +132,14 @@ static enum switch_state get_switch_state(void) if (sampled_value) { saved_state = recovery_req; + display_pattern(WWR_RECOVERY_REQUEST); printk(BIOS_INFO, "recovery requested\n"); } else { saved_state = wipeout_req; } } else { saved_state = no_req; + display_pattern(WWR_ALL_OFF); } return saved_state; -- cgit v1.2.3