1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include <console/console.h>
8 * Gale boards dedicate to the board ID three GPIOs in ternary mode: 64, 65
12 static int board_id_value
= -1;
14 static uint8_t get_board_id(void)
17 gpio_t hw_rev_gpios
[] = {[2] = 66, [1] = 65, [0] = 64}; /* 64 is LSB */
19 bid
= gpio_binary_first_base3_value(hw_rev_gpios
,
20 ARRAY_SIZE(hw_rev_gpios
));
21 printk(BIOS_INFO
, "Board ID %d\n", bid
);
26 uint32_t board_id(void)
28 if (board_id_value
< 0)
29 board_id_value
= get_board_id();
31 return board_id_value
;