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

Go to the source code of this file.

Macros

#define ADC_LEVELS   15
 

Enumerations

enum  { RAM_ID_HIGH_CHANNEL = 4 , RAM_ID_LOW_CHANNEL = 3 , SKU_ID_HIGH_CHANNEL = 6 , SKU_ID_LOW_CHANNEL = 5 }
 

Functions

static uint32_t get_adc_index (unsigned int channel)
 
uint32_t sku_id (void)
 
uint32_t ram_code (void)
 

Variables

static const unsigned int ram_voltages [ADC_LEVELS]
 
static const unsigned int * adc_voltages []
 

Macro Definition Documentation

◆ ADC_LEVELS

#define ADC_LEVELS   15

Definition at line 10 of file boardid.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RAM_ID_HIGH_CHANNEL 
RAM_ID_LOW_CHANNEL 
SKU_ID_HIGH_CHANNEL 
SKU_ID_LOW_CHANNEL 

Definition at line 12 of file boardid.c.

Function Documentation

◆ get_adc_index()

static uint32_t get_adc_index ( unsigned int  channel)
static

Definition at line 47 of file boardid.c.

References ADC_LEVELS, adc_voltages, ARRAY_SIZE, assert, auxadc_get_voltage_uv(), BIOS_DEBUG, printk, and value.

Referenced by ram_code(), and sku_id().

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 78 of file boardid.c.

References BIOS_DEBUG, BOARD_ID_INIT, get_adc_index(), printk, RAM_ID_HIGH_CHANNEL, and RAM_ID_LOW_CHANNEL.

Here is the call graph for this function:

◆ sku_id()

uint32_t sku_id ( void  )

Definition at line 65 of file boardid.c.

References BIOS_DEBUG, BOARD_ID_INIT, get_adc_index(), printk, SKU_ID_HIGH_CHANNEL, and SKU_ID_LOW_CHANNEL.

Referenced by sku_id().

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

Variable Documentation

◆ adc_voltages

const unsigned int* adc_voltages[]
static
Initial value:
= {
}
@ SKU_ID_HIGH_CHANNEL
Definition: boardid.c:17
@ SKU_ID_LOW_CHANNEL
Definition: boardid.c:18
@ RAM_ID_HIGH_CHANNEL
Definition: boardid.c:14
@ RAM_ID_LOW_CHANNEL
Definition: boardid.c:15
static const unsigned int ram_voltages[ADC_LEVELS]
Definition: boardid.c:21

Definition at line 40 of file boardid.c.

Referenced by get_adc_index().

◆ ram_voltages

const unsigned int ram_voltages[ADC_LEVELS]
static
Initial value:
= {
[0] = 74300,
[1] = 211700,
[2] = 318800,
[3] = 428600,
[4] = 541700,
[5] = 665800,
[6] = 781400,
[7] = 900000,
[8] = 1023100,
[9] = 1137000,
[10] = 1240000,
[11] = 1342600,
[12] = 1457500,
[13] = 1575600,
[14] = 1683600,
}

Definition at line 21 of file boardid.c.