coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
boardid.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <baseboard/variants.h>
4 #include <boardid.h>
5 #include <stddef.h>
6 #include <ec/acpi/ec.h>
7 
8 #define BOARD_ID_GLK_RVP1_DDR4 0x5 /* RVP1 - DDR4 */
9 #define BOARD_ID_GLK_RVP2_LP4SD 0x7 /* RVP2 - LP4 Solder Down */
10 #define BOARD_ID_GLK_RVP2_LP4 0x8 /* RVP2 - LP4 Socket */
11 #define EC_FAB_ID_CMD 0x0D /* Get the board fab ID in the lower 3 bits */
12 
14 {
15  MAYBE_STATIC_NONZERO int id = -1;
16  if (id < 0) {
17  if (CONFIG(EC_GOOGLE_CHROMEEC))
18  id = variant_board_id();
19  else {
21  id = (recv_ec_data() & 0x07);
22  }
23  }
24  return id;
25 }
@ CONFIG
Definition: dsi_common.h:201
int send_ec_command(u8 command)
Definition: ec.c:13
u8 recv_ec_data(void)
Definition: ec.c:65
uint32_t board_id(void)
board_id() - Get the board version
Definition: boardid.c:6
#define EC_FAB_ID_CMD
Definition: boardid.c:11
int variant_board_id(void)
variant_board_id() - Get the board id for the current board variant
Definition: boardid.c:7
#define MAYBE_STATIC_NONZERO
Definition: stddef.h:38
unsigned int uint32_t
Definition: stdint.h:14