summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-12-18 16:14:36 -0800
committerCommit Bot <commit-bot@chromium.org>2019-12-19 02:01:24 +0000
commitc4e8fffe2024108ed4373f910a5b68291aa3802e (patch)
treec1ebb980e657865ac92b537e34c58ec98c13ec19
parentfa6119dc2cd69e711e9127241c2736e57706321c (diff)
downloadchrome-ec-c4e8fffe2024108ed4373f910a5b68291aa3802e.tar.gz
SQA images should allow support rollback to 0.0.22
Rolling back to 0.0.22 requires erasing the INFO1 rollback protection space, as current RW level is at two, and 0.0.22 is at one. The only way to erase INFO1 is to run a node locked prod signed 0.3.22 image. But 0.3.22 will destroy board ID along with the rollback spaces AND it is not capable of rollback, so to roll back to a lower than 0.3.22 version one still needs to run the SQA image. 0.3.22 will not allow to restore the Board ID either. Another problem is that SQA image would update the rollback INFO1 space, thus again preventing 0.0.22 from running. This patch alleviates the situation by allowing the SQA images to write Board ID fields and preventing SQA images from updating rollback space in INFO1. BRANCH=cr50 BUG=b:146522336 TEST=with the new image was able to downgrade a device from 0.4.24 to 0.0.22 Change-Id: I8babf15ae32036dc612ae9c808c773a2b3355762 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1975092 Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--chip/g/board_id.c4
-rw-r--r--chip/g/system.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/chip/g/board_id.c b/chip/g/board_id.c
index 6a7309e739..588676c41e 100644
--- a/chip/g/board_id.c
+++ b/chip/g/board_id.c
@@ -233,7 +233,7 @@ static int command_board_id(int argc, char **argv)
ccprintf("Inv Type Mismatch (%08x instead of %08x)!\n",
id.type_inv, ~id.type);
}
-#ifdef CR50_DEV
+#ifdef CR50_RELAXED
else if (argc == 3) {
char *e;
@@ -250,7 +250,7 @@ static int command_board_id(int argc, char **argv)
return rv;
}
DECLARE_SAFE_CONSOLE_COMMAND(bid, command_board_id,
-#ifdef CR50_DEV
+#ifdef CR50_RELAXED
"[bid flags]",
#else
NULL,
diff --git a/chip/g/system.c b/chip/g/system.c
index d68da094f2..d1f1375c1d 100644
--- a/chip/g/system.c
+++ b/chip/g/system.c
@@ -607,7 +607,7 @@ const char *system_get_build_info(void)
static void update_rollback_mask(uint32_t addr_a, uint32_t addr_b,
uint32_t info_base_offset)
{
-#ifndef CR50_DEV
+#ifndef CR50_RELAXED
const struct SignedHeader *header_a;
const struct SignedHeader *header_b;
int updated_words_count = 0;
@@ -696,7 +696,7 @@ static void update_rollback_mask(uint32_t addr_a, uint32_t addr_b,
flash_info_write_disable();
CPRINTS("updated %d info map words", updated_words_count);
-#endif /* CR50_DEV ^^^^^^^^ NOT defined. */
+#endif /* CR50_RELAXED ^^^^^^^^ NOT defined. */
}
void system_update_rollback_mask_with_active_img(void)