diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2019-05-15 15:08:40 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-17 18:37:33 -0700 |
commit | 8a411be5297f9886e6ee8bf1fdac7fe6b7e53667 (patch) | |
tree | c56bc864353bb72102cc70e48a1080c445ded405 | |
parent | cd45a75e8c0dea45b94dc530fde7c86cc698fd2d (diff) | |
download | chrome-ec-8a411be5297f9886e6ee8bf1fdac7fe6b7e53667.tar.gz |
g: do not destroy manufacturing space by flasherase
When modifying flasherase behavior last time around, it was mistakenly
presumed that the manufacture_space field was set during Chrome OS
device manufacturing. In fact it is set during chip manufacture and
should be preserved.
BRANCH=none
BUG=b:132720245
TEST=using a device with H1 with cert seeds present:
- install CR50_DEV=1 image containing this patch
- install a recent prod image (it is not yet running, as its
version is lower than the ToT)
- on Cr50 console run
. flasherase
. rollback
- observe the released image start and successfully complete TPM
manufacture process.
Change-Id: Id028ffc51bb69810a0564c915b1be944ff5f1d89
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1615422
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r-- | chip/g/board_space.h | 10 | ||||
-rw-r--r-- | chip/g/flash.c | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/chip/g/board_space.h b/chip/g/board_space.h index b71733c210..68e67e78ec 100644 --- a/chip/g/board_space.h +++ b/chip/g/board_space.h @@ -48,7 +48,15 @@ struct info1_board_space { struct sn_data sn; }; -/* Layout of the entire 2K INFO1 space. */ +/* + * Layout of the entire 2K INFO1 space. + * + * - ro_info_map - maps controlling ro and rw images rollback protection. + * - rw_info_map + * - board_space - various objects used by Chrome OS applications + * - manufacture_space - seed used for generating and verification of + * endorsement certs. + */ struct info1_layout { uint8_t ro_info_map[INFO_RO_MAP_SIZE]; uint8_t rw_info_map[INFO_RW_MAP_SIZE]; diff --git a/chip/g/flash.c b/chip/g/flash.c index 8a9622e64c..b0d678f33b 100644 --- a/chip/g/flash.c +++ b/chip/g/flash.c @@ -567,12 +567,10 @@ static int command_erase_flash_info(int argc, char **argv) } #else /* CR50_SQA ^^^^^^ defined vvvvvvv Not defined. */ /* - * This must be CR50_DEV=1 image, just erase the entire board and - * manufacture spaces. + * This must be CR50_DEV=1 image, just erase the board information + * space. */ memset(&info1->board_space, 0xff, sizeof(info1->board_space)); - memset(&info1->manufacture_space, 0xff, - sizeof(info1->manufacture_space)); #endif /* CR50_SQA Not defined. */ memset(info1->rw_info_map, 0xff, sizeof(info1->rw_info_map)); |