coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EC_IO   0x100 /* Mainboard specific. Could be Kconfig option */
 
#define EC_IO_HIGH   EC_IO + 1
 
#define EC_IO_LOW   EC_IO + 2
 
#define EC_IO_DATA   EC_IO + 3
 
#define KBC_TIMEOUT_IN_MS   400
 
#define KBD_DATA   0x60
 
#define KBD_COMMAND   0x64
 
#define KBD_STATUS   0x64
 
#define KBD_IBF   (1 << 1)
 
#define KBD_OBF   (1 << 0)
 
#define EC_KBD_SMI_EVENT   0xCD
 
#define EC_KBD_CMD_UNMUTE   0xE8
 
#define EC_KBD_CMD_MUTE   0xE9
 
#define EC_DATA   0x62
 
#define EC_SC   0x66
 
#define SMI_EVT   (1 << 6)
 
#define SCI_EVT   (1 << 5)
 
#define RD_EC   0x80
 
#define WR_EC   0x81
 
#define QR_EC   0x84
 
#define EC_CMD_EXIT_BOOT_BLOCK   0x85
 
#define EC_CMD_NOTIFY_ACPI_ENTER   0x86
 
#define EC_CMD_NOTIFY_ACPI_EXIT   0x87
 
#define EC_CMD_WARM_RESET   0x8C
 
#define EC_PERIPH_CNTL_3   0x0D
 
#define EC_USB_S3_EN   0x26
 
#define EC_PERIPH_STAT_3   0x35
 
#define EC_THERM_0   0x78
 
#define EC_WAKE_SRC_ENABLE   0xBF
 
#define EC_FW_VER   0xE8
 
#define EC_IF_MIN_VER   0xEB
 
#define EC_STATUS_REG   0xEC
 
#define EC_IF_MAJ_VER   0xEF
 
#define EC_MBAT_STATUS   0x0138
 
#define EC_IN_RO_MODE   0x1
 
#define EC_IN_RECOVERY_MODE   0x3
 
#define EC_LID_WAKE_ENABLE   0x4
 

Functions

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)
 

Macro Definition Documentation

◆ EC_CMD_EXIT_BOOT_BLOCK

#define EC_CMD_EXIT_BOOT_BLOCK   0x85

Definition at line 44 of file ec.h.

◆ EC_CMD_NOTIFY_ACPI_ENTER

#define EC_CMD_NOTIFY_ACPI_ENTER   0x86

Definition at line 45 of file ec.h.

◆ EC_CMD_NOTIFY_ACPI_EXIT

#define EC_CMD_NOTIFY_ACPI_EXIT   0x87

Definition at line 46 of file ec.h.

◆ EC_CMD_WARM_RESET

#define EC_CMD_WARM_RESET   0x8C

Definition at line 47 of file ec.h.

◆ EC_DATA

#define EC_DATA   0x62

Definition at line 34 of file ec.h.

◆ EC_FW_VER

#define EC_FW_VER   0xE8

Definition at line 55 of file ec.h.

◆ EC_IF_MAJ_VER

#define EC_IF_MAJ_VER   0xEF

Definition at line 58 of file ec.h.

◆ EC_IF_MIN_VER

#define EC_IF_MIN_VER   0xEB

Definition at line 56 of file ec.h.

◆ EC_IN_RECOVERY_MODE

#define EC_IN_RECOVERY_MODE   0x3

Definition at line 65 of file ec.h.

◆ EC_IN_RO_MODE

#define EC_IN_RO_MODE   0x1

Definition at line 64 of file ec.h.

◆ EC_IO

#define EC_IO   0x100 /* Mainboard specific. Could be Kconfig option */

Definition at line 10 of file ec.h.

◆ EC_IO_DATA

#define EC_IO_DATA   EC_IO + 3

Definition at line 13 of file ec.h.

◆ EC_IO_HIGH

#define EC_IO_HIGH   EC_IO + 1

Definition at line 11 of file ec.h.

◆ EC_IO_LOW

#define EC_IO_LOW   EC_IO + 2

Definition at line 12 of file ec.h.

◆ EC_KBD_CMD_MUTE

#define EC_KBD_CMD_MUTE   0xE9

Definition at line 27 of file ec.h.

◆ EC_KBD_CMD_UNMUTE

#define EC_KBD_CMD_UNMUTE   0xE8

Definition at line 26 of file ec.h.

◆ EC_KBD_SMI_EVENT

#define EC_KBD_SMI_EVENT   0xCD

Definition at line 25 of file ec.h.

◆ EC_LID_WAKE_ENABLE

#define EC_LID_WAKE_ENABLE   0x4

Definition at line 68 of file ec.h.

◆ EC_MBAT_STATUS

#define EC_MBAT_STATUS   0x0138

Definition at line 59 of file ec.h.

◆ EC_PERIPH_CNTL_3

#define EC_PERIPH_CNTL_3   0x0D

Definition at line 50 of file ec.h.

◆ EC_PERIPH_STAT_3

#define EC_PERIPH_STAT_3   0x35

Definition at line 52 of file ec.h.

◆ EC_SC

#define EC_SC   0x66

Definition at line 35 of file ec.h.

◆ EC_STATUS_REG

#define EC_STATUS_REG   0xEC

Definition at line 57 of file ec.h.

◆ EC_THERM_0

#define EC_THERM_0   0x78

Definition at line 53 of file ec.h.

◆ EC_USB_S3_EN

#define EC_USB_S3_EN   0x26

Definition at line 51 of file ec.h.

◆ EC_WAKE_SRC_ENABLE

#define EC_WAKE_SRC_ENABLE   0xBF

Definition at line 54 of file ec.h.

◆ KBC_TIMEOUT_IN_MS

#define KBC_TIMEOUT_IN_MS   400

Definition at line 16 of file ec.h.

◆ KBD_COMMAND

#define KBD_COMMAND   0x64

Definition at line 20 of file ec.h.

◆ KBD_DATA

#define KBD_DATA   0x60

Definition at line 19 of file ec.h.

◆ KBD_IBF

#define KBD_IBF   (1 << 1)

Definition at line 22 of file ec.h.

◆ KBD_OBF

#define KBD_OBF   (1 << 0)

Definition at line 23 of file ec.h.

◆ KBD_STATUS

#define KBD_STATUS   0x64

Definition at line 21 of file ec.h.

◆ QR_EC

#define QR_EC   0x84

Definition at line 42 of file ec.h.

◆ RD_EC

#define RD_EC   0x80

Definition at line 40 of file ec.h.

◆ SCI_EVT

#define SCI_EVT   (1 << 5)

Definition at line 37 of file ec.h.

◆ SMI_EVT

#define SMI_EVT   (1 << 6)

Definition at line 36 of file ec.h.

◆ WR_EC

#define WR_EC   0x81

Definition at line 41 of file ec.h.

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 71 of file ec.c.

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

Referenced by ec_get_smi_event(), ec_it8518_get_event(), mainboard_smi_ec(), parrot_ec_init(), and parrot_rev().

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

◆ ec_kbc_write_cmd()

◆ ec_kbc_write_ib()

void ec_kbc_write_ib ( u8  data)

Definition at line 83 of file ec.c.

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

Referenced by ec_enter_acpi_mode(), ec_enter_apm_mode(), enter_apm_mode(), mainboard_smi_apmc(), mainboard_smi_sleep(), parrot_ec_init(), parrot_rev(), and set_keyboard_matrix_us().

Here is the call graph for this function:
Here is the caller 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 73 of file ec.c.

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

Referenced by ec_it8518_get_event(), ec_mem_read(), and ec_read().

Here is the call graph for this function:
Here is the caller 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 79 of file ec.c.

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

Referenced by early_ec_init(), ec_it8518_get_event(), ec_mem_read(), ec_mem_write(), ec_read(), ec_write(), mainboard_smi_apmc(), and mainboard_suspend_resume().

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

◆ ec_write_ib()

void ec_write_ib ( u8  data)

Definition at line 85 of file ec.c.

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

Referenced by ec_mem_read(), ec_mem_write(), ec_read(), and ec_write().

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