summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-09-25 14:53:55 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-09-29 11:24:37 -0700
commit48e38cc3707ad7ce174c29d52b009376eac5d1e9 (patch)
treee98e713cebe74a50353ca41b2adfbe6b68dd72bf
parent95c0393a67113cac466888c2c70ffd553bb6f6ee (diff)
downloadchrome-ec-48e38cc3707ad7ce174c29d52b009376eac5d1e9.tar.gz
Fizz: Show critical error on LED for recovery request
Fizz EC verifies RW by itself and jumps to RW before AP boots. If this fails, the system needs recovery. Since EC isn't capable of showing any info on a display, we use the power LED to inform the user. BUG=b:66914368 BRANCH=none TEST=Make Fizz fail RW verification. Observe LED illuminates in red. Change-Id: Ia07de60a316b40e74b1917903996d78750b4ae43 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/683218
-rw-r--r--board/fizz/board.h1
-rw-r--r--board/fizz/led.c11
-rw-r--r--common/vboot/vboot.c2
3 files changed, 12 insertions, 2 deletions
diff --git a/board/fizz/board.h b/board/fizz/board.h
index ea663ba6ec..dbfd7b2f04 100644
--- a/board/fizz/board.h
+++ b/board/fizz/board.h
@@ -232,6 +232,7 @@ void board_reset_pd_mcu(void);
void board_set_tcpc_power_mode(int port, int mode);
int board_get_battery_soc(void);
void led_alert(int enable);
+void led_critical(void);
#endif /* !__ASSEMBLER__ */
diff --git a/board/fizz/led.c b/board/fizz/led.c
index 6bd0796b3e..f7f5de3988 100644
--- a/board/fizz/led.c
+++ b/board/fizz/led.c
@@ -174,6 +174,13 @@ void led_alert(int enable)
}
}
+void led_critical(void)
+{
+ hook_call_deferred(&led_tick_data, -1);
+ if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED))
+ set_color(EC_LED_ID_POWER_LED, LED_RED, 100);
+}
+
static int command_led(int argc, char **argv)
{
enum ec_led_id id = EC_LED_ID_POWER_LED;
@@ -194,13 +201,15 @@ static int command_led(int argc, char **argv)
set_color(id, LED_AMBER, 100);
} else if (!strcasecmp(argv[1], "alert")) {
led_alert(1);
+ } else if (!strcasecmp(argv[1], "crit")) {
+ led_critical();
} else {
return EC_ERROR_PARAM1;
}
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(led, command_led,
- "[debug|red|green|amber|off|alert]",
+ "[debug|red|green|amber|off|alert|crit]",
"Turn on/off LED.");
void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
diff --git a/common/vboot/vboot.c b/common/vboot/vboot.c
index c645d7b4f9..d8f12f6a98 100644
--- a/common/vboot/vboot.c
+++ b/common/vboot/vboot.c
@@ -154,8 +154,8 @@ static void request_power(void)
static void request_recovery(void)
{
- /* TODO(crosbug.com/p/37646390): Blink LED */
CPRINTS("%s", __func__);
+ led_critical();
}
static int is_manual_recovery(void)