2090bccece5ef21b90aa6d08aed77551f253d27a
[coreboot.git] / src / mainboard / kontron / 986lcd-m / mainboard_smi.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2008-2009 coresystems GmbH
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19
20 #include <arch/io.h>
21 #include <arch/romcc_io.h>
22 #include <console/console.h>
23 #include "../../../southbridge/intel/i82801gx/i82801gx_nvs.h"
24
25 /* The southbridge SMI handler checks whether gnvs has a 
26  * valid pointer before calling the trap handler
27  */
28 extern global_nvs_t *gnvs;
29
30 int mainboard_io_trap_handler(int smif)
31 {
32         switch (smif) {
33         case 0x99:
34                 printk_debug("Sample\n");
35                 gnvs->smif = 0;
36                 break;
37         default:
38                 return 0;
39         }
40
41         /* On success, the IO Trap Handler returns 0
42          * On failure, the IO Trap Handler returns a value != 0
43          *
44          * For now, we force the return value to 0 and log all traps to
45          * see what's going on.
46          */
47         //gnvs->smif = 0;
48         return 1;
49 }
50
51