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

Go to the source code of this file.

Functions

static int get_scl (unsigned int bus)
 
static int get_sda (unsigned int bus)
 
static void set_scl (unsigned int bus, int high)
 
static void set_sda (unsigned int bus, int high)
 
void software_i2c_attach (unsigned int bus)
 
void software_i2c_detach (unsigned int bus)
 

Variables

struct {
   gpio_t   scl
 
   gpio_t   sda
 
pins []
 
static struct software_i2c_ops rk_ops
 

Function Documentation

◆ get_scl()

static int get_scl ( unsigned int  bus)
static

Definition at line 23 of file software_i2c.c.

References gpio_get(), pins, and scl.

Referenced by __wait(), in_bit(), out_bit(), software_i2c_wedge_ack(), software_i2c_wedge_read(), software_i2c_wedge_write(), start_cond(), and stop_cond().

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

◆ get_sda()

static int get_sda ( unsigned int  bus)
static

Definition at line 28 of file software_i2c.c.

References gpio_get(), pins, and sda.

Referenced by __wait(), out_bit(), software_i2c_wedge_ack(), software_i2c_wedge_read(), software_i2c_wedge_write(), start_cond(), and stop_cond().

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

◆ set_scl()

static void set_scl ( unsigned int  bus,
int  high 
)
static

Definition at line 33 of file software_i2c.c.

References gpio_input_pullup(), gpio_output(), pins, and scl.

Referenced by software_i2c_attach().

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

◆ set_sda()

static void set_sda ( unsigned int  bus,
int  high 
)
static

Definition at line 41 of file software_i2c.c.

Referenced by software_i2c_attach().

Here is the caller graph for this function:

◆ software_i2c_attach()

◆ software_i2c_detach()

Variable Documentation

◆ 

struct { ... } pins[]
Initial value:
= {
[0]{.scl = GPIO(0, C, 0), .sda = GPIO(0, B, 7)},
[1]{.scl = GPIO(8, A, 5), .sda = GPIO(8, A, 4)},
[2]{.scl = GPIO(6, B, 2), .sda = GPIO(6, B, 1)},
[3]{.scl = GPIO(2, C, 0), .sda = GPIO(2, C, 1)},
[4]{.scl = GPIO(7, C, 2), .sda = GPIO(7, C, 1)},
[5]{.scl = GPIO(7, C, 4), .sda = GPIO(7, C, 3)},
}
@ GPIO
Definition: chip.h:84

Referenced by get_scl(), get_sda(), and set_scl().

◆ rk_ops

struct software_i2c_ops rk_ops
static
Initial value:
= {
.get_scl = get_scl,
.get_sda = get_sda,
.set_scl = set_scl,
.set_sda = set_sda,
}
static void set_scl(unsigned int bus, int high)
Definition: software_i2c.c:33
static void set_sda(unsigned int bus, int high)
Definition: software_i2c.c:41
static int get_scl(unsigned int bus)
Definition: software_i2c.c:23
static int get_sda(unsigned int bus)
Definition: software_i2c.c:28

Definition at line 41 of file software_i2c.c.

Referenced by software_i2c_attach().

◆ scl

gpio_t scl

Definition at line 12 of file software_i2c.c.

◆ sda

gpio_t sda

Definition at line 13 of file software_i2c.c.