Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008-2009 coresystems GmbH |
| 5 | * |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
Sven Schnelle | 7592e8b | 2011-01-27 11:43:03 +0000 | [diff] [blame] | 20 | #ifndef _EC_ACPI_H |
| 21 | #define _EC_ACPI_H |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 22 | |
| 23 | #define EC_DATA 0x62 |
| 24 | #define EC_SC 0x66 |
| 25 | |
| 26 | /* EC_SC input */ |
| 27 | #define EC_SMI_EVT (1 << 6) // 1: SMI event pending |
| 28 | #define EC_SCI_EVT (1 << 5) // 1: SCI event pending |
| 29 | #define EC_BURST (1 << 4) // controller is in burst mode |
| 30 | #define EC_CMD (1 << 3) // 1: byte in data register is command |
| 31 | // 0: byte in data register is data |
| 32 | #define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec) |
| 33 | #define EC_OBF (1 << 0) // 1: output buffer full (data ready for host) |
| 34 | /* EC_SC output */ |
| 35 | #define RD_EC 0x80 // Read Embedded Controller |
| 36 | #define WR_EC 0x81 // Write Embedded Controller |
| 37 | #define BE_EC 0x82 // Burst Enable Embedded Controller |
| 38 | #define BD_EC 0x83 // Burst Disable Embedded Controller |
| 39 | #define QR_EC 0x84 // Query Embedded Controller |
| 40 | |
| 41 | int send_ec_command(u8 command); |
| 42 | int send_ec_data(u8 data); |
| 43 | int send_ec_data_nowait(u8 data); |
| 44 | u8 recv_ec_data(void); |
| 45 | u8 ec_read(u8 addr); |
| 46 | int ec_write(u8 addr, u8 data); |
Sven Schnelle | 8d94d7c | 2011-03-14 08:18:17 +0000 | [diff] [blame^] | 47 | void ec_set_bit(u8 addr, u8 bit); |
| 48 | void ec_clr_bit(u8 addr, u8 bit); |
Stefan Reinauer | 838c5a5 | 2010-01-17 14:08:17 +0000 | [diff] [blame] | 49 | |
| 50 | #endif |
| 51 | |