Stefan Reinauer | 020b22a | 2012-03-30 17:06:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. |
| 5 | * |
| 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. |
| 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 | * |
Stefan Reinauer | 020b22a | 2012-03-30 17:06:43 -0700 | [diff] [blame] | 15 | * Mailbox EC communication interface for SMSC MEC1308 Embedded Controller. |
| 16 | */ |
| 17 | |
| 18 | #ifndef _EC_SMSC_MEC1308_EC_H |
| 19 | #define _EC_SMSC_MEC1308_EC_H |
| 20 | |
| 21 | #define EC_TIMEOUT 0xfff |
| 22 | #define EC_MAILBOX_COMMAND 0x82 // Send a command |
| 23 | #define EC_MAILBOX_DATA 0x84 // Send data with a command |
| 24 | #define EC_MAILBOX_DATA_H 0x85 // Send data with a command |
| 25 | #define EC_RAM_READ 0x88 // Read from RAM |
| 26 | #define EC_RAM_WRITE 0x89 // Write to RAM |
| 27 | |
| 28 | int send_ec_command(u8 command); |
| 29 | int send_ec_command_data(u8 command, u8 data); |
| 30 | u8 read_ec_command_byte(u8 command); |
| 31 | u8 ec_read(u8 addr); |
| 32 | int ec_write(u8 addr, u8 data); |
| 33 | void ec_set_bit(u8 addr, u8 bit); |
| 34 | void ec_clr_bit(u8 addr, u8 bit); |
| 35 | void ec_set_ports(u16 cmd_reg, u16 data_reg); |
| 36 | |
| 37 | #endif /* _EC_SMSC_MEC1308_EC_H */ |