blob: a949009c200bedeec965c57e0c2742521dff52cc [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");
Kyösti Mälkki239abaf2020-06-28 12:12:01 +030023 gnvs->smif = 0;
Vladimir Serbinenko4679c412015-05-16 16:32:45 +020024 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 */
Kyösti Mälkki239abaf2020-06-28 12:12:01 +030035 //gnvs->smif = 0;
Vladimir Serbinenko4679c412015-05-16 16:32:45 +020036 return 1;
37}