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 <
boardid.h
>
4
#include "
commands.h
"
5
6
uint32_t
board_id
(
void
)
7
{
8
MAYBE_STATIC_NONZERO
uint32_t
id
=
BOARD_ID_INIT
;
9
10
if
(
id
==
BOARD_ID_INIT
) {
11
uint8_t
ec_id;
12
if
(
wilco_ec_get_board_id
(&ec_id) <= 0)
13
id
=
BOARD_ID_UNKNOWN
;
14
else
15
id
= ec_id;
16
}
17
18
return
id;
19
}
boardid.h
BOARD_ID_INIT
#define BOARD_ID_INIT
Definition:
boardid.h:11
BOARD_ID_UNKNOWN
#define BOARD_ID_UNKNOWN
Definition:
boardid.h:10
wilco_ec_get_board_id
int wilco_ec_get_board_id(uint8_t *id)
wilco_ec_get_board_id
Definition:
commands.c:125
commands.h
board_id
uint32_t board_id(void)
board_id() - Get the board version
Definition:
boardid.c:6
MAYBE_STATIC_NONZERO
#define MAYBE_STATIC_NONZERO
Definition:
stddef.h:38
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
uint8_t
unsigned char uint8_t
Definition:
stdint.h:8
src
ec
google
wilco
boardid.c
Generated by
1.9.1