pc: acpi: piix4: move IQST() into SSDT
[qemu/ar7.git] / hw / i386 / acpi-dsdt.dsl
blobbc6bd452c48d177cd3adfd3535a660cfebbc9620
1 /*
2  * Bochs/QEMU ACPI DSDT ASL definition
3  *
4  * Copyright (c) 2006 Fabrice Bellard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License version 2 as published by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
20 ACPI_EXTRACT_ALL_CODE AcpiDsdtAmlCode
22 DefinitionBlock (
23     "acpi-dsdt.aml",    // Output Filename
24     "DSDT",             // Signature
25     0x01,               // DSDT Compliance Revision
26     "BXPC",             // OEMID
27     "BXDSDT",           // TABLE ID
28     0x1                 // OEM Revision
29     )
32     Scope(\_SB) {
33         Device(PCI0) {
34             Name(_HID, EisaId("PNP0A03"))
35             Name(_ADR, 0x00)
36             Name(_UID, 1)
37 //#define PX13 S0B_
38 //            External(PX13, DeviceObj)
39         }
40     }
42 /****************************************************************
43  * PCI hotplug
44  ****************************************************************/
46     Scope(\_SB.PCI0) {
47         OperationRegion(PCST, SystemIO, 0xae00, 0x08)
48         Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
49             PCIU, 32,
50             PCID, 32,
51         }
53         OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
54         Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
55             B0EJ, 32,
56         }
58         OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
59         Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
60             BNUM, 32,
61         }
63         /* Lock to protect access to fields above. */
64         Mutex(BLCK, 0)
66         /* Methods called by bulk generated PCI devices below */
68         /* Methods called by hotplug devices */
69         Method(PCEJ, 2, NotSerialized) {
70             // _EJ0 method - eject callback
71             Acquire(BLCK, 0xFFFF)
72             Store(Arg0, BNUM)
73             Store(ShiftLeft(1, Arg1), B0EJ)
74             Release(BLCK)
75             Return (0x0)
76         }
78         /* Hotplug notification method supplied by SSDT */
79         External(\_SB.PCI0.PCNT, MethodObj)
80     }
83 /****************************************************************
84  * PCI IRQs
85  ****************************************************************/
87     Scope(\_SB) {
88         Scope(PCI0) {
89             Method (_PRT, 0) {
90                 Store(Package(128) {}, Local0)
91                 Store(Zero, Local1)
92                 While(LLess(Local1, 128)) {
93                     // slot = pin >> 2
94                     Store(ShiftRight(Local1, 2), Local2)
96                     // lnk = (slot + pin) & 3
97                     Store(And(Add(Local1, Local2), 3), Local3)
98                     If (LEqual(Local3, 0)) {
99                         Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
100                     }
101                     If (LEqual(Local3, 1)) {
102                         // device 1 is the power-management device, needs SCI
103                         If (LEqual(Local1, 4)) {
104                             Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
105                         } Else {
106                             Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
107                         }
108                     }
109                     If (LEqual(Local3, 2)) {
110                         Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
111                     }
112                     If (LEqual(Local3, 3)) {
113                         Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
114                     }
116                     // Complete the interrupt routing entry:
117                     //    Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
119                     Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
120                     Store(And(Local1, 3),                    Index(Local4, 1))
121                     Store(Local4,                            Index(Local0, Local1))
123                     Increment(Local1)
124                 }
126                 Return(Local0)
127             }
128         }
131         External(PRQ0, FieldUnitObj)
132         External(PRQ1, FieldUnitObj)
133         External(PRQ2, FieldUnitObj)
134         External(PRQ3, FieldUnitObj)
135         External(LNKA, DeviceObj)
136         External(LNKB, DeviceObj)
137         External(LNKC, DeviceObj)
138         External(LNKD, DeviceObj)
139         External(LNKS, DeviceObj)
140     }