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

Go to the source code of this file.

Functions

int send_ec_command (u8 command)
 
int send_ec_data (u8 data)
 
int send_ec_data_nowait (u8 data)
 
u8 recv_ec_data (void)
 
void ec_clear_out_queue (void)
 
u8 ec_read (u8 addr)
 
int ec_write (u8 addr, u8 data)
 
u8 ec_status (void)
 
u8 ec_query (void)
 
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)
 

Variables

static u16 ec_cmd_reg = EC_SC
 
static u16 ec_data_reg = EC_DATA
 

Function Documentation

◆ ec_clear_out_queue()

void ec_clear_out_queue ( void  )

Definition at line 92 of file ec.c.

References BIOS_ERR, BIOS_SPEW, ec_cmd_reg, ec_data_reg, EC_OBF, inb(), printk, and udelay().

Referenced by mainboard_smi_apmc().

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 
)

◆ ec_query()

u8 ec_query ( void  )

Definition at line 127 of file ec.c.

References recv_ec_data(), and send_ec_command().

Referenced by mainboard_smi_handle_ec_sci().

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

◆ ec_read()

◆ ec_set_bit()

◆ ec_set_ports()

void ec_set_ports ( u16  cmd_reg,
u16  data_reg 
)

Definition at line 143 of file ec.c.

References ec_cmd_reg, ec_data_reg, and ENV_STAGE_HAS_DATA_SECTION.

Referenced by chausie_ec_init(), mainboard_smi_apmc(), mainboard_smi_gpi(), and wilco_ec_init().

Here is the caller graph for this function:

◆ ec_status()

u8 ec_status ( void  )

Definition at line 122 of file ec.c.

References ec_cmd_reg, and inb().

Referenced by ec_running(), and it8518_init().

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

◆ ec_write()

◆ recv_ec_data()

u8 recv_ec_data ( void  )

Definition at line 65 of file ec.c.

References BIOS_DEBUG, BIOS_SPEW, ec_cmd_reg, ec_data_reg, EC_OBF, inb(), printk, and udelay().

Referenced by board_id(), ec_cmd_90_read(), ec_cmd_94_query(), ec_query(), ec_read(), ec_send_time(), get_board_id(), and get_ec_boardinfo().

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

◆ send_ec_command()

◆ send_ec_data()

int send_ec_data ( u8  data)

◆ send_ec_data_nowait()

int send_ec_data_nowait ( u8  data)

Definition at line 58 of file ec.c.

References ec_data_reg, and outb().

Here is the call graph for this function:

Variable Documentation

◆ ec_cmd_reg

u16 ec_cmd_reg = EC_SC
static

◆ ec_data_reg

u16 ec_data_reg = EC_DATA
static