Hello nsekar@codeaurora.org,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/32271
to review the following change.
Change subject: TEMP: NOT FOR REVIEW: Mistral: Add board id detection using TPM ......................................................................
TEMP: NOT FOR REVIEW: Mistral: Add board id detection using TPM
This patch adds support to select the board id based on the TPM availability.
Change-Id: Ib75d51a21a6129e3650e2af24ff85f37a462591b Signed-off-by: Nitheesh Sekar nsekar@codeaurora.org --- M src/mainboard/google/mistral/boardid.c 1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/32271/1
diff --git a/src/mainboard/google/mistral/boardid.c b/src/mainboard/google/mistral/boardid.c index 8258ac3..9a0d309 100644 --- a/src/mainboard/google/mistral/boardid.c +++ b/src/mainboard/google/mistral/boardid.c @@ -32,7 +32,22 @@ [1] = GPIO(106), [0] = GPIO(105)};
- bid = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins)); + if (is_tpm_detected() == 0) { + bid = 25; /* Assign 25 for EVB boards */ + printk(BIOS_DEBUG, "EVB Board ID: %d\n", bid); + } else { + bid = 0; /* Assign 0 for Proto boards */ + + /* The board id assigned for Proto boards is 0. + * Since gpios are not wired in the initial phase, + * we will get 0 whihch is a coincidence. + * To make sure it starts working, after gpios are + * wired, reassign the value read from gpios to id. + */ + bid = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins)); + + printk(BIOS_DEBUG, "Proto Board ID: %d\n", bid); + }
return bid; }