blob: 3d63a64bbf262017e39b5dd1d943041fd8ff168e [file] [log] [blame]
Aaron Durbin996b15c2016-07-14 00:29:03 -05001/*
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#. */
22void 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 Shaikh8788fd62017-11-20 20:28:18 -080028void chromeec_smi_sleep(int slp_type, uint64_t s3_mask, uint64_t s5_mask);
Aaron Durbin996b15c2016-07-14 00:29:03 -050029
30/*
Duncan Laurie7378a172017-06-29 23:52:17 -070031 * Set device event masks according to sleep type,
32 * and clear any pending device events.
33 */
Furquan Shaikh8788fd62017-11-20 20:28:18 -080034void chromeec_smi_device_event_sleep(int slp_type, uint64_t s3_mask,
35 uint64_t s5_mask);
Duncan Laurie7378a172017-06-29 23:52:17 -070036
37/*
Aaron Durbin996b15c2016-07-14 00:29:03 -050038 * 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 Shaikh8788fd62017-11-20 20:28:18 -080042void chromeec_smi_apmc(int apmc, uint64_t sci_mask, uint64_t smi_mask);
Aaron Durbin996b15c2016-07-14 00:29:03 -050043
44#endif /* _EC_GOOGLE_CHROMEEC_SMM_H */