Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Google Inc. |
| 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. |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 16 | #ifndef MAINBOARD_EC_H |
| 17 | #define MAINBOARD_EC_H |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 18 | |
| 19 | #include <ec/google/chromeec/ec_commands.h> |
| 20 | |
| 21 | #define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */ |
| 22 | #define EC_SMI_GPI 34 /* GPIO34 is EC_SMI# */ |
| 23 | |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 24 | #define MAINBOARD_EC_SCI_EVENTS \ |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 25 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 26 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 27 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 28 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 29 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 31 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 32 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\ |
| 34 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER)) |
| 35 | |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 36 | #define MAINBOARD_EC_SMI_EVENTS \ |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 37 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 38 | |
| 39 | /* EC can wake from S5 with lid or power button */ |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 40 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 41 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 42 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 43 | |
| 44 | /* EC can wake from S3 with lid or power button or key press */ |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 45 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 46 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 47 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 48 | |
| 49 | /* Log EC wake events plus EC shutdown events */ |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 50 | #define MAINBOARD_EC_LOG_EVENTS \ |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 51 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 52 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) |
| 53 | |
| 54 | #ifndef __ACPI__ |
Duncan Laurie | d80cd2a | 2013-05-22 16:13:49 -0700 | [diff] [blame] | 55 | extern void mainboard_ec_init(void); |
Duncan Laurie | cf72d91 | 2013-04-29 15:10:31 -0700 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | #endif |