soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / mainboard / google / gale / boardid.c
blob72d06ea040943fbd29f34e3e2e3866f26133a5e9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <boardid.h>
4 #include <gpio.h>
5 #include <console/console.h>
7 /*
8 * Gale boards dedicate to the board ID three GPIOs in ternary mode: 64, 65
9 * and 66.
12 static int board_id_value = -1;
14 static uint8_t get_board_id(void)
16 uint8_t bid;
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);
23 return 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;