1 /* Bochs/QEMU ACPI DSDT ASL definition */
2 /* SPDX-License-Identifier: GPL-2.0-only */
14 #include <acpi/dsdt_top.asl>
16 #include "acpi/dbug.asl"
19 /****************************************************************
21 ****************************************************************/
25 Name(_HID, EisaId("PNP0A03"))
30 #include "acpi/pci-crs.asl"
31 #include "acpi/hpet.asl"
34 /****************************************************************
36 ****************************************************************/
40 Name(_ADR, 0x00020000)
41 OperationRegion(PCIC, PCI_Config, 0, 0x4)
42 Field(PCIC, DWordAcc, NoLock, Preserve) {
45 Method(_S1D, 0, NotSerialized) {
48 Method(_S2D, 0, NotSerialized) {
51 Method(_S3D, 0, NotSerialized) {
52 If (VEND == 0x1001b36) {
62 /****************************************************************
64 ****************************************************************/
68 Name(_ADR, 0x00010003)
69 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
74 /****************************************************************
76 ****************************************************************/
80 Name(_ADR, 0x00010000)
82 /* PIIX PCI to ISA irq remapping */
83 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
86 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
100 #include "acpi/isa.asl"
103 /****************************************************************
105 ****************************************************************/
108 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
109 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
114 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
115 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
119 /* Methods called by bulk generated PCI devices below */
121 /* Methods called by hotplug devices */
122 Method(PCEJ, 1, NotSerialized) {
123 // _EJ0 method - eject callback
128 /* Hotplug notification method supplied by SSDT */
129 External(\_SB.PCI0.PCNT, MethodObj)
131 /* PCI hotplug notify method */
135 While (Local0 < 31) {
137 If (PCIU & (1 << Local0)) {
140 If (PCID & (1 << Local0)) {
148 /****************************************************************
150 ****************************************************************/
154 Name(_PRT, Package() {
155 /* PCI IRQ routing table, example from ACPI 2.0a specification,
157 /* Note: we provide the same info as the PCI routing
158 table of the Bochs BIOS */
160 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
161 Package() { nr##ffff, 0, lnk0, 0 }, \
162 Package() { nr##ffff, 1, lnk1, 0 }, \
163 Package() { nr##ffff, 2, lnk2, 0 }, \
164 Package() { nr##ffff, 3, lnk3, 0 }
166 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
167 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
168 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
169 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
172 /* Device 1 is power mgmt device, and can only use irq 9 */
173 prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
207 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
214 Method(IQST, 1, NotSerialized) {
215 // _STA method - get status
221 Method(IQCR, 1, Serialized) {
222 // _CRS method - get current settings
223 Name(PRR0, ResourceTemplate() {
224 Interrupt(, Level, ActiveHigh, Shared) { 0 }
226 CreateDWordField(PRR0, 0x05, PRRI)
233 #define define_link(link, uid, reg) \
235 Name(_HID, EISAID("PNP0C0F")) \
237 Name(_PRS, ResourceTemplate() { \
238 Interrupt(, Level, ActiveHigh, Shared) { \
242 Method(_STA, 0, NotSerialized) { \
245 Method(_DIS, 0, NotSerialized) { \
248 Method(_CRS, 0, NotSerialized) { \
251 Method(_SRS, 1, NotSerialized) { \
252 CreateDWordField(Arg0, 0x05, PRRI) \
257 define_link(LNKA, 0, PRQ0)
258 define_link(LNKB, 1, PRQ1)
259 define_link(LNKC, 2, PRQ2)
260 define_link(LNKD, 3, PRQ3)
263 Name(_HID, EISAID("PNP0C0F"))
265 Name(_PRS, ResourceTemplate() {
266 Interrupt(, Level, ActiveHigh, Shared) { 9 }
269 // The SCI cannot be disabled and is always attached to GSI 9,
270 // so these are no-ops. We only need this link to override the
271 // polarity to active high and match the content of the MADT.
272 Method(_STA, 0, NotSerialized) { Return (0x0b) }
273 Method(_DIS, 0, NotSerialized) { }
274 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
275 Method(_SRS, 1, NotSerialized) { }
279 /****************************************************************
280 * General purpose events
281 ****************************************************************/
284 Name(_HID, "ACPI0006")