Patrick Georgi | afd4c87 | 2020-05-05 23:43:18 +0200 | [diff] [blame] | 1 | /* Bochs/QEMU ACPI DSDT ASL definition */ |
Elyes HAOUAS | 674ad92 | 2020-05-09 13:21:47 +0200 | [diff] [blame] | 2 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | b28f466 | 2018-05-26 17:58:47 -0600 | [diff] [blame] | 3 | |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 4 | /* |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 5 | * Based on acpi-dsdt.dsl, but heavily modified for q35 chipset. |
| 6 | */ |
| 7 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 8 | #include <acpi/acpi.h> |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 9 | DefinitionBlock ( |
Elyes HAOUAS | 37509d7 | 2020-10-01 17:11:56 +0200 | [diff] [blame] | 10 | "dsdt.aml", |
| 11 | "DSDT", |
Elyes HAOUAS | 90d00de | 2020-10-05 16:38:53 +0200 | [diff] [blame] | 12 | ACPI_DSDT_REV_1, |
Elyes HAOUAS | 6d19a20 | 2018-11-22 11:15:29 +0100 | [diff] [blame] | 13 | OEM_ID, |
| 14 | ACPI_TABLE_CREATOR, |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 15 | 0x2 // OEM Revision |
| 16 | ) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 17 | { |
Kyösti Mälkki | cf246d5 | 2021-01-21 08:17:00 +0200 | [diff] [blame] | 18 | #include <acpi/dsdt_top.asl> |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 19 | |
| 20 | #include "../qemu-i440fx/acpi/dbug.asl" |
| 21 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 22 | Scope(\_SB) { |
| 23 | OperationRegion(PCST, SystemIO, 0xae00, 0x0c) |
| 24 | OperationRegion(PCSB, SystemIO, 0xae0c, 0x01) |
| 25 | Field(PCSB, AnyAcc, NoLock, WriteAsZeros) { |
| 26 | PCIB, 8, |
| 27 | } |
| 28 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 29 | |
| 30 | |
| 31 | /**************************************************************** |
| 32 | * PCI Bus definition |
| 33 | ****************************************************************/ |
| 34 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 35 | Scope(\_SB) { |
| 36 | Device(PCI0) { |
| 37 | Name(_HID, EisaId("PNP0A08")) |
| 38 | Name(_CID, EisaId("PNP0A03")) |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 39 | Name(_UID, 1) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 40 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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 |
| 44 | Method(_OSC, 4) { |
| 45 | // Create DWORD-addressable fields from the Capabilities Buffer |
| 46 | CreateDWordField(Arg3, 0, CDW1) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 47 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 48 | // Check for proper UUID |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 49 | If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 50 | // Create DWORD-addressable fields from the Capabilities Buffer |
| 51 | CreateDWordField(Arg3, 4, CDW2) |
| 52 | CreateDWordField(Arg3, 8, CDW3) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 53 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 54 | // Save Capabilities DWORD2 & 3 |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 55 | SUPP = CDW2 |
| 56 | CTRL = CDW3 |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 57 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 58 | // Always allow native PME, AER (no dependencies) |
| 59 | // Never allow SHPC (no SHPC controller in this system) |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 60 | CTRL &= 0x1D |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 61 | |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 62 | If (Arg1 != 1) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 63 | // Unknown revision |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 64 | CDW1 |= 0x08 |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 65 | } |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 66 | If (CDW3 != CTRL) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 67 | // Capabilities bits were masked |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 68 | CDW1 |= 0x10 |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 69 | } |
| 70 | // Update DWORD3 in the buffer |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 71 | CDW3 = CTRL |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 72 | } Else { |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 73 | CDW1 |= 4 // Unrecognized UUID |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 74 | } |
| 75 | Return (Arg3) |
| 76 | } |
| 77 | } |
| 78 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 79 | |
| 80 | #include "../qemu-i440fx/acpi/pci-crs.asl" |
| 81 | #include "../qemu-i440fx/acpi/hpet.asl" |
| 82 | |
| 83 | |
| 84 | /**************************************************************** |
| 85 | * VGA |
| 86 | ****************************************************************/ |
| 87 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 88 | Scope(\_SB.PCI0) { |
| 89 | Device(VGA) { |
| 90 | Name(_ADR, 0x00010000) |
| 91 | Method(_S1D, 0, NotSerialized) { |
| 92 | Return (0x00) |
| 93 | } |
| 94 | Method(_S2D, 0, NotSerialized) { |
| 95 | Return (0x00) |
| 96 | } |
| 97 | Method(_S3D, 0, NotSerialized) { |
| 98 | Return (0x00) |
| 99 | } |
| 100 | } |
| 101 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 102 | |
| 103 | |
| 104 | /**************************************************************** |
| 105 | * LPC ISA bridge |
| 106 | ****************************************************************/ |
| 107 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 108 | Scope(\_SB.PCI0) { |
| 109 | /* PCI D31:f0 LPC ISA bridge */ |
| 110 | Device(ISA) { |
| 111 | /* PCI D31:f0 */ |
| 112 | Name(_ADR, 0x001f0000) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 113 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 114 | /* ICH9 PCI to ISA irq remapping */ |
| 115 | OperationRegion(PIRQ, PCI_Config, 0x60, 0x0C) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 116 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 117 | OperationRegion(LPCD, PCI_Config, 0x80, 0x2) |
| 118 | Field(LPCD, AnyAcc, NoLock, Preserve) { |
| 119 | COMA, 3, |
| 120 | , 1, |
| 121 | COMB, 3, |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 122 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 123 | Offset(0x01), |
| 124 | LPTD, 2, |
| 125 | , 2, |
| 126 | FDCD, 2 |
| 127 | } |
| 128 | OperationRegion(LPCE, PCI_Config, 0x82, 0x2) |
| 129 | Field(LPCE, AnyAcc, NoLock, Preserve) { |
| 130 | CAEN, 1, |
| 131 | CBEN, 1, |
| 132 | LPEN, 1, |
| 133 | FDEN, 1 |
| 134 | } |
| 135 | } |
| 136 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 137 | |
| 138 | #include "../qemu-i440fx/acpi/isa.asl" |
| 139 | |
| 140 | |
| 141 | /**************************************************************** |
| 142 | * PCI IRQs |
| 143 | ****************************************************************/ |
| 144 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 145 | Scope(\_SB) { |
| 146 | Scope(PCI0) { |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 147 | #define prt_slot_lnk(nr, lnk0, lnk1, lnk2, lnk3) \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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 } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 152 | |
| 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) |
| 157 | |
| 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) |
| 162 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 189 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 197 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 198 | /* PCIe->PCI bridge. use PIRQ[E-H] */ |
| 199 | prt_slot_lnkE(0x001e), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 200 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 201 | prt_slot_lnkA(0x001f) |
| 202 | }) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 203 | |
| 204 | #define prt_slot_gsi(nr, gsi0, gsi1, gsi2, gsi3) \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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 } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 209 | |
| 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) |
| 214 | |
| 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) |
| 219 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 246 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 254 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 255 | /* PCIe->PCI bridge. use PIRQ[E-H] */ |
| 256 | prt_slot_gsiE(0x001e), |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 257 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 258 | prt_slot_gsiA(0x001f) |
| 259 | }) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 260 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 261 | Method(_PRT, 0, NotSerialized) { |
| 262 | /* PCI IRQ routing table, example from ACPI 2.0a specification, |
| 263 | section 6.2.8.1 */ |
| 264 | /* Note: we provide the same info as the PCI routing |
| 265 | table of the Bochs BIOS */ |
Kyösti Mälkki | cdaddde | 2021-01-27 13:22:52 +0200 | [diff] [blame] | 266 | If (\PICM == 0) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 267 | Return (PRTP) |
| 268 | } Else { |
| 269 | Return (PRTA) |
| 270 | } |
| 271 | } |
| 272 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 273 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 274 | Field(PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) { |
| 275 | PRQA, 8, |
| 276 | PRQB, 8, |
| 277 | PRQC, 8, |
| 278 | PRQD, 8, |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 279 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 280 | Offset(0x08), |
| 281 | PRQE, 8, |
| 282 | PRQF, 8, |
| 283 | PRQG, 8, |
| 284 | PRQH, 8 |
| 285 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 286 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 287 | Method(IQST, 1, NotSerialized) { |
| 288 | // _STA method - get status |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 289 | If (0x80 & Arg0) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 290 | Return (0x09) |
| 291 | } |
| 292 | Return (0x0B) |
| 293 | } |
| 294 | Method(IQCR, 1, Serialized) { |
| 295 | // _CRS method - get current settings |
| 296 | Name(PRR0, ResourceTemplate() { |
| 297 | Interrupt(, Level, ActiveHigh, Shared) { 0 } |
| 298 | }) |
| 299 | CreateDWordField(PRR0, 0x05, PRRI) |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 300 | PRRI = Arg0 & 0x0F |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 301 | Return (PRR0) |
| 302 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 303 | |
| 304 | #define define_link(link, uid, reg) \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 305 | Device(link) { \ |
| 306 | Name(_HID, EISAID("PNP0C0F")) \ |
| 307 | Name(_UID, uid) \ |
| 308 | Name(_PRS, ResourceTemplate() { \ |
| 309 | Interrupt(, Level, ActiveHigh, Shared) { \ |
| 310 | 5, 10, 11 \ |
| 311 | } \ |
| 312 | }) \ |
| 313 | Method(_STA, 0, NotSerialized) { \ |
| 314 | Return (IQST(reg)) \ |
| 315 | } \ |
| 316 | Method(_DIS, 0, NotSerialized) { \ |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 317 | reg |= 0x80 \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 318 | } \ |
| 319 | Method(_CRS, 0, NotSerialized) { \ |
| 320 | Return (IQCR(reg)) \ |
| 321 | } \ |
| 322 | Method(_SRS, 1, NotSerialized) { \ |
| 323 | CreateDWordField(Arg0, 0x05, PRRI) \ |
Elyes HAOUAS | 6245d07 | 2020-10-08 09:21:19 +0200 | [diff] [blame] | 324 | reg = PRRI \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 325 | } \ |
| 326 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 327 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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) |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 336 | |
| 337 | #define define_gsi_link(link, uid, gsi) \ |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 338 | Device(link) { \ |
| 339 | Name(_HID, EISAID("PNP0C0F")) \ |
| 340 | Name(_UID, uid) \ |
| 341 | Name(_PRS, ResourceTemplate() { \ |
| 342 | Interrupt(, Level, ActiveHigh, Shared) { \ |
| 343 | gsi \ |
| 344 | } \ |
| 345 | }) \ |
| 346 | Name(_CRS, ResourceTemplate() { \ |
| 347 | Interrupt(, Level, ActiveHigh, Shared) { \ |
| 348 | gsi \ |
| 349 | } \ |
| 350 | }) \ |
| 351 | Method(_SRS, 1, NotSerialized) { \ |
| 352 | } \ |
| 353 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 354 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 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) |
| 363 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 364 | |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 365 | /**************************************************************** |
| 366 | * General purpose events |
| 367 | ****************************************************************/ |
| 368 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 369 | Scope(\_GPE) { |
| 370 | Name(_HID, "ACPI0006") |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 371 | |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 372 | Method(_L00) { |
| 373 | } |
| 374 | Method(_L01) { |
Elyes HAOUAS | b87a734 | 2016-09-24 08:53:34 +0200 | [diff] [blame] | 375 | } |
| 376 | Method(_L02) { |
| 377 | } |
| 378 | Method(_L03) { |
| 379 | } |
| 380 | Method(_L04) { |
| 381 | } |
| 382 | Method(_L05) { |
| 383 | } |
| 384 | Method(_L06) { |
| 385 | } |
| 386 | Method(_L07) { |
| 387 | } |
| 388 | Method(_L08) { |
| 389 | } |
| 390 | Method(_L09) { |
| 391 | } |
| 392 | Method(_L0A) { |
| 393 | } |
| 394 | Method(_L0B) { |
| 395 | } |
| 396 | Method(_L0C) { |
| 397 | } |
| 398 | Method(_L0D) { |
| 399 | } |
| 400 | Method(_L0E) { |
| 401 | } |
| 402 | Method(_L0F) { |
| 403 | } |
| 404 | } |
Gerd Hoffmann | ee941b38 | 2013-06-07 16:03:44 +0200 | [diff] [blame] | 405 | } |