coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.c File Reference
#include <console/console.h>
#include <amdblocks/acpimmio.h>
#include <amdblocks/i2c.h>
#include <soc/i2c.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/southbridge.h>
#include "chip.h"
Include dependency graph for i2c.c:

Go to the source code of this file.

Functions

void i2c_set_bar (unsigned int bus, uintptr_t bar)
 
void soc_i2c_misc_init (unsigned int bus, const struct dw_i2c_bus_config *cfg)
 
const struct soc_i2c_ctrlr_infosoc_get_i2c_ctrlr_info (size_t *num_ctrlrs)
 
const struct dw_i2c_bus_configsoc_get_i2c_bus_config (size_t *num_buses)
 

Variables

static struct soc_i2c_ctrlr_info i2c_ctrlr [I2C_CTRLR_COUNT]
 

Function Documentation

◆ i2c_set_bar()

void i2c_set_bar ( unsigned int  bus,
uintptr_t  bar 
)

Definition at line 30 of file i2c.c.

References ARRAY_SIZE, soc_i2c_ctrlr_info::bar, BIOS_ERR, i2c_ctrlr, and printk.

◆ soc_get_i2c_bus_config()

const struct dw_i2c_bus_config* soc_get_i2c_bus_config ( size_t num_buses)

Definition at line 58 of file i2c.c.

References ARRAY_SIZE, config, and config_of_soc.

◆ soc_get_i2c_ctrlr_info()

const struct soc_i2c_ctrlr_info* soc_get_i2c_ctrlr_info ( size_t num_ctrlrs)

Definition at line 52 of file i2c.c.

References ARRAY_SIZE, and i2c_ctrlr.

◆ soc_i2c_misc_init()

void soc_i2c_misc_init ( unsigned int  bus,
const struct dw_i2c_bus_config cfg 
)

Definition at line 41 of file i2c.c.

References fch_i2c_pad_init(), I2C_PAD_RX_3_3V, i2c_pad_control::rx_level, and dw_i2c_bus_config::speed.

Here is the call graph for this function:

Variable Documentation

◆ i2c_ctrlr

struct soc_i2c_ctrlr_info i2c_ctrlr[I2C_CTRLR_COUNT]
static
Initial value:
= {
{ I2C_MASTER_MODE, 0, ""},
{ I2C_MASTER_MODE, 0, "" },
{ I2C_MASTER_MODE, 0, "" },
{ I2C_MASTER_MODE, 0, "" },
{ I2C_PERIPHERAL_MODE, 0, "" },
}
@ I2C_MASTER_MODE
Definition: i2c.h:13
@ I2C_PERIPHERAL_MODE
Definition: i2c.h:14

Definition at line 1 of file i2c.c.

Referenced by i2c_set_bar(), and soc_get_i2c_ctrlr_info().