Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2016 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 _EC_GOOGLE_CHROMEEC_SMM_H |
| 17 | #define _EC_GOOGLE_CHROMEEC_SMM_H |
| 18 | |
| 19 | #include <stdint.h> |
| 20 | |
| 21 | /* Process all events from the EC when EC triggered an SMI#. */ |
| 22 | void chromeec_smi_process_events(void); |
| 23 | |
| 24 | /* |
| 25 | * Set wake masks according to sleep type, clear SCI and SMI masks, |
| 26 | * and clear any pending events. |
| 27 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 28 | void chromeec_smi_sleep(int slp_type, uint64_t s3_mask, uint64_t s5_mask); |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 29 | |
| 30 | /* |
Duncan Laurie | 7378a17 | 2017-06-29 23:52:17 -0700 | [diff] [blame] | 31 | * Set device event masks according to sleep type, |
| 32 | * and clear any pending device events. |
| 33 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 34 | void chromeec_smi_device_event_sleep(int slp_type, uint64_t s3_mask, |
| 35 | uint64_t s5_mask); |
Duncan Laurie | 7378a17 | 2017-06-29 23:52:17 -0700 | [diff] [blame] | 36 | |
| 37 | /* |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 38 | * Provided the APMC command do the following while clearing pending events. |
| 39 | * APM_CNT_ACPI_ENABLE: clear SMI mask. set SCI mask. |
| 40 | * APM_CNT_ACPI_DISABLE: clear SCI mask. set SMI mask. |
| 41 | */ |
Furquan Shaikh | 8788fd6 | 2017-11-20 20:28:18 -0800 | [diff] [blame] | 42 | void chromeec_smi_apmc(int apmc, uint64_t sci_mask, uint64_t smi_mask); |
Aaron Durbin | 996b15c | 2016-07-14 00:29:03 -0500 | [diff] [blame] | 43 | |
| 44 | #endif /* _EC_GOOGLE_CHROMEEC_SMM_H */ |