Matt DeVillier | c12e5ae | 2016-11-27 02:19:02 -0600 | [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. |
| 14 | */ |
| 15 | |
| 16 | #ifndef MAINBOARD_EC_H |
| 17 | #define MAINBOARD_EC_H |
| 18 | |
| 19 | #include <ec/ec.h> |
| 20 | #include <ec/google/chromeec/ec_commands.h> |
| 21 | |
| 22 | #define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */ |
| 23 | #define EC_SMI_GPI 34 /* GPIO34 is EC_SMI# */ |
| 24 | |
| 25 | #define MAINBOARD_EC_SCI_EVENTS \ |
| 26 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\ |
| 27 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 28 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\ |
| 29 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_DISCONNECTED) |\ |
| 30 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_LOW) |\ |
| 31 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_CRITICAL) |\ |
| 32 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\ |
| 33 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\ |
| 34 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\ |
| 35 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER)) |
| 36 | |
| 37 | #define MAINBOARD_EC_SMI_EVENTS \ |
| 38 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)) |
| 39 | |
| 40 | /* EC can wake from S5 with lid or power button */ |
| 41 | #define MAINBOARD_EC_S5_WAKE_EVENTS \ |
| 42 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\ |
| 43 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) |
| 44 | |
| 45 | /* EC can wake from S3 with lid or power button or key press */ |
| 46 | #define MAINBOARD_EC_S3_WAKE_EVENTS \ |
| 47 | (MAINBOARD_EC_S5_WAKE_EVENTS |\ |
| 48 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED)) |
| 49 | |
| 50 | /* Log EC wake events plus EC shutdown events */ |
| 51 | #define MAINBOARD_EC_LOG_EVENTS \ |
| 52 | (EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\ |
| 53 | EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN)) |
| 54 | |
| 55 | #endif |