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 \_SB.PCI0.LPCB.EC.MUTE(1)
73 /* The _WAK method is called on system wakeup */
79 // Notify PCI Express slots in case a card
80 // was inserted while a sleep state was active.
82 // Are we going to S3?
83 If (LEqual(Arg0, 3)) {
87 // Are we going to S4?
88 If (LEqual(Arg0, 4)) {
92 // TODO: Windows XP SP2 P-State restore
94 Return(Package(){0,0})
99 External (\_PR_.CPU0, DeviceObj)
100 External (\_PR_.CPU1, DeviceObj)
105 If(And(PDC0, 0x08)) {
106 Notify (\_PR_.CPU0, 0x80) // _PPC
108 If (And(PDC0, 0x10)) {
110 Notify(\_PR_.CPU0, 0x81) // _CST
114 If(And(PDC1, 0x08)) {
115 Notify (\_PR_.CPU1, 0x80) // _PPC
116 If (And(PDC1, 0x10)) {
118 Notify(\_PR_.CPU1, 0x81) // _CST
123 Notify (\_PR_.CPU0, 0x80)
125 Notify(\_PR_.CPU0, 0x81)
128 // Notify the Batteries
129 Notify(\_SB.PCI0.LPCB.EC.BAT0, 0x80) // Execute BAT1 _BST
130 Notify(\_SB.PCI0.LPCB.EC.BAT1, 0x80) // Execute BAT2 _BST
137 /* This method is placed on the top level, so we can make sure it's the
138 * first executed _INI method.
142 /* The DTS data in NVS is probably not up to date.
143 * Update temperature values and make sure AP thermal
144 * interrupts can happen
149 /* Determine the Operating System and save the value in OSYS.
150 * We have to do this in order to be able to work around
151 * certain windows bugs.
153 * OSYS value | Operating System
154 * -----------+------------------
155 * 2000 | Windows 2000
156 * 2001 | Windows XP(+SP1)
157 * 2002 | Windows XP SP2
158 * 2006 | Windows Vista
162 /* Let's assume we're running at least Windows 2000 */
165 If (CondRefOf(_OSI, Local0)) {
166 /* Linux answers _OSI with "True" for a couple of
167 * Windows version queries. But unlike Windows it
168 * needs a Video repost, so let's determine whether
169 * we're running Linux.
176 If (_OSI("Windows 2001")) {
180 If (_OSI("Windows 2001 SP1")) {
184 If (_OSI("Windows 2001 SP2")) {
188 If (_OSI("Windows 2006")) {
193 /* And the OS workarounds start right after we know what we're
194 * running: Windows XP SP1 needs to have C-State coordination
197 If (LAnd(LEqual(OSYS, 2001), MPEN)) {
201 /* SMM power state and C4-on-C3 settings need to be updated */