blob: 1b3a269b67fb37a3b247aeefc3138199ca3289bd [file] [log] [blame]
Angel Pons378a9552020-04-05 13:22:58 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
T Michael Turney626a5372019-10-15 07:40:30 -07003
4#include <boardid.h>
5#include <gpio.h>
6
7uint32_t board_id(void)
8{
9 static uint32_t id = UNDEFINED_STRAPPING_ID;
10
11 const gpio_t pins[] = {[2] = GPIO(31), [1] = GPIO(93), [0] = GPIO(33)};
12
13 if (id == UNDEFINED_STRAPPING_ID)
14 id = gpio_base2_value(pins, ARRAY_SIZE(pins));
15
16 return id;
17}
18
19uint32_t ram_code(void)
20{
21 static uint32_t id = UNDEFINED_STRAPPING_ID;
22
Julius Werneref437112020-04-13 15:24:22 -070023 const gpio_t pins[] = {[2] = GPIO(13), [1] = GPIO(91), [0] = GPIO(29)};
T Michael Turney626a5372019-10-15 07:40:30 -070024
25 if (id == UNDEFINED_STRAPPING_ID)
26 id = gpio_base2_value(pins, ARRAY_SIZE(pins));
27
28 return id;
29}
30
31uint32_t sku_id(void)
32{
33 static uint32_t id = UNDEFINED_STRAPPING_ID;
34
35 const gpio_t pins[] = {[1] = GPIO(90), [0] = GPIO(114)};
36
37 if (id == UNDEFINED_STRAPPING_ID)
38 id = gpio_base2_value(pins, ARRAY_SIZE(pins));
39
40 return id;
41}