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 <delay.h>
#include <device/i2c_simple.h>
#include <drivers/camera/cros_camera.h>
#include <ec/google/chromeec/ec.h>
#include <soc/auxadc_common.h>
#include <soc/i2c.h>
#include <soc/pmic_wrap_common.h>
Include dependency graph for boardid.c:

Go to the source code of this file.

Macros

#define FLAPJACK_UNDEF_SKU_ID   0
 
#define ADC_LEVELS   12
 
#define PMIC_LDO_VCAMIO_CON0   0x1cb0
 
#define CROS_CAMERA_INFO_OFFSET   0x1f80
 
#define MT8183_FORMAT   0x8183
 
#define KODAMA_PID   0x00c7
 

Enumerations

enum  { LCM_ID_CHANNEL = 2 , RAM_ID_CHANNEL = 3 , SKU_ID_CHANNEL = 4 }
 

Functions

static uint32_t get_adc_index (unsigned int channel)
 
static uint8_t eeprom_random_read (uint8_t bus, uint8_t slave, uint16_t offset, uint8_t *data, uint16_t len)
 
static uint8_t wfc_id (void)
 
static uint8_t lcm_id (void)
 
uint32_t sku_id (void)
 
uint32_t ram_code (void)
 

Variables

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

Macro Definition Documentation

◆ ADC_LEVELS

#define ADC_LEVELS   12

Definition at line 23 of file boardid.c.

◆ CROS_CAMERA_INFO_OFFSET

#define CROS_CAMERA_INFO_OFFSET   0x1f80

Definition at line 110 of file boardid.c.

◆ FLAPJACK_UNDEF_SKU_ID

#define FLAPJACK_UNDEF_SKU_ID   0

Definition at line 21 of file boardid.c.

◆ KODAMA_PID

#define KODAMA_PID   0x00c7

Definition at line 112 of file boardid.c.

◆ MT8183_FORMAT

#define MT8183_FORMAT   0x8183

Definition at line 111 of file boardid.c.

◆ PMIC_LDO_VCAMIO_CON0

#define PMIC_LDO_VCAMIO_CON0   0x1cb0

Definition at line 108 of file boardid.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LCM_ID_CHANNEL 
RAM_ID_CHANNEL 
SKU_ID_CHANNEL 

Definition at line 25 of file boardid.c.

Function Documentation

◆ eeprom_random_read()

static uint8_t eeprom_random_read ( uint8_t  bus,
uint8_t  slave,
uint16_t  offset,
uint8_t data,
uint16_t  len 
)
static

Definition at line 86 of file boardid.c.

References address, ARRAY_SIZE, i2c_msg::buf, i2c_msg::flags, I2C_M_RD, i2c_transfer(), i2c_msg::len, offset, slave, and i2c_msg::slave.

Referenced by wfc_id().

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

◆ get_adc_index()

static uint32_t get_adc_index ( unsigned int  channel)
static

Definition at line 69 of file boardid.c.

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

Referenced by lcm_id(), ram_code(), and sku_id().

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

◆ lcm_id()

static uint8_t lcm_id ( void  )
static

Definition at line 178 of file boardid.c.

References CONFIG, get_adc_index(), and LCM_ID_CHANNEL.

Referenced by 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 222 of file boardid.c.

References BOARD_ID_INIT, get_adc_index(), and RAM_ID_CHANNEL.

Here is the call graph for this function:

◆ sku_id()

uint32_t sku_id ( void  )

Definition at line 187 of file boardid.c.

References board_id(), BOARD_ID_INIT, CONFIG, FLAPJACK_UNDEF_SKU_ID, get_adc_index(), google_chromeec_cbi_get_sku_id(), lcm_id(), SKU_ID_CHANNEL, and wfc_id().

Here is the call graph for this function:

◆ wfc_id()

Variable Documentation

◆ adc_voltages

const int* adc_voltages[]
static
Initial value:
= {
}
static const int lcm_voltages[ADC_LEVELS]
Definition: boardid.c:47
@ SKU_ID_CHANNEL
Definition: boardid.c:28
@ LCM_ID_CHANNEL
Definition: boardid.c:26
@ RAM_ID_CHANNEL
Definition: boardid.c:27
static const int ram_voltages[ADC_LEVELS]
Definition: boardid.c:31

Definition at line 63 of file boardid.c.

Referenced by get_adc_index().

◆ lcm_voltages

const int lcm_voltages[ADC_LEVELS]
static
Initial value:
= {
0,
283000,
394000,
503000,
608000,
712000,
823000,
937000,
1046000,
1155000,
1277000,
1434000,
}

Definition at line 47 of file boardid.c.

◆ ram_voltages

const int ram_voltages[ADC_LEVELS]
static
Initial value:
= {
74000,
212000,
319000,
429000,
542000,
666000,
781000,
900000,
1023000,
1137000,
1240000,
1343000,
}

Definition at line 31 of file boardid.c.