summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2021-03-11 16:45:54 +0800
committerHung-Te Lin <hungte@chromium.org>2021-03-15 02:28:10 +0000
commita79d6e76b852e5e5a4667818722388f1a07497df (patch)
treefc16cfdfefda425436ff265ac157504d7b029fb5 /src/mainboard
parent2fcbebbbcde4b13df5807d771beeffb0490a9644 (diff)
mb/google/asurada: get SKU ID from AP strapping pins
The SKU ID for Asurada should come from AP ADC channel 5 and 6. BUG=None TEST=make; boots on asurada Change-Id: I6a00c555f20aca4cd7f8bcee46ee81c17ef6ca3c Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51405 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/asurada/boardid.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mainboard/google/asurada/boardid.c b/src/mainboard/google/asurada/boardid.c
index 06c21ec36e..c026a6b85e 100644
--- a/src/mainboard/google/asurada/boardid.c
+++ b/src/mainboard/google/asurada/boardid.c
@@ -10,8 +10,12 @@
#define ADC_LEVELS 15
enum {
+ /* RAM IDs */
RAM_ID_HIGH_CHANNEL = 4,
RAM_ID_LOW_CHANNEL = 3,
+ /* SKU IDs */
+ SKU_ID_HIGH_CHANNEL = 6,
+ SKU_ID_LOW_CHANNEL = 5,
};
static const unsigned int ram_voltages[ADC_LEVELS] = {
@@ -58,7 +62,15 @@ static uint32_t get_adc_index(unsigned int channel)
uint32_t sku_id(void)
{
- return 0;
+ static uint32_t cached_sku_code = BOARD_ID_INIT;
+
+ if (cached_sku_code == BOARD_ID_INIT) {
+ cached_sku_code = (get_adc_index(SKU_ID_HIGH_CHANNEL) << 4 |
+ get_adc_index(SKU_ID_LOW_CHANNEL));
+ printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);
+ }
+
+ return cached_sku_code;
}
uint32_t ram_code(void)