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 <delay.h>
#include <device/device.h>
#include <device/pnp.h>
#include <pc80/keyboard.h>
#include "ec.h"
#include "chip.h"
Include dependency graph for ec.c:

Go to the source code of this file.

Functions

static int input_buffer_empty (u16 status_reg)
 
static int output_buffer_full (u16 status_reg)
 
u8 ec_kbc_read_ob (void)
 
void ec_kbc_write_cmd (u8 cmd)
 
void ec_kbc_write_ib (u8 data)
 
u8 ec_read_ob (void)
 
void ec_write_cmd (u8 cmd)
 
void ec_write_ib (u8 data)
 
u8 ec_read (u16 addr)
 
void ec_write (u16 addr, u8 data)
 
u8 ec_it8518_get_event (void)
 
void ec_it8518_enable_wake_events (void)
 
static void it8518_init (struct device *dev)
 
static void enable_dev (struct device *dev)
 

Variables

static struct device_operations ops
 
static struct pnp_info pnp_dev_info []
 
struct chip_operations ec_quanta_it8518_ops
 

Function Documentation

◆ ec_it8518_enable_wake_events()

void ec_it8518_enable_wake_events ( void  )

Definition at line 123 of file ec.c.

References EC_LID_WAKE_ENABLE, ec_read(), EC_WAKE_SRC_ENABLE, and ec_write().

Referenced by mainboard_smi_sleep().

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

◆ ec_it8518_get_event()

u8 ec_it8518_get_event ( void  )

Definition at line 109 of file ec.c.

References ec_kbc_read_ob(), ec_kbc_write_cmd(), EC_KBD_SMI_EVENT, ec_read_ob(), EC_SC, ec_write_cmd(), inb(), QR_EC, SCI_EVT, and SMI_EVT.

Referenced by mainboard_smi_ec().

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

◆ ec_kbc_read_ob()

u8 ec_kbc_read_ob ( void  )

Definition at line 55 of file ec.c.

References inb(), KBD_DATA, KBD_STATUS, and output_buffer_full().

Here is the call graph for this function:

◆ ec_kbc_write_cmd()

void ec_kbc_write_cmd ( u8  cmd)

Definition at line 61 of file ec.c.

References input_buffer_empty(), KBD_COMMAND, KBD_STATUS, and outb().

Here is the call graph for this function:

◆ ec_kbc_write_ib()

void ec_kbc_write_ib ( u8  data)

Definition at line 67 of file ec.c.

References input_buffer_empty(), KBD_DATA, KBD_STATUS, and outb().

Here is the call graph for this function:

◆ ec_read()

u8 ec_read ( u16  addr)

Definition at line 95 of file ec.c.

References addr, ec_read_ob(), ec_write_cmd(), ec_write_ib(), and RD_EC.

Here is the call graph for this function:

◆ ec_read_ob()

u8 ec_read_ob ( void  )

Definition at line 77 of file ec.c.

References EC_DATA, EC_SC, inb(), and output_buffer_full().

Here is the call graph for this function:

◆ ec_write()

void ec_write ( u16  addr,
u8  data 
)

Definition at line 102 of file ec.c.

References addr, ec_write_cmd(), ec_write_ib(), and WR_EC.

Here is the call graph for this function:

◆ ec_write_cmd()

void ec_write_cmd ( u8  cmd)

Definition at line 83 of file ec.c.

References EC_SC, input_buffer_empty(), and outb().

Here is the call graph for this function:

◆ ec_write_ib()

void ec_write_ib ( u8  data)

Definition at line 89 of file ec.c.

References EC_DATA, EC_SC, input_buffer_empty(), and outb().

Here is the call graph for this function:

◆ enable_dev()

static void enable_dev ( struct device dev)
static

Definition at line 151 of file ec.c.

◆ input_buffer_empty()

static int input_buffer_empty ( u16  status_reg)
static

Definition at line 14 of file ec.c.

References BIOS_WARNING, inb(), KBC_TIMEOUT_IN_MS, KBD_IBF, printk, and udelay().

Referenced by ec_kbc_write_cmd(), ec_kbc_write_ib(), ec_write_cmd(), and ec_write_ib().

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

◆ it8518_init()

static void it8518_init ( struct device dev)
static

Definition at line 132 of file ec.c.

References BIOS_DEBUG, device::enabled, NO_AUX_DEVICE, pc_keyboard_init(), and printk.

Here is the call graph for this function:

◆ output_buffer_full()

static int output_buffer_full ( u16  status_reg)
static

Definition at line 29 of file ec.c.

References BIOS_INFO, inb(), KBC_TIMEOUT_IN_MS, KBD_OBF, printk, and udelay().

Referenced by ec_kbc_read_ob(), and ec_read_ob().

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

Variable Documentation

◆ ec_quanta_it8518_ops

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

Definition at line 151 of file ec.c.

◆ ops

struct device_operations ops
static
Initial value:
= {
.init = it8518_init,
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
}
static void it8518_init(struct device *dev)
Definition: ec.c:132
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
Definition: device.h:73
static void noop_set_resources(struct device *dev)
Definition: device.h:74

Definition at line 132 of file ec.c.

◆ pnp_dev_info

struct pnp_info pnp_dev_info[]
static
Initial value:
= {
{ NULL, 0, 0, 0, }
}
#define NULL
Definition: stddef.h:19

Definition at line 132 of file ec.c.