From 6405df6102e1adc981bd497a4d8987ce921a8945 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 30 Oct 2019 16:42:10 -0700 Subject: board_id: change the vc to allow setting only flags If the board id type is 0xffffffff, hold off on erasing any type_inv bits until we get a type that isn't empty. BUG=b:143649068 BRANCH=cr50 TEST=Use gsctool -i 0xffffffff:0x3f80 to set flags to 0x3f80. Get the board id and make sure the rlz and rlz_inv fields are still 0xffffffff. Change-Id: I8243cb59f2560dc232bb982e1615271136d60f24 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1892118 Reviewed-by: Vadim Bendebury --- chip/g/board_id.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chip/g/board_id.c b/chip/g/board_id.c index 15a8f54376..e816720fb9 100644 --- a/chip/g/board_id.c +++ b/chip/g/board_id.c @@ -192,7 +192,10 @@ static enum vendor_cmd_rc vc_set_board_id(enum vendor_cmd_cc code, memcpy(&id.type, pbuf, sizeof(id.type)); id.type = be32toh(id.type); - id.type_inv = ~id.type; + if (id.type == BLANK_FIELD) + id.type_inv = BLANK_FIELD; + else + id.type_inv = ~id.type; memcpy(&id.flags, pbuf + sizeof(id.type), sizeof(id.flags)); id.flags = be32toh(id.flags); -- cgit v1.2.1