Remove Inagua Kconfig items for external VGA and AHCI binaries. These can be addded...
[coreboot.git] / src / mainboard / lenovo / x60 / acpi / ec.asl
1 /*
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.
15  *
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,
19  * MA 02110-1301 USA
20  */
21
22 Device(EC0)
23 {
24         Name (_HID, EISAID("PNP0C09"))
25         Name (_UID, 1)
26
27         Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
28         Name (ECON, 0)
29         Name (QEVT, 0)
30
31         OperationRegion(ERAM, EmbeddedControl, 0x00, 0xff)
32         Field (ERAM, ByteAcc, NoLock, Preserve)
33         {
34                 Offset(0x04), // Command interface
35                 CMCM,     8,
36                 CMD1,     8,
37                 CMD2,     8,
38                 CMD3,     8,
39                 Offset(0x18), // SMBus
40                 SMPR,     8,
41                 SMST,     8,
42                 SMAD,     8,
43                 SMCM,     8,
44                 Offset(0x1c),
45                 SMW0,    16,
46                 //SMD0, 264,
47                 Offset(0x3d),
48                 SMAA,     8,
49                 Offset(0x78), // GPIs
50                 P60S,     1,
51                 P61S,     1,
52                 P62S,     1,
53                 P63S,     1,
54                 P64S,     1,
55                 P65S,     1,
56                 P66S,     1,
57                 P67S,     1,
58                 Offset(0x83), // Thermal
59                 RTMP,     8,
60                 TML0,     8,
61                 TMH0,     8,
62                 Offset(0x87),
63                 TMCR,     8,
64                 Offset(0x89),
65                 TML1,     8,
66                 TMH1,     8
67         }
68
69         Method (_CRS, 0)
70         {
71                 Name (ECMD, ResourceTemplate()
72                 {
73                         IO (Decode16, 0x62, 0x62, 1, 1)
74                         IO (Decode16, 0x66, 0x66, 1, 1)
75                 })
76
77                 Return (ECMD)
78         }
79
80         Method (_REG, 2)
81         {
82                 // This method is needed by Windows XP/2000 for
83                 // EC initialization before a driver is loaded
84
85                 If (LEqual(Arg0, 0x03)) {
86                         Store (Arg1, ECON)
87                 }
88         }
89
90         // EC Query methods
91
92         Method (_Q11, 0)
93         {
94                 Store("_Q11: Fn-F8 (Sleep Button) pressed", Debug)
95                 Notify(SLPB, 0x80)
96         }
97
98         Method (_Q12, 0)
99         {
100                 Store("_Q12: Fn-F9 (Display Switch) pressed", Debug)
101                 // Store(1, TLST)
102                 // HKDS(10)
103         }
104
105         Method (_Q30, 0)
106         {
107                 Store("_Q30: AC In/Out", Debug)
108                 Notify(ADP1, 0x80)      // Tell the Power Adapter
109                 PNOT()                  // and the CPU and Battery
110         }
111
112         Method (_Q31, 0)
113         {
114                 Store("_Q31: LID Open/Close", Debug)
115                 Notify(LID0, 0x80)
116         }
117
118         Method (_Q32, 0)
119         {
120                 Store("_Q32: Battery 1 In/Out", Debug)
121                 If (ECON) {
122                         Store (P62S, Local0)
123                         If (Not(Local0)) {
124                                 Notify(BAT1, 0x80)
125                         }
126                 }
127         }
128
129         Method (_Q33, 0)
130         {
131                 Store("_Q33: Battery 2 In/Out", Debug)
132                 If (ECON) {
133                         Store (P63S, Local0)
134                         If (Not(Local0)) {
135                                 Notify(BAT2, 0x80)
136                         }
137                 }
138         }
139
140         Method (_Q34, 0)
141         {
142                 Store("_Q34: LPT/FDD", Debug)
143                 // PHSS(0x70)
144         }
145
146         Method (_Q35, 0)
147         {
148                 Store("_Q35: Processor is hot", Debug)
149         }
150
151         Method (_Q36, 0)
152         {
153                 Store("_Q36: Thermal Warning", Debug)
154         }
155
156         Method (_Q37, 0)
157         {
158                 Store("_Q37: PME", Debug)
159         }
160
161         Method (_Q38, 0)
162         {
163                 Store("_Q38: Thermal", Debug)
164         }
165
166         Method (_Q39, 0)
167         {
168                 Store("_Q39: Thermal", Debug)
169         }
170
171         // TODO Scope _SB devices for AC power, LID, Power button
172
173 }