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, 0x4e, 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"))
69 Name(_PRW, Package() { 0x08, 0x03 })
74 Acquire (SIOM, 0xffff)
76 // Is the hardware enabled?
77 Store (READ(0, 0x24, 0xff), Local0)
78 If (LEqual(Local0, 0)) {
82 Store (READ(0, 0x02, 0x08), Local0)
83 If (LEqual(Local0, 0)) {
96 Store(READ(0, 0x28, 0x0f), Local0)
99 Store(READ(0, 0x02, 0xff), Local0)
101 And(Local0, Local1, Local0)
102 WRIT(0, 0x02, Local0)
105 /* Possible Resource Settings */
106 Name(_PRS, ResourceTemplate() {
107 StartDependentFn(0, 1) {
108 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8)
113 /* Current Resource Settings */
116 Name(NONE, ResourceTemplate() {
117 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
121 Name(RSRC, ResourceTemplate() {
122 IO(Decode16, 0x3f8, 0x3f8, 0x8, 0x8, _IOA)
123 IRQNoFlags(_IRA) { 4 }
126 And (_STA(), 0x02, Local0)
127 If (LEqual(Local0, 0)) {
131 CreateByteField(RSRC,
132 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IOA._MIN, IOLO)
133 CreateByteField(RSRC, 0x03, IOHI) // Why?
134 CreateByteField(RSRC,
135 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IOA._MAX, IORL)
136 CreateByteField(RSRC, 0x05, IORH) // Why?
137 CreateByteField(RSRC,
138 \_SB.PCI0.LPCB.SIO1.UAR1._CRS._IRA._INT, IRQL)
140 Store (READ(0, 0x24, 0xff), Local0)
141 And (Local0, 0xc0, Local1)
142 ShiftRight(Local1, 0x06, Local1)
143 ShiftLeft(Local0, 0x02, Local0)
150 Store(READ(0, 0x28, 0xf0), Local0)
151 ShiftRight(Local0, 4, Local0)
152 ShiftLeft(1, Local0, IRQL)
156 /* Set Resource Settings */
159 CreateByteField(Arg0, 0x02, IOLO)
160 CreateByteField(Arg0, 0x03, IOHI)
161 CreateByteField(Arg0, 0x09, IRQL)
164 FindSetRightBit(IRQL, Local0)
166 ShiftLeft(Local0, 4, Local0)
168 Store(READ(0, 0x28, 0x0f), Local1)
169 Or(Local0, Local1, Local0)
170 WRIT(0, 0x28, Local0)
173 ShiftRight(Local0, 2, Local0)
174 And(Local0, 0xfe, Local0)
177 ShiftLeft(Local1, 6, Local1)
178 Or (Local0, Local1, Local0)
179 WRIT(0, 0x24, Local0)
181 Store(READ(0, 0x02, 0xff), Local0)
182 Or(Local0, 0x08, Local0)
183 WRIT(0, 0x02, Local0)
185 Store(READ(0, 0x07, 0xff), Local0)
187 And (Local0, Local1, Local0)
188 WRIT(0, 0x07, Local0)
192 /* D0 state - Line drivers are on */
195 Store(READ(0, 0x02, 0xff), Local0)
196 Or(Local0, 0x08, Local0)
197 WRIT(0, 0x02, Local0)
199 Store (READ(0, 0x07, 0xff), Local0)
201 And(Local0, Local1, Local0)
202 WRIT(0, 0x07, Local0)
205 /* D3 State - Line drivers are off */
208 Store(READ(0, 0x02, 0xff), Local0)
210 And(Local0, Local1, Local0)
211 WRIT(0, 0x02, Local0)
217 Name(_HID, EISAID("PNP0501"))
220 Name(_PRW, Package() { 0x08, 0x03 })
226 Store(READ(0, 0x0c, 0x38), Local0)
227 If (LNotEqual(Local0, Zero)) {
231 // Is the hardware enabled?
232 Store (READ(0, 0x25, 0xff), Local0)
233 If (LEqual(Local0, 0)) {
237 Store (READ(0, 0x02, 0x80), Local0)
238 If (LEqual(Local0, 0)) {
251 Store(READ(0, 0x28, 0xf0), Local0)
252 WRIT(0, 0x28, Local0)
254 Store(READ(0, 0x02, 0xff), Local0)
256 And(Local0, Local1, Local0)
257 WRIT(0, 0x02, Local0)
260 /* Possible Resource Settings */
261 Name(_PRS, ResourceTemplate() {
262 StartDependentFn(0, 1) {
263 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8)
268 /* Current Resource Settings */
271 Name(NONE, ResourceTemplate() {
272 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
276 Name(RSRC, ResourceTemplate() {
277 IO(Decode16, 0x2f8, 0x2f8, 0x8, 0x8, _IOB)
278 IRQNoFlags(_IRB) { 3 }
281 And (_STA(), 0x02, Local0)
282 If (LEqual(Local0, 0)) {
286 CreateByteField(RSRC,
287 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IOB._MIN, IOLO)
288 CreateByteField(RSRC, 0x03, IOHI)
289 CreateByteField(RSRC,
290 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IOB._MAX, IORL)
291 CreateByteField(RSRC, 0x05, IORH)
292 CreateByteField(RSRC,
293 \_SB.PCI0.LPCB.SIO1.UAR2._CRS._IRB._INT, IRQL)
295 Store (READ(0, 0x25, 0xff), Local0)
296 And (Local0, 0xc0, Local1)
297 ShiftRight(Local1, 0x06, Local1)
298 ShiftLeft(Local0, 0x02, Local0)
305 Store(READ(0, 0x28, 0x0f), Local0)
306 ShiftRight(Local0, 4, Local0)
307 ShiftLeft(1, Local0, IRQL)
311 /* Set Resource Settings */
314 CreateByteField(Arg0, 0x02, IOLO)
315 CreateByteField(Arg0, 0x03, IOHI)
316 CreateByteField(Arg0, 0x09, IRQL)
319 FindSetRightBit(IRQL, Local0)
322 Store(READ(0, 0x28, 0xf0), Local1)
323 Or(Local0, Local1, Local0)
324 WRIT(0, 0x28, Local0)
327 ShiftRight(Local0, 2, Local0)
328 And(Local0, 0xfe, Local0)
331 ShiftLeft(Local1, 6, Local1)
332 Or (Local0, Local1, Local0)
333 WRIT(0, 0x25, Local0)
335 Store(READ(0, 0x0c, 0xff), Local0)
337 And(Local0, Local1, Local0)
338 WRIT(0, 0x0c, Local0)
340 Store(READ(0, 0x02, 0xff), Local0)
341 Or(Local0, 0x80, Local0)
342 WRIT(0, 0x02, Local0)
344 Store(READ(0, 0x07, 0xff), Local0)
346 And (Local0, Local1, Local0)
347 WRIT(0, 0x07, Local0)
350 /* D0 state - Line drivers are on */
353 Store(READ(0, 0x02, 0xff), Local0)
354 Or(Local0, 0x80, Local0)
355 WRIT(0, 0x02, Local0)
357 Store (READ(0, 0x07, 0xff), Local0)
359 And(Local0, Local1, Local0)
360 WRIT(0, 0x07, Local0)
363 /* D3 State - Line drivers are off */
366 Store(READ(0, 0x02, 0xff), Local0)
368 And(Local0, Local1, Local0)
369 WRIT(0, 0x02, Local0)
375 Name(_HID, EISAID("PNP0501"))
378 Name(_PRW, Package() { 0x08, 0x03 })
383 Acquire (SIOM, 0xffff)
385 // Is the hardware enabled?
386 Store (READ(0, 0x1b, 0xff), Local0)
387 If (LEqual(Local0, 0)) {
391 Store (READ(0, 0x02, 0x02), Local0)
392 If (LEqual(Local0, 0)) {
405 Store(READ(0, 0x1d, 0x0f), Local0)
406 WRIT(0, 0x1d, Local0)
408 Store(READ(0, 0x02, 0xff), Local0)
410 And(Local0, Local1, Local0)
411 WRIT(0, 0x02, Local0)
414 /* Possible Resource Settings */
415 Name(_PRS, ResourceTemplate() {
416 StartDependentFn(0, 1) {
417 IO(Decode16, 0x3e8, 0x3e8, 0x8, 0x8)
422 /* Current Resource Settings */
425 Name(NONE, ResourceTemplate() {
426 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
430 Name(RSRC, ResourceTemplate() {
431 IO(Decode16, 0x3e8, 0x3e8, 0x8, 0x8, _IOA)
432 IRQNoFlags(_IRA) { 5 }
435 And (_STA(), 0x02, Local0)
436 If (LEqual(Local0, 0)) {
440 CreateByteField(RSRC,
441 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IOA._MIN, IOLO)
442 CreateByteField(RSRC, 0x03, IOHI) // Why?
443 CreateByteField(RSRC,
444 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IOA._MAX, IORL)
445 CreateByteField(RSRC, 0x05, IORH) // Why?
446 CreateByteField(RSRC,
447 \_SB.PCI0.LPCB.SIO1.UAR3._CRS._IRA._INT, IRQL)
449 Store (READ(0, 0x1b, 0xff), Local0)
450 And (Local0, 0xc0, Local1)
451 ShiftRight(Local1, 0x06, Local1)
452 ShiftLeft(Local0, 0x02, Local0)
459 Store(READ(0, 0x1d, 0xf0), Local0)
460 ShiftRight(Local0, 4, Local0)
461 ShiftLeft(1, Local0, IRQL)
465 /* Set Resource Settings */
468 CreateByteField(Arg0, 0x02, IOLO)
469 CreateByteField(Arg0, 0x03, IOHI)
470 CreateByteField(Arg0, 0x09, IRQL)
473 FindSetRightBit(IRQL, Local0)
475 ShiftLeft(Local0, 4, Local0)
477 Store(READ(0, 0x1d, 0x0f), Local1)
478 Or(Local0, Local1, Local0)
479 WRIT(0, 0x1d, Local0)
482 ShiftRight(Local0, 2, Local0)
483 And(Local0, 0xfe, Local0)
486 ShiftLeft(Local1, 6, Local1)
487 Or (Local0, Local1, Local0)
488 WRIT(0, 0x1b, Local0)
490 Store(READ(0, 0x02, 0xff), Local0)
491 Or(Local0, 0x02, Local0)
492 WRIT(0, 0x02, Local0)
494 Store(READ(0, 0x07, 0xff), Local0)
496 And (Local0, Local1, Local0)
497 WRIT(0, 0x07, Local0)
501 /* D0 state - Line drivers are on */
504 Store(READ(0, 0x02, 0xff), Local0)
505 Or(Local0, 0x02, Local0)
506 WRIT(0, 0x02, Local0)
508 Store (READ(0, 0x07, 0xff), Local0)
510 And(Local0, Local1, Local0)
511 WRIT(0, 0x07, Local0)
514 /* D3 State - Line drivers are off */
517 Store(READ(0, 0x02, 0xff), Local0)
519 And(Local0, Local1, Local0)
520 WRIT(0, 0x02, Local0)
527 Name(_HID, EISAID("PNP0501"))
530 Name(_PRW, Package() { 0x08, 0x03 })
535 Acquire (SIOM, 0xffff)
537 // Is the hardware enabled?
538 Store (READ(0, 0x1c, 0xff), Local0)
539 If (LEqual(Local0, 0)) {
543 Store (READ(0, 0x02, 0x04), Local0)
544 If (LEqual(Local0, 0)) {
557 Store(READ(0, 0x1d, 0x0f), Local0)
558 WRIT(0, 0x1d, Local0)
560 Store(READ(0, 0x02, 0xff), Local0)
562 And(Local0, Local1, Local0)
563 WRIT(0, 0x02, Local0)
566 /* Possible Resource Settings */
567 Name(_PRS, ResourceTemplate() {
568 StartDependentFn(0, 1) {
569 IO(Decode16, 0x2e8, 0x2e8, 0x8, 0x8)
574 /* Current Resource Settings */
577 Name(NONE, ResourceTemplate() {
578 IO(Decode16, 0x000, 0x000, 0x0, 0x0)
582 Name(RSRC, ResourceTemplate() {
583 IO(Decode16, 0x2e8, 0x2e8, 0x8, 0x8, _IOA)
584 IRQNoFlags(_IRA) { 11 }
587 And (_STA(), 0x02, Local0)
588 If (LEqual(Local0, 0)) {
592 CreateByteField(RSRC,
593 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IOA._MIN, IOLO)
594 CreateByteField(RSRC, 0x03, IOHI) // Why?
595 CreateByteField(RSRC,
596 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IOA._MAX, IORL)
597 CreateByteField(RSRC, 0x05, IORH) // Why?
598 CreateByteField(RSRC,
599 \_SB.PCI0.LPCB.SIO1.UAR4._CRS._IRA._INT, IRQL)
601 Store (READ(0, 0x1c, 0xff), Local0)
602 And (Local0, 0xc0, Local1)
603 ShiftRight(Local1, 0x06, Local1)
604 ShiftLeft(Local0, 0x02, Local0)
611 Store(READ(0, 0x1d, 0xf0), Local0)
612 ShiftRight(Local0, 4, Local0)
613 ShiftLeft(1, Local0, IRQL)
617 /* Set Resource Settings */
620 CreateByteField(Arg0, 0x02, IOLO)
621 CreateByteField(Arg0, 0x03, IOHI)
622 CreateByteField(Arg0, 0x09, IRQL)
625 FindSetRightBit(IRQL, Local0)
627 ShiftLeft(Local0, 4, Local0)
629 Store(READ(0, 0x1d, 0x0f), Local1)
630 Or(Local0, Local1, Local0)
631 WRIT(0, 0x1d, Local0)
634 ShiftRight(Local0, 2, Local0)
635 And(Local0, 0xfe, Local0)
638 ShiftLeft(Local1, 6, Local1)
639 Or (Local0, Local1, Local0)
640 WRIT(0, 0x1c, Local0)
642 Store(READ(0, 0x02, 0xff), Local0)
643 Or(Local0, 0x04, Local0)
644 WRIT(0, 0x02, Local0)
646 Store(READ(0, 0x07, 0xff), Local0)
648 And (Local0, Local1, Local0)
649 WRIT(0, 0x07, Local0)
653 /* D0 state - Line drivers are on */
656 Store(READ(0, 0x02, 0xff), Local0)
657 Or(Local0, 0x04, Local0)
658 WRIT(0, 0x02, Local0)
660 Store (READ(0, 0x07, 0xff), Local0)
662 And(Local0, Local1, Local0)
663 WRIT(0, 0x07, Local0)
666 /* D3 State - Line drivers are off */
669 Store(READ(0, 0x02, 0xff), Local0)
671 And(Local0, Local1, Local0)
672 WRIT(0, 0x02, Local0)