| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <boardid.h> |
| 4 | #include <soc/sdram.h> |
| 5 | |
| 6 | #include "gpio.h" |
| 7 | |
| 8 | uint32_t board_id(void) |
| 9 | { |
| 10 | static int id = -1; |
| 11 | |
| 12 | if (id < 0) { |
| 13 | gpio_t gpio[] = {[1] = BD_ID1, [0] = BD_ID0}; /* ID0 is LSB */ |
| 14 | |
| 15 | id = gpio_base3_value(gpio, ARRAY_SIZE(gpio)); |
| 16 | } |
| 17 | |
| 18 | return id; |
| 19 | } |
| 20 | |
| 21 | uint32_t ram_code(void) |
| 22 | { |
| 23 | return sdram_get_ram_code(); |
| 24 | } |