2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 /* These come from the dynamically created CPU SSDT */
26 /* The APM port can be used for generating software SMIs */
28 OperationRegion (APMP, SystemIO, 0xb2, 2)
29 Field (APMP, ByteAcc, NoLock, Preserve)
31 APMC, 8, // APM command
37 OperationRegion (POST, SystemIO, 0x80, 1)
38 Field (POST, ByteAcc, Lock, Preserve)
44 Method(TRAP, 1, Serialized)
46 Store (Arg0, SMIF) // SMI Function
47 Store (0, TRP0) // Generate trap
48 Return (SMIF) // Return value of SMI handler
51 /* The _PIC method is called by the OS to choose between interrupt
52 * routing via the i8259 interrupt controller or the APIC.
54 * _PIC is called with a parameter of 0 for i8259 configuration and
55 * with a parameter of 1 for Local Apic/IOAPIC configuration.
60 // Remember the OS' IRQ routing choice.
64 /* The _PTS method (Prepare To Sleep) is called before the OS is
65 * entering a sleep state. The sleep state number is passed in Arg0
70 // Call a trap so SMI can prepare for Sleep as well.
74 /* The _WAK method is called on system wakeup */
80 // Notify PCI Express slots in case a card
81 // was inserted while a sleep state was active.
83 // Are we going to S3?
84 If (LEqual(Arg0, 3)) {
88 // Are we going to S4?
89 If (LEqual(Arg0, 4)) {
93 // TODO: Windows XP SP2 P-State restore
95 Return(Package(){0,0})
100 External (\_PR_.CPU0, DeviceObj)
101 External (\_PR_.CPU1, DeviceObj)
106 If(And(PDC0, 0x08)) {
107 Notify (\_PR_.CPU0, 0x80) // _PPC
109 If (And(PDC0, 0x10)) {
111 Notify(\_PR_.CPU0, 0x81) // _CST
115 If(And(PDC1, 0x08)) {
116 Notify (\_PR_.CPU1, 0x80) // _PPC
117 If (And(PDC1, 0x10)) {
119 Notify(\_PR_.CPU1, 0x81) // _CST
124 Notify (\_PR_.CPU0, 0x80)
126 Notify(\_PR_.CPU0, 0x81)
129 // Notify the Batteries
130 Notify(BAT1, 0x80) // Execute BAT1 _BST
131 Notify(BAT2, 0x80) // Execute BAT2 _BST
138 /* This method is placed on the top level, so we can make sure it's the
139 * first executed _INI method.
143 /* The DTS data in NVS is probably not up to date.
144 * Update temperature values and make sure AP thermal
145 * interrupts can happen
150 /* Determine the Operating System and save the value in OSYS.
151 * We have to do this in order to be able to work around
152 * certain windows bugs.
154 * OSYS value | Operating System
155 * -----------+------------------
156 * 2000 | Windows 2000
157 * 2001 | Windows XP(+SP1)
158 * 2002 | Windows XP SP2
159 * 2006 | Windows Vista
163 /* Let's assume we're running at least Windows 2000 */
166 If (CondRefOf(_OSI, Local0)) {
167 /* Linux answers _OSI with "True" for a couple of
168 * Windows version queries. But unlike Windows it
169 * needs a Video repost, so let's determine whether
170 * we're running Linux.
177 If (_OSI("Windows 2001")) {
181 If (_OSI("Windows 2001 SP1")) {
185 If (_OSI("Windows 2001 SP2")) {
189 If (_OSI("Windows 2006")) {
194 /* And the OS workarounds start right after we know what we're
195 * running: Windows XP SP1 needs to have C-State coordination
198 If (LAnd(LEqual(OSYS, 2001), MPEN)) {
202 /* SMM power state and C4-on-C3 settings need to be updated */