~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Bochs x86 Emulator
bochs/bios/acpi-dsdt.dsl

Version: ~ [ SVN-2014-01-05 ] ~ [ 2.6.2 ] ~

  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 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     )
 27 {
 28     Scope (\)
 29     {
 30         /* Debug Output */
 31         OperationRegion (DBG, SystemIO, 0xb044, 0x04)
 32         Field (DBG, DWordAcc, NoLock, Preserve)
 33         {
 34             DBGL,   32,
 35         }
 36     }
 37 
 38 
 39     /* PCI Bus definition */
 40     Scope(\_SB) {
 41         Device(PCI0) {
 42             Name (_HID, EisaId ("PNP0A03"))
 43             Name (_ADR, 0x00)
 44             Name (_UID, 1)
 45             Name(_PRT, Package() {
 46                 /* PCI IRQ routing table, example from ACPI 2.0a specification,
 47                    section 6.2.8.1 */
 48                 /* Note: we provide the same info as the PCI routing
 49                    table of the Bochs BIOS */
 50 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
 51        Package() { nr##ffff, 0, lnk0, 0 }, \
 52        Package() { nr##ffff, 1, lnk1, 0 }, \
 53        Package() { nr##ffff, 2, lnk2, 0 }, \
 54        Package() { nr##ffff, 3, lnk3, 0 }
 55 
 56 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
 57 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
 58 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
 59 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
 60                prt_slot0(0x0000),
 61                prt_slot1(0x0001),
 62                prt_slot2(0x0002),
 63                prt_slot3(0x0003),
 64                prt_slot0(0x0004),
 65                prt_slot1(0x0005),
 66                prt_slot2(0x0006),
 67                prt_slot3(0x0007),
 68                prt_slot0(0x0008),
 69                prt_slot1(0x0009),
 70                prt_slot2(0x000a),
 71                prt_slot3(0x000b),
 72                prt_slot0(0x000c),
 73                prt_slot1(0x000d),
 74                prt_slot2(0x000e),
 75                prt_slot3(0x000f),
 76                prt_slot0(0x0010),
 77                prt_slot1(0x0011),
 78                prt_slot2(0x0012),
 79                prt_slot3(0x0013),
 80                prt_slot0(0x0014),
 81                prt_slot1(0x0015),
 82                prt_slot2(0x0016),
 83                prt_slot3(0x0017),
 84                prt_slot0(0x0018),
 85                prt_slot1(0x0019),
 86                prt_slot2(0x001a),
 87                prt_slot3(0x001b),
 88                prt_slot0(0x001c),
 89                prt_slot1(0x001d),
 90                prt_slot2(0x001e),
 91                prt_slot3(0x001f),
 92             })
 93 
 94             Name (_CRS, ResourceTemplate ()
 95             {
 96                 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
 97                     0x0000,             // Address Space Granularity
 98                     0x0000,             // Address Range Minimum
 99                     0x00FF,             // Address Range Maximum
100                     0x0000,             // Address Translation Offset
101                     0x0100,             // Address Length
102                     ,, )
103                 IO (Decode16,
104                     0x0CF8,             // Address Range Minimum
105                     0x0CF8,             // Address Range Maximum
106                     0x01,               // Address Alignment
107                     0x08,               // Address Length
108                     )
109                 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
110                     0x0000,             // Address Space Granularity
111                     0x0000,             // Address Range Minimum
112                     0x0CF7,             // Address Range Maximum
113                     0x0000,             // Address Translation Offset
114                     0x0CF8,             // Address Length
115                     ,, , TypeStatic)
116                 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
117                     0x0000,             // Address Space Granularity
118                     0x0D00,             // Address Range Minimum
119                     0xFFFF,             // Address Range Maximum
120                     0x0000,             // Address Translation Offset
121                     0xF300,             // Address Length
122                     ,, , TypeStatic)
123                 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
124                     0x00000000,         // Address Space Granularity
125                     0x000A0000,         // Address Range Minimum
126                     0x000BFFFF,         // Address Range Maximum
127                     0x00000000,         // Address Translation Offset
128                     0x00020000,         // Address Length
129                     ,, , AddressRangeMemory, TypeStatic)
130                 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
131                     0x00000000,         // Address Space Granularity
132                     0xC0000000,         // Address Range Minimum
133                     0xFEBFFFFF,         // Address Range Maximum
134                     0x00000000,         // Address Translation Offset
135                     0x3EC00000,         // Address Length
136                     ,, , AddressRangeMemory, TypeStatic)
137             })
138         }
139 #ifdef BX_QEMU
140         Device(HPET) {
141             Name(_HID,  EISAID("PNP0103"))
142             Name(_UID, 0)
143             Method (_STA, 0, NotSerialized) {
144                     Return(0x0F)
145             }
146             Name(_CRS, ResourceTemplate() {
147                 DWordMemory(
148                     ResourceConsumer, PosDecode, MinFixed, MaxFixed,
149                     NonCacheable, ReadWrite,
150                     0x00000000,
151                     0xFED00000,
152                     0xFED003FF,
153                     0x00000000,
154                     0x00000400 /* 1K memory: FED00000 - FED003FF */
155                 )
156             })
157         }
158 #endif
159     }
160 
161     Scope(\_SB.PCI0) {
162         Device (VGA) {
163                  Name (_ADR, 0x00020000)
164                  Method (_S1D, 0, NotSerialized)
165                  {
166                          Return (0x00)
167                  }
168                  Method (_S2D, 0, NotSerialized)
169                  {
170                          Return (0x00)
171                  }
172                  Method (_S3D, 0, NotSerialized)
173                  {
174                          Return (0x00)
175                  }
176         }
177 
178         /* PIIX3 ISA bridge */
179         Device (ISA) {
180             Name (_ADR, 0x00010000)
181 
182             /* PIIX PCI to ISA irq remapping */
183             OperationRegion (P40C, PCI_Config, 0x60, 0x04)
184 
185             /* Real-time clock */
186             Device (RTC)
187             {
188                 Name (_HID, EisaId ("PNP0B00"))
189                 Name (_CRS, ResourceTemplate ()
190                 {
191                     IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
192                     IRQNoFlags () {8}
193                     IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
194                 })
195             }
196 
197             /* Keyboard seems to be important for WinXP install */
198             Device (KBD)
199             {
200                 Name (_HID, EisaId ("PNP0303"))
201                 Method (_STA, 0, NotSerialized)
202                 {
203                     Return (0x0f)
204                 }
205 
206                 Method (_CRS, 0, NotSerialized)
207                 {
208                      Name (TMP, ResourceTemplate ()
209                      {
210                     IO (Decode16,
211                         0x0060,             // Address Range Minimum
212                         0x0060,             // Address Range Maximum
213                         0x01,               // Address Alignment
214                         0x01,               // Address Length
215                         )
216                     IO (Decode16,
217                         0x0064,             // Address Range Minimum
218                         0x0064,             // Address Range Maximum
219                         0x01,               // Address Alignment
220                         0x01,               // Address Length
221                         )
222                     IRQNoFlags ()
223                         {1}
224                     })
225                     Return (TMP)
226                 }
227             }
228 
229             /* PS/2 mouse */
230             Device (MOU)
231             {
232                 Name (_HID, EisaId ("PNP0F13"))
233                 Method (_STA, 0, NotSerialized)
234                 {
235                     Return (0x0f)
236                 }
237 
238                 Method (_CRS, 0, NotSerialized)
239                 {
240                     Name (TMP, ResourceTemplate ()
241                     {
242                          IRQNoFlags () {12}
243                     })
244                     Return (TMP)
245                 }
246             }
247 
248             /* PS/2 floppy controller */
249             Device (FDC0)
250             {
251                 Name (_HID, EisaId ("PNP0700"))
252                 Method (_STA, 0, NotSerialized)
253                 {
254                     Return (0x0F)
255                 }
256                 Method (_CRS, 0, NotSerialized)
257                 {
258                     Name (BUF0, ResourceTemplate ()
259                     {
260                         IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
261                         IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
262                         IRQNoFlags () {6}
263                         DMA (Compatibility, NotBusMaster, Transfer8) {2}
264                     })
265                     Return (BUF0)
266                 }
267             }
268 
269             /* Parallel port */
270             Device (LPT)
271             {
272                 Name (_HID, EisaId ("PNP0400"))
273                 Method (_STA, 0, NotSerialized)
274                 {
275                     Store (\_SB.PCI0.PX13.DRSA, Local0)
276                     And (Local0, 0x80000000, Local0)
277                     If (LEqual (Local0, 0))
278                     {
279                         Return (0x00)
280                     }
281                     Else
282                     {
283                         Return (0x0F)
284                     }
285                 }
286                 Method (_CRS, 0, NotSerialized)
287                 {
288                     Name (BUF0, ResourceTemplate ()
289                     {
290                         IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
291                         IRQNoFlags () {7}
292                     })
293                     Return (BUF0)
294                 }
295             }
296 
297             /* Serial Ports */
298             Device (COM1)
299             {
300                 Name (_HID, EisaId ("PNP0501"))
301                 Name (_UID, 0x01)
302                 Method (_STA, 0, NotSerialized)
303                 {
304                     Store (\_SB.PCI0.PX13.DRSC, Local0)
305                     And (Local0, 0x08000000, Local0)
306                     If (LEqual (Local0, 0))
307                     {
308                         Return (0x00)
309                     }
310                     Else
311                     {
312                         Return (0x0F)
313                     }
314                 }
315                 Method (_CRS, 0, NotSerialized)
316                 {
317                     Name (BUF0, ResourceTemplate ()
318                     {
319                         IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
320                         IRQNoFlags () {4}
321                     })
322                     Return (BUF0)
323                 }
324             }
325 
326             Device (COM2)
327             {
328                 Name (_HID, EisaId ("PNP0501"))
329                 Name (_UID, 0x02)
330                 Method (_STA, 0, NotSerialized)
331                 {
332                     Store (\_SB.PCI0.PX13.DRSC, Local0)
333                     And (Local0, 0x80000000, Local0)
334                     If (LEqual (Local0, 0))
335                     {
336                         Return (0x00)
337                     }
338                     Else
339                     {
340                         Return (0x0F)
341                     }
342                 }
343                 Method (_CRS, 0, NotSerialized)
344                 {
345                     Name (BUF0, ResourceTemplate ()
346                     {
347                         IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
348                         IRQNoFlags () {3}
349                     })
350                     Return (BUF0)
351                 }
352             }
353         }
354 
355         /* PIIX4 PM */
356         Device (PX13) {
357             Name (_ADR, 0x00010003)
358 
359             OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
360             Field (P13C, DWordAcc, NoLock, Preserve)
361             {
362                 DRSA, 32,
363                 DRSB, 32,
364                 DRSC, 32,
365                 DRSE, 32,
366                 DRSF, 32,
367                 DRSG, 32,
368                 DRSH, 32,
369                 DRSI, 32,
370                 DRSJ, 32
371             }
372         }
373     }
374 
375     /* PCI IRQs */
376     Scope(\_SB) {
377          Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
378          {
379              PRQ0,   8,
380              PRQ1,   8,
381              PRQ2,   8,
382              PRQ3,   8
383          }
384 
385         Device(LNKA){
386                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
387                 Name(_UID, 1)
388                 Name(_PRS, ResourceTemplate(){
389                     IRQ (Level, ActiveLow, Shared)
390                         {3,4,5,6,7,9,10,11,12}
391                 })
392                 Method (_STA, 0, NotSerialized)
393                 {
394                     Store (0x0B, Local0)
395                     If (And (0x80, PRQ0, Local1))
396                     {
397                          Store (0x09, Local0)
398                     }
399                     Return (Local0)
400                 }
401                 Method (_DIS, 0, NotSerialized)
402                 {
403                     Or (PRQ0, 0x80, PRQ0)
404                 }
405                 Method (_CRS, 0, NotSerialized)
406                 {
407                     Name (PRR0, ResourceTemplate ()
408                     {
409                         IRQ (Level, ActiveLow, Shared)
410                             {1}
411                     })
412                     CreateWordField (PRR0, 0x01, TMP)
413                     Store (PRQ0, Local0)
414                     If (LLess (Local0, 0x80))
415                     {
416                         ShiftLeft (One, Local0, TMP)
417                     }
418                     Else
419                     {
420                         Store (Zero, TMP)
421                     }
422                     Return (PRR0)
423                 }
424                 Method (_SRS, 1, NotSerialized)
425                 {
426                     CreateWordField (Arg0, 0x01, TMP)
427                     FindSetRightBit (TMP, Local0)
428                     Decrement (Local0)
429                     Store (Local0, PRQ0)
430                 }
431         }
432         Device(LNKB){
433                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
434                 Name(_UID, 2)
435                 Name(_PRS, ResourceTemplate(){
436                     IRQ (Level, ActiveLow, Shared)
437                         {3,4,5,6,7,9,10,11,12}
438                 })
439                 Method (_STA, 0, NotSerialized)
440                 {
441                     Store (0x0B, Local0)
442                     If (And (0x80, PRQ1, Local1))
443                     {
444                          Store (0x09, Local0)
445                     }
446                     Return (Local0)
447                 }
448                 Method (_DIS, 0, NotSerialized)
449                 {
450                     Or (PRQ1, 0x80, PRQ1)
451                 }
452                 Method (_CRS, 0, NotSerialized)
453                 {
454                     Name (PRR0, ResourceTemplate ()
455                     {
456                         IRQ (Level, ActiveLow, Shared)
457                             {1}
458                     })
459                     CreateWordField (PRR0, 0x01, TMP)
460                     Store (PRQ1, Local0)
461                     If (LLess (Local0, 0x80))
462                     {
463                         ShiftLeft (One, Local0, TMP)
464                     }
465                     Else
466                     {
467                         Store (Zero, TMP)
468                     }
469                     Return (PRR0)
470                 }
471                 Method (_SRS, 1, NotSerialized)
472                 {
473                     CreateWordField (Arg0, 0x01, TMP)
474                     FindSetRightBit (TMP, Local0)
475                     Decrement (Local0)
476                     Store (Local0, PRQ1)
477                 }
478         }
479         Device(LNKC){
480                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
481                 Name(_UID, 3)
482                 Name(_PRS, ResourceTemplate(){
483                     IRQ (Level, ActiveLow, Shared)
484                         {3,4,5,6,7,9,10,11,12}
485                 })
486                 Method (_STA, 0, NotSerialized)
487                 {
488                     Store (0x0B, Local0)
489                     If (And (0x80, PRQ2, Local1))
490                     {
491                          Store (0x09, Local0)
492                     }
493                     Return (Local0)
494                 }
495                 Method (_DIS, 0, NotSerialized)
496                 {
497                     Or (PRQ2, 0x80, PRQ2)
498                 }
499                 Method (_CRS, 0, NotSerialized)
500                 {
501                     Name (PRR0, ResourceTemplate ()
502                     {
503                         IRQ (Level, ActiveLow, Shared)
504                             {1}
505                     })
506                     CreateWordField (PRR0, 0x01, TMP)
507                     Store (PRQ2, Local0)
508                     If (LLess (Local0, 0x80))
509                     {
510                         ShiftLeft (One, Local0, TMP)
511                     }
512                     Else
513                     {
514                         Store (Zero, TMP)
515                     }
516                     Return (PRR0)
517                 }
518                 Method (_SRS, 1, NotSerialized)
519                 {
520                     CreateWordField (Arg0, 0x01, TMP)
521                     FindSetRightBit (TMP, Local0)
522                     Decrement (Local0)
523                     Store (Local0, PRQ2)
524                 }
525         }
526         Device(LNKD){
527                 Name(_HID, EISAID("PNP0C0F"))     // PCI interrupt link
528                 Name(_UID, 4)
529                 Name(_PRS, ResourceTemplate(){
530                     IRQ (Level, ActiveLow, Shared)
531                         {3,4,5,6,7,9,10,11,12}
532                 })
533                 Method (_STA, 0, NotSerialized)
534                 {
535                     Store (0x0B, Local0)
536                     If (And (0x80, PRQ3, Local1))
537                     {
538                          Store (0x09, Local0)
539                     }
540                     Return (Local0)
541                 }
542                 Method (_DIS, 0, NotSerialized)
543                 {
544                     Or (PRQ3, 0x80, PRQ3)
545                 }
546                 Method (_CRS, 0, NotSerialized)
547                 {
548                     Name (PRR0, ResourceTemplate ()
549                     {
550                         IRQ (Level, ActiveLow, Shared)
551                             {1}
552                     })
553                     CreateWordField (PRR0, 0x01, TMP)
554                     Store (PRQ3, Local0)
555                     If (LLess (Local0, 0x80))
556                     {
557                         ShiftLeft (One, Local0, TMP)
558                     }
559                     Else
560                     {
561                         Store (Zero, TMP)
562                     }
563                     Return (PRR0)
564                 }
565                 Method (_SRS, 1, NotSerialized)
566                 {
567                     CreateWordField (Arg0, 0x01, TMP)
568                     FindSetRightBit (TMP, Local0)
569                     Decrement (Local0)
570                     Store (Local0, PRQ3)
571                 }
572         }
573     }
574 
575     /*
576      * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
577      * must match piix4 emulation.
578      */
579     Name (\_S3, Package (0x04)
580     {
581         0x01,  /* PM1a_CNT.SLP_TYP */
582         0x01,  /* PM1b_CNT.SLP_TYP */
583         Zero,  /* reserved */
584         Zero   /* reserved */
585     })
586     Name (\_S4, Package (0x04)
587     {
588         Zero,  /* PM1a_CNT.SLP_TYP */
589         Zero,  /* PM1b_CNT.SLP_TYP */
590         Zero,  /* reserved */
591         Zero   /* reserved */
592     })
593     Name (\_S5, Package (0x04)
594     {
595         Zero,  /* PM1a_CNT.SLP_TYP */
596         Zero,  /* PM1b_CNT.SLP_TYP */
597         Zero,  /* reserved */
598         Zero   /* reserved */
599     })
600 }

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.