blob: 5c6f96861df30d5e305b4b4489c5c955967e5910 [file] [log] [blame]
Timothy Pearson4b373c92015-04-05 17:54:08 -05001/*
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
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
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.
Timothy Pearson4b373c92015-04-05 17:54:08 -050015 */
16
Timothy Pearson4b373c92015-04-05 17:54:08 -050017/* The _PTS method (Prepare To Sleep) is called before the OS is
18 * entering a sleep state. The sleep state number is passed in Arg0
19 */
20
21Method(_PTS,1)
22{
23 // Call a trap so SMI can prepare for Sleep as well.
24 // TRAP(0x55)
Nicola Corna435d3072017-02-22 16:52:29 +010025 \_SB.PCI0.LPCB.EC.MUTE(1)
26 \_SB.PCI0.LPCB.EC.USBP(0)
Timothy Pearson4b373c92015-04-05 17:54:08 -050027 \_SB.PCI0.LPCB.EC.RADI(0)
28}
29
30/* The _WAK method is called on system wakeup */
31
32Method(_WAK,1)
33{
34 // CPU specific part
35
36 // Notify PCI Express slots in case a card
37 // was inserted while a sleep state was active.
38
39 // Are we going to S3?
40 If (LEqual(Arg0, 3)) {
41 // ..
42 }
43
44 // Are we going to S4?
45 If (LEqual(Arg0, 4)) {
46 // ..
47 }
48
49 // TODO: Windows XP SP2 P-State restore
50
51 // TODO: Return Arg0 as second value if S-Arg0 was entered
52 // before.
53
54 Return(Package(){0,0})
55}
56
Timothy Pearson4b373c92015-04-05 17:54:08 -050057/* System Bus */
58
59Scope(\_SB)
60{
61 /* This method is placed on the top level, so we can make sure it's the
62 * first executed _INI method.
63 */
64 Method(_INI, 0)
65 {
66 /* The DTS data in NVS is probably not up to date.
67 * Update temperature values and make sure AP thermal
68 * interrupts can happen
69 */
70
71 // TRAP(71) // TODO
72
Paul Menzelbb1b2592015-10-12 19:20:48 +020073 \GOS()
Timothy Pearson4b373c92015-04-05 17:54:08 -050074
75 /* And the OS workarounds start right after we know what we're
76 * running: Windows XP SP1 needs to have C-State coordination
77 * enabled in SMM.
78 */
79 If (LAnd(LEqual(OSYS, 2001), MPEN)) {
80 // TRAP(61) // TODO
81 }
82
83 /* SMM power state and C4-on-C3 settings need to be updated */
84 // TRAP(43) // TODO
85 }
86}