1 /* Bochs/QEMU ACPI DSDT ASL definition */
2 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Based on acpi-dsdt.dsl, but heavily modified for q35 chipset.
18 #include <acpi/dsdt_top.asl>
20 #include "../qemu-i440fx/acpi/dbug.asl"
23 OperationRegion(PCST, SystemIO, 0xae00, 0x0c)
24 OperationRegion(PCSB, SystemIO, 0xae0c, 0x01)
25 Field(PCSB, AnyAcc, NoLock, WriteAsZeros) {
31 /****************************************************************
33 ****************************************************************/
37 Name(_HID, EisaId("PNP0A08"))
38 Name(_CID, EisaId("PNP0A03"))
41 // _OSC: based on sample of ACPI3.0b spec
42 Name(SUPP, 0) // PCI _OSC Support Field value
43 Name(CTRL, 0) // PCI _OSC Control Field value
45 // Create DWORD-addressable fields from the Capabilities Buffer
46 CreateDWordField(Arg3, 0, CDW1)
48 // Check for proper UUID
49 If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")) {
50 // Create DWORD-addressable fields from the Capabilities Buffer
51 CreateDWordField(Arg3, 4, CDW2)
52 CreateDWordField(Arg3, 8, CDW3)
54 // Save Capabilities DWORD2 & 3
58 // Always allow native PME, AER (no dependencies)
59 // Never allow SHPC (no SHPC controller in this system)
67 // Capabilities bits were masked
70 // Update DWORD3 in the buffer
73 CDW1 |= 4 // Unrecognized UUID
80 #include "../qemu-i440fx/acpi/pci-crs.asl"
81 #include "../qemu-i440fx/acpi/hpet.asl"
84 /****************************************************************
86 ****************************************************************/
90 Name(_ADR, 0x00010000)
91 Method(_S1D, 0, NotSerialized) {
94 Method(_S2D, 0, NotSerialized) {
97 Method(_S3D, 0, NotSerialized) {
104 /****************************************************************
106 ****************************************************************/
109 /* PCI D31:f0 LPC ISA bridge */
112 Name(_ADR, 0x001f0000)
114 /* ICH9 PCI to ISA irq remapping */
115 OperationRegion(PIRQ, PCI_Config, 0x60, 0x0C)
117 OperationRegion(LPCD, PCI_Config, 0x80, 0x2)
118 Field(LPCD, AnyAcc, NoLock, Preserve) {
128 OperationRegion(LPCE, PCI_Config, 0x82, 0x2)
129 Field(LPCE, AnyAcc, NoLock, Preserve) {
138 #include "../qemu-i440fx/acpi/isa.asl"
141 /****************************************************************
143 ****************************************************************/
147 #define prt_slot_lnk(nr, lnk0, lnk1, lnk2, lnk3) \
148 Package() { nr##ffff, 0, lnk0, 0 }, \
149 Package() { nr##ffff, 1, lnk1, 0 }, \
150 Package() { nr##ffff, 2, lnk2, 0 }, \
151 Package() { nr##ffff, 3, lnk3, 0 }
153 #define prt_slot_lnkA(nr) prt_slot_lnk(nr, LNKA, LNKB, LNKC, LNKD)
154 #define prt_slot_lnkB(nr) prt_slot_lnk(nr, LNKB, LNKC, LNKD, LNKA)
155 #define prt_slot_lnkC(nr) prt_slot_lnk(nr, LNKC, LNKD, LNKA, LNKB)
156 #define prt_slot_lnkD(nr) prt_slot_lnk(nr, LNKD, LNKA, LNKB, LNKC)
158 #define prt_slot_lnkE(nr) prt_slot_lnk(nr, LNKE, LNKF, LNKG, LNKH)
159 #define prt_slot_lnkF(nr) prt_slot_lnk(nr, LNKF, LNKG, LNKH, LNKE)
160 #define prt_slot_lnkG(nr) prt_slot_lnk(nr, LNKG, LNKH, LNKE, LNKF)
161 #define prt_slot_lnkH(nr) prt_slot_lnk(nr, LNKH, LNKE, LNKF, LNKG)
163 Name(PRTP, Package() {
164 prt_slot_lnkE(0x0000),
165 prt_slot_lnkF(0x0001),
166 prt_slot_lnkG(0x0002),
167 prt_slot_lnkH(0x0003),
168 prt_slot_lnkE(0x0004),
169 prt_slot_lnkF(0x0005),
170 prt_slot_lnkG(0x0006),
171 prt_slot_lnkH(0x0007),
172 prt_slot_lnkE(0x0008),
173 prt_slot_lnkF(0x0009),
174 prt_slot_lnkG(0x000a),
175 prt_slot_lnkH(0x000b),
176 prt_slot_lnkE(0x000c),
177 prt_slot_lnkF(0x000d),
178 prt_slot_lnkG(0x000e),
179 prt_slot_lnkH(0x000f),
180 prt_slot_lnkE(0x0010),
181 prt_slot_lnkF(0x0011),
182 prt_slot_lnkG(0x0012),
183 prt_slot_lnkH(0x0013),
184 prt_slot_lnkE(0x0014),
185 prt_slot_lnkF(0x0015),
186 prt_slot_lnkG(0x0016),
187 prt_slot_lnkH(0x0017),
188 prt_slot_lnkE(0x0018),
190 /* INTA -> PIRQA for slot 25 - 31
191 see the default value of D<N>IR */
192 prt_slot_lnkA(0x0019),
193 prt_slot_lnkA(0x001a),
194 prt_slot_lnkA(0x001b),
195 prt_slot_lnkA(0x001c),
196 prt_slot_lnkA(0x001d),
198 /* PCIe->PCI bridge. use PIRQ[E-H] */
199 prt_slot_lnkE(0x001e),
201 prt_slot_lnkA(0x001f)
204 #define prt_slot_gsi(nr, gsi0, gsi1, gsi2, gsi3) \
205 Package() { nr##ffff, 0, gsi0, 0 }, \
206 Package() { nr##ffff, 1, gsi1, 0 }, \
207 Package() { nr##ffff, 2, gsi2, 0 }, \
208 Package() { nr##ffff, 3, gsi3, 0 }
210 #define prt_slot_gsiA(nr) prt_slot_gsi(nr, GSIA, GSIB, GSIC, GSID)
211 #define prt_slot_gsiB(nr) prt_slot_gsi(nr, GSIB, GSIC, GSID, GSIA)
212 #define prt_slot_gsiC(nr) prt_slot_gsi(nr, GSIC, GSID, GSIA, GSIB)
213 #define prt_slot_gsiD(nr) prt_slot_gsi(nr, GSID, GSIA, GSIB, GSIC)
215 #define prt_slot_gsiE(nr) prt_slot_gsi(nr, GSIE, GSIF, GSIG, GSIH)
216 #define prt_slot_gsiF(nr) prt_slot_gsi(nr, GSIF, GSIG, GSIH, GSIE)
217 #define prt_slot_gsiG(nr) prt_slot_gsi(nr, GSIG, GSIH, GSIE, GSIF)
218 #define prt_slot_gsiH(nr) prt_slot_gsi(nr, GSIH, GSIE, GSIF, GSIG)
220 Name(PRTA, Package() {
221 prt_slot_gsiE(0x0000),
222 prt_slot_gsiF(0x0001),
223 prt_slot_gsiG(0x0002),
224 prt_slot_gsiH(0x0003),
225 prt_slot_gsiE(0x0004),
226 prt_slot_gsiF(0x0005),
227 prt_slot_gsiG(0x0006),
228 prt_slot_gsiH(0x0007),
229 prt_slot_gsiE(0x0008),
230 prt_slot_gsiF(0x0009),
231 prt_slot_gsiG(0x000a),
232 prt_slot_gsiH(0x000b),
233 prt_slot_gsiE(0x000c),
234 prt_slot_gsiF(0x000d),
235 prt_slot_gsiG(0x000e),
236 prt_slot_gsiH(0x000f),
237 prt_slot_gsiE(0x0010),
238 prt_slot_gsiF(0x0011),
239 prt_slot_gsiG(0x0012),
240 prt_slot_gsiH(0x0013),
241 prt_slot_gsiE(0x0014),
242 prt_slot_gsiF(0x0015),
243 prt_slot_gsiG(0x0016),
244 prt_slot_gsiH(0x0017),
245 prt_slot_gsiE(0x0018),
247 /* INTA -> PIRQA for slot 25 - 31, but 30
248 see the default value of D<N>IR */
249 prt_slot_gsiA(0x0019),
250 prt_slot_gsiA(0x001a),
251 prt_slot_gsiA(0x001b),
252 prt_slot_gsiA(0x001c),
253 prt_slot_gsiA(0x001d),
255 /* PCIe->PCI bridge. use PIRQ[E-H] */
256 prt_slot_gsiE(0x001e),
258 prt_slot_gsiA(0x001f)
261 Method(_PRT, 0, NotSerialized) {
262 /* PCI IRQ routing table, example from ACPI 2.0a specification,
264 /* Note: we provide the same info as the PCI routing
265 table of the Bochs BIOS */
274 Field(PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) {
287 Method(IQST, 1, NotSerialized) {
288 // _STA method - get status
294 Method(IQCR, 1, Serialized) {
295 // _CRS method - get current settings
296 Name(PRR0, ResourceTemplate() {
297 Interrupt(, Level, ActiveHigh, Shared) { 0 }
299 CreateDWordField(PRR0, 0x05, PRRI)
304 #define define_link(link, uid, reg) \
306 Name(_HID, EISAID("PNP0C0F")) \
308 Name(_PRS, ResourceTemplate() { \
309 Interrupt(, Level, ActiveHigh, Shared) { \
313 Method(_STA, 0, NotSerialized) { \
316 Method(_DIS, 0, NotSerialized) { \
319 Method(_CRS, 0, NotSerialized) { \
322 Method(_SRS, 1, NotSerialized) { \
323 CreateDWordField(Arg0, 0x05, PRRI) \
328 define_link(LNKA, 0, PRQA)
329 define_link(LNKB, 1, PRQB)
330 define_link(LNKC, 2, PRQC)
331 define_link(LNKD, 3, PRQD)
332 define_link(LNKE, 4, PRQE)
333 define_link(LNKF, 5, PRQF)
334 define_link(LNKG, 6, PRQG)
335 define_link(LNKH, 7, PRQH)
337 #define define_gsi_link(link, uid, gsi) \
339 Name(_HID, EISAID("PNP0C0F")) \
341 Name(_PRS, ResourceTemplate() { \
342 Interrupt(, Level, ActiveHigh, Shared) { \
346 Name(_CRS, ResourceTemplate() { \
347 Interrupt(, Level, ActiveHigh, Shared) { \
351 Method(_SRS, 1, NotSerialized) { \
355 define_gsi_link(GSIA, 0, 0x10)
356 define_gsi_link(GSIB, 0, 0x11)
357 define_gsi_link(GSIC, 0, 0x12)
358 define_gsi_link(GSID, 0, 0x13)
359 define_gsi_link(GSIE, 0, 0x14)
360 define_gsi_link(GSIF, 0, 0x15)
361 define_gsi_link(GSIG, 0, 0x16)
362 define_gsi_link(GSIH, 0, 0x17)
365 /****************************************************************
366 * General purpose events
367 ****************************************************************/
370 Name(_HID, "ACPI0006")