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

Go to the source code of this file.

Data Structures

struct  dw_i2c_speed_config
 
struct  dw_i2c_bus_config
 

Macros

#define DW_I2C_DEBUG   BIOS_NEVER
 
#define DW_I2C_SPEED_CONFIG_COUNT   4
 

Functions

uintptr_t dw_i2c_get_soc_early_base (unsigned int bus)
 
int dw_i2c_soc_devfn_to_bus (unsigned int devfn)
 
int dw_i2c_soc_bus_to_devfn (unsigned int bus)
 
const struct dw_i2c_bus_configdw_i2c_get_soc_cfg (unsigned int bus)
 
uintptr_t dw_i2c_base_address (unsigned int bus)
 
enum cb_err dw_i2c_init (unsigned int bus, const struct dw_i2c_bus_config *bcfg)
 
enum cb_err dw_i2c_gen_speed_config (uintptr_t dw_i2c_addr, enum i2c_speed speed, const struct dw_i2c_bus_config *bcfg, struct dw_i2c_speed_config *config)
 
int dw_i2c_soc_dev_to_bus (const struct device *dev)
 
void dw_i2c_dev_init (struct device *dev)
 
void dw_i2c_acpi_fill_ssdt (const struct device *dev)
 

Variables

const struct i2c_bus_operations dw_i2c_bus_ops
 

Macro Definition Documentation

◆ DW_I2C_DEBUG

#define DW_I2C_DEBUG   BIOS_NEVER

Definition at line 14 of file dw_i2c.h.

◆ DW_I2C_SPEED_CONFIG_COUNT

#define DW_I2C_SPEED_CONFIG_COUNT   4

Definition at line 47 of file dw_i2c.h.

Function Documentation

◆ dw_i2c_acpi_fill_ssdt()

◆ dw_i2c_base_address()

uintptr_t dw_i2c_base_address ( unsigned int  bus)

Definition at line 19 of file i2c.c.

References ALIGN_DOWN, soc_i2c_ctrlr_info::bar, base, BIOS_ERR, dw_i2c_soc_bus_to_devfn(), lpss_i2c_early_init_bus(), NULL, PCI_BASE_ADDRESS_0, PCI_DEV, PCI_FUNC, pci_read_config32(), PCI_SLOT, printk, and soc_get_i2c_ctrlr_info().

Referenced by dw_i2c_acpi_fill_ssdt().

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

◆ dw_i2c_dev_init()

void dw_i2c_dev_init ( struct device dev)

Definition at line 782 of file dw_i2c.c.

References config, dw_i2c_get_soc_cfg(), dw_i2c_init(), and dw_i2c_soc_dev_to_bus().

Here is the call graph for this function:

◆ dw_i2c_gen_speed_config()

enum cb_err dw_i2c_gen_speed_config ( uintptr_t  dw_i2c_addr,
enum i2c_speed  speed,
const struct dw_i2c_bus_config bcfg,
struct dw_i2c_speed_config config 
)

Definition at line 484 of file dw_i2c.c.

Referenced by dw_i2c_acpi_fill_ssdt().

Here is the caller graph for this function:

◆ dw_i2c_get_soc_cfg()

const struct dw_i2c_bus_config* dw_i2c_get_soc_cfg ( unsigned int  bus)

Definition at line 33 of file i2c.c.

References BIOS_ERR, chip_get_common_soc_structure(), soc_intel_common_config::i2c, NULL, printk, and soc_get_i2c_bus_config().

Referenced by dw_i2c_acpi_fill_ssdt(), dw_i2c_dev_init(), and lpss_i2c_early_init_bus().

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

◆ dw_i2c_get_soc_early_base()

uintptr_t dw_i2c_get_soc_early_base ( unsigned int  bus)

Definition at line 32 of file i2c.c.

References EARLY_I2C_BASE.

Referenced by lpss_i2c_early_init_bus().

Here is the caller graph for this function:

◆ dw_i2c_init()

enum cb_err dw_i2c_init ( unsigned int  bus,
const struct dw_i2c_bus_config bcfg 
)

Definition at line 484 of file dw_i2c.c.

Referenced by dw_i2c_dev_init(), dw_i2c_soc_init(), and lpss_i2c_early_init_bus().

Here is the caller graph for this function:

◆ dw_i2c_soc_bus_to_devfn()

int dw_i2c_soc_bus_to_devfn ( unsigned int  bus)

◆ dw_i2c_soc_dev_to_bus()

int dw_i2c_soc_dev_to_bus ( const struct device dev)

Definition at line 63 of file i2c.c.

References mmio_path::addr, soc_i2c_ctrlr_info::bar, BIOS_ERR, pci_path::devfn, die(), dw_i2c_soc_devfn_to_bus(), device_path::mmio, device::path, device_path::pci, printk, and soc_get_i2c_ctrlr_info().

Referenced by dw_i2c_acpi_fill_ssdt(), and dw_i2c_dev_init().

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

◆ dw_i2c_soc_devfn_to_bus()

int dw_i2c_soc_devfn_to_bus ( unsigned int  devfn)

Definition at line 13 of file i2c.c.

References PCH_DEV_SLOT_SIO1, PCH_DEV_SLOT_SIO2, PCH_DEVFN_I2C0, PCH_DEVFN_I2C1, PCH_DEVFN_I2C2, PCH_DEVFN_I2C3, PCH_DEVFN_I2C4, PCH_DEVFN_I2C5, PCH_DEVFN_I2C6, PCH_DEVFN_I2C7, PCI_FUNC, and PCI_SLOT.

Referenced by dw_i2c_soc_dev_to_bus().

Here is the caller graph for this function:

Variable Documentation

◆ dw_i2c_bus_ops

const struct i2c_bus_operations dw_i2c_bus_ops
extern

Definition at line 845 of file dw_i2c.c.