coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _EC_ACPI_H
4 #define _EC_ACPI_H
5 
6 #include <stdint.h>
7 
8 #define EC_DATA 0x62
9 #define EC_SC 0x66
10 
11 /* EC_SC input */
12 #define EC_SMI_EVT (1 << 6) // 1: SMI event pending
13 #define EC_SCI_EVT (1 << 5) // 1: SCI event pending
14 #define EC_BURST (1 << 4) // controller is in burst mode
15 #define EC_CMD (1 << 3) // 1: byte in data register is command
16  // 0: byte in data register is data
17 #define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
18 #define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
19 /* EC_SC output */
20 #define RD_EC 0x80 // Read Embedded Controller
21 #define WR_EC 0x81 // Write Embedded Controller
22 #define BE_EC 0x82 // Burst Enable Embedded Controller
23 #define BD_EC 0x83 // Burst Disable Embedded Controller
24 #define QR_EC 0x84 // Query Embedded Controller
25 
26 int send_ec_command(u8 command);
27 int send_ec_data(u8 data);
28 int send_ec_data_nowait(u8 data);
29 u8 recv_ec_data(void);
30 void ec_clear_out_queue(void);
31 u8 ec_status(void);
32 u8 ec_query(void);
33 u8 ec_read(u8 addr);
34 int ec_write(u8 addr, u8 data);
35 void ec_set_bit(u8 addr, u8 bit);
36 void ec_clr_bit(u8 addr, u8 bit);
37 void ec_set_ports(u16 cmd_reg, u16 data_reg);
38 
39 #endif /* _EC_ACPI_H */
static u32 addr
Definition: cirrus.c:14
void ec_set_bit(u8 addr, u8 bit)
Definition: ec.c:133
u8 ec_read(u8 addr)
Definition: ec.c:107
void ec_clr_bit(u8 addr, u8 bit)
Definition: ec.c:138
int send_ec_command(u8 command)
Definition: ec.c:13
u8 recv_ec_data(void)
Definition: ec.c:65
void ec_clear_out_queue(void)
Definition: ec.c:92
u8 ec_query(void)
Definition: ec.c:127
void ec_set_ports(u16 cmd_reg, u16 data_reg)
Definition: ec.c:143
u8 ec_status(void)
Definition: ec.c:122
int send_ec_data(u8 data)
Definition: ec.c:35
int ec_write(u8 addr, u8 data)
Definition: ec.c:115
int send_ec_data_nowait(u8 data)
Definition: ec.c:58
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45