diff options
author | Mary Ruthven <mruthven@chromium.org> | 2019-10-30 18:35:19 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-07 22:52:09 +0000 |
commit | 68ccda60a1ed696d94586d88d209402e4be39c31 (patch) | |
tree | 622d5359938b1dda745a52cb41dce2fd0421e557 /chip | |
parent | 3f53eda83e9b91eef3058c41e68a8c6842a70d82 (diff) | |
download | chrome-ec-68ccda60a1ed696d94586d88d209402e4be39c31.tar.gz |
board_id: clean up/enhancements
Add type_inv to the bid command output. In the bid output you can't tell
the difference between a board with type 0xffffffff and a empty type.
Change the command output to show type and type_inv, so we can tell the
difference.
Remove unused clear_flag parameter
BUG=b:143649068
BRANCH=cr50
TEST=run 'bid'
Change-Id: I13b6ba472010fdf85f94cb4015a9bbc48531973d
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1892115
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/g/board_id.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chip/g/board_id.c b/chip/g/board_id.c index c863a81fba..2a412d97e7 100644 --- a/chip/g/board_id.c +++ b/chip/g/board_id.c @@ -121,7 +121,7 @@ uint32_t board_id_mismatch(const struct SignedHeader *sh) * @return EC_SUCCESS or an error code in cases of various failures to read or * if the space has been already initialized. */ -static int write_board_id(const struct board_id *id, int clear_flags) +static int write_board_id(const struct board_id *id) { struct board_id id_test; uint32_t rv; @@ -143,7 +143,7 @@ static int write_board_id(const struct board_id *id, int clear_flags) return rv; } - if (!clear_flags && !board_id_is_blank(&id_test)) { + if (!board_id_is_blank(&id_test)) { CPRINTS("%s: Board ID already programmed", __func__); return EC_ERROR_ACCESS_DENIED; } @@ -186,7 +186,7 @@ static enum vendor_cmd_rc vc_set_board_id(enum vendor_cmd_cc code, id.flags = be32toh(id.flags); /* We care about the LSB only. */ - *pbuf = write_board_id(&id, 0); + *pbuf = write_board_id(&id); return *pbuf; } @@ -204,7 +204,8 @@ static int command_board_id(int argc, char **argv) ccprintf("Failed to read board ID space\n"); return rv; } - ccprintf("Board ID: %08x, flags %08x\n", id.type, id.flags); + ccprintf("Board ID: %08x:%08x, flags %08x\n", id.type, + id.type_inv, id.flags); if (board_id_is_blank(&id)) return rv; /* The space is not initialized. */ @@ -224,7 +225,7 @@ static int command_board_id(int argc, char **argv) id.flags = strtoi(argv[2], &e, 0); if (*e) return EC_ERROR_PARAM2; - rv = write_board_id(&id, 0); + rv = write_board_id(&id); } #endif return rv; |