Set max virtual processor to 4 for ia64
[qemu-kvm/amd-iommu.git] / kvm / bios / acpi-dsdt.dsl
blobdf255ce210ae01e656c4dcab090df05bb781ef5e
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  */
19 DefinitionBlock (
20     "acpi-dsdt.aml",    // Output Filename
21     "DSDT",             // Signature
22     0x01,               // DSDT Compliance Revision
23     "BXPC",             // OEMID
24     "BXDSDT",           // TABLE ID
25     0x1                 // OEM Revision
26     )
28     Scope (_PR)
29     {
30         Processor (CPU0, 0x00, 0x0000b010, 0x06) {}
31         Processor (CPU1, 0x01, 0x0000b010, 0x06) {}
32         Processor (CPU2, 0x02, 0x0000b010, 0x06) {}
33         Processor (CPU3, 0x03, 0x0000b010, 0x06) {}
34         Processor (CPU4, 0x04, 0x0000b010, 0x06) {}
35         Processor (CPU5, 0x05, 0x0000b010, 0x06) {}
36         Processor (CPU6, 0x06, 0x0000b010, 0x06) {}
37         Processor (CPU7, 0x07, 0x0000b010, 0x06) {}
38         Processor (CPU8, 0x08, 0x0000b010, 0x06) {}
39         Processor (CPU9, 0x09, 0x0000b010, 0x06) {}
40         Processor (CPUA, 0x0a, 0x0000b010, 0x06) {}
41         Processor (CPUB, 0x0b, 0x0000b010, 0x06) {}
42         Processor (CPUC, 0x0c, 0x0000b010, 0x06) {}
43         Processor (CPUD, 0x0d, 0x0000b010, 0x06) {}
44         Processor (CPUE, 0x0e, 0x0000b010, 0x06) {}
45     }
47     Scope (\)
48     {
49         /* CMOS memory access */
50         OperationRegion (CMS, SystemIO, 0x70, 0x02)
51         Field (CMS, ByteAcc, NoLock, Preserve)
52         {
53             CMSI,   8, 
54             CMSD,   8
55         }
56         Method (CMRD, 1, NotSerialized)
57         {
58             Store (Arg0, CMSI)
59             Store (CMSD, Local0)
60             Return (Local0)
61         }
63         /* Debug Output */
64         OperationRegion (DBG, SystemIO, 0xb044, 0x04)
65         Field (DBG, DWordAcc, NoLock, Preserve)
66         {
67             DBGL,   32, 
68         }
69     }
72     /* PCI Bus definition */
73     Scope(\_SB) {
74         Device(PCI0) {
75             Name (_HID, EisaId ("PNP0A03"))
76             Name (_ADR, 0x00)
77             Name (_UID, 1)
78             Name(_PRT, Package() {
79                 /* PCI IRQ routing table, example from ACPI 2.0a specification,
80                    section 6.2.8.1 */
81                 /* Note: we provide the same info as the PCI routing
82                    table of the Bochs BIOS */
83                    
84                 // PCI Slot 0
85                 Package() {0x0000ffff, 0, LNKD, 0}, 
86                 Package() {0x0000ffff, 1, LNKA, 0}, 
87                 Package() {0x0000ffff, 2, LNKB, 0}, 
88                 Package() {0x0000ffff, 3, LNKC, 0}, 
90                 // PCI Slot 1
91                 Package() {0x0001ffff, 0, LNKA, 0}, 
92                 Package() {0x0001ffff, 1, LNKB, 0}, 
93                 Package() {0x0001ffff, 2, LNKC, 0}, 
94                 Package() {0x0001ffff, 3, LNKD, 0}, 
95                 
96                 // PCI Slot 2
97                 Package() {0x0002ffff, 0, LNKB, 0}, 
98                 Package() {0x0002ffff, 1, LNKC, 0}, 
99                 Package() {0x0002ffff, 2, LNKD, 0}, 
100                 Package() {0x0002ffff, 3, LNKA, 0}, 
102                 // PCI Slot 3
103                 Package() {0x0003ffff, 0, LNKC, 0}, 
104                 Package() {0x0003ffff, 1, LNKD, 0}, 
105                 Package() {0x0003ffff, 2, LNKA, 0}, 
106                 Package() {0x0003ffff, 3, LNKB, 0}, 
108                 // PCI Slot 4
109                 Package() {0x0004ffff, 0, LNKD, 0}, 
110                 Package() {0x0004ffff, 1, LNKA, 0}, 
111                 Package() {0x0004ffff, 2, LNKB, 0}, 
112                 Package() {0x0004ffff, 3, LNKC, 0}, 
114                 // PCI Slot 5
115                 Package() {0x0005ffff, 0, LNKA, 0}, 
116                 Package() {0x0005ffff, 1, LNKB, 0}, 
117                 Package() {0x0005ffff, 2, LNKC, 0}, 
118                 Package() {0x0005ffff, 3, LNKD, 0}, 
119             })
121             Method (_CRS, 0, NotSerialized)
122             {
123             Name (MEMP, ResourceTemplate ()
124             {
125                 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
126                     0x0000,             // Address Space Granularity
127                     0x0000,             // Address Range Minimum
128                     0x00FF,             // Address Range Maximum
129                     0x0000,             // Address Translation Offset
130                     0x0100,             // Address Length
131                     ,, )
132                 IO (Decode16,
133                     0x0CF8,             // Address Range Minimum
134                     0x0CF8,             // Address Range Maximum
135                     0x01,               // Address Alignment
136                     0x08,               // Address Length
137                     )
138                 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
139                     0x0000,             // Address Space Granularity
140                     0x0000,             // Address Range Minimum
141                     0x0CF7,             // Address Range Maximum
142                     0x0000,             // Address Translation Offset
143                     0x0CF8,             // Address Length
144                     ,, , TypeStatic)
145                 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
146                     0x0000,             // Address Space Granularity
147                     0x0D00,             // Address Range Minimum
148                     0xFFFF,             // Address Range Maximum
149                     0x0000,             // Address Translation Offset
150                     0xF300,             // Address Length
151                     ,, , TypeStatic)
152                 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
153                     0x00000000,         // Address Space Granularity
154                     0x000A0000,         // Address Range Minimum
155                     0x000BFFFF,         // Address Range Maximum
156                     0x00000000,         // Address Translation Offset
157                     0x00020000,         // Address Length
158                     ,, , AddressRangeMemory, TypeStatic)
159                 DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
160                     0x00000000,         // Address Space Granularity
161                     0x00000000,         // Address Range Minimum
162                     0xFEBFFFFF,         // Address Range Maximum
163                     0x00000000,         // Address Translation Offset
164                     0x00000000,         // Address Length
165                     ,, MEMF, AddressRangeMemory, TypeStatic)
166             })
167                 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
168                 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
169                 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
170                 /* compute available RAM */
171                 Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
172                 ShiftLeft(Local0, 16, Local0)
173                 Add(Local0, 0x1000000, Local0)
174                 /* update field of last region */
175                 Store(Local0, PMIN)
176                 Subtract (PMAX, PMIN, PLEN)
177                 Increment (PLEN)
178                 Return (MEMP)
179             }
180         }
181     }
183     Scope(\_SB.PCI0) {
185         /* PIIX3 ISA bridge */
186         Device (ISA) {
187             Name (_ADR, 0x00010000)
188         
189             /* PIIX PCI to ISA irq remapping */
190             OperationRegion (P40C, PCI_Config, 0x60, 0x04)
193             /* Keyboard seems to be important for WinXP install */
194             Device (KBD)
195             {
196                 Name (_HID, EisaId ("PNP0303"))
197                 Method (_STA, 0, NotSerialized)
198                 {
199                     Return (0x0f)
200                 }
202                 Method (_CRS, 0, NotSerialized)
203                 {
204                      Name (TMP, ResourceTemplate ()
205                      {
206                     IO (Decode16,
207                         0x0060,             // Address Range Minimum
208                         0x0060,             // Address Range Maximum
209                         0x01,               // Address Alignment
210                         0x01,               // Address Length
211                         )
212                     IO (Decode16,
213                         0x0064,             // Address Range Minimum
214                         0x0064,             // Address Range Maximum
215                         0x01,               // Address Alignment
216                         0x01,               // Address Length
217                         )
218                     IRQNoFlags ()
219                         {1}
220                     })
221                     Return (TMP)
222                 }
223             }
225             /* PS/2 mouse */
226             Device (MOU) 
227             {
228                 Name (_HID, EisaId ("PNP0F13"))
229                 Method (_STA, 0, NotSerialized)
230                 {
231                     Return (0x0f)
232                 }
234                 Method (_CRS, 0, NotSerialized)
235                 {
236                     Name (TMP, ResourceTemplate ()
237                     {
238                          IRQNoFlags () {12}
239                     })
240                     Return (TMP)
241                 }
242             }
244             /* PS/2 floppy controller */
245             Device (FDC0)
246             {
247                 Name (_HID, EisaId ("PNP0700"))
248                 Method (_STA, 0, NotSerialized)
249                 {
250                     Return (0x0F)
251                 }
252                 Method (_CRS, 0, NotSerialized)
253                 {
254                     Name (BUF0, ResourceTemplate ()
255                     {
256                         IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
257                         IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
258                         IRQNoFlags () {6}
259                         DMA (Compatibility, NotBusMaster, Transfer8) {2}
260                     })
261                     Return (BUF0)
262                 }
263             }
265             /* Parallel port */
266             Device (LPT)
267             {
268                 Name (_HID, EisaId ("PNP0400"))
269                 Method (_STA, 0, NotSerialized)
270                 {
271                     Store (\_SB.PCI0.PX13.DRSA, Local0)
272                     And (Local0, 0x80000000, Local0)
273                     If (LEqual (Local0, 0))
274                     {
275                         Return (0x00)
276                     }
277                     Else
278                     {
279                         Return (0x0F)
280                     }
281                 }
282                 Method (_CRS, 0, NotSerialized)
283                 {
284                     Name (BUF0, ResourceTemplate ()
285                     {
286                         IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
287                         IRQNoFlags () {7}
288                     })
289                     Return (BUF0)
290                 }
291             }
293             /* Serial Ports */
294             Device (COM1)
295             {
296                 Name (_HID, EisaId ("PNP0501"))
297                 Name (_UID, 0x01)
298                 Method (_STA, 0, NotSerialized)
299                 {
300                     Store (\_SB.PCI0.PX13.DRSC, Local0)
301                     And (Local0, 0x08000000, Local0)
302                     If (LEqual (Local0, 0))
303                     {
304                         Return (0x00)
305                     }
306                     Else
307                     {
308                         Return (0x0F)
309                     }
310                 }
311                 Method (_CRS, 0, NotSerialized)
312                 {
313                     Name (BUF0, ResourceTemplate ()
314                     {
315                         IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
316                         IRQNoFlags () {4}
317                     })
318                     Return (BUF0)
319                 }
320             }
322             Device (COM2)
323             {
324                 Name (_HID, EisaId ("PNP0501"))
325                 Name (_UID, 0x02)
326                 Method (_STA, 0, NotSerialized)
327                 {
328                     Store (\_SB.PCI0.PX13.DRSC, Local0)
329                     And (Local0, 0x80000000, Local0)
330                     If (LEqual (Local0, 0))
331                     {
332                         Return (0x00)
333                     }
334                     Else
335                     {
336                         Return (0x0F)
337                     }
338                 }
339                 Method (_CRS, 0, NotSerialized)
340                 {
341                     Name (BUF0, ResourceTemplate ()
342                     {
343                         IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
344                         IRQNoFlags () {3}
345                     })
346                     Return (BUF0)
347                 }
348             }
349         }
351         /* PIIX4 PM */
352         Device (PX13) {
353             Name (_ADR, 0x00010003)
355             OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
356             Field (P13C, DWordAcc, NoLock, Preserve)
357             {
358                 DRSA, 32,
359                 DRSB, 32,
360                 DRSC, 32,
361                 DRSE, 32,
362                 DRSF, 32,
363                 DRSG, 32,
364                 DRSH, 32,
365                 DRSI, 32,
366                 DRSJ, 32
367             }
368         }
369     }
371     /* PCI IRQs */
372     Scope(\_SB) {
373          Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
374          {
375              PRQ0,   8, 
376              PRQ1,   8, 
377              PRQ2,   8, 
378              PRQ3,   8
379          }
381         Device(LNKA){
382                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
383                 Name(_UID, 1)
384                 Name(_PRS, ResourceTemplate(){
385                     Interrupt (, Level, ActiveHigh, Shared)
386                         { 5, 9, 10, 11 }
387                 })
388                 Method (_STA, 0, NotSerialized)
389                 {
390                     Store (0x0B, Local0)
391                     If (And (0x80, PRQ0, Local1))
392                     {
393                          Store (0x09, Local0)
394                     }
395                     Return (Local0)
396                 }
397                 Method (_DIS, 0, NotSerialized)
398                 {
399                     Or (PRQ0, 0x80, PRQ0)
400                 }
401                 Method (_CRS, 0, NotSerialized)
402                 {
403                     Name (PRR0, ResourceTemplate ()
404                     {
405                         Interrupt (, Level, ActiveHigh, Shared)
406                             {1}
407                     })
408                     CreateDWordField (PRR0, 0x05, TMP)
409                     Store (PRQ0, Local0)
410                     If (LLess (Local0, 0x80))
411                     {
412                         Store (Local0, TMP)
413                     }
414                     Else
415                     {
416                         Store (Zero, TMP)
417                     }
418                     Return (PRR0)
419                 }
420                 Method (_SRS, 1, NotSerialized)
421                 {
422                     CreateDWordField (Arg0, 0x05, TMP)
423                     Store (TMP, PRQ0)
424                 }
425         }
426         Device(LNKB){
427                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
428                 Name(_UID, 2)
429                 Name(_PRS, ResourceTemplate(){
430                     Interrupt (, Level, ActiveHigh, Shared)
431                         { 5, 9, 10, 11 }
432                 })
433                 Method (_STA, 0, NotSerialized)
434                 {
435                     Store (0x0B, Local0)
436                     If (And (0x80, PRQ1, Local1))
437                     {
438                          Store (0x09, Local0)
439                     }
440                     Return (Local0)
441                 }
442                 Method (_DIS, 0, NotSerialized)
443                 {
444                     Or (PRQ1, 0x80, PRQ1)
445                 }
446                 Method (_CRS, 0, NotSerialized)
447                 {
448                     Name (PRR0, ResourceTemplate ()
449                     {
450                         Interrupt (, Level, ActiveHigh, Shared)
451                             {1}
452                     })
453                     CreateDWordField (PRR0, 0x05, TMP)
454                     Store (PRQ1, Local0)
455                     If (LLess (Local0, 0x80))
456                     {
457                         Store (Local0, TMP)
458                     }
459                     Else
460                     {
461                         Store (Zero, TMP)
462                     }
463                     Return (PRR0)
464                 }
465                 Method (_SRS, 1, NotSerialized)
466                 {
467                     CreateDWordField (Arg0, 0x05, TMP)
468                     Store (TMP, PRQ1)
469                 }
470         }
471         Device(LNKC){
472                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
473                 Name(_UID, 3)
474                 Name(_PRS, ResourceTemplate(){
475                     Interrupt (, Level, ActiveHigh, Shared)
476                         { 5, 9, 10, 11 }
477                 })
478                 Method (_STA, 0, NotSerialized)
479                 {
480                     Store (0x0B, Local0)
481                     If (And (0x80, PRQ2, Local1))
482                     {
483                          Store (0x09, Local0)
484                     }
485                     Return (Local0)
486                 }
487                 Method (_DIS, 0, NotSerialized)
488                 {
489                     Or (PRQ2, 0x80, PRQ2)
490                 }
491                 Method (_CRS, 0, NotSerialized)
492                 {
493                     Name (PRR0, ResourceTemplate ()
494                     {
495                         Interrupt (, Level, ActiveHigh, Shared)
496                             {1}
497                     })
498                     CreateDWordField (PRR0, 0x05, TMP)
499                     Store (PRQ2, Local0)
500                     If (LLess (Local0, 0x80))
501                     {
502                         Store (Local0, TMP)
503                     }
504                     Else
505                     {
506                         Store (Zero, TMP)
507                     }
508                     Return (PRR0)
509                 }
510                 Method (_SRS, 1, NotSerialized)
511                 {
512                     CreateDWordField (Arg0, 0x05, TMP)
513                     Store (TMP, PRQ2)
514                 }
515         }
516         Device(LNKD){
517                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
518                 Name(_UID, 4)
519                 Name(_PRS, ResourceTemplate(){
520                     Interrupt (, Level, ActiveHigh, Shared)
521                         { 5, 9, 10, 11 }
522                 })
523                 Method (_STA, 0, NotSerialized)
524                 {
525                     Store (0x0B, Local0)
526                     If (And (0x80, PRQ3, Local1))
527                     {
528                          Store (0x09, Local0)
529                     }
530                     Return (Local0)
531                 }
532                 Method (_DIS, 0, NotSerialized)
533                 {
534                     Or (PRQ3, 0x80, PRQ3)
535                 }
536                 Method (_CRS, 0, NotSerialized)
537                 {
538                     Name (PRR0, ResourceTemplate ()
539                     {
540                         Interrupt (, Level, ActiveHigh, Shared)
541                             {1}
542                     })
543                     CreateDWordField (PRR0, 0x05, TMP)
544                     Store (PRQ3, Local0)
545                     If (LLess (Local0, 0x80))
546                     {
547                         Store (Local0, TMP)
548                     }
549                     Else
550                     {
551                         Store (Zero, TMP)
552                     }
553                     Return (PRR0)
554                 }
555                 Method (_SRS, 1, NotSerialized)
556                 {
557                     CreateDWordField (Arg0, 0x05, TMP)
558                     Store (TMP, PRQ3)
559                 }
560         }
561     }
563     /* S5 = power off state */
564     Name (_S5, Package (4) {
565         0x00, // PM1a_CNT.SLP_TYP 
566         0x00, // PM2a_CNT.SLP_TYP 
567         0x00, // reserved
568         0x00, // reserved
569     })