X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FAcpiTables%2FDsdt.asl;h=e12c3e9a07d180a860b341ef1a4027e550f96091;hb=a42bdfccc34fa671891758fed27b4618ba5e5142;hp=f7ae92b0b585bd2f1736354a94ec3baf62993191;hpb=0228e598634428fd8c86ce7c33f3639720aa794a;p=mirror_edk2.git diff --git a/OvmfPkg/AcpiTables/Dsdt.asl b/OvmfPkg/AcpiTables/Dsdt.asl index f7ae92b0b5..e12c3e9a07 100644 --- a/OvmfPkg/AcpiTables/Dsdt.asl +++ b/OvmfPkg/AcpiTables/Dsdt.asl @@ -36,7 +36,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { // // BUS, I/O, and MMIO resources // - Name (_CRS, ResourceTemplate () { + Name (CRES, ResourceTemplate () { WORDBusNumber ( // Bus number resource (0); the bridge produces bus numbers for its subsequent buses ResourceProducer, // bit 0 of general flags is 1 MinFixed, // Range is fixed @@ -91,21 +91,102 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { 0x00020000 // Range Length ) - DWORDMEMORY ( // Descriptor for linear frame buffer video RAM + DWORDMEMORY ( // Descriptor for 32-bit MMIO ResourceProducer, // bit 0 of general flags is 0 PosDecode, MinFixed, // Range is fixed MaxFixed, // Range is Fixed - Cacheable, + NonCacheable, ReadWrite, 0x00000000, // Granularity 0xF8000000, // Min 0xFFFBFFFF, // Max 0x00000000, // Translation - 0x07FC0000 // Range Length + 0x07FC0000, // Range Length + , // ResourceSourceIndex + , // ResourceSource + PW32 // DescriptorName ) }) + Name (CR64, ResourceTemplate () { + QWordMemory ( // Descriptor for 64-bit MMIO + ResourceProducer, // bit 0 of general flags is 0 + PosDecode, + MinFixed, // Range is fixed + MaxFixed, // Range is Fixed + Cacheable, + ReadWrite, + 0x00000000, // Granularity + 0x8000000000, // Min + 0xFFFFFFFFFF, // Max + 0x00000000, // Translation + 0x8000000000, // Range Length + , // ResourceSourceIndex + , // ResourceSource + PW64 // DescriptorName + ) + }) + + Method (_CRS, 0) { + // + // see the FIRMWARE_DATA structure in "OvmfPkg/AcpiPlatformDxe/Qemu.c" + // + External (FWDT, OpRegionObj) + Field(FWDT, QWordAcc, NoLock, Preserve) { + P0S, 64, // PciWindow32.Base + P0E, 64, // PciWindow32.End + P0L, 64, // PciWindow32.Length + P1S, 64, // PciWindow64.Base + P1E, 64, // PciWindow64.End + P1L, 64 // PciWindow64.Length + } + Field(FWDT, DWordAcc, NoLock, Preserve) { + P0SL, 32, // PciWindow32.Base, low 32 bits + P0SH, 32, // PciWindow32.Base, high 32 bits + P0EL, 32, // PciWindow32.End, low 32 bits + P0EH, 32, // PciWindow32.End, high 32 bits + P0LL, 32, // PciWindow32.Length, low 32 bits + P0LH, 32, // PciWindow32.Length, high 32 bits + P1SL, 32, // PciWindow64.Base, low 32 bits + P1SH, 32, // PciWindow64.Base, high 32 bits + P1EL, 32, // PciWindow64.End, low 32 bits + P1EH, 32, // PciWindow64.End, high 32 bits + P1LL, 32, // PciWindow64.Length, low 32 bits + P1LH, 32 // PciWindow64.Length, high 32 bits + } + + // + // fixup 32-bit PCI IO window + // + CreateDWordField (CRES, \_SB.PCI0.PW32._MIN, PS32) + CreateDWordField (CRES, \_SB.PCI0.PW32._MAX, PE32) + CreateDWordField (CRES, \_SB.PCI0.PW32._LEN, PL32) + Store (P0SL, PS32) + Store (P0EL, PE32) + Store (P0LL, PL32) + + If (LAnd (LEqual (P1SL, 0x00), LEqual (P1SH, 0x00))) { + Return (CRES) + } Else { + // + // fixup 64-bit PCI IO window + // + CreateQWordField (CR64, \_SB.PCI0.PW64._MIN, PS64) + CreateQWordField (CR64, \_SB.PCI0.PW64._MAX, PE64) + CreateQWordField (CR64, \_SB.PCI0.PW64._LEN, PL64) + Store (P1S, PS64) + Store (P1E, PE64) + Store (P1L, PL64) + + // + // add window and return result + // + ConcatenateResTemplate (CRES, CR64, Local0) + Return (Local0) + } + } + // // PCI Interrupt Routing Table - PIC Mode Only // @@ -158,58 +239,43 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { } } - // - // _DIS method for LNKA, LNKB, LNKC, LNKD - // - Method (PDIS, 1, NotSerialized) { - Or (Arg0, 0x80, Arg0) - } - // // _CRS method for LNKA, LNKB, LNKC, LNKD // Method (PCRS, 1, NotSerialized) { - Name (BUF0, ResourceTemplate () {IRQ (Level, ActiveLow, Shared){0}}) // - // Define references to buffer elements + // create temporary buffer with an Extended Interrupt Descriptor + // whose single vector defaults to zero // - CreateWordField (BUF0, 0x01, IRQW) // IRQ low + Name (BUF0, ResourceTemplate () { + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared){0} + } + ) + // - // Write current settings into IRQ descriptor + // define reference to first interrupt vector in buffer // - If (And (Arg0, 0x80)) { - Store (Zero, Local0) - } Else { - Store (One, Local0) - } + CreateDWordField (BUF0, 0x05, IRQW) + // - // Shift 1 by value in register 70 + // If the disable-bit is clear, overwrite the default zero vector + // with the value in Arg0 (ie. PIRQRC[A:D]). Reserved bits are read + // as 0. // - ShiftLeft (Local0, And (Arg0, 0x0F), IRQW) // Save in buffer - Return (BUF0) // Return Buf0 + If (LNot (And (Arg0, 0x80))) { + Store (Arg0, IRQW) + } + Return (BUF0) } // // _PRS resource for LNKA, LNKB, LNKC, LNKD // Name (PPRS, ResourceTemplate () { - IRQ (Level, ActiveLow, Shared) {3, 4, 5, 7, 9, 10, 11, 12, 14, 15} - }) - - // - // _SRS method for LNKA, LNKB, LNKC, LNKD - // - Method (PSRS, 2, NotSerialized) { - CreateWordField (Arg1, 0x01, IRQW) // IRQ low - FindSetRightBit (IRQW, Local0) // Set IRQ - If (LNotEqual (IRQW, Zero)) { - And (Local0, 0x7F, Local0) - Decrement (Local0) - } Else { - Or (Local0, 0x80, Local0) + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { + 3, 4, 5, 7, 9, 10, 11, 12, 14, 15 } - Store (Local0, Arg0) - } + }) // // PCI IRQ Link A @@ -219,10 +285,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { Name (_UID, 1) Method (_STA, 0, NotSerialized) { Return (PSTA (PIRA)) } - Method (_DIS, 0, NotSerialized) { PDIS (PIRA) } + Method (_DIS, 0, NotSerialized) { + Or (PIRA, 0x80, PIRA) // set disable-bit + } Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRA)) } Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { PSRS (PIRA, Arg0) } + Method (_SRS, 1, NotSerialized) { + CreateDWordField (Arg0, 0x05, IRQW) + Store (IRQW, PIRA) + } } // @@ -233,10 +304,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { Name (_UID, 2) Method (_STA, 0, NotSerialized) { Return (PSTA (PIRB)) } - Method (_DIS, 0, NotSerialized) { PDIS (PIRB) } + Method (_DIS, 0, NotSerialized) { + Or (PIRB, 0x80, PIRB) // set disable-bit + } Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRB)) } Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { PSRS (PIRB, Arg0) } + Method (_SRS, 1, NotSerialized) { + CreateDWordField (Arg0, 0x05, IRQW) + Store (IRQW, PIRB) + } } // @@ -247,10 +323,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { Name (_UID, 3) Method (_STA, 0, NotSerialized) { Return (PSTA (PIRC)) } - Method (_DIS, 0, NotSerialized) { PDIS (PIRC) } + Method (_DIS, 0, NotSerialized) { + Or (PIRC, 0x80, PIRC) // set disable-bit + } Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRC)) } Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { PSRS (PIRC, Arg0) } + Method (_SRS, 1, NotSerialized) { + CreateDWordField (Arg0, 0x05, IRQW) + Store (IRQW, PIRC) + } } // @@ -261,10 +342,15 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { Name (_UID, 1) Method (_STA, 0, NotSerialized) { Return (PSTA (PIRD)) } - Method (_DIS, 0, NotSerialized) { PDIS (PIRD) } + Method (_DIS, 0, NotSerialized) { + Or (PIRD, 0x80, PIRD) // set disable-bit + } Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRD)) } Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { PSRS (PIRD, Arg0) } + Method (_SRS, 1, NotSerialized) { + CreateDWordField (Arg0, 0x05, IRQW) + Store (IRQW, PIRD) + } } // @@ -364,13 +450,14 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) { IO (Decode16, 0x278, 0x278, 0x00, 0x08) IO (Decode16, 0x370, 0x370, 0x00, 0x02) IO (Decode16, 0x378, 0x378, 0x00, 0x08) + IO (Decode16, 0x402, 0x402, 0x00, 0x01) // QEMU debug console, should use FixedPcdGet16 (PcdDebugIoPort) IO (Decode16, 0x440, 0x440, 0x00, 0x10) IO (Decode16, 0x678, 0x678, 0x00, 0x08) IO (Decode16, 0x778, 0x778, 0x00, 0x08) - IO (Decode16, 0xafe0, 0xafe0, 0x00, 0x04) // QEMU GPE0 BLK - IO (Decode16, 0xb000, 0xb000, 0x00, 0x40) // PMBLK1 - Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC - Memory32Fixed (ReadOnly, 0xFEE00000, 0x1000) + IO (Decode16, 0xafe0, 0xafe0, 0x00, 0x04) // QEMU GPE0 BLK + IO (Decode16, 0xb000, 0xb000, 0x00, 0x40) // PMBLK1 + Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC + Memory32Fixed (ReadOnly, 0xFEE00000, 0x100000) // LAPIC }) }