coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
boardid.c File Reference
#include <boardid.h>
#include <console/console.h>
#include <gpio.h>
#include <soc/saradc.h>
Include dependency graph for boardid.c:

Go to the source code of this file.

Functions

 _Static_assert (ARRAY_SIZE(id_readings)==16, "Yo' messed up da table, bruh!")
 
static uint32_t get_index (uint32_t channel, int *cached_id)
 
uint32_t board_id (void)
 board_id() - Get the board version More...
 
uint32_t ram_code (void)
 
uint32_t sku_id (void)
 

Variables

static const int id_readings []
 
static int cached_board_id = -1
 
static int cached_ram_id = -1
 

Function Documentation

◆ _Static_assert()

_Static_assert ( ARRAY_SIZE(id_readings = =16,
"Yo' messed up da  table,
bruh!"   
)

◆ board_id()

uint32_t board_id ( void  )

board_id() - Get the board version

Return: board version on success, BOARD_ID_UNKNOWN on failure/error.

This function is used to get the mainboard version.

Definition at line 57 of file boardid.c.

References cached_board_id, and get_index().

Here is the call graph for this function:

◆ get_index()

static uint32_t get_index ( uint32_t  channel,
int *  cached_id 
)
static

Definition at line 36 of file boardid.c.

References ARRAY_SIZE, BIOS_DEBUG, die(), get_saradc_value(), id_readings, and printk.

Referenced by board_id(), and ram_code().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ram_code()

uint32_t ram_code ( void  )

Definition at line 62 of file boardid.c.

References cached_ram_id, and get_index().

Here is the call graph for this function:

◆ sku_id()

uint32_t sku_id ( void  )

Definition at line 67 of file boardid.c.

References ARRAY_SIZE, CONFIG, GPIO, gpio_pullup_base2_value(), pins, sku_id(), and UNDEFINED_STRAPPING_ID.

Here is the call graph for this function:

Variable Documentation

◆ cached_board_id

int cached_board_id = -1
static

Definition at line 33 of file boardid.c.

Referenced by board_id().

◆ cached_ram_id

int cached_ram_id = -1
static

Definition at line 34 of file boardid.c.

Referenced by ram_code().

◆ id_readings

const int id_readings[]
static
Initial value:
= {
81,
150,
211,
274,
342,
411,
477,
545,
613,
675,
733,
795,
861,
925,
989,
1023
}

Definition at line 8 of file boardid.c.

Referenced by get_index().