summaryrefslogtreecommitdiff
path: root/src/ec/google/wilco
diff options
context:
space:
mode:
Diffstat (limited to 'src/ec/google/wilco')
-rw-r--r--src/ec/google/wilco/Makefile.inc3
-rw-r--r--src/ec/google/wilco/commands.c6
-rw-r--r--src/ec/google/wilco/commands.h21
3 files changed, 29 insertions, 1 deletions
diff --git a/src/ec/google/wilco/Makefile.inc b/src/ec/google/wilco/Makefile.inc
index 3a7790c097..f17869ecbc 100644
--- a/src/ec/google/wilco/Makefile.inc
+++ b/src/ec/google/wilco/Makefile.inc
@@ -1,6 +1,7 @@
ifeq ($(CONFIG_EC_GOOGLE_WILCO),y)
-bootblock-y += bootblock.c
+bootblock-y += bootblock.c commands.c mailbox.c
+verstage-y += commands.c mailbox.c
romstage-y += commands.c mailbox.c romstage.c boardid.c
ramstage-y += chip.c commands.c mailbox.c boardid.c
smm-y += commands.c mailbox.c smihandler.c boardid.c
diff --git a/src/ec/google/wilco/commands.c b/src/ec/google/wilco/commands.c
index d0d572d569..a97a28ecce 100644
--- a/src/ec/google/wilco/commands.c
+++ b/src/ec/google/wilco/commands.c
@@ -181,3 +181,9 @@ int wilco_ec_signed_fw(void)
CONFIG_EC_BASE_ACPI_DATA);
return !!ec_read(EC_RAM_SIGNED_FW);
}
+
+int wilco_ec_err_code(enum ec_err_code err_code)
+{
+ return wilco_ec_mailbox(WILCO_EC_MSG_DEFAULT, KB_ERR_CODE,
+ &err_code, 1, NULL, 0);
+}
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 */