blob: 38fb7bdf23ddb3025f0dd95029ffdba4c7566e64 [file] [log] [blame]
Stefan Reinauer7cfa7f92010-05-16 14:24:41 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008-2009 coresystems GmbH
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Stefan Reinauer7cfa7f92010-05-16 14:24:41 +000015 */
16
Sven Schnelle7592e8b2011-01-27 11:43:03 +000017#ifndef _MAINBOARD_EC_OEM_H
18#define _MAINBOARD_EC_OEM_H
Stefan Reinauer7cfa7f92010-05-16 14:24:41 +000019
20#define EC_OEM_DATA 0x68
21#define EC_OEM_SC 0x6c
22
23/* EC_SC input */
24#define EC_SMI_EVT (1 << 6) // 1: SMI event pending
25#define EC_SCI_EVT (1 << 5) // 1: SCI event pending
26#define EC_BURST (1 << 4) // controller is in burst mode
27#define EC_CMD (1 << 3) // 1: byte in data register is command
28 // 0: byte in data register is data
29#define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
30#define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
31/* EC_SC output */
32#define RD_EC 0x80 // Read Embedded Controller
33#define WR_EC 0x81 // Write Embedded Controller
34#define BE_EC 0x82 // Burst Enable Embedded Controller
35#define BD_EC 0x83 // Burst Disable Embedded Controller
36#define QR_EC 0x84 // Query Embedded Controller
37
Stefan Reinauer7cfa7f92010-05-16 14:24:41 +000038int send_ec_oem_command(u8 command);
39int send_ec_oem_data(u8 data);
40int send_ec_oem_data_nowait(u8 data);
41u8 recv_ec_oem_data(void);
42u8 ec_oem_read(u8 addr);
43int ec_oem_write(u8 addr, u8 data);
44
45int ec_dump_status(void);
46int ec_oem_dump_status(void);
47#endif