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 
8 {
9  static int id = -1;
10  gpio_t pins[] = {[3] = GPIO(2, A, 7), [2] = GPIO(2, A, 2),
11  [1] = GPIO(2, A, 1), [0] = GPIO(2, A, 0)}; /* GPIO2_A0 is LSB */
12 
13  if (id < 0) {
15  printk(BIOS_SPEW, "Board ID: %d.\n", id);
16  }
17 
18  return id;
19 }
20 
22 {
23  uint32_t code;
24  gpio_t pins[] = {[3] = GPIO(8, A, 3), [2] = GPIO(8, A, 2),
25  [1] = GPIO(8, A, 1), [0] = GPIO(8, A, 0)}; /* GPIO8_A0 is LSB */
26 
27  if (CONFIG(VEYRON_FORCE_BINARY_RAM_CODE))
29  else
31  printk(BIOS_SPEW, "RAM Config: %u.\n", code);
32 
33  return code;
34 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
@ GPIO
Definition: chip.h:84
@ CONFIG
Definition: dsi_common.h:201
uint32_t board_id(void)
board_id() - Get the board version
Definition: boardid.c:6
uint32_t gpio_base2_value(const gpio_t gpio[], int num_gpio)
Definition: gpio.c:30
static uint32_t gpio_binary_first_base3_value(const gpio_t gpio[], int num_gpio)
Definition: gpio.h:93
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
uint32_t ram_code(void)
Definition: boardid.c:78
static struct @1213 pins[]
unsigned int uint32_t
Definition: stdint.h:14