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 <
console/console.h
>
5
#include <gpio.h>
6
7
uint32_t
board_id
(
void
)
8
{
9
static
int
id
= -1;
10
11
if
(
id
< 0) {
12
id
=
gpio_get
(
GPIO
(Q3)) << 0 |
13
gpio_get
(
GPIO
(T1)) << 1 |
14
gpio_get
(
GPIO
(X1)) << 2 |
15
gpio_get
(
GPIO
(X4)) << 3;
16
printk
(
BIOS_SPEW
,
"Board ID: %#x.\n"
,
id
);
17
}
18
19
return
id;
20
}
boardid.h
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
GPIO
@ GPIO
Definition:
chip.h:84
board_id
uint32_t board_id(void)
board_id() - Get the board version
Definition:
boardid.c:6
gpio_get
int gpio_get(gpio_t gpio)
Definition:
gpio.c:166
BIOS_SPEW
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition:
loglevel.h:142
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
src
mainboard
google
nyan
boardid.c
Generated by
1.9.1