summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-03-17 15:37:54 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-04-22 19:54:17 +0200
commit4e0de324ebf9c0586695901aed19b2d4545cf0c6 (patch)
tree9ce10d0f21d39defd2d698578e3c1e79a2426ce6 /src/mainboard
parent507a0cbff8815a9cb6a9b1b6521300516d6b5c2e (diff)
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 <pgeorgi@chromium.org> Original-Commit-Id: bdfff0e646283da6a2faaacf33e0179d2fea221c Original-Change-Id: Ie279151b6060a2888268a2e9a0d4dc22ecaba460 Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/260649 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9868 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/storm/chromeos.c14
1 files changed, 11 insertions, 3 deletions
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;