| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <boardid.h> |
| 4 | #include <console/console.h> |
| 5 | #include <gpio.h> |
| 6 | |
| 7 | uint32_t board_id(void) |
| 8 | { |
| 9 | static int id = -1; |
| 10 | gpio_t gpio[] = {[3] = GPIO(X4), [2] = GPIO(X1), /* X4 is MSB */ |
| 11 | [1] = GPIO(T1), [0] = GPIO(Q3),}; /* Q3 is LSB */ |
| 12 | |
| 13 | if (id < 0) { |
| 14 | id = gpio_base3_value(gpio, ARRAY_SIZE(gpio)); |
| 15 | |
| 16 | printk(BIOS_SPEW, "Board TRISTATE ID: %d.\n", id); |
| 17 | } |
| 18 | |
| 19 | return id; |
| 20 | } |