coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.c File Reference
#include <assert.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <delay.h>
#include <device/device.h>
#include <device/i2c_simple.h>
#include <device/pci.h>
#include <soc/i2c.h>
#include <soc/ramstage.h>
#include <soc/reg_access.h>
#include <timer.h>
Include dependency graph for i2c.c:

Go to the source code of this file.

Functions

static void i2c_disable (I2C_REGS *regs)
 
static int platform_i2c_write (uint32_t restart, uint8_t *tx_buffer, int length, uint32_t stop, uint8_t *rx_buffer, struct stopwatch *timeout)
 
static int platform_i2c_read (uint32_t restart, uint8_t *rx_buffer, int length, uint32_t stop, struct stopwatch *timeout)
 
int platform_i2c_transfer (unsigned int bus, struct i2c_msg *segment, int seg_count)
 

Function Documentation

◆ i2c_disable()

static void i2c_disable ( I2C_REGS regs)
static

Definition at line 15 of file i2c.c.

References die_with_post_code, IC_ENABLE_CONTROLLER, POST_HW_INIT_FAILURE, and udelay().

Referenced by platform_i2c_read(), platform_i2c_transfer(), and platform_i2c_write().

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

◆ platform_i2c_read()

static int platform_i2c_read ( uint32_t  restart,
uint8_t rx_buffer,
int  length,
uint32_t  stop,
struct stopwatch timeout 
)
static

Definition at line 103 of file i2c.c.

References ASSERT, BIOS_ERR, CONFIG, get_i2c_address(), i2c_disable(), IC_DATA_CMD_READ, IC_INTR_RX_OVER, IC_INTR_RX_UNDER, IC_INTR_TX_ABRT, IC_INTR_TX_OVER, IC_STATUS_RFNE, IC_STATUS_TFNF, length, MIN, NULL, printk, regs, stopwatch_expired(), udelay(), and void().

Referenced by platform_i2c_transfer().

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

◆ platform_i2c_transfer()

◆ platform_i2c_write()

static int platform_i2c_write ( uint32_t  restart,
uint8_t tx_buffer,
int  length,
uint32_t  stop,
uint8_t rx_buffer,
struct stopwatch timeout 
)
static

Definition at line 38 of file i2c.c.

References ASSERT, BIOS_ERR, CONFIG, get_i2c_address(), i2c_disable(), IC_DATA_CMD_WRITE, IC_INTR_RX_OVER, IC_INTR_RX_UNDER, IC_INTR_TX_ABRT, IC_INTR_TX_OVER, IC_STATUS_RFNE, IC_STATUS_TFNF, length, NULL, printk, regs, stopwatch_expired(), and udelay().

Referenced by platform_i2c_transfer().

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