summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorRavi Kumar Bokka <rbokka@codeaurora.org>2021-06-03 20:14:39 +0530
committerShelley Chen <shchen@google.com>2021-07-23 17:21:07 +0000
commit12184db008736c7d0c9fc7f03a872bef6cd7feab (patch)
treed64b2d17ae05b608cd3ad62f403ec967d2ce90e8 /src/mainboard/google
parent1cfb5999928c1a5cf5965b5ea520562fd3f7912a (diff)
herobrine: get boardid from GPIO configuration
Getting boardid information for the different SKU variants BUG=b:182963902, b:193807794 TEST=Validated on qualcomm sc7280 development board Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org> Change-Id: I2b7625f9b98563438d1ac20e6f29411ef1058cf4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55950 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Shelley Chen <shchen@google.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/herobrine/board.h4
-rw-r--r--src/mainboard/google/herobrine/boardid.c16
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mainboard/google/herobrine/board.h b/src/mainboard/google/herobrine/board.h
index 0d2b2dba68..33c8c7df51 100644
--- a/src/mainboard/google/herobrine/board.h
+++ b/src/mainboard/google/herobrine/board.h
@@ -8,6 +8,10 @@
#define GPIO_SD_CD_L GPIO(91)
+#define QCOM_SC7280_SKU1 0x0
+#define QCOM_SC7280_SKU2 0x1
+#define QCOM_SC7280_SKU3 0x2
+
void setup_chromeos_gpios(void);
#endif /* _COREBOOT_SRC_MAINBOARD_GOOGLE_HEROBRINE_BOARD_H_ */
diff --git a/src/mainboard/google/herobrine/boardid.c b/src/mainboard/google/herobrine/boardid.c
index 6368d25157..7db3e0bc64 100644
--- a/src/mainboard/google/herobrine/boardid.c
+++ b/src/mainboard/google/herobrine/boardid.c
@@ -2,11 +2,27 @@
#include <boardid.h>
#include <ec/google/chromeec/ec.h>
+#include "board.h"
+#include <commonlib/bsd/cb_err.h>
+#include <console/console.h>
#include <gpio.h>
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)};
+
+ 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 - "
+ "Machine model: "
+ "Qualcomm Technologies, Inc. "
+ "sc7280 IDP SKU%d platform\n", id, (id+1));
+ else
+ printk(BIOS_ERR, "Invalid BoardId : %d\n", id);
return id;
}