Since some people disapprove of white space cleanups mixed in regular commits
[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 <cpu/x86/smm.h>
24 #include "../../../southbridge/intel/i82801gx/i82801gx_nvs.h"
25
26 /* The southbridge SMI handler checks whether gnvs has a
27  * valid pointer before calling the trap handler
28  */
29 extern global_nvs_t *gnvs;
30
31 int mainboard_io_trap_handler(int smif)
32 {
33         switch (smif) {
34         case 0x99:
35                 printk(BIOS_DEBUG, "Sample\n");
36                 gnvs->smif = 0;
37                 break;
38         default:
39                 return 0;
40         }
41
42         /* On success, the IO Trap Handler returns 0
43          * On failure, the IO Trap Handler returns a value != 0
44          *
45          * For now, we force the return value to 0 and log all traps to
46          * see what's going on.
47          */
48         //gnvs->smif = 0;
49         return 1;
50 }
51
52