blob: d7cf36570bc725addc4680582c4af632f3cd0ec7 [file] [log] [blame]
Kyösti Mälkkif09e6d42015-01-10 12:13:23 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
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.
Kyösti Mälkkif09e6d42015-01-10 12:13:23 +020014 */
15
16/* Wake status package */
17Name(WKST,Package(){Zero, Zero})
18
19/*
20* \_PTS - Prepare to Sleep method
21*
22* Entry:
23* Arg0=The value of the sleeping state S1=1, S2=2, etc
24*
25* Exit:
26* -none-
27*
28* The _PTS control method is executed at the beginning of the sleep process
Marshall Dawsona8025db2016-12-16 13:17:34 -050029* for S1-S5. The sleeping value is passed to the _PTS control method. This
Kyösti Mälkkif09e6d42015-01-10 12:13:23 +020030* control method may be executed a relatively long time before entering the
Marshall Dawsona8025db2016-12-16 13:17:34 -050031* sleep state and the OS may abort the operation without notification to
Kyösti Mälkkif09e6d42015-01-10 12:13:23 +020032* the ACPI driver. This method cannot modify the configuration or power
33* state of any device in the system.
34*/
35Method(\_PTS, 1) {
36 /* DBGO("\\_PTS\n") */
37 /* DBGO("From S0 to S") */
38 /* DBGO(Arg0) */
39 /* DBGO("\n") */
40
41 /* Don't allow PCIRST# to reset USB */
42 if (LEqual(Arg0,3)){
43 Store(0,URRE)
44 }
45
46 /* Clear sleep SMI status flag and enable sleep SMI trap. */
47 /*Store(One, CSSM)
48 Store(One, SSEN)*/
49
50 /* On older chips, clear PciExpWakeDisEn */
51 /*if (LLessEqual(\_SB.SBRI, 0x13)) {
52 * Store(0,\_SB.PWDE)
53 *}
54 */
55
56 /* Clear wake status structure. */
57 Store(0, Index(WKST,0))
58 Store(0, Index(WKST,1))
59} /* End Method(\_PTS) */
60
61/*
62* \_BFS OEM Back From Sleep method
63*
64* Entry:
65* Arg0=The value of the sleeping state S1=1, S2=2
66*
67* Exit:
68* -none-
69*/
70Method(\_BFS, 1) {
71 /* DBGO("\\_BFS\n") */
72 /* DBGO("From S") */
73 /* DBGO(Arg0) */
74 /* DBGO(" to S0\n") */
75}
76
77/*
78* \_WAK System Wake method
79*
80* Entry:
81* Arg0=The value of the sleeping state S1=1, S2=2
82*
83* Exit:
84* Return package of 2 DWords
85* Dword 1 - Status
86* 0x00000000 wake succeeded
87* 0x00000001 Wake was signaled but failed due to lack of power
88* 0x00000002 Wake was signaled but failed due to thermal condition
89* Dword 2 - Power Supply state
90* if non-zero the effective S-state the power supply entered
91*/
92Method(\_WAK, 1) {
93 /* DBGO("\\_WAK\n") */
94 /* DBGO("From S") */
95 /* DBGO(Arg0) */
96 /* DBGO(" to S0\n") */
97
98 /* Re-enable HPET */
99 Store(1,HPDE)
100
101 /* Restore PCIRST# so it resets USB */
102 if (LEqual(Arg0,3)){
103 Store(1,URRE)
104 }
105
106 /* Arbitrarily clear PciExpWakeStatus */
Martin Rothf77516c2015-12-08 14:00:07 -0700107 Store(PWST, Local1)
108 Store(Local1, PWST)
Kyösti Mälkkif09e6d42015-01-10 12:13:23 +0200109
110 /* if(DeRefOf(Index(WKST,0))) {
111 * Store(0, Index(WKST,1))
112 * } else {
113 * Store(Arg0, Index(WKST,1))
114 * }
115 */
116 Return(WKST)
117} /* End Method(\_WAK) */