From 8ef6732b94148a39f8203cb3b4cf3388dc103199 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Fri, 10 May 2019 11:49:24 -0600 Subject: ec/google/wilco: Add support for KB_ERR_CODE to Wilco EC Adds support for the KB_ERR_CODE command on the Wilco EC. This command is used to drive diagnostic LEDs on the platform after a failed boot. This change also adds the Wilco EC mailbox command support to bootblock and verstage so that those stages can use the KB_ERR_CODE command. BUG=b:124401932 BRANCH=sarien TEST=build coreboot for sarien and arcada platforms Change-Id: I96d17baf57694e4e01c676d80c606f67054cd0c3 Signed-off-by: Keith Short Reviewed-on: https://review.coreboot.org/c/coreboot/+/32776 Reviewed-by: Duncan Laurie Tested-by: build bot (Jenkins) --- src/ec/google/wilco/commands.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/ec/google/wilco/commands.h') diff --git a/src/ec/google/wilco/commands.h b/src/ec/google/wilco/commands.h index 3077eee578..fafb7fd8ba 100644 --- a/src/ec/google/wilco/commands.h +++ b/src/ec/google/wilco/commands.h @@ -50,6 +50,8 @@ enum { KB_SLP_EN = 0x64, /* Inform the EC about BIOS boot progress */ KB_BIOS_PROGRESS = 0xc2, + /* Inform the EC that a fatal error occurred */ + KB_ERR_CODE = 0x7b, }; enum ec_ram_addr { @@ -86,6 +88,12 @@ enum ec_camera { CAMERA_OFF }; +enum ec_err_code { + DLED_MEMORY = 0x03, + DLED_PANEL = 0x10, + DLED_ROM = 0x19, +}; + /** * wilco_ec_radio_control() - Control wireless radios. * @ec_radio: Wireless radio type. @@ -310,4 +318,17 @@ enum ec_acpi_wake_events { */ int wilco_ec_signed_fw(void); +/** + * wilco_ec_err_code + * + * Send an error code to the EC to indicate a failed boot. The EC flashes the + * platform LED amber and white to provide user indication of the failure type. + * + * @err_code: Error code to send to the EC + * + * Returns 0 if EC command was successful + * Returns -1 if EC command failed + */ +int wilco_ec_err_code(enum ec_err_code err_code); + #endif /* EC_GOOGLE_WILCO_COMMANDS_H */ -- cgit v1.2.3