This patch adds support for mainboard iBASE:MB899
[coreboot.git] / src / mainboard / ibase / mb899 / acpi / platform.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007-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 /* The APM port can be used for generating software SMIs */
21
22 OperationRegion (APMP, SystemIO, 0xb2, 2)
23 Field (APMP, ByteAcc, NoLock, Preserve)
24 {
25         APMC, 8,        // APM command
26         APMS, 8         // APM status
27 }
28
29 /* Port 80 POST */
30
31 OperationRegion (POST, SystemIO, 0x80, 1)
32 Field (POST, ByteAcc, Lock, Preserve)
33 {
34         DBG0, 8
35 }
36
37 /* SMI I/O Trap */
38 Method(TRAP, 1, Serialized)
39 {
40         Store (Arg0, SMIF)      // SMI Function
41         Store (0, TRP0)         // Generate trap
42         Return (SMIF)           // Return value of SMI handler
43 }
44
45 /* The _PIC method is called by the OS to choose between interrupt
46  * routing via the i8259 interrupt controller or the APIC.
47  *
48  * _PIC is called with a parameter of 0 for i8259 configuration and
49  * with a parameter of 1 for Local Apic/IOAPIC configuration.
50  */
51
52 Method(_PIC, 1)
53 {
54         // Remember the OS' IRQ routing choice.
55         Store(Arg0, PICM)
56 }
57
58 /* The _PTS method (Prepare To Sleep) is called before the OS is
59  * entering a sleep state. The sleep state number is passed in Arg0
60  */
61
62 Method(_PTS,1)
63 {
64         // Call a trap so SMI can prepare for Sleep as well.
65         // TRAP(0x55)
66 }
67
68 /* The _WAK method is called on system wakeup */
69
70 Method(_WAK,1)
71 {
72         // CPU specific part
73
74         // Notify PCI Express slots in case a card
75         // was inserted while a sleep state was active.
76
77         // Are we going to S3?
78         If (LEqual(Arg0, 3)) {
79                 // ..
80         }
81
82         // Are we going to S4?
83         If (LEqual(Arg0, 4)) {
84                 // ..
85         }
86
87         // TODO: Windows XP SP2 P-State restore
88
89         Return(Package(){0,0})
90 }
91