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.
21 Name (_HID, EISAID("PNP0A05"))
24 OperationRegion(SIOR, SystemIO, 0x4e, 0x02)
25 Field (SIOR, ByteAcc, Nolock, Preserve)
35 Acquire (SIOM, 0xffff)
36 If (LEqual(Arg0, 0)) {
42 And (Local1, Arg2, Local1)
49 Acquire (SIOM, 0xffff)
50 If (LEqual(Arg0, 0)) {
61 Name(_HID, EISAID("PNP0501"))
64 Name(_PRW, Package() { 0x08, 0x03 })
69 Acquire (SIOM, 0xffff)
71 // Is the hardware enabled?
72 Store (READ(0, 0x24, 0xff), Local0)
73 If (LEqual(Local0, 0)) {
77 Store (READ(0, 0x02, 0x08), Local0)
78 If (LEqual(Local0, 0)) {
91 Store(READ(0, 0x28, 0x0f), Local0)
94 Store(READ(0, 0x02, 0xff), Local0)
96 And(Local0, Local1, Local0)
100 /* Possible Resource Settings */
101 Name(_PRS, ResourceTemplate() {
102 StartDependentFn(0, 1) {
103 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8)
108 /* Current Resource Settings */
111 Name(NONE, ResourceTemplate() {
112 IO(Decode16, 0x000, 0x000, 0x0, 0x1)
116 Name(RSRC, ResourceTemplate() {
117 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8, _IOA)
118 IRQNoFlags(_IRA) { 4 }
121 And (_STA(), 0x02, Local0)
122 If (LEqual(Local0, 0)) {
126 CreateWordField(RSRC,
127 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IOA._MIN, IOMN)
128 CreateWordField(RSRC,
129 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IOA._MAX, IOMX)
130 CreateWordField(RSRC,
131 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IRA._INT, IRQ)
134 Store (READ(0, 0x24, 0xfe), Local0)
135 ShiftLeft(Local0, 0x02, Local0)
140 Store(READ(0, 0x28, 0xf0), Local0)
141 ShiftRight(Local0, 4, Local0)
142 ShiftLeft(1, Local0, IRQ)
146 /* Set Resource Settings */
149 CreateByteField(Arg0, 0x02, IOLO)
150 CreateByteField(Arg0, 0x03, IOHI)
151 CreateByteField(Arg0, 0x09, IRQL)
154 FindSetRightBit(IRQL, Local0)
156 ShiftLeft(Local0, 4, Local0)
158 Store(READ(0, 0x28, 0x0f), Local1)
159 Or(Local0, Local1, Local0)
160 WRIT(0, 0x28, Local0)
163 ShiftRight(Local0, 2, Local0)
164 And(Local0, 0xfe, Local0)
167 ShiftLeft(Local1, 6, Local1)
168 Or (Local0, Local1, Local0)
169 WRIT(0, 0x24, Local0)
171 Store(READ(0, 0x02, 0xff), Local0)
172 Or(Local0, 0x08, Local0)
173 WRIT(0, 0x02, Local0)
175 Store(READ(0, 0x07, 0xff), Local0)
177 And (Local0, Local1, Local0)
178 WRIT(0, 0x07, Local0)
182 /* D0 state - Line drivers are on */
185 Store(READ(0, 0x02, 0xff), Local0)
186 Or(Local0, 0x08, Local0)
187 WRIT(0, 0x02, Local0)
189 Store (READ(0, 0x07, 0xff), Local0)
191 And(Local0, Local1, Local0)
192 WRIT(0, 0x07, Local0)
195 /* D3 State - Line drivers are off */
198 Store(READ(0, 0x02, 0xff), Local0)
200 And(Local0, Local1, Local0)
201 WRIT(0, 0x02, Local0)
207 Name(_HID, EISAID("PNP0501"))
210 Name(_PRW, Package() { 0x08, 0x03 })
216 Store(READ(0, 0x0c, 0x38), Local0)
217 If (LNotEqual(Local0, Zero)) {
221 // Is the hardware enabled?
222 Store (READ(0, 0x25, 0xff), Local0)
223 If (LEqual(Local0, 0)) {
227 Store (READ(0, 0x02, 0x80), Local0)
228 If (LEqual(Local0, 0)) {
241 Store(READ(0, 0x28, 0xf0), Local0)
242 WRIT(0, 0x28, Local0)
244 Store(READ(0, 0x02, 0xff), Local0)
246 And(Local0, Local1, Local0)
247 WRIT(0, 0x02, Local0)
250 /* Possible Resource Settings */
251 Name(_PRS, ResourceTemplate() {
252 StartDependentFn(0, 1) {
253 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8)
258 /* Current Resource Settings */
261 Name(NONE, ResourceTemplate() {
262 IO(Decode16, 0x000, 0x000, 0x0, 0x1)
266 Name(RSRC, ResourceTemplate() {
267 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8, _IOB)
268 IRQNoFlags(_IRB) { 3 }
271 And (_STA(), 0x02, Local0)
272 If (LEqual(Local0, 0)) {
276 CreateWordField(RSRC,
277 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IOB._MIN, IOMN)
278 CreateWordField(RSRC,
279 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IOB._MAX, IOMX)
280 CreateWordField(RSRC,
281 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IRB._INT, IRQ)
284 Store (READ(0, 0x25, 0xfe), Local0)
285 ShiftLeft(Local0, 0x02, Local0)
290 Store(READ(0, 0x28, 0x0f), Local0)
291 ShiftRight(Local0, 4, Local0)
292 ShiftLeft(1, Local0, IRQ)
296 /* Set Resource Settings */
299 CreateByteField(Arg0, 0x02, IOLO)
300 CreateByteField(Arg0, 0x03, IOHI)
301 CreateByteField(Arg0, 0x09, IRQL)
304 FindSetRightBit(IRQL, Local0)
307 Store(READ(0, 0x28, 0xf0), Local1)
308 Or(Local0, Local1, Local0)
309 WRIT(0, 0x28, Local0)
312 ShiftRight(Local0, 2, Local0)
313 And(Local0, 0xfe, Local0)
316 ShiftLeft(Local1, 6, Local1)
317 Or (Local0, Local1, Local0)
318 WRIT(0, 0x25, Local0)
320 Store(READ(0, 0x0c, 0xff), Local0)
322 And(Local0, Local1, Local0)
323 WRIT(0, 0x0c, Local0)
325 Store(READ(0, 0x02, 0xff), Local0)
326 Or(Local0, 0x80, Local0)
327 WRIT(0, 0x02, Local0)
329 Store(READ(0, 0x07, 0xff), Local0)
331 And (Local0, Local1, Local0)
332 WRIT(0, 0x07, Local0)
335 /* D0 state - Line drivers are on */
338 Store(READ(0, 0x02, 0xff), Local0)
339 Or(Local0, 0x80, Local0)
340 WRIT(0, 0x02, Local0)
342 Store (READ(0, 0x07, 0xff), Local0)
344 And(Local0, Local1, Local0)
345 WRIT(0, 0x07, Local0)
348 /* D3 State - Line drivers are off */
351 Store(READ(0, 0x02, 0xff), Local0)
353 And(Local0, Local1, Local0)
354 WRIT(0, 0x02, Local0)
360 Name(_HID, EISAID("PNP0501"))
363 Name(_PRW, Package() { 0x08, 0x03 })
368 Acquire (SIOM, 0xffff)
370 // Is the hardware enabled?
371 Store (READ(0, 0x1b, 0xff), Local0)
372 If (LEqual(Local0, 0)) {
376 Store (READ(0, 0x02, 0x02), Local0)
377 If (LEqual(Local0, 0)) {
390 Store(READ(0, 0x1d, 0x0f), Local0)
391 WRIT(0, 0x1d, Local0)
393 Store(READ(0, 0x02, 0xff), Local0)
395 And(Local0, Local1, Local0)
396 WRIT(0, 0x02, Local0)
399 /* Possible Resource Settings */
400 Name(_PRS, ResourceTemplate() {
401 StartDependentFn(0, 1) {
402 IO(Decode16, 0x3e8, 0x3e8, 0x8, 0x8)
407 /* Current Resource Settings */
410 Name(NONE, ResourceTemplate() {
411 IO(Decode16, 0x000, 0x000, 0x0, 0x1)
415 Name(RSRC, ResourceTemplate() {
416 IO(Decode16, 0x3e8, 0x3e8, 0x8, 0x8, _IOA)
417 IRQNoFlags(_IRA) { 5 }
420 And (_STA(), 0x02, Local0)
421 If (LEqual(Local0, 0)) {
425 CreateWordField(RSRC,
426 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IOA._MIN, IOMN)
427 CreateWordField(RSRC,
428 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IOA._MAX, IOMX)
429 CreateWordField(RSRC,
430 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IRA._INT, IRQ)
433 Store (READ(0, 0x1b, 0xfe), Local0)
434 ShiftLeft(Local0, 0x02, Local0)
439 Store(READ(0, 0x1d, 0xf0), Local0)
440 ShiftRight(Local0, 4, Local0)
441 ShiftLeft(1, Local0, IRQ)
445 /* Set Resource Settings */
448 CreateByteField(Arg0, 0x02, IOLO)
449 CreateByteField(Arg0, 0x03, IOHI)
450 CreateByteField(Arg0, 0x09, IRQL)
453 FindSetRightBit(IRQL, Local0)
455 ShiftLeft(Local0, 4, Local0)
457 Store(READ(0, 0x1d, 0x0f), Local1)
458 Or(Local0, Local1, Local0)
459 WRIT(0, 0x1d, Local0)
462 ShiftRight(Local0, 2, Local0)
463 And(Local0, 0xfe, Local0)
466 ShiftLeft(Local1, 6, Local1)
467 Or (Local0, Local1, Local0)
468 WRIT(0, 0x1b, Local0)
470 Store(READ(0, 0x02, 0xff), Local0)
471 Or(Local0, 0x02, Local0)
472 WRIT(0, 0x02, Local0)
474 Store(READ(0, 0x07, 0xff), Local0)
476 And (Local0, Local1, Local0)
477 WRIT(0, 0x07, Local0)
481 /* D0 state - Line drivers are on */
484 Store(READ(0, 0x02, 0xff), Local0)
485 Or(Local0, 0x02, Local0)
486 WRIT(0, 0x02, Local0)
488 Store (READ(0, 0x07, 0xff), Local0)
490 And(Local0, Local1, Local0)
491 WRIT(0, 0x07, Local0)
494 /* D3 State - Line drivers are off */
497 Store(READ(0, 0x02, 0xff), Local0)
499 And(Local0, Local1, Local0)
500 WRIT(0, 0x02, Local0)
507 Name(_HID, EISAID("PNP0501"))
510 Name(_PRW, Package() { 0x08, 0x03 })
515 Acquire (SIOM, 0xffff)
517 // Is the hardware enabled?
518 Store (READ(0, 0x1c, 0xff), Local0)
519 If (LEqual(Local0, 0)) {
523 Store (READ(0, 0x02, 0x04), Local0)
524 If (LEqual(Local0, 0)) {
537 Store(READ(0, 0x1d, 0x0f), Local0)
538 WRIT(0, 0x1d, Local0)
540 Store(READ(0, 0x02, 0xff), Local0)
542 And(Local0, Local1, Local0)
543 WRIT(0, 0x02, Local0)
546 /* Possible Resource Settings */
547 Name(_PRS, ResourceTemplate() {
548 StartDependentFn(0, 1) {
549 IO(Decode16, 0x2e8, 0x2e8, 0x8, 0x8)
554 /* Current Resource Settings */
557 Name(NONE, ResourceTemplate() {
558 IO(Decode16, 0x000, 0x000, 0x0, 0x1)
562 Name(RSRC, ResourceTemplate() {
563 IO(Decode16, 0x2e8, 0x2e8, 0x8, 0x8, _IOA)
564 IRQNoFlags(_IRA) { 11 }
567 And (_STA(), 0x02, Local0)
568 If (LEqual(Local0, 0)) {
572 CreateWordField(RSRC,
573 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IOA._MIN, IOMN)
574 CreateWordField(RSRC,
575 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IOA._MAX, IOMX)
576 CreateWordField(RSRC,
577 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IRA._INT, IRQ)
580 Store (READ(0, 0x1c, 0xfe), Local0)
581 ShiftLeft(Local0, 0x02, Local0)
586 Store(READ(0, 0x1d, 0xf0), Local0)
587 ShiftRight(Local0, 4, Local0)
588 ShiftLeft(1, Local0, IRQ)
592 /* Set Resource Settings */
595 CreateByteField(Arg0, 0x02, IOLO)
596 CreateByteField(Arg0, 0x03, IOHI)
597 CreateByteField(Arg0, 0x09, IRQL)
600 FindSetRightBit(IRQL, Local0)
602 ShiftLeft(Local0, 4, Local0)
604 Store(READ(0, 0x1d, 0x0f), Local1)
605 Or(Local0, Local1, Local0)
606 WRIT(0, 0x1d, Local0)
609 ShiftRight(Local0, 2, Local0)
610 And(Local0, 0xfe, Local0)
613 ShiftLeft(Local1, 6, Local1)
614 Or (Local0, Local1, Local0)
615 WRIT(0, 0x1c, Local0)
617 Store(READ(0, 0x02, 0xff), Local0)
618 Or(Local0, 0x04, Local0)
619 WRIT(0, 0x02, Local0)
621 Store(READ(0, 0x07, 0xff), Local0)
623 And (Local0, Local1, Local0)
624 WRIT(0, 0x07, Local0)
628 /* D0 state - Line drivers are on */
631 Store(READ(0, 0x02, 0xff), Local0)
632 Or(Local0, 0x04, Local0)
633 WRIT(0, 0x02, Local0)
635 Store (READ(0, 0x07, 0xff), Local0)
637 And(Local0, Local1, Local0)
638 WRIT(0, 0x07, Local0)
641 /* D3 State - Line drivers are off */
644 Store(READ(0, 0x02, 0xff), Local0)
646 And(Local0, Local1, Local0)
647 WRIT(0, 0x02, Local0)