diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-08-15 16:34:52 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-09-12 01:11:59 -0700 |
commit | 4dcee1c545c31d288b23221d8e07bc452214ce7b (patch) | |
tree | 1ddab11d51dcd5c0571f6f777b655ba333cd84e6 /include/flash.h | |
parent | a52cfbc80c060d9883aee9de4e764e0b250d184a (diff) | |
download | chrome-ec-4dcee1c545c31d288b23221d8e07bc452214ce7b.tar.gz |
EFS: Add support for early firmware selection
Chromebox ECs performs EFS: verifying firmware before the AP boots.
This patch updates host commands which are required for the EFS.
The change includes:
* Update EC_CMD_FLASH_REGION_INFO to accept EC_FLASH_REGION_UPDATE
* Update EC_CMD_VBOOT_HASH to accept EC_VBOOT_HASH_OFFSET_UPDATE
When EC_FLASHS_REGION_UPDATE is specified, EC_CMD_FLASH_REGION_INFO
returns the slot which currently is not hosting a running RW copy.
When EC_VBOOT_HASH_OFFSET_UPDATE is specified, EC_CMD_VBOOT_HASH
computs the hash of the update slot. This hash covers the entire
region, including the signature at the end.
This patch undefines CONFIG_CMD_USBMUX and CONFIG_CMD_TYPEC
for gru to create space.
BUG=b:65028930
BRANCH=none
CQ-DEPEND=CL:648071
TEST=On Fizz, verify:
1. RW_B is old and updated by soft sync. RW_B is activated and
executed after reboot. System continues to boot to OS.
2. RW_A is old and updated by soft sync. RW_A is activated and
executed after reboot. System continues to boot to OS.
Change-Id: I9ece907b764d07ce94054ba27996e048c665a80a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/648448
Diffstat (limited to 'include/flash.h')
-rw-r--r-- | include/flash.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h index c769f5753d..d52f1f7ce7 100644 --- a/include/flash.h +++ b/include/flash.h @@ -102,6 +102,31 @@ enum flash_region { FLASH_REGION_COUNT }; +/** + * Get active slot + * + * Active slot contains an image which is being executed or will be executed + * after sysjump. + * + * @return Active slot index + */ +enum flash_rw_slot flash_get_active_slot(void); + +/** + * Get updatable (non-active) slot + * + * @return Updatable slot index + */ +enum flash_rw_slot flash_get_update_slot(void); + +/** + * Translate slot index to image index + * + * @param slot Slot index to convert. + * @return Image index converted from <slot> + */ +enum system_image_copy_t flash_slot_to_image(enum flash_rw_slot slot); + /*****************************************************************************/ /* Low-level methods, for use by flash_common. */ |