![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
Go to the source code of this file.
Macros | |
#define | DEBUG 0 /* Set to 1 for per-byte output */ |
#define | SPEW 0 /* Set to 1 for verbose bitwise/line-state output */ |
#define | DELAY_US 5 /* Default setup delay: 4us (+1 for timer inaccuracy) */ |
#define | TIMEOUT_US 50000 /* Maximum clock stretching time we want to allow */ |
#define | spew(...) do { if (SPEW) printk(BIOS_SPEW, ##__VA_ARGS__); } while (0) |
#define | ERR_NACK -2 |
#define | ERR_TIMEOUT -3 |
#define | ERR_ARB -4 |
#define | ERR_WEDGE -5 |
Functions | |
static int | __wait (unsigned int bus, int timeout_us, int for_scl) |
static void | wait (unsigned int bus) |
static int | wait_for_scl (unsigned int bus, const char *error_context) |
static int | start_cond (unsigned int bus) |
static int | stop_cond (unsigned int bus) |
static int | out_bit (unsigned int bus, int bit) |
static int | in_bit (unsigned int bus) |
static int | out_byte (unsigned int bus, u8 byte) |
static int | in_byte (unsigned int bus, int ack) |
int | software_i2c_transfer (unsigned int bus, struct i2c_msg *segments, int count) |
void | software_i2c_wedge_ack (unsigned int bus, u8 chip) |
void | software_i2c_wedge_read (unsigned int bus, u8 chip, u8 reg, int bits) |
void | software_i2c_wedge_write (unsigned int bus, u8 chip, u8 reg, int bits) |
Variables | |
struct software_i2c_ops * | software_i2c [SOFTWARE_I2C_MAX_BUS] |
#define DEBUG 0 /* Set to 1 for per-byte output */ |
Definition at line 12 of file software_i2c.c.
#define DELAY_US 5 /* Default setup delay: 4us (+1 for timer inaccuracy) */ |
Definition at line 14 of file software_i2c.c.
#define ERR_ARB -4 |
Definition at line 21 of file software_i2c.c.
#define ERR_NACK -2 |
Definition at line 19 of file software_i2c.c.
#define ERR_TIMEOUT -3 |
Definition at line 20 of file software_i2c.c.
#define ERR_WEDGE -5 |
Definition at line 22 of file software_i2c.c.
#define SPEW 0 /* Set to 1 for verbose bitwise/line-state output */ |
Definition at line 13 of file software_i2c.c.
Definition at line 17 of file software_i2c.c.
#define TIMEOUT_US 50000 /* Maximum clock stretching time we want to allow */ |
Definition at line 15 of file software_i2c.c.
|
static |
Definition at line 30 of file software_i2c.c.
References get_scl(), software_i2c_ops::get_scl, get_sda(), software_i2c_ops::get_sda, scl, sda, software_i2c, spew, stopwatch_duration_usecs(), stopwatch_expired(), and stopwatch_init_usecs_expire().
Referenced by wait(), and wait_for_scl().
|
static |
Definition at line 166 of file software_i2c.c.
References assert, ERR_TIMEOUT, get_scl(), software_i2c_ops::get_sda, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, spew, wait(), and wait_for_scl().
Referenced by in_byte(), out_byte(), and software_i2c_wedge_read().
|
static |
Definition at line 212 of file software_i2c.c.
References BIOS_DEBUG, DEBUG, in_bit(), out_bit(), and printk.
Referenced by software_i2c_transfer(), and spi_bitbang_xfer().
|
static |
Definition at line 133 of file software_i2c.c.
References assert, BIOS_ERR, ERR_TIMEOUT, ERR_WEDGE, get_scl(), get_sda(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, spew, wait(), and wait_for_scl().
Referenced by in_byte(), out_byte(), software_i2c_wedge_ack(), and software_i2c_wedge_write().
Definition at line 194 of file software_i2c.c.
References BIOS_DEBUG, DEBUG, ERR_NACK, in_bit(), out_bit(), and printk.
Referenced by software_i2c_transfer(), software_i2c_wedge_read(), software_i2c_wedge_write(), and spi_bitbang_xfer().
Definition at line 233 of file software_i2c.c.
References i2c_msg::buf, count, i2c_msg::flags, I2C_M_RD, in_byte(), i2c_msg::len, out_byte(), i2c_msg::slave, start_cond(), and stop_cond().
Referenced by i2c_transfer().
Definition at line 261 of file software_i2c.c.
References BIOS_INFO, chip, get_scl(), get_sda(), out_bit(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, start_cond(), wait(), and wait_for_scl().
Definition at line 284 of file software_i2c.c.
References BIOS_INFO, chip, get_scl(), get_sda(), in_bit(), out_byte(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, start_cond(), wait(), and wait_for_scl().
Definition at line 313 of file software_i2c.c.
References BIOS_INFO, chip, get_scl(), get_sda(), out_bit(), out_byte(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, start_cond(), wait(), and wait_for_scl().
|
static |
Definition at line 72 of file software_i2c.c.
References assert, BIOS_ERR, ERR_ARB, ERR_TIMEOUT, get_scl(), get_sda(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, spew, wait(), and wait_for_scl().
Referenced by software_i2c_transfer(), software_i2c_wedge_ack(), software_i2c_wedge_read(), and software_i2c_wedge_write().
|
static |
Definition at line 104 of file software_i2c.c.
References assert, BIOS_WARNING, ERR_TIMEOUT, get_scl(), get_sda(), printk, software_i2c_ops::set_scl, software_i2c_ops::set_sda, software_i2c, spew, wait(), and wait_for_scl().
Referenced by software_i2c_transfer().
Definition at line 55 of file software_i2c.c.
References __wait(), and DELAY_US.
Referenced by in_bit(), out_bit(), software_i2c_wedge_ack(), software_i2c_wedge_read(), software_i2c_wedge_write(), spi_sdcard_do_command_help(), spi_sdcard_init(), spi_sdcard_multiple_read(), spi_sdcard_multiple_write(), spi_sdcard_single_read(), spi_sdcard_single_write(), spi_sdcard_size(), start_cond(), and stop_cond().
|
static |
Definition at line 61 of file software_i2c.c.
References __wait(), BIOS_ERR, ERR_TIMEOUT, printk, and TIMEOUT_US.
Referenced by in_bit(), out_bit(), software_i2c_wedge_ack(), software_i2c_wedge_read(), software_i2c_wedge_write(), start_cond(), and stop_cond().
struct software_i2c_ops* software_i2c[SOFTWARE_I2C_MAX_BUS] |
Definition at line 24 of file software_i2c.c.
Referenced by __wait(), ast_software_i2c_read(), i2c_transfer(), in_bit(), out_bit(), software_i2c_attach(), software_i2c_detach(), software_i2c_wedge_ack(), software_i2c_wedge_read(), software_i2c_wedge_write(), start_cond(), stop_cond(), tegra_software_i2c_disable(), and tegra_software_i2c_init().