Patrick Georgi | 2faeb11 | 2020-05-08 18:32:38 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Vladimir Serbinenko | 4679c41 | 2015-05-16 16:32:45 +0200 | [diff] [blame] | 2 | |
| 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 | |
| 18 | int mainboard_io_trap_handler(int smif) |
| 19 | { |
| 20 | switch (smif) { |
| 21 | case 0x99: |
| 22 | printk(BIOS_DEBUG, "Sample\n"); |
Kyösti Mälkki | 239abaf | 2020-06-28 12:12:01 +0300 | [diff] [blame] | 23 | gnvs->smif = 0; |
Vladimir Serbinenko | 4679c41 | 2015-05-16 16:32:45 +0200 | [diff] [blame] | 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 | */ |
Kyösti Mälkki | 239abaf | 2020-06-28 12:12:01 +0300 | [diff] [blame] | 35 | //gnvs->smif = 0; |
Vladimir Serbinenko | 4679c41 | 2015-05-16 16:32:45 +0200 | [diff] [blame] | 36 | return 1; |
| 37 | } |