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 <soc/sdram.h>
5
6
#include "
gpio.h
"
7
8
uint32_t
board_id
(
void
)
9
{
10
static
int
id
= -1;
11
12
if
(
id
< 0) {
13
gpio_t
gpio
[] = {[1] =
BD_ID1
, [0] =
BD_ID0
};
/* ID0 is LSB */
14
15
id
=
gpio_base3_value
(
gpio
,
ARRAY_SIZE
(
gpio
));
16
}
17
18
return
id;
19
}
20
21
uint32_t
ram_code
(
void
)
22
{
23
return
sdram_get_ram_code
();
24
}
boardid.h
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
board_id
uint32_t board_id(void)
board_id() - Get the board version
Definition:
boardid.c:6
gpio_base3_value
static uint32_t gpio_base3_value(const gpio_t gpio[], int num_gpio)
Definition:
gpio.h:63
ram_code
uint32_t ram_code(void)
Definition:
boardid.c:78
BD_ID0
@ BD_ID0
Definition:
gpio.h:31
BD_ID1
@ BD_ID1
Definition:
gpio.h:32
sdram_get_ram_code
uint32_t sdram_get_ram_code(void)
Definition:
sdram.c:601
gpio.h
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
gpio_t
Definition:
gpio_base.h:7
gpio
Definition:
pinmux.c:36
src
mainboard
google
smaug
boardid.c
Generated by
1.9.1