coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.h File Reference
#include <amdblocks/gpio.h>
#include <device/i2c.h>
#include <drivers/i2c/designware/dw_i2c.h>
#include <types.h>
Include dependency graph for i2c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  soc_i2c_ctrlr_info
 Data structure to hold SoC I2C controller information @bar: MMIO base address for the I2C bus. More...
 
struct  soc_i2c_scl_pin
 Data structure to identify GPIO to be toggled to reset peripherals on an I2C bus. More...
 
struct  soc_i2c_peripheral_reset_info
 Information about I2C peripherals that need to be reset. More...
 
struct  i2c_pad_control
 

Macros

#define I2C_RESET_SCL_PIN(pin_name, pin_mask_value)
 

Enumerations

enum  i2c_ctrlr_mode { I2C_MASTER_MODE , I2C_PERIPHERAL_MODE }
 
enum  i2c_pad_rx_level {
  I2C_PAD_RX_NO_CHANGE , I2C_PAD_RX_OFF , I2C_PAD_RX_3_3V , I2C_PAD_RX_1_8V ,
  I2C_PAD_RX_1_1V
}
 

Functions

void fch_i2c_pad_init (unsigned int bus, enum i2c_speed speed, const struct i2c_pad_control *ctrl)
 
void fch_i23c_pad_init (unsigned int bus, enum i2c_speed speed, const struct i2c_pad_control *ctrl)
 
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)
 
void i2c_soc_early_init (void)
 
void i2c_soc_init (void)
 
void sb_reset_i2c_peripherals (const struct soc_i2c_peripheral_reset_info *reset_info)
 

Macro Definition Documentation

◆ I2C_RESET_SCL_PIN

#define I2C_RESET_SCL_PIN (   pin_name,
  pin_mask_value 
)
Value:
{ \
.pin = PAD_CFG_STRUCT(pin_name, pin_name ## _IOMUX_GPIOxx, PAD_OUTPUT(HIGH)), \
.pin_mask = pin_mask_value, \
}
#define PAD_CFG_STRUCT(__pin, __function, __control)
Definition: gpio_defs.h:196
#define PAD_OUTPUT(__dir)
Definition: gpio_defs.h:200

Definition at line 39 of file i2c.h.

Enumeration Type Documentation

◆ i2c_ctrlr_mode

Enumerator
I2C_MASTER_MODE 
I2C_PERIPHERAL_MODE 

Definition at line 12 of file i2c.h.

◆ i2c_pad_rx_level

Enumerator
I2C_PAD_RX_NO_CHANGE 
I2C_PAD_RX_OFF 
I2C_PAD_RX_3_3V 
I2C_PAD_RX_1_8V 
I2C_PAD_RX_1_1V 

Definition at line 59 of file i2c.h.

Function Documentation

◆ fch_i23c_pad_init()

◆ fch_i2c_pad_init()

◆ i2c_soc_early_init()

void i2c_soc_early_init ( void  )

Definition at line 108 of file i2c.c.

References dw_i2c_soc_init().

Referenced by bootblock_soc_init(), fch_early_init(), and verstage_soc_i2c_init().

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

◆ i2c_soc_init()

void i2c_soc_init ( void  )

Definition at line 113 of file i2c.c.

References dw_i2c_soc_init().

Referenced by fch_init(), and mainboard_init().

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

◆ sb_reset_i2c_peripherals()

void sb_reset_i2c_peripherals ( const struct soc_i2c_peripheral_reset_info reset_info)

◆ soc_get_i2c_bus_config()

const struct dw_i2c_bus_config* soc_get_i2c_bus_config ( size_t num_buses)

Definition at line 51 of file i2c.c.

References ARRAY_SIZE, config, and config_of_soc.

Referenced by dw_i2c_get_soc_cfg(), and dw_i2c_soc_init().

Here is the caller graph for this function:

◆ soc_get_i2c_ctrlr_info()

const struct soc_i2c_ctrlr_info* soc_get_i2c_ctrlr_info ( size_t num_ctrlrs)

Definition at line 45 of file i2c.c.

References ARRAY_SIZE, and i2c_ctrlr.

Referenced by dw_i2c_base_address(), dw_i2c_soc_dev_to_bus(), dw_i2c_soc_init(), and i2c_acpi_name().

Here is the caller graph for this function:

◆ soc_i2c_misc_init()

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

Definition at line 35 of file i2c.c.

References ARRAY_SIZE, config, config_of_soc, fch_i23c_pad_init(), fch_i2c_pad_init(), I2C_PAD_RX_3_3V, i2c_pad_control::rx_level, and dw_i2c_bus_config::speed.

Referenced by dw_i2c_soc_init().

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