coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.c File Reference
#include <arch/io.h>
#include <console/console.h>
#include <device/device.h>
#include <delay.h>
#include "ec.h"
#include "chip.h"
Include dependency graph for ec.c:

Go to the source code of this file.

Functions

static u8 __ec_read (u8 addr)
 
static void __ec_write (u8 addr, u8 data)
 
static int ec_ready (void)
 
int send_ec_command (u8 command)
 
int send_ec_command_data (u8 command, u8 data)
 
u8 read_ec_command_byte (u8 command)
 
u8 ec_read (u8 addr)
 
int ec_write (u8 addr, u8 data)
 
void ec_set_bit (u8 addr, u8 bit)
 
void ec_clr_bit (u8 addr, u8 bit)
 
void ec_set_ports (u16 cmd_reg, u16 data_reg)
 
static void mec1308_enable (struct device *dev)
 

Variables

static u16 ec_cmd_reg = 0
 
static u16 ec_data_reg = 0
 
struct chip_operations ec_smsc_mec1308_ops
 

Function Documentation

◆ __ec_read()

static u8 __ec_read ( u8  addr)
inlinestatic

Definition at line 14 of file ec.c.

References addr, ec_cmd_reg, ec_data_reg, inb(), and outb().

Referenced by ec_read(), ec_ready(), and read_ec_command_byte().

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

◆ __ec_write()

static void __ec_write ( u8  addr,
u8  data 
)
inlinestatic

Definition at line 20 of file ec.c.

References addr, ec_cmd_reg, ec_data_reg, and outb().

Referenced by ec_write(), send_ec_command(), and send_ec_command_data().

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

◆ ec_clr_bit()

void ec_clr_bit ( u8  addr,
u8  bit 
)

Definition at line 93 of file ec.c.

References addr, ec_read(), and ec_write().

Here is the call graph for this function:

◆ ec_read()

u8 ec_read ( u8  addr)

Definition at line 71 of file ec.c.

References __ec_read(), addr, EC_MAILBOX_DATA, EC_RAM_READ, and send_ec_command_data().

Here is the call graph for this function:

◆ ec_ready()

static int ec_ready ( void  )
static

Definition at line 26 of file ec.c.

References __ec_read(), BIOS_DEBUG, BIOS_SPEW, ec_cmd_reg, ec_data_reg, EC_MAILBOX_COMMAND, EC_TIMEOUT, printk, and udelay().

Referenced by ec_write(), send_ec_command(), and send_ec_command_data().

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

◆ ec_set_bit()

void ec_set_bit ( u8  addr,
u8  bit 
)

Definition at line 88 of file ec.c.

References addr, ec_read(), and ec_write().

Here is the call graph for this function:

◆ ec_set_ports()

void ec_set_ports ( u16  cmd_reg,
u16  data_reg 
)

Definition at line 98 of file ec.c.

References ec_cmd_reg, and ec_data_reg.

◆ ec_write()

int ec_write ( u8  addr,
u8  data 
)

Definition at line 78 of file ec.c.

References __ec_write(), addr, EC_MAILBOX_COMMAND, EC_MAILBOX_DATA, EC_MAILBOX_DATA_H, EC_RAM_WRITE, and ec_ready().

Here is the call graph for this function:

◆ mec1308_enable()

static void mec1308_enable ( struct device dev)
static

Definition at line 104 of file ec.c.

◆ read_ec_command_byte()

u8 read_ec_command_byte ( u8  command)

Definition at line 65 of file ec.c.

References __ec_read(), EC_MAILBOX_DATA, and send_ec_command().

Referenced by mainboard_smi_ec().

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

◆ send_ec_command()

int send_ec_command ( u8  command)

Definition at line 48 of file ec.c.

References __ec_write(), EC_MAILBOX_COMMAND, and ec_ready().

Here is the call graph for this function:

◆ send_ec_command_data()

int send_ec_command_data ( u8  command,
u8  data 
)

Definition at line 56 of file ec.c.

References __ec_write(), EC_MAILBOX_COMMAND, EC_MAILBOX_DATA, and ec_ready().

Referenced by ec_read(), and lumpy_ec_init().

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

Variable Documentation

◆ ec_cmd_reg

u16 ec_cmd_reg = 0
static

Definition at line 11 of file ec.c.

Referenced by __ec_read(), __ec_write(), ec_ready(), and ec_set_ports().

◆ ec_data_reg

u16 ec_data_reg = 0
static

Definition at line 12 of file ec.c.

Referenced by __ec_read(), __ec_write(), ec_ready(), and ec_set_ports().

◆ ec_smsc_mec1308_ops

struct chip_operations ec_smsc_mec1308_ops
Initial value:
= {
.enable_dev = mec1308_enable
}
static void mec1308_enable(struct device *dev)
Definition: ec.c:104

Definition at line 104 of file ec.c.