summaryrefslogtreecommitdiff
path: root/common/extension.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-03-20 21:30:11 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-03-22 18:03:48 -0700
commitdc66986d0a7fd182ddcafbee00045a25709edcb4 (patch)
treeb9cb818b5539de701bc1386db03960661042073d /common/extension.c
parente9a079f1f145fd07e45aeab9911764c8b45a0b10 (diff)
downloadchrome-ec-dc66986d0a7fd182ddcafbee00045a25709edcb4.tar.gz
cr50: add vendor command to restore corrupted header
The upcoming move of the Cr50 firmware update to the background requires postponing the activation of the newly uploaded Cr50 image to a later point in time, when the AP is ready to switch to start using the new Cr50 image. The suggested way of achieving it is as follows: when downloading the new image, the current Cr50 code modifies the header's 'image_size' field, setting its top bit to 1. This both makes the size invalid and guarantees that the new image would not verify on the following Cr50 restarts. When the AP is ready to switch to running the new Cr50 image, it will send a vendor command, which would trigger the currently running Cr50 image to restore the other image's size field. This vendor command would also communicate the timeout for the Cr50 to wait before rebooting, if there has been at least one header (ro or rw) restored. Rebooting the Cr50 would trigger rebooting the AP, resulting in the entire system running the updated firmware. Response sent to the AP will indicate if there has been a header restored and the reboot is indeed upcoming, this would allow the AP to quiesce the state of the device to handle the reboot gracefully. BRANCH=cr50 BUG=b:35580805 TEST=with the rest of the patches applied observed the system properly after the new header version was restored. Change-Id: Ia1edee67b6aa8f458810d5dc2931477cfaab1566 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/457676 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common/extension.c')
-rw-r--r--common/extension.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/extension.c b/common/extension.c
index 63ae8f0495..f71d4557a3 100644
--- a/common/extension.c
+++ b/common/extension.c
@@ -45,6 +45,7 @@ uint32_t usb_extension_route_command(uint16_t command_code,
switch (command_code) {
#ifdef CR50_DEV
case VENDOR_CC_IMMEDIATE_RESET:
+ case VENDOR_CC_TURN_UPDATE_ON:
#endif /* defined(CR50_DEV) */
case EXTENSION_POST_RESET: /* Always need to be able to reset. */
is_allowed = 1;