blob: e880581d5b3be4292950b54505e6ee295e113492 [file] [log] [blame]
Furquan Shaikh06cd9032016-12-14 12:10:21 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 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#include <cpu/x86/smm.h>
Furquan Shaikh48547612017-10-16 23:02:00 -070017#include <ec/google/chromeec/ec.h>
Furquan Shaikh06cd9032016-12-14 12:10:21 -080018#include <ec/google/chromeec/smm.h>
Furquan Shaikh48547612017-10-16 23:02:00 -070019#include <elog.h>
Furquan Shaikh3178bdc2017-05-27 17:52:32 -070020#include <gpio.h>
21#include <soc/gpio.h>
Furquan Shaikh06cd9032016-12-14 12:10:21 -080022#include <soc/smm.h>
23
Furquan Shaikh3178bdc2017-05-27 17:52:32 -070024#include <variant/gpio.h>
Furquan Shaikh76c392d2017-04-13 14:15:56 -070025#include <variant/ec.h>
Furquan Shaikh06cd9032016-12-14 12:10:21 -080026
27void mainboard_smi_espi_handler(void)
28{
29 chromeec_smi_process_events();
30}
31
32void mainboard_smi_sleep(u8 slp_typ)
33{
34 chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS,
35 MAINBOARD_EC_S5_WAKE_EVENTS);
Furquan Shaikh06cd9032016-12-14 12:10:21 -080036}
37
38int mainboard_smi_apmc(u8 apmc)
39{
40 chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS,
41 MAINBOARD_EC_SMI_EVENTS);
42 return 0;
43}
Furquan Shaikh48547612017-10-16 23:02:00 -070044
45void elog_gsmi_cb_mainboard_log_wake_source(void)
46{
47 google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
48 MAINBOARD_EC_S0IX_WAKE_EVENTS);
49}