2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
5 * Copyright 2014 Google Inc.
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.
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.
17 #include <arch/acpi.h>
19 #include <console/console.h>
20 #include <cpu/x86/smm.h>
24 #include <ec/google/chromeec/ec.h>
26 #include <soc/iomap.h>
30 #include <superio/ite/it8772f/it8772f.h>
33 int mainboard_io_trap_handler(int smif
)
37 printk(BIOS_DEBUG
, "Sample\n");
38 smm_get_gnvs()->smif
= 0;
44 /* On success, the IO Trap Handler returns 0
45 * On failure, the IO Trap Handler returns a value != 0
47 * For now, we force the return value to 0 and log all traps to
48 * see what's going on.
53 /* gpi_sts is GPIO 47:32 */
54 void mainboard_smi_gpi(u32 gpi_sts
)
58 void mainboard_smi_sleep(u8 slp_typ
)
60 /* Disable USB charging if required */
63 it8772f_gpio_led(IT8772F_GPIO_DEV
, 1 /* set */, 0x01 /* select */,
64 0x01 /* polarity */, 0x01 /* 1=pullup */,
65 0x01 /* output */, 0x00, /* 0=Alternate function */
66 SIO_GPIO_BLINK_GPIO10
, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ
);
69 it8772f_gpio_led(IT8772F_GPIO_DEV
, 1 /* set */, 0x01 /* select */,
70 0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
71 0x01 /* output */, 0x01 /* 1=Simple IO function */,
72 SIO_GPIO_BLINK_GPIO10
, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ
);
80 int mainboard_smi_apmc(u8 apmc
)
83 case APM_CNT_ACPI_ENABLE
:
85 case APM_CNT_ACPI_DISABLE
: