summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorRavi Kumar Bokka <rbokka@codeaurora.org>2021-07-27 19:29:18 +0530
committerShelley Chen <shchen@google.com>2022-01-05 02:35:13 +0000
commit8b63dac06184e56ce40d82d982e983ac79163551 (patch)
tree98ad7aae0c8ff89111b72efdfc866a2b2264ee1e /src/mainboard/google
parentbdad283237ac332c32682d8fb60c42c12cccc362 (diff)
google/herobrine: configure gpio to detect board ID
BUG=b:182963902, b:193807794 TEST=Validated on qualcomm sc7280 development board Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org> Change-Id: I6de2a7e7b11ecce8325e0fd44dc7221d73729390 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56642 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Shelley Chen <shchen@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/herobrine/board.h1
-rw-r--r--src/mainboard/google/herobrine/boardid.c20
2 files changed, 13 insertions, 8 deletions
diff --git a/src/mainboard/google/herobrine/board.h b/src/mainboard/google/herobrine/board.h
index b604cf762e..9debfb8d6b 100644
--- a/src/mainboard/google/herobrine/board.h
+++ b/src/mainboard/google/herobrine/board.h
@@ -18,7 +18,6 @@
#define QCOM_SC7280_SKU1 0x0
#define QCOM_SC7280_SKU2 0x1
-#define QCOM_SC7280_SKU3 0x2
/* Fingerprint-specific GPIOs. Only for fingerprint-enabled devices. */
#if CONFIG(HEROBRINE_HAS_FINGERPRINT)
diff --git a/src/mainboard/google/herobrine/boardid.c b/src/mainboard/google/herobrine/boardid.c
index 7db3e0bc64..ad90dd9143 100644
--- a/src/mainboard/google/herobrine/boardid.c
+++ b/src/mainboard/google/herobrine/boardid.c
@@ -10,19 +10,25 @@
uint32_t board_id(void)
{
static uint32_t id = UNDEFINED_STRAPPING_ID;
- const gpio_t pins[] = {[2] = GPIO(50), [1] = GPIO(49), [0] = GPIO(48)};
+ gpio_t pins[3];
+ if (CONFIG(BOARD_GOOGLE_HEROBRINE)) {
+ pins[2] = GPIO(75);
+ pins[1] = GPIO(74);
+ pins[0] = GPIO(73);
+ } else if (CONFIG(BOARD_GOOGLE_PIGLIN) || CONFIG(BOARD_GOOGLE_HOGLIN)
+ || CONFIG(BOARD_GOOGLE_SENOR)) {
+ pins[2] = GPIO(50);
+ pins[1] = GPIO(49);
+ pins[0] = GPIO(48);
+ }
if (id == UNDEFINED_STRAPPING_ID)
id = gpio_base3_value(pins, ARRAY_SIZE(pins));
- if ((id == QCOM_SC7280_SKU1) || (id == QCOM_SC7280_SKU2) ||
- (id == QCOM_SC7280_SKU3))
- printk(BIOS_INFO, "BoardID :%d - "
+ printk(BIOS_INFO, "BoardID :%d - "
"Machine model: "
"Qualcomm Technologies, Inc. "
- "sc7280 IDP SKU%d platform\n", id, (id+1));
- else
- printk(BIOS_ERR, "Invalid BoardId : %d\n", id);
+ "sc7280 platform\n", id);
return id;
}