blob: 3b47ac6454bba252d0ad2eb2d61c309cc287d25f [file] [log] [blame]
Patrick Georgi04746fc2015-06-05 18:53:43 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008-2009 coresystems GmbH
5 * Copyright 2014 Google Inc.
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.
Patrick Georgi04746fc2015-06-05 18:53:43 +020015 */
16
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050017#include <arch/acpi.h>
Patrick Georgi04746fc2015-06-05 18:53:43 +020018#include <arch/io.h>
19#include <console/console.h>
20#include <cpu/x86/smm.h>
21#include <soc/pm.h>
22#include <soc/smm.h>
23#include <elog.h>
24#include <ec/google/chromeec/ec.h>
25#include <soc/gpio.h>
26#include <soc/iomap.h>
27#include <soc/nvs.h>
28#include <soc/pm.h>
29#include <soc/smm.h>
30
31int mainboard_io_trap_handler(int smif)
32{
33 switch (smif) {
34 case 0x99:
35 printk(BIOS_DEBUG, "Sample\n");
36 smm_get_gnvs()->smif = 0;
37 break;
38 default:
39 return 0;
40 }
41
42 /* On success, the IO Trap Handler returns 0
43 * On failure, the IO Trap Handler returns a value != 0
44 *
45 * For now, we force the return value to 0 and log all traps to
46 * see what's going on.
47 */
48 return 1;
49}
50
51/* gpi_sts is GPIO 47:32 */
52void mainboard_smi_gpi(u32 gpi_sts)
53{
54}
55
56void mainboard_smi_sleep(u8 slp_typ)
57{
58 /* Disable USB charging if required */
59 switch (slp_typ) {
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050060 case ACPI_S3:
Patrick Georgi04746fc2015-06-05 18:53:43 +020061 break;
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050062 case ACPI_S5:
Patrick Georgi04746fc2015-06-05 18:53:43 +020063 break;
64 }
65}
66
67int mainboard_smi_apmc(u8 apmc)
68{
69 switch (apmc) {
70 case APM_CNT_ACPI_ENABLE:
71 break;
72 case APM_CNT_ACPI_DISABLE:
73 break;
74 }
75 return 0;
76}