coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
i2c.c File Reference
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <device/i2c_simple.h>
#include <string.h>
#include <soc/addressmap.h>
#include <stdint.h>
#include "i2c.h"
Include dependency graph for i2c.c:

Go to the source code of this file.

Functions

static void do_bus_clear (int bus)
 
static int tegra_i2c_send_recv (int bus, int read, uint32_t *headers, int header_words, uint8_t *data, int data_len)
 
static int tegra_i2c_request (int bus, unsigned int chip, int cont, int restart, int read, void *data, int data_len)
 
static int i2c_transfer_segment (unsigned int bus, unsigned int chip, int restart, int read, void *buf, int len)
 
int platform_i2c_transfer (unsigned int bus, struct i2c_msg *segments, int count)
 
void i2c_init (unsigned int bus)
 

Function Documentation

◆ do_bus_clear()

static void do_bus_clear ( int  bus)
static

Definition at line 13 of file i2c.c.

References BIOS_DEBUG, I2C_BUS_CLEAR_CONFIG_BC_ENABLE, I2C_BUS_CLEAR_CONFIG_BC_TERMINATE_IMMEDIATE, I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD_ENABLE, info, printk, read32(), tegra_i2c_info, udelay(), and write32().

Referenced by tegra_i2c_send_recv().

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

◆ i2c_init()

◆ i2c_transfer_segment()

static int i2c_transfer_segment ( unsigned int  bus,
unsigned int  chip,
int  restart,
int  read,
void buf,
int  len 
)
static

Definition at line 160 of file i2c.c.

References buf, chip, IOHEADER_PAYLOADSIZE_MASK, IOHEADER_PAYLOADSIZE_SHIFT, MIN, and tegra_i2c_request().

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  count 
)

Definition at line 178 of file i2c.c.

References BIOS_ERR, i2c_msg::buf, count, i2c_msg::flags, I2C_M_RD, i2c_transfer_segment(), i2c_msg::len, num_i2c_buses, printk, and i2c_msg::slave.

Here is the call graph for this function:

◆ tegra_i2c_request()

static int tegra_i2c_request ( int  bus,
unsigned int  chip,
int  cont,
int  restart,
int  read,
void data,
int  data_len 
)
static

◆ tegra_i2c_send_recv()

static int tegra_i2c_send_recv ( int  bus,
int  read,
uint32_t headers,
int  header_words,
uint8_t data,
int  data_len 
)
static