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 <console/console.h>
#include <device/i2c_simple.h>
#include <string.h>
#include <soc/blsp.h>
#include <soc/qup.h>
#include <soc/gpio.h>
Include dependency graph for i2c.c:

Go to the source code of this file.

Functions

static int i2c_read (uint32_t gsbi_id, uint8_t slave, uint8_t *data, int data_len)
 
static int i2c_write (uint32_t gsbi_id, uint8_t slave, uint8_t *data, int data_len, uint8_t stop_seq)
 
static int i2c_init (blsp_qup_id_t id)
 
int platform_i2c_transfer (unsigned int bus, struct i2c_msg *segments, int seg_count)
 

Variables

static qup_config_t blsp1_qup0_config
 
static qup_config_t blsp1_qup1_config
 
static qup_config_t blsp1_qup2_config
 
static qup_config_t blsp1_qup3_config
 

Function Documentation

◆ i2c_init()

◆ i2c_read()

static int i2c_read ( uint32_t  gsbi_id,
uint8_t  slave,
uint8_t data,
int  data_len 
)
static

Definition at line 43 of file i2c.c.

References qup_data_t::iic, memset(), qup_data_t::p, qup_data_t::protocol, QUP_MINICORE_I2C_MASTER, qup_recv_data(), QUP_SUCCESS, and slave.

Referenced by platform_i2c_transfer().

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

◆ i2c_write()

static int i2c_write ( uint32_t  gsbi_id,
uint8_t  slave,
uint8_t data,
int  data_len,
uint8_t  stop_seq 
)
static

Definition at line 62 of file i2c.c.

References qup_data_t::iic, memset(), qup_data_t::p, qup_data_t::protocol, QUP_MINICORE_I2C_MASTER, qup_send_data(), QUP_SUCCESS, and slave.

Referenced by platform_i2c_transfer().

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

◆ platform_i2c_transfer()

int platform_i2c_transfer ( unsigned int  bus,
struct i2c_msg segments,
int  seg_count 
)

Definition at line 126 of file i2c.c.

References i2c_msg::buf, i2c_msg::flags, i2c_init(), I2C_M_RD, i2c_read(), i2c_write(), i2c_msg::len, qup_set_state(), QUP_STATE_RESET, and i2c_msg::slave.

Here is the call graph for this function:

Variable Documentation

◆ blsp1_qup0_config

qup_config_t blsp1_qup0_config
static
Initial value:
= {
400000,
19200000,
0
}
@ QUP_MINICORE_I2C_MASTER
Definition: qup.h:121
@ QUP_MODE_BLOCK
Definition: qup.h:127

Definition at line 11 of file i2c.c.

Referenced by i2c_init().

◆ blsp1_qup1_config

qup_config_t blsp1_qup1_config
static
Initial value:
= {
400000,
19200000,
0
}

Definition at line 19 of file i2c.c.

Referenced by i2c_init().

◆ blsp1_qup2_config

qup_config_t blsp1_qup2_config
static
Initial value:
= {
400000,
19200000,
0
}

Definition at line 27 of file i2c.c.

Referenced by i2c_init().

◆ blsp1_qup3_config

qup_config_t blsp1_qup3_config
static
Initial value:
= {
400000,
19200000,
0
}

Definition at line 35 of file i2c.c.

Referenced by i2c_init().