summaryrefslogtreecommitdiff
path: root/chip/g/system_chip.h
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-06-20 15:14:47 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-21 18:48:05 -0700
commite7ebdfeefc4dfd38dfcb4ef57dbd5fd4e9029639 (patch)
tree09da97eccc5291a5e2021078eb14025da22b22e4 /chip/g/system_chip.h
parentc6a8c03ac92f189aee428895f0c03eb23acd4566 (diff)
downloadchrome-ec-e7ebdfeefc4dfd38dfcb4ef57dbd5fd4e9029639.tar.gz
g: cr50: update INFO1 mask when corrupting the second image
The INFO1 mask field contents serves as input for the rollback protection mechanism, when the RO decides if an RW is allowed to run on the device. The existing code updates INFO1 mask to match the lowest rollback priority of the two images (RW_A and RW_B) present on the device. INFO1 mask should be also updated when the current image is endorsed by the host. In this case the alternative RW is destroyed, so the INFO1 mask could be set based solely on the currently running image. This patch refactors the code to allow setting INFO1 mask based on one or both RW headers' contents. BRANCH=cr50 BUG=b:62138152 TEST=verified that "normal" INFO1 mask updates still work as before, the mask is modified to match the image with the lowest rollback priority. Also verified that when the VENDOR_CC_INVALIDATE_INACTIVE_RW command is received the INFO1 mask is updated based on the currently running image. Change-Id: I23172388674e1f3a4c2489e139dd197a84029f54 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/541738 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip/g/system_chip.h')
-rw-r--r--chip/g/system_chip.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/chip/g/system_chip.h b/chip/g/system_chip.h
index ce63f3eab8..3f72b81611 100644
--- a/chip/g/system_chip.h
+++ b/chip/g/system_chip.h
@@ -52,10 +52,11 @@ int system_rollback_detected(void);
int system_battery_cutoff_support_required(void);
/**
- * Modify info1 RW rollback mask to match currently executing RW image's
- * header.
+ * Functions to update INFO1 rollback mask based on one or both RW image
+ * headers.
*/
-void system_update_rollback_mask(void);
+void system_update_rollback_mask_with_active_img(void);
+void system_update_rollback_mask_with_both_imgs(void);
/**
* Scan INFO1 rollback map and infomap fields of both RW and RW_B image