blob: 558e12f87791dfb91890778d7196af26e0042d84 [file] [log] [blame]
Patrick Georgi2faeb112020-05-08 18:32:38 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Vladimir Serbinenko4679c412015-05-16 16:32:45 +02002
3#include <arch/io.h>
4#include <console/console.h>
5#include <cpu/x86/smm.h>
6#include <soc/pm.h>
7#include <soc/smm.h>
8#include <elog.h>
9#include <ec/google/chromeec/ec.h>
10#include <soc/gpio.h>
11#include <soc/iomap.h>
12#include <soc/nvs.h>
13#include <soc/pm.h>
14#include <soc/smm.h>
15#include "ec.h"
16#include "gpio.h"
17
18int mainboard_io_trap_handler(int smif)
19{
20 switch (smif) {
21 case 0x99:
22 printk(BIOS_DEBUG, "Sample\n");
23 smm_get_gnvs()->smif = 0;
24 break;
25 default:
26 return 0;
27 }
28
29 /* On success, the IO Trap Handler returns 0
30 * On failure, the IO Trap Handler returns a value != 0
31 *
32 * For now, we force the return value to 0 and log all traps to
33 * see what's going on.
34 */
35 //smm_get_gnvs()->smif = 0;
36 return 1;
37}