546f31b4adc1ef620929e82f8418d26343cc6d16
[coreboot.git] / src / mainboard / siemens / sitemp_g1p1 / acpi / event.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2008 Advanced Micro Devices, Inc.
5  * Copyright (C) 2010 Siemens AG, Inc.
6  * (Written by Josef Kellermann <joseph.kellermann@heitec.de> for Siemens AG, Inc.)
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  */
21  
22 /* Supported sleep states: */
23 Name(\_S0, Package () {0x00, 0x00, 0x00, 0x00} )        /* (S0) - working state */
24 Name(\_S1, Package () {0x01, 0x01, 0x00, 0x00} )        /* (S1) - sleeping w/CPU context */
25 Name(\_S2, Package () {0x02, 0x02, 0x00, 0x00} )        /* (S2) - "light" Suspend to RAM */
26 Name(\_S3, Package () {0x03, 0x03, 0x00, 0x00} )        /* (S3) - Suspend to RAM */
27 Name(\_S4, Package () {0x04, 0x04, 0x00, 0x00} )        /* (S4) - Suspend to Disk */
28 Name(\_S5, Package () {0x05, 0x05, 0x00, 0x00} )        /* (S5) - Soft Off */
29
30 Name(\_SB.CSPS ,0)              /* Current Sleep State (S0, ... , S5) */
31 Name(CSMS, 0)                   /* Current System State */
32
33 /* Wake status package */
34 Name(WKST,Package(){Zero, Zero})
35
36 /*
37 * \_PTS - Prepare to Sleep method
38 *
39 *       Entry:
40 *               Arg0=The value of the sleeping state S1=1, S2=2, etc
41 *
42 * Exit:
43 *               -none-
44 *
45 * The _PTS control method is executed at the beginning of the sleep process
46 * for S1-S5. The sleeping value is passed to the _PTS control method.   This
47 * control method may be executed a relatively long time before entering the
48 * sleep state and the OS may abort      the operation without notification to
49 * the ACPI driver.  This method cannot modify the configuration or power
50 * state of any device in the system.
51 */
52 Method(\_PTS, 1) {
53         /* DBGO("\\_PTS\n") */
54         /* DBGO("From S0 to S") */
55         /* DBGO(Arg0) */
56         /* DBGO("\n") */
57
58         /* Don't allow PCIRST# to reset USB */
59         if (LEqual(Arg0,3)){
60                 Store(0,URRE)
61         }
62
63         /* Clear sleep SMI status flag and enable sleep SMI trap. */
64         /*Store(One, CSSM)
65         Store(One, SSEN)*/
66
67         /* On older chips, clear PciExpWakeDisEn */
68         /*if (LLessEqual(\_SB.SBRI, 0x13)) {
69         *       Store(0,\_SB.PWDE)
70         *}
71         */
72
73         /* Clear wake status structure. */
74         Store(0, Index(WKST,0))
75         Store(0, Index(WKST,1))
76         \_SB.PCI0.SIOS (Arg0)
77 } /* End Method(\_PTS) */
78
79 /*
80 *  The following method results in a "not a valid reserved NameSeg"
81 *  warning so I have commented it out for the duration.  It isn't
82 *  used, so it could be removed.
83 *
84 *
85 *       \_GTS OEM Going To Sleep method
86 *
87 *       Entry:
88 *               Arg0=The value of the sleeping state S1=1, S2=2
89 *
90 *       Exit:
91 *               -none-
92 *
93 *  Method(\_GTS, 1) {
94 *  DBGO("\\_GTS\n")
95 *  DBGO("From S0 to S")
96 *  DBGO(Arg0)
97 *  DBGO("\n")
98 *  }
99 */
100
101 /*
102 *       \_BFS OEM Back From Sleep method
103 *
104 *       Entry:
105 *               Arg0=The value of the sleeping state S1=1, S2=2
106 *
107 *       Exit:
108 *               -none-
109 */
110 Method(\_BFS, 1) {
111         /* DBGO("\\_BFS\n") */
112         /* DBGO("From S") */
113         /* DBGO(Arg0) */
114         /* DBGO(" to S0\n") */
115 }
116
117 /*
118 *  \_WAK System Wake method
119 *
120 *       Entry:
121 *               Arg0=The value of the sleeping state S1=1, S2=2
122 *
123 *       Exit:
124 *               Return package of 2 DWords
125 *               Dword 1 - Status
126 *                       0x00000000      wake succeeded
127 *                       0x00000001      Wake was signaled but failed due to lack of power
128 *                       0x00000002      Wake was signaled but failed due to thermal condition
129 *               Dword 2 - Power Supply state
130 *                       if non-zero the effective S-state the power supply entered
131 */
132 Method(\_WAK, 1) {
133         /* DBGO("\\_WAK\n") */
134         /* DBGO("From S") */
135         /* DBGO(Arg0) */
136         /* DBGO(" to S0\n") */
137
138         /* Re-enable HPET */
139         Store(1,HPDE)
140
141         /* Restore PCIRST# so it resets USB */
142         if (LEqual(Arg0,3)){
143                 Store(1,URRE)
144         }
145
146         /* Arbitrarily clear PciExpWakeStatus */
147         Store(PWST, PWST)
148
149         /* if(DeRefOf(Index(WKST,0))) {
150         *       Store(0, Index(WKST,1))
151         * } else {
152         *       Store(Arg0, Index(WKST,1))
153         * }
154         */
155         \_SB.PCI0.SIOW (Arg0)
156         Return(WKST)
157 } /* End Method(\_WAK) */
158
159 Scope(\_GPE) {  /* Start Scope GPE */
160         /*  General event 3  */
161         Method(_L03) {
162                 /* DBGO("\\_GPE\\_L00\n") */
163                 Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */
164         }
165
166         /*  Legacy PM event  */
167         Method(_L08) {
168                 /* DBGO("\\_GPE\\_L08\n") */
169         }
170
171         /*  Temp warning (TWarn) event  */
172         Method(_L09) {
173                 /* DBGO("\\_GPE\\_L09\n") */
174                 Notify (\_TZ.TZ00, 0x80)
175         }
176
177         /*  Reserved  */
178         /* Method(_L0A) {
179         *       DBGO("\\_GPE\\_L0A\n")
180         * }
181         */
182
183         /*  USB controller PME#  */
184         Method(_L0B) {
185                 /* DBGO("\\_GPE\\_L0B\n") */
186                 Notify(\_SB.PCI0.UOH1, 0x02) /* NOTIFY_DEVICE_WAKE */
187                 Notify(\_SB.PCI0.UOH2, 0x02) /* NOTIFY_DEVICE_WAKE */
188                 Notify(\_SB.PCI0.UOH3, 0x02) /* NOTIFY_DEVICE_WAKE */
189                 Notify(\_SB.PCI0.UOH4, 0x02) /* NOTIFY_DEVICE_WAKE */
190                 Notify(\_SB.PCI0.UOH5, 0x02) /* NOTIFY_DEVICE_WAKE */
191                 Notify(\_SB.PCI0.UEH1, 0x02) /* NOTIFY_DEVICE_WAKE */
192                 Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */
193         }
194
195         /*  AC97 controller PME#  */
196         /* Method(_L0C) {
197         *       DBGO("\\_GPE\\_L0C\n")
198         * }
199         */
200
201         /*  OtherTherm PME#  */
202         /* Method(_L0D) {
203         *       DBGO("\\_GPE\\_L0D\n")
204         * }
205         */
206
207         /*  GPM9 SCI event - Moved to USB.asl */
208         /* Method(_L0E) {
209         *       DBGO("\\_GPE\\_L0E\n")
210         * }
211         */
212
213         /*  PCIe HotPlug event  */
214         /* Method(_L0F) {
215         *       DBGO("\\_GPE\\_L0F\n")
216         * }
217         */
218
219         /*  ExtEvent0 SCI event  */
220         Method(_L10) {
221                 /* DBGO("\\_GPE\\_L10\n") */
222         }
223
224
225         /*  ExtEvent1 SCI event  */
226         Method(_L11) {
227                 /* DBGO("\\_GPE\\_L11\n") */
228         }
229
230         /*  PCIe PME# event  */
231         /* Method(_L12) {
232         *       DBGO("\\_GPE\\_L12\n")
233         * }
234         */
235
236         /*  GPM0 SCI event - Moved to USB.asl */
237         /* Method(_L13) {
238         *       DBGO("\\_GPE\\_L13\n")
239         * }
240         */
241
242         /*  GPM1 SCI event - Moved to USB.asl */
243         /* Method(_L14) {
244         *       DBGO("\\_GPE\\_L14\n")
245         * }
246         */
247
248         /*  GPM2 SCI event - Moved to USB.asl */
249         /* Method(_L15) {
250         *       DBGO("\\_GPE\\_L15\n")
251         * }
252         */
253
254         /*  GPM3 SCI event - Moved to USB.asl */
255         /* Method(_L16) {
256         *       DBGO("\\_GPE\\_L16\n")
257         * }
258         */
259
260         /*  GPM8 SCI event - Moved to USB.asl */
261         /* Method(_L17) {
262         *       DBGO("\\_GPE\\_L17\n")
263         * }
264         */
265
266         /*  GPIO0 or GEvent8 event  */
267         Method(_L18) {
268                 /* DBGO("\\_GPE\\_L18\n") */
269                 Notify(\_SB.PCI0.PBR2, 0x02) /* NOTIFY_DEVICE_WAKE */
270                 Notify(\_SB.PCI0.PBR4, 0x02) /* NOTIFY_DEVICE_WAKE */
271                 Notify(\_SB.PCI0.PBR5, 0x02) /* NOTIFY_DEVICE_WAKE */
272                 Notify(\_SB.PCI0.PBR6, 0x02) /* NOTIFY_DEVICE_WAKE */
273                 Notify(\_SB.PCI0.PBR7, 0x02) /* NOTIFY_DEVICE_WAKE */
274                 Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */
275         }
276
277         /*  GPM4 SCI event - Moved to USB.asl */
278         /* Method(_L19) {
279         *       DBGO("\\_GPE\\_L19\n")
280         * }
281         */
282
283         /*  GPM5 SCI event - Moved to USB.asl */
284         /* Method(_L1A) {
285         *       DBGO("\\_GPE\\_L1A\n")
286         * }
287         */
288
289         /*  Azalia SCI event  */
290         Method(_L1B) {
291                 /* DBGO("\\_GPE\\_L1B\n") */
292                 Notify(\_SB.PCI0.AZHD, 0x02) /* NOTIFY_DEVICE_WAKE */
293                 Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */
294         }
295
296         /*  GPM6 SCI event - Reassigned to _L06 */
297         /* Method(_L1C) {
298         *       DBGO("\\_GPE\\_L1C\n")
299         * }
300         */
301
302         /*  GPM7 SCI event - Reassigned to _L07 */
303         /* Method(_L1D) {
304         *       DBGO("\\_GPE\\_L1D\n")
305         * }
306         */
307
308         /*  GPIO2 or GPIO66 SCI event  */
309         /* Method(_L1E) {
310         *       DBGO("\\_GPE\\_L1E\n")
311         * }
312         */
313
314         /*  SATA SCI event  */
315         /* SATA Hot Plug Support -> acpi/sata.asl */
316 }       /* End Scope GPE */