2 * Bochs/QEMU ACPI DSDT ASL definition
4 * Copyright (c) 2006 Fabrice Bellard
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.
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.
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
20 ACPI_EXTRACT_ALL_CODE AcpiDsdtAmlCode
23 "acpi-dsdt.aml", // Output Filename
25 0x01, // DSDT Compliance Revision
34 Name(_HID, EisaId("PNP0A03"))
38 // External(PX13, DeviceObj)
42 /****************************************************************
44 ****************************************************************/
48 Name(_ADR, 0x00010003)
49 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
54 /****************************************************************
56 ****************************************************************/
60 External(ISA, DeviceObj)
63 Name(_ADR, 0x00010000)
65 /* PIIX PCI to ISA irq remapping */
66 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
69 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
83 /****************************************************************
85 ****************************************************************/
88 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
89 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
94 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
95 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
99 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
100 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
104 /* Lock to protect access to fields above. */
107 /* Methods called by bulk generated PCI devices below */
109 /* Methods called by hotplug devices */
110 Method(PCEJ, 2, NotSerialized) {
111 // _EJ0 method - eject callback
112 Acquire(BLCK, 0xFFFF)
114 Store(ShiftLeft(1, Arg1), B0EJ)
119 /* Hotplug notification method supplied by SSDT */
120 External(\_SB.PCI0.PCNT, MethodObj)
124 /****************************************************************
126 ****************************************************************/
131 Store(Package(128) {}, Local0)
133 While(LLess(Local1, 128)) {
135 Store(ShiftRight(Local1, 2), Local2)
137 // lnk = (slot + pin) & 3
138 Store(And(Add(Local1, Local2), 3), Local3)
139 If (LEqual(Local3, 0)) {
140 Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
142 If (LEqual(Local3, 1)) {
143 // device 1 is the power-management device, needs SCI
144 If (LEqual(Local1, 4)) {
145 Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
147 Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
150 If (LEqual(Local3, 2)) {
151 Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
153 If (LEqual(Local3, 3)) {
154 Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
157 // Complete the interrupt routing entry:
158 // Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
160 Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
161 Store(And(Local1, 3), Index(Local4, 1))
162 Store(Local4, Index(Local0, Local1))
171 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
178 Method(IQST, 1, NotSerialized) {
179 // _STA method - get status
180 If (And(0x80, Arg0)) {
185 Method(IQCR, 1, Serialized) {
186 // _CRS method - get current settings
187 Name(PRR0, ResourceTemplate() {
188 Interrupt(, Level, ActiveHigh, Shared) { 0 }
190 CreateDWordField(PRR0, 0x05, PRRI)
191 If (LLess(Arg0, 0x80)) {
197 #define define_link(link, uid, reg) \
199 Name(_HID, EISAID("PNP0C0F")) \
201 Name(_PRS, ResourceTemplate() { \
202 Interrupt(, Level, ActiveHigh, Shared) { \
206 Method(_STA, 0, NotSerialized) { \
209 Method(_DIS, 0, NotSerialized) { \
212 Method(_CRS, 0, NotSerialized) { \
215 Method(_SRS, 1, NotSerialized) { \
216 CreateDWordField(Arg0, 0x05, PRRI) \
221 define_link(LNKA, 0, PRQ0)
222 define_link(LNKB, 1, PRQ1)
223 define_link(LNKC, 2, PRQ2)
224 define_link(LNKD, 3, PRQ3)
227 Name(_HID, EISAID("PNP0C0F"))
229 Name(_PRS, ResourceTemplate() {
230 Interrupt(, Level, ActiveHigh, Shared) { 9 }
233 // The SCI cannot be disabled and is always attached to GSI 9,
234 // so these are no-ops. We only need this link to override the
235 // polarity to active high and match the content of the MADT.
236 Method(_STA, 0, NotSerialized) { Return (0x0b) }
237 Method(_DIS, 0, NotSerialized) { }
238 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
239 Method(_SRS, 1, NotSerialized) { }
243 /****************************************************************
244 * General purpose events
245 ****************************************************************/
247 Name(_HID, "ACPI0006")
253 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
255 Release(\_SB.PCI0.BLCK)