blob: 4575519d10c37c635e7a12c48056795a50465b4e [file] [log] [blame]
Kevin O'Connora4d35762008-03-08 15:43:03 -05001/*
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 */
Michael S. Tsirkin2e55b032011-10-26 23:28:02 +020019
20ACPI_EXTRACT_ALL_CODE AmlCode
21
Kevin O'Connora4d35762008-03-08 15:43:03 -050022DefinitionBlock (
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 )
30{
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040031
Gerd Hoffmann0e25a252012-11-28 10:17:38 +010032#include "acpi-dsdt-dbug.dsl"
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040033
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050034
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040035/****************************************************************
36 * PCI Bus definition
37 ****************************************************************/
38
Kevin O'Connora4d35762008-03-08 15:43:03 -050039 Scope(\_SB) {
40 Device(PCI0) {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050041 Name(_HID, EisaId("PNP0A03"))
42 Name(_ADR, 0x00)
43 Name(_UID, 1)
Kevin O'Connora4d35762008-03-08 15:43:03 -050044 }
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040045 }
Kevin O'Connorf4343772009-10-08 22:05:21 -040046
Gerd Hoffmann20886ab2012-11-28 10:17:42 +010047#include "acpi-dsdt-pci-crs.dsl"
Gerd Hoffmann4dfa5472012-11-28 10:17:40 +010048#include "acpi-dsdt-hpet.dsl"
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040049
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050050
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040051/****************************************************************
52 * VGA
53 ****************************************************************/
54
Kevin O'Connora4d35762008-03-08 15:43:03 -050055 Scope(\_SB.PCI0) {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050056 Device(VGA) {
57 Name(_ADR, 0x00020000)
58 OperationRegion(PCIC, PCI_Config, Zero, 0x4)
59 Field(PCIC, DWordAcc, NoLock, Preserve) {
60 VEND, 32
61 }
62 Method(_S1D, 0, NotSerialized) {
63 Return (0x00)
64 }
65 Method(_S2D, 0, NotSerialized) {
66 Return (0x00)
67 }
68 Method(_S3D, 0, NotSerialized) {
69 If (LEqual(VEND, 0x1001b36)) {
70 Return (0x03) // QXL
71 } Else {
72 Return (0x00)
73 }
74 }
Kevin O'Connor9967ab72008-12-18 21:57:33 -050075 }
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040076 }
Kevin O'Connora4d35762008-03-08 15:43:03 -050077
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040078
79/****************************************************************
80 * PIIX3 ISA bridge
81 ****************************************************************/
82
83 Scope(\_SB.PCI0) {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050084 Device(ISA) {
85 Name(_ADR, 0x00010000)
Kevin O'Connor3c241ed2011-01-05 21:25:18 -050086
Kevin O'Connora4d35762008-03-08 15:43:03 -050087 /* PIIX PCI to ISA irq remapping */
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050088 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040089 }
90 }
Kevin O'Connora4d35762008-03-08 15:43:03 -050091
Kevin O'Connore9fe15b2011-09-21 19:58:42 -040092
93/****************************************************************
94 * SuperIO devices (kbd, mouse, etc.)
95 ****************************************************************/
96
97 Scope(\_SB.PCI0.ISA) {
Gerd Hoffmannfb87c192012-11-28 10:17:46 +010098
Kevin O'Connore9e7ab42012-12-02 01:09:17 -050099 /* enable bits */
100 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
101 Offset(0x5f),
102 , 7,
103 LPEN, 1, // LPT
104 Offset(0x67),
105 , 3,
106 CAEN, 1, // COM1
107 , 3,
108 CBEN, 1, // COM2
109 }
110 Name(FDEN, 1)
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400111 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500112
Gerd Hoffmann8d744972012-11-28 10:17:47 +0100113#include "acpi-dsdt-isa.dsl"
114
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400115
116/****************************************************************
117 * PIIX4 PM
118 ****************************************************************/
119
120 Scope(\_SB.PCI0) {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500121 Device(PX13) {
122 Name(_ADR, 0x00010003)
123 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
124 }
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400125 }
126
127
128/****************************************************************
129 * PCI hotplug
130 ****************************************************************/
131
132 Scope(\_SB.PCI0) {
Kevin O'Connorbb430272012-12-02 01:22:23 -0500133 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
134 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
135 PCIU, 32,
136 PCID, 32,
137 }
138
139 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
140 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
141 B0EJ, 32,
142 }
143
Kevin O'Connor9d3d7cb2011-09-21 21:19:51 -0400144 /* Methods called by bulk generated PCI devices below */
Kevin O'Connor3c241ed2011-01-05 21:25:18 -0500145
Michael S. Tsirkinc9737882011-11-20 19:56:59 +0200146 /* Methods called by hotplug devices */
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500147 Method(PCEJ, 1, NotSerialized) {
Kevin O'Connor9d3d7cb2011-09-21 21:19:51 -0400148 // _EJ0 method - eject callback
149 Store(ShiftLeft(1, Arg0), B0EJ)
150 Return (0x0)
151 }
152
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500153 /* Hotplug notification method supplied by SSDT */
154 External(\_SB.PCI0.PCNT, MethodObj)
Kevin O'Connor5eaed9c2011-09-21 20:14:42 -0400155
Kevin O'Connor5eaed9c2011-09-21 20:14:42 -0400156 /* PCI hotplug notify method */
157 Method(PCNF, 0) {
Kevin O'Connor9d3d7cb2011-09-21 21:19:51 -0400158 // Local0 = iterator
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500159 Store(Zero, Local0)
Kevin O'Connor9d3d7cb2011-09-21 21:19:51 -0400160 While (LLess(Local0, 31)) {
161 Increment(Local0)
162 If (And(PCIU, ShiftLeft(1, Local0))) {
163 PCNT(Local0, 1)
164 }
165 If (And(PCID, ShiftLeft(1, Local0))) {
166 PCNT(Local0, 3)
167 }
168 }
Kevin O'Connor9d3d7cb2011-09-21 21:19:51 -0400169 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500170 }
171
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400172
173/****************************************************************
174 * PCI IRQs
175 ****************************************************************/
176
Kevin O'Connora4d35762008-03-08 15:43:03 -0500177 Scope(\_SB) {
Kevin O'Connorbb430272012-12-02 01:22:23 -0500178 Scope(PCI0) {
179 Name(_PRT, Package() {
180 /* PCI IRQ routing table, example from ACPI 2.0a specification,
181 section 6.2.8.1 */
182 /* Note: we provide the same info as the PCI routing
183 table of the Bochs BIOS */
184
185#define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
186 Package() { nr##ffff, 0, lnk0, 0 }, \
187 Package() { nr##ffff, 1, lnk1, 0 }, \
188 Package() { nr##ffff, 2, lnk2, 0 }, \
189 Package() { nr##ffff, 3, lnk3, 0 }
190
191#define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
192#define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
193#define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
194#define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
195
196 prt_slot0(0x0000),
197 /* Device 1 is power mgmt device, and can only use irq 9 */
198 Package() { 0x1ffff, 0, 0, 9 },
199 Package() { 0x1ffff, 1, LNKB, 0 },
200 Package() { 0x1ffff, 2, LNKC, 0 },
201 Package() { 0x1ffff, 3, LNKD, 0 },
202 prt_slot2(0x0002),
203 prt_slot3(0x0003),
204 prt_slot0(0x0004),
205 prt_slot1(0x0005),
206 prt_slot2(0x0006),
207 prt_slot3(0x0007),
208 prt_slot0(0x0008),
209 prt_slot1(0x0009),
210 prt_slot2(0x000a),
211 prt_slot3(0x000b),
212 prt_slot0(0x000c),
213 prt_slot1(0x000d),
214 prt_slot2(0x000e),
215 prt_slot3(0x000f),
216 prt_slot0(0x0010),
217 prt_slot1(0x0011),
218 prt_slot2(0x0012),
219 prt_slot3(0x0013),
220 prt_slot0(0x0014),
221 prt_slot1(0x0015),
222 prt_slot2(0x0016),
223 prt_slot3(0x0017),
224 prt_slot0(0x0018),
225 prt_slot1(0x0019),
226 prt_slot2(0x001a),
227 prt_slot3(0x001b),
228 prt_slot0(0x001c),
229 prt_slot1(0x001d),
230 prt_slot2(0x001e),
231 prt_slot3(0x001f),
232 })
233 }
234
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500235 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
Kevin O'Connora65f4172011-09-25 23:08:58 -0400236 PRQ0, 8,
237 PRQ1, 8,
238 PRQ2, 8,
239 PRQ3, 8
240 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500241
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500242 Method(IQST, 1, NotSerialized) {
Kevin O'Connora65f4172011-09-25 23:08:58 -0400243 // _STA method - get status
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500244 If (And(0x80, Arg0)) {
Kevin O'Connora65f4172011-09-25 23:08:58 -0400245 Return (0x09)
246 }
247 Return (0x0B)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500248 }
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500249 Method(IQCR, 1, NotSerialized) {
Kevin O'Connora65f4172011-09-25 23:08:58 -0400250 // _CRS method - get current settings
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500251 Name(PRR0, ResourceTemplate() {
252 Interrupt(, Level, ActiveHigh, Shared) { 0 }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400253 })
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500254 CreateDWordField(PRR0, 0x05, PRRI)
255 If (LLess(Arg0, 0x80)) {
256 Store(Arg0, PRRI)
Kevin O'Connora65f4172011-09-25 23:08:58 -0400257 }
258 Return (PRR0)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500259 }
Kevin O'Connor891766f2011-12-17 10:26:17 -0500260 // _DIS method - disable interrupt
261#define DISIRQ(PRQVAR) \
262 Or(PRQVAR, 0x80, PRQVAR) \
263 // _SRS method - set interrupt
264#define SETIRQ(PRQVAR, IRQINFO) \
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500265 CreateDWordField(IRQINFO, 0x05, PRRI) \
266 Store(PRRI, PRQVAR)
Kevin O'Connora65f4172011-09-25 23:08:58 -0400267
268 Device(LNKA) {
269 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
270 Name(_UID, 1)
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500271 Name(_PRS, ResourceTemplate() {
272 Interrupt(, Level, ActiveHigh, Shared) {
273 5, 10, 11
274 }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400275 })
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500276 Method(_STA, 0, NotSerialized) { Return (IQST(PRQ0)) }
277 Method(_DIS, 0, NotSerialized) { DISIRQ(PRQ0) }
278 Method(_CRS, 0, NotSerialized) { Return (IQCR(PRQ0)) }
279 Method(_SRS, 1, NotSerialized) { SETIRQ(PRQ0, Arg0) }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400280 }
281 Device(LNKB) {
282 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
283 Name(_UID, 2)
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500284 Name(_PRS, ResourceTemplate() {
285 Interrupt(, Level, ActiveHigh, Shared) {
286 5, 10, 11
287 }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400288 })
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500289 Method(_STA, 0, NotSerialized) { Return (IQST(PRQ1)) }
290 Method(_DIS, 0, NotSerialized) { DISIRQ(PRQ1) }
291 Method(_CRS, 0, NotSerialized) { Return (IQCR(PRQ1)) }
292 Method(_SRS, 1, NotSerialized) { SETIRQ(PRQ1, Arg0) }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400293 }
294 Device(LNKC) {
295 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
296 Name(_UID, 3)
297 Name(_PRS, ResourceTemplate() {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500298 Interrupt(, Level, ActiveHigh, Shared) {
299 5, 10, 11
300 }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400301 })
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500302 Method(_STA, 0, NotSerialized) { Return (IQST(PRQ2)) }
303 Method(_DIS, 0, NotSerialized) { DISIRQ(PRQ2) }
304 Method(_CRS, 0, NotSerialized) { Return (IQCR(PRQ2)) }
305 Method(_SRS, 1, NotSerialized) { SETIRQ(PRQ2, Arg0) }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400306 }
307 Device(LNKD) {
308 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
309 Name(_UID, 4)
310 Name(_PRS, ResourceTemplate() {
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500311 Interrupt(, Level, ActiveHigh, Shared) {
312 5, 10, 11
313 }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400314 })
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500315 Method(_STA, 0, NotSerialized) { Return (IQST(PRQ3)) }
316 Method(_DIS, 0, NotSerialized) { DISIRQ(PRQ3) }
317 Method(_CRS, 0, NotSerialized) { Return (IQCR(PRQ3)) }
318 Method(_SRS, 1, NotSerialized) { SETIRQ(PRQ3, Arg0) }
Kevin O'Connora65f4172011-09-25 23:08:58 -0400319 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500320 }
321
Gerd Hoffmann3aab6ff2012-11-28 10:17:44 +0100322#include "acpi-dsdt-cpu-hotplug.dsl"
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400323
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500324
Kevin O'Connore9fe15b2011-09-21 19:58:42 -0400325/****************************************************************
326 * General purpose events
327 ****************************************************************/
328
Kevin O'Connore9e7ab42012-12-02 01:09:17 -0500329 Scope(\_GPE) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400330 Name(_HID, "ACPI0006")
331
332 Method(_L00) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400333 }
Igor Mammedov9c6635b2012-04-03 23:48:44 +0200334 Method(_E01) {
Kevin O'Connor5eaed9c2011-09-21 20:14:42 -0400335 // PCI hotplug event
Kevin O'Connor475ce3f2012-10-27 21:31:12 -0400336 \_SB.PCI0.PCNF()
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400337 }
Igor Mammedov9c6635b2012-04-03 23:48:44 +0200338 Method(_E02) {
Kevin O'Connore2074bf2010-08-03 21:30:03 -0400339 // CPU hotplug event
Kevin O'Connor475ce3f2012-10-27 21:31:12 -0400340 \_SB.PRSC()
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400341 }
342 Method(_L03) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400343 }
344 Method(_L04) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400345 }
346 Method(_L05) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400347 }
348 Method(_L06) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400349 }
350 Method(_L07) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400351 }
352 Method(_L08) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400353 }
354 Method(_L09) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400355 }
356 Method(_L0A) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400357 }
358 Method(_L0B) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400359 }
360 Method(_L0C) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400361 }
362 Method(_L0D) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400363 }
364 Method(_L0E) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400365 }
366 Method(_L0F) {
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400367 }
368 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500369}