coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <assert.h>
#include <console/console.h>
#include <delay.h>
#include <device/i2c_simple.h>
#include <soc/clk.h>
#include <soc/i2c.h>
#include <soc/periph.h>
#include <timer.h>
Go to the source code of this file.
Data Structures | |
struct | i2c_regs |
struct | s3c24x0_i2c_bus |
Macros | |
#define | I2C_TIMEOUT_US (1000 * USECS_PER_MSEC) |
Enumerations | |
enum | { I2cConIntPending = 0x1 << 4 , I2cConIntEn = 0x1 << 5 , I2cConAckGen = 0x1 << 7 } |
enum | { I2cStatAck = 0x1 << 0 , I2cStatAddrZero = 0x1 << 1 , I2cStatAddrSlave = 0x1 << 2 , I2cStatArb = 0x1 << 3 , I2cStatEnable = 0x1 << 4 , I2cStatStartStop = 0x1 << 5 , I2cStatBusy = 0x1 << 5 , I2cStatModeMask = 0x3 << 6 , I2cStatSlaveRecv = 0x0 << 6 , I2cStatSlaveXmit = 0x1 << 6 , I2cStatMasterRecv = 0x2 << 6 , I2cStatMasterXmit = 0x3 << 6 } |
Functions | |
static int | i2c_int_pending (struct i2c_regs *regs) |
static void | i2c_clear_int (struct i2c_regs *regs) |
static void | i2c_ack_enable (struct i2c_regs *regs) |
static void | i2c_ack_disable (struct i2c_regs *regs) |
static int | i2c_got_ack (struct i2c_regs *regs) |
static int | i2c_wait_for_idle (struct i2c_regs *regs, int timeout_us) |
static int | i2c_wait_for_int (struct i2c_regs *regs, int timeout_us) |
static int | i2c_send_stop (struct i2c_regs *regs) |
static int | i2c_send_start (struct i2c_regs *regs, int read, int chip) |
static int | i2c_xmit_buf (struct i2c_regs *regs, uint8_t *data, int len) |
static int | i2c_recv_buf (struct i2c_regs *regs, uint8_t *data, int len) |
int | platform_i2c_transfer (unsigned int bus, struct i2c_msg *segments, int seg_count) |
void | i2c_init (unsigned int bus, int speed, int slaveadd) |
Variables | |
static struct s3c24x0_i2c_bus | i2c_busses [] |
#define I2C_TIMEOUT_US (1000 * USECS_PER_MSEC) |
anonymous enum |
anonymous enum |
Definition at line 115 of file i2c.c.
References I2cConAckGen, read8(), and write8().
Referenced by i2c_recv_buf().
Definition at line 110 of file i2c.c.
References I2cConAckGen, read8(), and write8().
Referenced by i2c_recv_buf(), and i2c_xmit_buf().
Definition at line 105 of file i2c.c.
References I2cConIntPending, read8(), and write8().
Referenced by i2c_recv_buf(), i2c_send_start(), i2c_send_stop(), and i2c_xmit_buf().
|
static |
Definition at line 120 of file i2c.c.
References I2cStatAck, and read8().
Referenced by i2c_send_start(), and i2c_xmit_buf().
|
static |
Definition at line 100 of file i2c.c.
References I2cConIntPending, and read8().
Referenced by i2c_wait_for_int().
Definition at line 198 of file i2c.c.
References ASSERT, i2c_ack_disable(), i2c_ack_enable(), i2c_clear_int(), i2c_wait_for_int(), and read8().
Referenced by platform_i2c_transfer().
|
static |
Definition at line 157 of file i2c.c.
References chip, i2c_clear_int(), i2c_got_ack(), I2C_TIMEOUT_US, i2c_wait_for_int(), I2cStatEnable, I2cStatMasterRecv, I2cStatMasterXmit, I2cStatStartStop, and write8().
Referenced by platform_i2c_transfer().
|
static |
Definition at line 149 of file i2c.c.
References i2c_clear_int(), I2C_TIMEOUT_US, i2c_wait_for_idle(), I2cStatEnable, I2cStatModeMask, read8(), and write8().
Referenced by platform_i2c_transfer().
|
static |
Definition at line 125 of file i2c.c.
References BIOS_ERR, DIV_ROUND_UP, I2cStatBusy, printk, read8(), and udelay().
Referenced by i2c_send_stop(), and platform_i2c_transfer().
|
static |
Definition at line 137 of file i2c.c.
References BIOS_ERR, DIV_ROUND_UP, i2c_int_pending(), printk, and udelay().
Referenced by i2c_recv_buf(), i2c_send_start(), and i2c_xmit_buf().
Definition at line 175 of file i2c.c.
References ASSERT, BIOS_INFO, i2c_ack_enable(), i2c_clear_int(), i2c_got_ack(), i2c_wait_for_int(), printk, and write8().
Referenced by platform_i2c_transfer().
Definition at line 219 of file i2c.c.
References i2c_msg::buf, i2c_msg::flags, i2c_busses, I2C_M_RD, i2c_recv_buf(), i2c_send_start(), i2c_send_stop(), I2C_TIMEOUT_US, i2c_wait_for_idle(), i2c_xmit_buf(), I2cStatEnable, I2cStatMasterXmit, i2c_msg::len, s3c24x0_i2c_bus::regs, i2c_msg::slave, and write8().
|
static |
Definition at line 1 of file i2c.c.
Referenced by i2c_init(), and platform_i2c_transfer().