| 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 | |
| 11 | if (id < 0) { |
| 12 | id = gpio_get(GPIO(Q3)) << 0 | |
| 13 | gpio_get(GPIO(T1)) << 1 | |
| 14 | gpio_get(GPIO(X1)) << 2 | |
| 15 | gpio_get(GPIO(X4)) << 3; |
| 16 | printk(BIOS_SPEW, "Board ID: %#x.\n", id); |
| 17 | } |
| 18 | |
| 19 | return id; |
| 20 | } |