summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2020-06-03 04:43:30 +1000
committerCommit Bot <commit-bot@chromium.org>2020-06-02 23:47:02 +0000
commit88d0ae075d1e24338e7f5fca9dd3767ec5bd4023 (patch)
tree1c4c3b361721a03b8966e9bc28b0711ff9380b06 /chip
parent5ae7720ca6599c89ad54614b36af5269340fe2fd (diff)
downloadchrome-ec-88d0ae075d1e24338e7f5fca9dd3767ec5bd4023.tar.gz
remove CR50_SQA
SQA images won't be built anymore. This change removes the SQA support. It deletes all SQA ifdefs and replaces CR50_RELAXED with CR50_DEV. BUG=b:158011401 TEST=manual build regular image and check eraselfashinfo and rollback aren't included. build image with CR50_SQA=1 and check it's no different than the regular image. build DBG image and make sure it still starts open, it has the eraseflashinfo and rollback commands, and it can flash old cr50 images. Change-Id: I5e94c88b1903cfcf0eee0081fc871e55fc8586c7 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2227149 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/g/board_id.c4
-rw-r--r--chip/g/build.mk13
-rw-r--r--chip/g/flash.c49
-rw-r--r--chip/g/system.c4
-rw-r--r--chip/g/upgrade_fw.c4
5 files changed, 8 insertions, 66 deletions
diff --git a/chip/g/board_id.c b/chip/g/board_id.c
index 0eb6efc0b5..c7613dd3bd 100644
--- a/chip/g/board_id.c
+++ b/chip/g/board_id.c
@@ -252,7 +252,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_RELAXED
+#ifdef CR50_DEV
else if (argc == 3) {
char *e;
@@ -269,7 +269,7 @@ static int command_board_id(int argc, char **argv)
return rv;
}
DECLARE_SAFE_CONSOLE_COMMAND(bid, command_board_id,
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
"[bid flags]",
#else
NULL,
diff --git a/chip/g/build.mk b/chip/g/build.mk
index bb28bee410..ceb68f34a6 100644
--- a/chip/g/build.mk
+++ b/chip/g/build.mk
@@ -123,21 +123,8 @@ ifneq ($(CONFIG_RW_B),)
$(out)/$(PROJECT).obj: $(out)/RW/ec.RW_B.flat
endif
-CR50_OPTS=
-
ifneq ($(CR50_DEV),)
CPPFLAGS += -DCR50_DEV=$(CR50_DEV)
-CR50_OPTS+=CR50_DEV
-endif
-
-ifneq ($(CR50_SQA),)
-CPPFLAGS += -DCR50_SQA=$(CR50_SQA)
-CR50_OPTS+=CR50_SQA
-endif
-
-# Test if more than one Cr50 build option is specified
-ifneq ($(wordlist 2,3,$(CR50_OPTS)),)
-$(error Incompatible CR50 build options specified: $(CR50_OPTS))
endif
MANIFEST := util/signer/ec_RW-manifest-dev.json
diff --git a/chip/g/flash.c b/chip/g/flash.c
index 7812bb52e3..83870e03ec 100644
--- a/chip/g/flash.c
+++ b/chip/g/flash.c
@@ -199,7 +199,7 @@ static int do_flash_op(enum flash_op op, int is_info_bank,
/* What are we doing? */
switch (op) {
case OP_ERASE_BLOCK:
-#ifndef CR50_RELAXED
+#ifndef CR50_DEV
if (is_info_bank)
/* Erasing the INFO bank from the RW section is
* unsupported. */
@@ -530,8 +530,7 @@ static enum vendor_cmd_rc vc_endorsement_seed(enum vendor_cmd_cc code,
return rv;
}
DECLARE_VENDOR_COMMAND(VENDOR_CC_ENDORSEMENT_SEED, vc_endorsement_seed);
-#endif
-#ifdef CR50_RELAXED
+
static int command_erase_flash_info(int argc, char **argv)
{
int i;
@@ -554,50 +553,11 @@ static int command_erase_flash_info(int argc, char **argv)
goto exit;
}
}
-
-#ifdef CR50_SQA
- /*
- * SQA images erase INFO1 RW mask, but do not allow erasing board ID.
- *
- * If compiled with CR50_SQA=1, board ID flags will set to zero, if
- * compiled with CR50_SQA=2 or greater, board ID flags can be set to
- * an arbitrary value passed in on the command line, but guaranteeing
- * not to lock out the currently running image.
- */
- {
- uint32_t flags = 0;
-#if CR50_SQA > 1
- if (argc > 1) {
- char *e;
-
- flags = strtoi(argv[1], &e, 0);
- if (*e) {
- rv = EC_ERROR_PARAM1;
- goto exit;
- }
- }
-#endif
- if (board_id_is_blank(&info1->board_space.bid)) {
- ccprintf("BID is erased. Not modifying flags\n");
- } else {
- ccprintf("setting BID flags to %x\n", flags);
- info1->board_space.bid.flags = flags;
- }
- if (check_board_id_vs_header(&info1->board_space.bid,
- get_current_image_header())) {
- ccprintf("Flags %x would lock out current image\n",
- flags);
- rv = EC_ERROR_PARAM1;
- goto exit;
- }
- }
-#else /* CR50_SQA ^^^^^^ defined vvvvvvv Not defined. */
/*
* This must be CR50_DEV=1 image, just erase the board information
* space.
*/
memset(&info1->board_space, 0xff, sizeof(info1->board_space));
-#endif /* CR50_SQA Not defined. */
memset(info1->rw_info_map, 0xff, sizeof(info1->rw_info_map));
@@ -625,10 +585,5 @@ static int command_erase_flash_info(int argc, char **argv)
return rv;
}
DECLARE_SAFE_CONSOLE_COMMAND(eraseflashinfo, command_erase_flash_info,
-#if defined(CR50_SQA) && (CR50_SQA > 1)
- "[bid flags]",
- "Erase INFO1 flash space and set Board ID flags");
-#else
"", "Erase INFO1 flash space");
#endif
-#endif
diff --git a/chip/g/system.c b/chip/g/system.c
index d1f1375c1d..d68da094f2 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_RELAXED
+#ifndef CR50_DEV
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_RELAXED ^^^^^^^^ NOT defined. */
+#endif /* CR50_DEV ^^^^^^^^ NOT defined. */
}
void system_update_rollback_mask_with_active_img(void)
diff --git a/chip/g/upgrade_fw.c b/chip/g/upgrade_fw.c
index d78afb610d..7f15574e3b 100644
--- a/chip/g/upgrade_fw.c
+++ b/chip/g/upgrade_fw.c
@@ -164,7 +164,7 @@ int usb_pdu_valid(struct upgrade_command *cmd_body, size_t cmd_size)
return 1;
}
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
#ifndef CONFIG_IGNORE_G_UPDATE_CHECKS
#define CONFIG_IGNORE_G_UPDATE_CHECKS
#endif
@@ -372,7 +372,7 @@ static int contents_allowed(uint32_t block_offset,
size_t body_size, void *upgrade_data,
uint8_t *error_code)
{
-#ifndef CR50_RELAXED
+#ifndef CR50_DEV
#ifdef CONFIG_BOARD_ID_SUPPORT
if (block_offset == valid_sections.rw_base_offset) {
/* This block is a rw header of the new image. */