]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: cros_ec: Support EC_CMD_ENTERING_MODE emulation
authorSimon Glass <sjg@chromium.org>
Mon, 4 May 2015 17:31:09 +0000 (11:31 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 15 May 2015 00:49:34 +0000 (18:49 -0600)
Emualate this function which is used with Chrome OS verified boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/misc/cros_ec_sandbox.c
include/ec_commands.h

index df41e82bc9a91f90e8776b8b8b5e02b20e7df522..7509612fb8370d62482636deb86e82b22eb47e56 100644 (file)
@@ -459,6 +459,8 @@ static int process_cmd(struct ec_state *ec,
        case EC_CMD_MKBP_STATE:
                len = cros_ec_keyscan(ec, resp_data);
                break;
+       case EC_CMD_ENTERING_MODE:
+               break;
        default:
                printf("   ** Unknown EC command %#02x\n", req_hdr->command);
                return -1;
index 78baab1641afdfc1453992b356b4d62c055d1347..76050664372a9b0470519b576288a3734d268280 100644 (file)
@@ -1555,6 +1555,21 @@ struct ec_params_sb_wr_block {
        uint16_t data[32];
 } __packed;
 
+/*
+ * Entering Verified Boot Mode Command
+ * Default mode is VBOOT_MODE_NORMAL if EC did not receive this command.
+ * Valid Modes are: normal, developer, and recovery.
+ */
+#define EC_CMD_ENTERING_MODE 0xb6
+
+struct ec_params_entering_mode {
+       int vboot_mode;
+} __packed;
+
+#define VBOOT_MODE_NORMAL    0
+#define VBOOT_MODE_DEVELOPER 1
+#define VBOOT_MODE_RECOVERY  2
+
 /*****************************************************************************/
 /* System commands */