| 1 |
|
| 2 |
|
| 3 |
#include <boardid.h> |
| 4 |
#include <ec/google/chromeec/ec.h> |
| 5 |
#include <gpio.h> |
| 6 |
|
| 7 |
uint32_t board_id(void) |
| 8 |
{ |
| 9 |
static uint32_t id = UNDEFINED_STRAPPING_ID; |
| 10 |
if (id != UNDEFINED_STRAPPING_ID) |
| 11 |
return id; |
| 12 |
|
| 13 |
const gpio_t pins[] = { |
| 14 |
[3] = GPIO(138), |
| 15 |
[2] = GPIO(137), |
| 16 |
[1] = GPIO(136), |
| 17 |
[0] = GPIO(135) |
| 18 |
}; |
| 19 |
|
| 20 |
id = gpio_base3_value(pins, ARRAY_SIZE(pins)); |
| 21 |
|
| 22 |
return id; |
| 23 |
} |
| 24 |
|
| 25 |
uint32_t sku_id(void) |
| 26 |
{ |
| 27 |
static uint32_t id = UNDEFINED_STRAPPING_ID; |
| 28 |
if (id != UNDEFINED_STRAPPING_ID) |
| 29 |
return id; |
| 30 |
|
| 31 |
if (CONFIG(EC_GOOGLE_CHROMEEC)) |
| 32 |
id = google_chromeec_get_board_sku(); |
| 33 |
|
| 34 |
return id; |
| 35 |
} |