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,
26 Name (_HID, EISAID("PNP0A05"))
29 OperationRegion(SIOR, SystemIO, 0x2e, 0x02)
30 Field (SIOR, ByteAcc, Nolock, Preserve)
40 Acquire (SIOM, 0xffff)
41 If (LEqual(Arg0, 0)) {
47 And (Local1, Arg2, Local1)
54 Acquire (SIOM, 0xffff)
55 If (LEqual(Arg0, 0)) {
66 Name(_HID, EISAID("PNP0501"))
68 Name(_PRW, Package() { 0x08, 0x03 })
73 // Device disabled by coreboot?
74 If (LEqual(CMAP, 0)) {
78 // Is the hardware enabled?
79 Store (READ(0, 0x24, 0xff), Local0)
80 If (LEqual(Local0, 0)) {
84 Store (READ(0, 0x02, 0x08), Local0)
85 If (LEqual(Local0, 0)) {
98 Store(READ(0, 0x28, 0x0f), Local0)
101 Store(READ(0, 0x02, 0xff), Local0)
103 And(Local0, Local1, Local0)
104 WRIT(0, 0x02, Local0)
107 /* Possible Resource Settings */
108 Name(_PRS, ResourceTemplate() {
109 StartDependentFn(0, 1) {
110 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8)
115 /* Current Resource Settings */
118 Name(NONE, ResourceTemplate() {
119 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
123 Name(RSRC, ResourceTemplate() {
124 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8, _IOA)
125 IRQNoFlags(_IRA) { 4 }
128 And (_STA(), 0x02, Local0)
129 If (LEqual(Local0, 0)) {
133 CreateByteField(RSRC,
134 \_SB.PCI0.LPCB.SIO1.COMA._CRS._IOA._MIN, IOLO)
135 CreateByteField(RSRC, 0x03, IOHI) // Why?
136 CreateByteField(RSRC,
137 \_SB.PCI0.LPCB.SIO1.COMA._CRS._IOA._MAX, IORL)
138 CreateByteField(RSRC, 0x05, IORH) // Why?
139 CreateByteField(RSRC,
140 \_SB.PCI0.LPCB.SIO1.COMA._CRS._IRA._INT, IRQL)
142 Store (READ(0, 0x24, 0xff), Local0)
143 And (Local0, 0xc0, Local1)
144 ShiftRight(Local1, 0x06, Local1)
145 ShiftLeft(Local0, 0x02, Local0)
152 Store(READ(0, 0x28, 0xf0), Local0)
153 ShiftRight(Local0, 4, Local0)
154 ShiftLeft(1, Local0, IRQL)
158 /* Set Resource Settings */
161 CreateByteField(Arg0, 0x02, IOLO)
162 CreateByteField(Arg0, 0x03, IOHI)
163 CreateByteField(Arg0, 0x09, IRQL)
166 FindSetRightBit(IRQL, Local0)
168 ShiftLeft(Local0, 4, Local0)
170 Store(READ(0, 0x28, 0x0f), Local1)
171 Or(Local0, Local1, Local0)
172 WRIT(0, 0x28, Local0)
175 ShiftRight(Local0, 2, Local0)
176 And(Local0, 0xfe, Local0)
179 ShiftLeft(Local1, 6, Local1)
180 Or (Local0, Local1, Local0)
181 WRIT(0, 0x24, Local0)
183 Store(READ(0, 0x02, 0xff), Local0)
184 Or(Local0, 0x08, Local0)
185 WRIT(0, 0x02, Local0)
187 Store(READ(0, 0x07, 0xff), Local0)
189 And (Local0, Local1, Local0)
190 WRIT(0, 0x07, Local0)
194 /* D0 state - Line drivers are on */
197 Store(READ(0, 0x02, 0xff), Local0)
198 Or(Local0, 0x08, Local0)
199 WRIT(0, 0x02, Local0)
201 Store (READ(0, 0x07, 0xff), Local0)
203 And(Local0, Local1, Local0)
204 WRIT(0, 0x07, Local0)
207 /* D3 State - Line drivers are off */
210 Store(READ(0, 0x02, 0xff), Local0)
212 And(Local0, Local1, Local0)
213 WRIT(0, 0x02, Local0)
219 Name(_HID, EISAID("PNP0501"))
221 Name(_PRW, Package() { 0x08, 0x03 })
226 // Device disabled by coreboot?
227 If (LEqual(CMBP, 0)) {
232 Store(READ(0, 0x0c, 0x38), Local0)
233 If (LNotEqual(Local0, Zero)) {
237 // Is the hardware enabled?
238 Store (READ(0, 0x25, 0xff), Local0)
239 If (LEqual(Local0, 0)) {
243 Store (READ(0, 0x02, 0x80), Local0)
244 If (LEqual(Local0, 0)) {
257 Store(READ(0, 0x28, 0xf0), Local0)
258 WRIT(0, 0x28, Local0)
260 Store(READ(0, 0x02, 0xff), Local0)
262 And(Local0, Local1, Local0)
263 WRIT(0, 0x02, Local0)
266 /* Possible Resource Settings */
267 Name(_PRS, ResourceTemplate() {
268 StartDependentFn(0, 1) {
269 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8)
274 /* Current Resource Settings */
277 Name(NONE, ResourceTemplate() {
278 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
282 Name(RSRC, ResourceTemplate() {
283 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8, _IOB)
284 IRQNoFlags(_IRB) { 3 }
287 And (_STA(), 0x02, Local0)
288 If (LEqual(Local0, 0)) {
292 CreateByteField(RSRC,
293 \_SB.PCI0.LPCB.SIO1.COMB._CRS._IOB._MIN, IOLO)
294 CreateByteField(RSRC, 0x03, IOHI)
295 CreateByteField(RSRC,
296 \_SB.PCI0.LPCB.SIO1.COMB._CRS._IOB._MAX, IORL)
297 CreateByteField(RSRC, 0x05, IORH)
298 CreateByteField(RSRC,
299 \_SB.PCI0.LPCB.SIO1.COMB._CRS._IRB._INT, IRQL)
301 Store (READ(0, 0x25, 0xff), Local0)
302 And (Local0, 0xc0, Local1)
303 ShiftRight(Local1, 0x06, Local1)
304 ShiftLeft(Local0, 0x02, Local0)
311 Store(READ(0, 0x28, 0x0f), Local0)
312 ShiftRight(Local0, 4, Local0)
313 ShiftLeft(1, Local0, IRQL)
317 /* Set Resource Settings */
320 CreateByteField(Arg0, 0x02, IOLO)
321 CreateByteField(Arg0, 0x03, IOHI)
322 CreateByteField(Arg0, 0x09, IRQL)
325 FindSetRightBit(IRQL, Local0)
328 Store(READ(0, 0x28, 0xf0), Local1)
329 Or(Local0, Local1, Local0)
330 WRIT(0, 0x28, Local0)
333 ShiftRight(Local0, 2, Local0)
334 And(Local0, 0xfe, Local0)
337 ShiftLeft(Local1, 6, Local1)
338 Or (Local0, Local1, Local0)
339 WRIT(0, 0x25, Local0)
341 Store(READ(0, 0x0c, 0xff), Local0)
343 And(Local0, Local1, Local0)
344 WRIT(0, 0x0c, Local0)
346 Store(READ(0, 0x02, 0xff), Local0)
347 Or(Local0, 0x80, Local0)
348 WRIT(0, 0x02, Local0)
350 Store(READ(0, 0x07, 0xff), Local0)
352 And (Local0, Local1, Local0)
353 WRIT(0, 0x07, Local0)
356 /* D0 state - Line drivers are on */
359 Store(READ(0, 0x02, 0xff), Local0)
360 Or(Local0, 0x80, Local0)
361 WRIT(0, 0x02, Local0)
363 Store (READ(0, 0x07, 0xff), Local0)
365 And(Local0, Local1, Local0)
366 WRIT(0, 0x07, Local0)
369 /* D3 State - Line drivers are off */
372 Store(READ(0, 0x02, 0xff), Local0)
374 And(Local0, Local1, Local0)
375 WRIT(0, 0x02, Local0)