coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
eeprom.c File Reference
#include <assert.h>
#include <console/console.h>
#include <crc_byte.h>
#include <delay.h>
#include <device/pci_ops.h>
#include <device/smbus_host.h>
#include <soc/intel/common/block/smbus/smbuslib.h>
#include <types.h>
#include "eeprom.h"
Include dependency graph for eeprom.c:

Go to the source code of this file.

Macros

#define I2C_ADDR_EEPROM   0x57
 

Functions

int check_signature (const size_t offset, const uint64_t signature)
 
static bool get_board_settings_from_eeprom (struct eeprom_board_settings *board_cfg)
 
struct eeprom_board_settingsget_board_settings (void)
 
struct eeprom_bmc_settingsget_bmc_settings (void)
 
uint8_t get_bmc_hsi (void)
 
bool eeprom_read_buffer (void *blob, size_t read_offset, size_t size)
 
void report_eeprom_error (const size_t off)
 
static bool eeprom_write_byte (const uint8_t data, const uint16_t write_offset)
 
bool write_board_settings (const struct eeprom_board_layout *new_layout)
 

Macro Definition Documentation

◆ I2C_ADDR_EEPROM

#define I2C_ADDR_EEPROM   0x57

Definition at line 14 of file eeprom.c.

Function Documentation

◆ check_signature()

int check_signature ( const size_t  offset,
const uint64_t  signature 
)

Definition at line 20 of file eeprom.c.

References ARRAY_SIZE, BIOS_DEBUG, eeprom_read_buffer(), offset, and printk.

Referenced by mainboard_early(), mainboard_memory_init_params(), and mainboard_silicon_init_params().

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

◆ eeprom_read_buffer()

bool eeprom_read_buffer ( void blob,
size_t  read_offset,
size_t  size 
)

◆ eeprom_write_byte()

static bool eeprom_write_byte ( const uint8_t  data,
const uint16_t  write_offset 
)
static

Definition at line 144 of file eeprom.c.

References BIOS_SPEW, buffer, do_smbus_block_write(), HOSTC, I2C_ADDR_EEPROM, I2C_EN, mdelay(), PCH_DEV_SMBUS, pci_read_config32(), pci_write_config32(), printk, retry, and SMBUS_IO_BASE.

Referenced by write_board_settings().

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

◆ get_bmc_hsi()

uint8_t get_bmc_hsi ( void  )

Definition at line 91 of file eeprom.c.

References BIOS_DEBUG, get_bmc_settings(), eeprom_bmc_settings::hsi, printk, and s.

Referenced by mainboard_azalia_program_runtime_verbs(), and smbios_mainboard_version().

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

◆ get_bmc_settings()

struct eeprom_bmc_settings* get_bmc_settings ( void  )

Definition at line 73 of file eeprom.c.

References BIOS_ERR, eeprom_read_buffer(), NULL, offsetof, and printk.

Referenced by get_bmc_hsi(), and mainboard_vbt_filename().

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

◆ get_board_settings()

struct eeprom_board_settings* get_board_settings ( void  )

Definition at line 59 of file eeprom.c.

References board_cfg, get_board_settings_from_eeprom(), and NULL.

Referenced by mainboard_early(), mainboard_final(), mainboard_init(), and mainboard_r0x_configure_alc888().

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

◆ get_board_settings_from_eeprom()

static bool get_board_settings_from_eeprom ( struct eeprom_board_settings board_cfg)
static

Definition at line 40 of file eeprom.c.

References BIOS_ERR, board_cfg, CRC, crc32_byte(), eeprom_read_buffer(), offsetof, and printk.

Referenced by get_board_settings().

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

◆ report_eeprom_error()

void report_eeprom_error ( const size_t  off)

Definition at line 135 of file eeprom.c.

References BIOS_ERR, and printk.

◆ write_board_settings()

bool write_board_settings ( const struct eeprom_board_layout new_layout)

Definition at line 183 of file eeprom.c.

References assert, BIOS_DEBUG, BIOS_ERR, eeprom_read_buffer(), eeprom_write_byte(), offsetof, and printk.

Referenced by update_board_layout().

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