diff options
-rw-r--r-- | board/fizz/ec.tasklist | 2 | ||||
-rw-r--r-- | common/vboot/vboot.c | 19 | ||||
-rw-r--r-- | include/ec_commands.h | 7 |
3 files changed, 27 insertions, 1 deletions
diff --git a/board/fizz/ec.tasklist b/board/fizz/ec.tasklist index b60ae990a7..55b3f9bc0f 100644 --- a/board/fizz/ec.tasklist +++ b/board/fizz/ec.tasklist @@ -25,7 +25,7 @@ /* Larger stack for RW verification (i.e. sha256, rsa) */ \ TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(HOSTCMD, host_command_task, NULL, 2048) \ TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/common/vboot/vboot.c b/common/vboot/vboot.c index d8f12f6a98..47cf1aa10a 100644 --- a/common/vboot/vboot.c +++ b/common/vboot/vboot.c @@ -111,6 +111,25 @@ static int verify_slot(enum system_image_copy_t slot) return EC_SUCCESS; } +static int hc_verify_slot(struct host_cmd_handler_args *args) +{ + const struct ec_params_efs_verify *p = args->params; + enum system_image_copy_t slot; + + switch (p->region) { + case EC_FLASH_REGION_ACTIVE: + slot = system_get_active_copy(); + break; + case EC_FLASH_REGION_UPDATE: + slot = system_get_update_copy(); + break; + default: + return EC_RES_INVALID_PARAM; + } + return verify_slot(slot) ? EC_RES_ERROR : EC_RES_SUCCESS; +} +DECLARE_HOST_COMMAND(EC_CMD_EFS_VERIFY, hc_verify_slot, EC_VER_MASK(0)); + static int verify_and_jump(void) { enum system_image_copy_t slot; diff --git a/include/ec_commands.h b/include/ec_commands.h index e4ba2d0b96..189618731a 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -4561,6 +4561,13 @@ struct __ec_align4 ec_params_rwsig_action { uint32_t action; }; +/* Run verification on a slot */ +#define EC_CMD_EFS_VERIFY 0x011E + +struct __ec_align1 ec_params_efs_verify { + uint8_t region; /* enum ec_flash_region */ +}; + /*****************************************************************************/ /* The command range 0x200-0x2FF is reserved for Rotor. */ |