Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [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. |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef MAINBOARD_EC_H |
| 17 | #define MAINBOARD_EC_H |
| 18 | |
| 19 | #include <ec/google/chromeec/ec_commands.h> |
| 20 | |
Aaron Durbin | 84da959 | 2013-11-07 11:19:34 -0600 | [diff] [blame] | 21 | /* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */ |
| 22 | #define EC_SCI_GPI 24 |
| 23 | /* GPIO_S5_07 is EC_SMI#, but it is bit 23 in GPE_STS and ALT_GPIO_SMI. */ |
| 24 | #define EC_SMI_GPI 23 |
Aaron Durbin | 063c873 | 2013-10-28 11:24:53 -0500 | [diff] [blame] | 25 | |
| 26 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 27 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 28 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 29 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 31 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 32 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 34 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 35 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\ |
| 36 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\ |
| 37 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\ |
| 38 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER)) |
| 39 | |
| 40 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 41 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 42 | |
| 43 | /* EC can wake from S5 with lid or power button */ |
| 44 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 45 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 46 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 47 | |
| 48 | /* EC can wake from S3 with lid or power button or key press */ |
| 49 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 50 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 51 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 52 | |
| 53 | /* Log EC wake events plus EC shutdown events */ |
| 54 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 55 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 56 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) |
| 57 | |
| 58 | #ifndef __ACPI__ |
| 59 | extern void mainboard_ec_init(void); |
| 60 | #endif |
| 61 | |
| 62 | #endif |