summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.rules3
-rw-r--r--board/cr50/board.c2
-rw-r--r--board/cr50/board.h3
-rw-r--r--board/cr50/build.mk2
-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
-rw-r--r--common/ec_comm.c6
-rw-r--r--common/ec_efs.c2
-rwxr-xr-xutil/getversion.sh2
12 files changed, 16 insertions, 78 deletions
diff --git a/Makefile.rules b/Makefile.rules
index ecbccceb80..41de0b7495 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -533,8 +533,7 @@ $(out)/RW/%.a:
# changed.
old_version_hash := $(shell cat $(out)/ec_version.h 2> /dev/null | md5sum -)
new_version_hash := $(shell BOARD=$(BOARD) CR50_DEV=$(CR50_DEV) \
- CR50_SQA=$(CR50_SQA) CRYPTO_TEST=$(CRYPTO_TEST) \
- ./util/getversion.sh | md5sum -)
+ CRYPTO_TEST=$(CRYPTO_TEST) ./util/getversion.sh | md5sum -)
ifneq ($(old_version_hash),$(new_version_hash))
.PHONY: $(out)/ec_version.h
diff --git a/board/cr50/board.c b/board/cr50/board.c
index e20810cd42..6843673662 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -1708,7 +1708,7 @@ static int command_board_properties(int argc, char **argv)
DECLARE_SAFE_CONSOLE_COMMAND(brdprop, command_board_properties,
NULL, "Display board properties");
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
static int command_rollback(int argc, char **argv)
{
system_ensure_rollback();
diff --git a/board/cr50/board.h b/board/cr50/board.h
index 9f6833e5f1..fea738f7d2 100644
--- a/board/cr50/board.h
+++ b/board/cr50/board.h
@@ -117,9 +117,6 @@
#define CONFIG_CMD_FLASH_LOG
#define CONFIG_PHYSICAL_PRESENCE_DEBUG_UNSAFE
#endif
-#if defined(CR50_DEV) || defined(CR50_SQA)
-#define CR50_RELAXED
-#endif
#define CONFIG_USB_PID 0x5014
#define CONFIG_USB_SELF_POWERED
diff --git a/board/cr50/build.mk b/board/cr50/build.mk
index b84f2dc65f..0396ad6c17 100644
--- a/board/cr50/build.mk
+++ b/board/cr50/build.mk
@@ -18,7 +18,7 @@ ifeq ($(BOARD_MK_INCLUDED_ONCE),)
# List of variables which can be defined in the environment or set in the make
# command line.
-ENV_VARS := CR50_DEV CR50_SQA CRYPTO_TEST H1_RED_BOARD
+ENV_VARS := CR50_DEV CRYPTO_TEST H1_RED_BOARD
ifneq ($(CRYPTO_TEST),)
CPPFLAGS += -DCRYPTO_TEST_SETUP
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. */
diff --git a/common/ec_comm.c b/common/ec_comm.c
index 4ad6311acc..5d56c39450 100644
--- a/common/ec_comm.c
+++ b/common/ec_comm.c
@@ -243,7 +243,7 @@ int ec_comm_process_packet(uint8_t ch)
if (response) {
transfer_response_to_ec_(response);
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
CPRINTS("decoded a packet");
CPRINTS("header : 0x%ph",
HEX_BUF((uint8_t *)&ec_comm_ctx.ph,
@@ -343,10 +343,10 @@ static int command_ec_comm(int argc, char **argv)
ccprintf("preamble_count : %d\n", ec_comm_ctx.preamble_count);
ccprintf("bytes_received : %d\n", ec_comm_ctx.bytes_received);
ccprintf("bytes_expected : %d\n", ec_comm_ctx.bytes_expected);
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
ccprintf("packet:\n");
hexdump((uint8_t *)ec_comm_ctx.packet, CR50_COMM_MAX_PACKET_SIZE);
-#endif /* CR50_RELAXED */
+#endif /* CR50_DEV */
ccprintf("response : 0x%04x\n", ec_comm_ctx.last_resp);
ccprintf("\n");
ec_efs_print_status();
diff --git a/common/ec_efs.c b/common/ec_efs.c
index a08edde9b1..e3e2cf2d50 100644
--- a/common/ec_efs.c
+++ b/common/ec_efs.c
@@ -281,7 +281,7 @@ void ec_efs_print_status(void)
ccprintf("boot_mode : %s\n",
boot_mode_name_[ec_efs_ctx.boot_mode]);
-#ifdef CR50_RELAXED
+#ifdef CR50_DEV
ccprintf("ec_hash_secdata : %ph\n",
HEX_BUF(ec_efs_ctx.hash, SHA256_DIGEST_SIZE));
#endif
diff --git a/util/getversion.sh b/util/getversion.sh
index d775100e8d..6fa0ad4fbe 100755
--- a/util/getversion.sh
+++ b/util/getversion.sh
@@ -89,7 +89,7 @@ main() {
local ver
IFS="${dc}"
- ver="${CR50_SQA:+SQA/}${CR50_DEV:+DBG/}${CRYPTO_TEST:+CT/}${BOARD}_"
+ ver="${CR50_DEV:+DBG/}${CRYPTO_TEST:+CT/}${BOARD}_"
tool_ver=""
global_dirty= # set if any of the component repos is 'dirty'.
dir_list=( . ) # list of component directories, always includes the EC tree