Marshall Dawson | 79df1fb | 2017-10-04 12:34:17 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008-2009 coresystems GmbH |
| 5 | * Copyright (C) 2016 Intel Corp. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | */ |
| 16 | |
| 17 | #include <arch/acpi.h> |
| 18 | #include <cpu/x86/smm.h> |
| 19 | #include <ec/google/chromeec/smm.h> |
Marc Jones | ee03dc2 | 2018-07-14 17:32:04 -0600 | [diff] [blame] | 20 | #include <gpio.h> |
Marshall Dawson | 79df1fb | 2017-10-04 12:34:17 -0600 | [diff] [blame] | 21 | #include <soc/smi.h> |
Martin Roth | 6c623ca | 2017-11-16 22:14:53 -0700 | [diff] [blame] | 22 | #include <variant/ec.h> |
Marc Jones | ee03dc2 | 2018-07-14 17:32:04 -0600 | [diff] [blame] | 23 | #include <variant/gpio.h> |
Marshall Dawson | 79df1fb | 2017-10-04 12:34:17 -0600 | [diff] [blame] | 24 | |
Raul E Rangel | 8173ad1 | 2018-05-25 16:11:39 -0600 | [diff] [blame] | 25 | void mainboard_smi_gpi(u32 gpi_sts) |
| 26 | { |
| 27 | if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) |
| 28 | if (gpi_sts & (1 << EC_SMI_GPI)) |
| 29 | chromeec_smi_process_events(); |
| 30 | } |
| 31 | |
Marshall Dawson | f8bf9a7 | 2017-10-04 15:13:52 -0600 | [diff] [blame] | 32 | void mainboard_smi_sleep(u8 slp_typ) |
| 33 | { |
| 34 | if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) |
| 35 | chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, |
| 36 | MAINBOARD_EC_S5_WAKE_EVENTS); |
| 37 | } |
| 38 | |
Marshall Dawson | 79df1fb | 2017-10-04 12:34:17 -0600 | [diff] [blame] | 39 | int mainboard_smi_apmc(u8 apmc) |
| 40 | { |
| 41 | if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) |
| 42 | chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, |
| 43 | MAINBOARD_EC_SMI_EVENTS); |
Marc Jones | ee03dc2 | 2018-07-14 17:32:04 -0600 | [diff] [blame] | 44 | |
| 45 | /* Enable backlight - GPIO active low */ |
| 46 | gpio_set(GPIO_133, 0); |
| 47 | |
Marshall Dawson | 79df1fb | 2017-10-04 12:34:17 -0600 | [diff] [blame] | 48 | return 0; |
| 49 | } |