Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2005 AMD |
| 3 | * Copyright (C) 2011, 2014 Oskar Enoksson <enok@lysator.liu.se> |
| 4 | */ |
| 5 | //AMD8111 |
| 6 | // APIC version of the interrupt routing table |
| 7 | Name (APIC, Package (0x04) { |
| 8 | Package (0x04) { 0x0004FFFF, 0x00, 0x00, 0x10},// 0x0004ffff : assusme 8131 is present |
| 9 | Package (0x04) { 0x0004FFFF, 0x01, 0x00, 0x11}, |
| 10 | Package (0x04) { 0x0004FFFF, 0x02, 0x00, 0x12}, |
| 11 | Package (0x04) { 0x0004FFFF, 0x03, 0x00, 0x13} |
| 12 | }) |
| 13 | // PIC version of the interrupt routing table |
| 14 | Name (PICM, Package (0x04) { |
| 15 | Package (0x04) { 0x0004FFFF, 0x00, \_SB.PCI0.LNKA, 0x00}, |
| 16 | Package (0x04) { 0x0004FFFF, 0x01, \_SB.PCI0.LNKB, 0x00}, |
| 17 | Package (0x04) { 0x0004FFFF, 0x02, \_SB.PCI0.LNKC, 0x00}, |
| 18 | Package (0x04) { 0x0004FFFF, 0x03, \_SB.PCI0.LNKD, 0x00} |
| 19 | }) |
| 20 | Name (DNCG, Ones) |
| 21 | Method (_PRT, 0, NotSerialized) { |
| 22 | If (LEqual (^DNCG, Ones)) { |
| 23 | Store (DADD(\_SB.PCI0.SBDN, 0x0001ffff), Local0) |
| 24 | // Update the Device Number according to SBDN |
| 25 | Store(Local0, Index (DeRefOf (Index (PICM, 0)), 0)) |
| 26 | Store(Local0, Index (DeRefOf (Index (PICM, 1)), 0)) |
| 27 | Store(Local0, Index (DeRefOf (Index (PICM, 2)), 0)) |
| 28 | Store(Local0, Index (DeRefOf (Index (PICM, 3)), 0)) |
| 29 | |
| 30 | Store(Local0, Index (DeRefOf (Index (APIC, 0)), 0)) |
| 31 | Store(Local0, Index (DeRefOf (Index (APIC, 1)), 0)) |
| 32 | Store(Local0, Index (DeRefOf (Index (APIC, 2)), 0)) |
| 33 | Store(Local0, Index (DeRefOf (Index (APIC, 3)), 0)) |
| 34 | |
| 35 | Store (0x00, ^DNCG) |
| 36 | } |
| 37 | |
| 38 | If (LNot (PICF)) { |
| 39 | Return (PICM) |
| 40 | } Else { |
| 41 | Return (APIC) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // AMD8111 System Management I/O Mapped Registers (PMxx) |
| 46 | OperationRegion (PMIO, SystemIO, PMBS, 0xDF) |
| 47 | Field (PMIO, ByteAcc, NoLock, Preserve) { |
| 48 | Offset (0x1E), |
| 49 | SWSM, 8, // Software SMI Trigger (sets GSTS) |
| 50 | Offset (0x28), |
| 51 | GSTS, 16, // Global STatuS |
| 52 | GNBL, 16, // Global SMI enable |
| 53 | Offset (0x30), |
| 54 | STMC, 5, // Miscellaneous SMI Status |
| 55 | Offset (0x32), |
| 56 | ENMC, 5, // Miscellaneous SMI Enable |
| 57 | Offset (0x44), |
| 58 | STC0, 9, // TCO Status 1 |
| 59 | Offset (0x46), |
| 60 | STC1, 4, // TCO Status 2 |
| 61 | Offset (0xA8), |
| 62 | STHW, 20 // Device monitor SMI Interrupt Enable |
| 63 | } |
| 64 | Device (HPET) { |
| 65 | Name (HPT, 0x00) |
| 66 | Name (_HID, EisaId ("PNP0103")) |
| 67 | Name (_UID, 0x00) |
| 68 | Method (_STA, 0, NotSerialized) { |
| 69 | Return (0x0F) |
| 70 | } |
| 71 | Method (_CRS, 0, Serialized) { |
| 72 | Name (BUF0, ResourceTemplate () { |
| 73 | Memory32Fixed (ReadWrite, 0xFED00000, 0x00000400) |
| 74 | }) |
| 75 | Return (BUF0) |
| 76 | } |
| 77 | } |
| 78 | #include "amd8111_pic.asl" |
| 79 | #include "amd8111_isa.asl" |
| 80 | |
| 81 | Device (TP2P) { |
| 82 | // 8111 P2P and it should 0x00030000 when 8131 present |
| 83 | Method (_ADR, 0, NotSerialized) { |
| 84 | Return (DADD(\_SB.PCI0.SBDN, 0x00000000)) |
| 85 | } |
| 86 | Method (_PRW, 0, NotSerialized) { // Power Resource for Wake |
| 87 | // result : |
| 88 | // [0] Bit index into GPEx_EN in the GPE block described by FADT. |
| 89 | // [1] The lowest power state from which the system can be awakened. |
Martin Roth | 3e41ee9 | 2015-12-08 15:24:41 -0700 | [diff] [blame] | 90 | //If (CondRefOf (\_S3)) { |
Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 91 | // Return (Package (0x02) { 0x08, 0x03 }) |
| 92 | //} Else { |
| 93 | Return (Package (0x02) { 0x08, 0x01 }) |
| 94 | //} |
| 95 | } |
| 96 | Device (ETHR) { |
| 97 | Name (_ADR, 0x00010000) |
| 98 | Method (_PRW, 0, NotSerialized) { // Power Resource for Wake |
Martin Roth | 3e41ee9 | 2015-12-08 15:24:41 -0700 | [diff] [blame] | 99 | //If (CondRefOf (\_S3)) { |
Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 100 | // Return (Package (0x02) { 0x08, 0x03 }) |
| 101 | //} Else { |
| 102 | Return (Package (0x02) { 0x08, 0x01 }) |
| 103 | //} |
| 104 | } |
| 105 | } |
| 106 | Device (USB0) { |
| 107 | Name (_ADR, 0x00000000) |
| 108 | Method (_PSW, 1, NotSerialized) { // Power State Wake |
| 109 | And (GNBL, 0x7FFF, GNBL) |
| 110 | } |
| 111 | Method (_PRW, 0, NotSerialized) { // Power Resource for Wake |
Martin Roth | 3e41ee9 | 2015-12-08 15:24:41 -0700 | [diff] [blame] | 112 | //If (CondRefOf (\_S3)) { |
Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 113 | // Return (Package (0x02) { 0x0F, 0x03 }) |
| 114 | //} Else { |
| 115 | Return (Package (0x02) { 0x0F, 0x01 }) |
| 116 | //} |
| 117 | } |
| 118 | } |
| 119 | Device (USB1) { |
| 120 | Name (_ADR, 0x00000001) |
| 121 | Method (_PSW, 1, NotSerialized) { // Power State Wake |
| 122 | And (GNBL, 0x7FFF, GNBL) |
| 123 | } |
| 124 | Method (_PRW, 0, NotSerialized) { // Power Resource for Wake |
Martin Roth | 3e41ee9 | 2015-12-08 15:24:41 -0700 | [diff] [blame] | 125 | //If (CondRefOf (\_S3)) { |
Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 126 | // Return (Package (0x02) { 0x0F, 0x03 }) |
| 127 | //} Else { |
| 128 | Return (Package (0x02) { 0x0F, 0x01 }) |
| 129 | //} |
| 130 | } |
| 131 | } |
| 132 | Name (APIC, Package (0x0C) { |
| 133 | Package (0x04) { 0x0000FFFF, 0x00, 0x00, 0x10 }, //USB |
| 134 | Package (0x04) { 0x0000FFFF, 0x01, 0x00, 0x11 }, |
| 135 | Package (0x04) { 0x0000FFFF, 0x02, 0x00, 0x12 }, |
| 136 | Package (0x04) { 0x0000FFFF, 0x03, 0x00, 0x13 }, |
| 137 | Package (0x04) { 0x0004FFFF, 0x00, 0x00, 0x10 }, //Slot 6 |
| 138 | Package (0x04) { 0x0004FFFF, 0x01, 0x00, 0x11 }, |
| 139 | Package (0x04) { 0x0004FFFF, 0x02, 0x00, 0x12 }, |
| 140 | Package (0x04) { 0x0004FFFF, 0x03, 0x00, 0x13 }, |
| 141 | Package (0x04) { 0x0005FFFF, 0x00, 0x00, 0x11 }, //Slot 5 |
| 142 | Package (0x04) { 0x0005FFFF, 0x01, 0x00, 0x12 }, |
| 143 | Package (0x04) { 0x0005FFFF, 0x02, 0x00, 0x13 }, |
| 144 | Package (0x04) { 0x0005FFFF, 0x03, 0x00, 0x10 } |
| 145 | }) |
| 146 | Name (PICM, Package (0x0C) { |
| 147 | Package (0x04) { 0x0000FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 }, //USB |
| 148 | Package (0x04) { 0x0000FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 }, |
| 149 | Package (0x04) { 0x0000FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 }, |
| 150 | Package (0x04) { 0x0000FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 }, |
| 151 | Package (0x04) { 0x0004FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 }, //Slot 6 |
| 152 | Package (0x04) { 0x0004FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 }, |
| 153 | Package (0x04) { 0x0004FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 }, |
| 154 | Package (0x04) { 0x0004FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 }, |
| 155 | Package (0x04) { 0x0005FFFF, 0x00, \_SB.PCI0.LNKB, 0x00 }, //Slot 5 |
| 156 | Package (0x04) { 0x0005FFFF, 0x01, \_SB.PCI0.LNKC, 0x00 }, |
| 157 | Package (0x04) { 0x0005FFFF, 0x02, \_SB.PCI0.LNKD, 0x00 }, |
| 158 | Package (0x04) { 0x0005FFFF, 0x03, \_SB.PCI0.LNKA, 0x00 } |
| 159 | }) |
| 160 | Method (_PRT, 0, NotSerialized) { |
| 161 | If (LNot (PICF)) { Return (PICM) } |
| 162 | Else { Return (APIC) } |
| 163 | } |
| 164 | } |
| 165 | Device (IDE0) { |
| 166 | Method (_ADR, 0, NotSerialized) { |
| 167 | Return (DADD(\_SB.PCI0.SBDN, 0x00010001)) |
| 168 | } |
| 169 | Name (REGF, 0x01) |
| 170 | Method (_REG, 2, NotSerialized) { |
| 171 | If (LEqual (Arg0, 0x02)) { |
| 172 | Store (Arg1, REGF) |
| 173 | } |
| 174 | } |
| 175 | OperationRegion (BAR0, PCI_Config, 0x00, 0x60) |
| 176 | Field (BAR0, ByteAcc, NoLock, Preserve) { |
| 177 | Offset (0x40), // EIDE Controller Configuration Register |
| 178 | SCEN, 1, // Secondary Channel Enable |
| 179 | PCEN, 1, // Primary Channel Enable |
| 180 | , 10, |
| 181 | SPWB, 1, // Secondary Port posted-write buffer for PIO modes enable |
| 182 | SRPB, 1, // RW (controls nothing) |
| 183 | PPWB, 1, // Primary Port posted-write buffer for PIO modes enable |
| 184 | PRPB, 1, // RW (controls nothing) |
| 185 | PM80, 1, // High-speed 80-pin cable enable Primary Master |
| 186 | PS80, 1, // High-speed 80-pin cable enable Primary Slave |
| 187 | SM80, 1, // High-speed 80-pin cable enable Secondary Master |
| 188 | SS80, 1, // High-speed 80-pin cable enable Secondary Slave |
| 189 | , 4, // RW (controls nothing) |
| 190 | Offset (0x48), |
| 191 | SSRT, 4, // |
| 192 | SSPW, 4, // |
| 193 | SMRT, 4, // |
| 194 | SMPW, 4, |
| 195 | PSRT, 4, |
| 196 | PSPW, 4, |
| 197 | PMRT, 4, |
| 198 | PMPW, 4, |
| 199 | SSAD, 2, |
| 200 | SMAD, 2, |
| 201 | PSAD, 2, |
| 202 | PMAD, 2, |
| 203 | Offset (0x4E), |
| 204 | SXRT, 4, |
| 205 | SXPW, 4, |
| 206 | PXRT, 4, |
| 207 | PXPW, 4, |
| 208 | SSUD, 8, |
| 209 | SMUD, 8, |
| 210 | PSUD, 8, |
| 211 | PMUD, 8, |
| 212 | PPDN, 1, |
| 213 | PPDS, 1, |
| 214 | , 2, |
| 215 | SPDN, 1, |
| 216 | SPDS, 1 |
| 217 | } |
| 218 | Name (TIM0, Package (0x06) { |
| 219 | Package (0x05) { |
| 220 | 0x78, |
| 221 | 0xB4, |
| 222 | 0xF0, |
| 223 | 0x0186, |
| 224 | 0x0258 |
| 225 | }, |
| 226 | Package (0x07) { |
| 227 | 0x78, |
| 228 | 0x5A, |
| 229 | 0x3C, |
| 230 | 0x2D, |
| 231 | 0x1E, |
| 232 | 0x14, |
| 233 | 0x0F |
| 234 | }, |
| 235 | Package (0x08) { |
| 236 | 0x04, |
| 237 | 0x03, |
| 238 | 0x02, |
| 239 | 0x01, |
| 240 | 0x00, |
| 241 | 0x00, |
| 242 | 0x00, |
| 243 | 0x00 |
| 244 | }, |
| 245 | Package (0x03) { |
| 246 | 0x02, |
| 247 | 0x01, |
| 248 | 0x00 |
| 249 | }, |
| 250 | Package (0x05) { |
| 251 | 0x20, |
| 252 | 0x22, |
| 253 | 0x42, |
| 254 | 0x65, |
| 255 | 0xA8 |
| 256 | }, |
| 257 | Package (0x07) { |
| 258 | 0xC2, |
| 259 | 0xC1, |
| 260 | 0xC0, |
| 261 | 0xC4, |
| 262 | 0xC5, |
| 263 | 0xC6, |
| 264 | 0xC7 |
| 265 | } |
| 266 | }) |
| 267 | Name (TMD0, Buffer (0x14) {}) |
| 268 | CreateDWordField (TMD0, 0x00, PIO0) |
| 269 | CreateDWordField (TMD0, 0x04, DMA0) |
| 270 | CreateDWordField (TMD0, 0x08, PIO1) |
| 271 | CreateDWordField (TMD0, 0x0C, DMA1) |
| 272 | CreateDWordField (TMD0, 0x10, CHNF) |
| 273 | Device (CHN0) { |
| 274 | Name (_ADR, 0x00) |
| 275 | Method (_STA, 0, NotSerialized) { |
| 276 | If (PCEN) { Return (0x0F) } |
| 277 | Else { Return (0x09) } |
| 278 | } |
| 279 | Method (_GTM, 0, NotSerialized) { |
| 280 | Return (GTM (PMPW, PMRT, PSPW, PSRT, PMUD, PSUD)) |
| 281 | } |
| 282 | Method (_STM, 3, NotSerialized) { |
| 283 | Store (Arg0, TMD0) |
| 284 | Store (STM (), Local0) |
| 285 | And (Local0, 0xFF, PSUD) |
| 286 | ShiftRight (Local0, 0x08, Local0) |
| 287 | And (Local0, 0xFF, PMUD) |
| 288 | ShiftRight (Local0, 0x08, Local0) |
| 289 | And (Local0, 0x0F, PSRT) |
| 290 | ShiftRight (Local0, 0x04, Local0) |
| 291 | And (Local0, 0x0F, PSPW) |
| 292 | ShiftRight (Local0, 0x04, Local0) |
| 293 | And (Local0, 0x0F, PMRT) |
| 294 | ShiftRight (Local0, 0x04, Local0) |
| 295 | And (Local0, 0x0F, PMPW) |
| 296 | Store (GTF (0x00, Arg1), ATA0) |
| 297 | Store (GTF (0x01, Arg2), ATA1) |
| 298 | } |
| 299 | Device (DRV0) { |
| 300 | Name (_ADR, 0x00) |
| 301 | Method (_GTF, 0, NotSerialized) { |
| 302 | Return (RATA (ATA0)) |
| 303 | } |
| 304 | } |
| 305 | Device (DRV1) { |
| 306 | Name (_ADR, 0x01) |
| 307 | Method (_GTF, 0, NotSerialized) { |
| 308 | Return (RATA (ATA1)) |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | Device (CHN1) { |
| 313 | Name (_ADR, 0x01) |
| 314 | Method (_STA, 0, NotSerialized) { |
| 315 | If (SCEN) { Return (0x0F) } |
| 316 | Else { Return (0x09) } |
| 317 | } |
| 318 | Method (_GTM, 0, NotSerialized) { |
| 319 | Return (GTM (SMPW, SMRT, SSPW, SSRT, SMUD, SSUD)) |
| 320 | } |
| 321 | Method (_STM, 3, NotSerialized) { |
| 322 | Store (Arg0, TMD0) |
| 323 | Store (STM (), Local0) |
| 324 | And (Local0, 0xFF, SSUD) |
| 325 | ShiftRight (Local0, 0x08, Local0) |
| 326 | And (Local0, 0xFF, SMUD) |
| 327 | ShiftRight (Local0, 0x08, Local0) |
| 328 | And (Local0, 0x0F, SSRT) |
| 329 | ShiftRight (Local0, 0x04, Local0) |
| 330 | And (Local0, 0x0F, SSPW) |
| 331 | ShiftRight (Local0, 0x04, Local0) |
| 332 | And (Local0, 0x0F, SMRT) |
| 333 | ShiftRight (Local0, 0x04, Local0) |
| 334 | And (Local0, 0x0F, SMPW) |
| 335 | Store (GTF (0x00, Arg1), ATA2) |
| 336 | Store (GTF (0x01, Arg2), ATA3) |
| 337 | } |
| 338 | Device (DRV0) { |
| 339 | Name (_ADR, 0x00) |
| 340 | Method (_GTF, 0, NotSerialized) { |
| 341 | Return (RATA (ATA2)) |
| 342 | } |
| 343 | } |
| 344 | Device (DRV1) { |
| 345 | Name (_ADR, 0x01) |
| 346 | Method (_GTF, 0, NotSerialized) { |
| 347 | Return (RATA (ATA3)) |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | Method (GTM, 6, Serialized) { |
| 352 | Store (Ones, PIO0) |
| 353 | Store (Ones, PIO1) |
| 354 | Store (Ones, DMA0) |
| 355 | Store (Ones, DMA1) |
| 356 | Store (0x1A, CHNF) |
| 357 | If (REGF) {} |
| 358 | Else { Return (TMD0) } |
| 359 | Add (Arg0, Arg1, Local0) |
| 360 | Add (Local0, 0x02, Local0) |
| 361 | Multiply (Local0, 0x1E, PIO0) |
| 362 | Add (Arg2, Arg3, Local0) |
| 363 | Add (Local0, 0x02, Local0) |
| 364 | Multiply (Local0, 0x1E, PIO1) |
| 365 | If (And (Arg4, 0x40)) { |
| 366 | Or (CHNF, 0x01, CHNF) |
| 367 | And (Arg4, 0x07, Local0) |
| 368 | If (LLess (Local0, 0x04)) { |
| 369 | Add (Local0, 0x02, Local0) |
| 370 | Multiply (Local0, 0x1E, DMA0) |
| 371 | } Else { |
| 372 | If (LEqual (Local0, 0x04)) { |
| 373 | Store (0x2D, DMA0) |
| 374 | } Else { |
| 375 | If (LEqual (Local0, 0x05)) { |
| 376 | Store (0x1E, DMA0) |
| 377 | } Else { |
| 378 | If (LEqual (Local0, 0x06)) { |
| 379 | Store (0x14, DMA0) |
| 380 | } Else { |
| 381 | If (LEqual (Local0, 0x07)) { |
| 382 | Store (0x0F, DMA0) |
| 383 | } Else { |
| 384 | Store (PIO0, DMA0) |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } Else { |
| 391 | Store (PIO0, DMA0) |
| 392 | } |
| 393 | If (And (Arg5, 0x40)) { |
| 394 | Or (CHNF, 0x04, CHNF) |
| 395 | And (Arg5, 0x07, Local0) |
| 396 | If (LLess (Local0, 0x04)) { |
| 397 | Add (Local0, 0x02, Local0) |
| 398 | Multiply (Local0, 0x1E, DMA1) |
| 399 | } Else { |
| 400 | If (LEqual (Local0, 0x04)) { |
| 401 | Store (0x2D, DMA1) |
| 402 | } Else { |
| 403 | If (LEqual (Local0, 0x05)) { |
| 404 | Store (0x1E, DMA1) |
| 405 | } Else { |
| 406 | If (LEqual (Local0, 0x06)) { |
| 407 | Store (0x14, DMA1) |
| 408 | } Else { |
| 409 | If (LEqual (Local0, 0x07)) { |
| 410 | Store (0x0F, DMA0) |
| 411 | } Else { |
| 412 | Store (PIO1, DMA1) |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | } Else { |
| 419 | Store (PIO1, DMA1) |
| 420 | } |
| 421 | Return (TMD0) |
| 422 | } |
| 423 | Method (STM, 0, Serialized) { |
| 424 | If (REGF) {} |
| 425 | Else { Return (0xFFFFFFFF) } |
| 426 | If (LEqual (PIO0, 0xFFFFFFFF)) { |
| 427 | Store (0xA8, Local1) |
| 428 | } Else { |
| 429 | And (Match (DerefOf (Index (TIM0, 0x00)), |
| 430 | MGE, PIO0, MTR, |
| 431 | 0x00, 0x00), |
| 432 | 0x07, Local0) |
| 433 | Store (DerefOf (Index (DerefOf (Index (TIM0, 0x04)), Local0)), |
| 434 | Local1) |
| 435 | } |
| 436 | ShiftLeft (Local1, 0x08, Local1) |
| 437 | If (LEqual (PIO1, 0xFFFFFFFF)) { |
| 438 | Or (Local1, 0xA8, Local1) |
| 439 | } Else { |
| 440 | And (Match (DerefOf (Index (TIM0, 0x00)), MGE, PIO1, MTR, |
| 441 | 0x00, 0x00), 0x07, Local0) |
| 442 | Or (DerefOf (Index (DerefOf (Index (TIM0, 0x04)), Local0)), |
| 443 | Local1, Local1) |
| 444 | } |
| 445 | ShiftLeft (Local1, 0x08, Local1) |
| 446 | If (LEqual (DMA0, 0xFFFFFFFF)) { |
| 447 | Or (Local1, 0x03, Local1) |
| 448 | } Else { |
| 449 | If (And (CHNF, 0x01)) { |
| 450 | And (Match (DerefOf (Index (TIM0, 0x01)), MLE, DMA0, MTR, |
| 451 | 0x00, 0x00), 0x07, Local0) |
| 452 | Or (DerefOf (Index (DerefOf (Index (TIM0, 0x05)), Local0)), |
| 453 | Local1, Local1) |
| 454 | } Else { |
| 455 | Or (Local1, 0x03, Local1) |
| 456 | } |
| 457 | } |
| 458 | ShiftLeft (Local1, 0x08, Local1) |
| 459 | If (LEqual (DMA1, 0xFFFFFFFF)) { |
| 460 | Or (Local1, 0x03, Local1) |
| 461 | } Else { |
| 462 | If (And (CHNF, 0x04)) { |
| 463 | And (Match (DerefOf (Index (TIM0, 0x01)), MLE, DMA1, MTR, |
| 464 | 0x00, 0x00), 0x07, Local0) |
| 465 | Or (DerefOf (Index (DerefOf (Index (TIM0, 0x05)), Local0)), |
| 466 | Local1, Local1) |
| 467 | } Else { |
| 468 | Or (Local1, 0x03, Local1) |
| 469 | } |
| 470 | } |
| 471 | Return (Local1) |
| 472 | } |
| 473 | Name (AT01, Buffer (0x07) { |
| 474 | 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF |
| 475 | }) |
| 476 | Name (AT02, Buffer (0x07) { |
| 477 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90 |
| 478 | }) |
| 479 | Name (AT03, Buffer (0x07) { |
| 480 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6 |
| 481 | }) |
| 482 | Name (AT04, Buffer (0x07) { |
| 483 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91 |
| 484 | }) |
| 485 | Name (ATA0, Buffer (0x1D) {}) |
| 486 | Name (ATA1, Buffer (0x1D) {}) |
| 487 | Name (ATA2, Buffer (0x1D) {}) |
| 488 | Name (ATA3, Buffer (0x1D) {}) |
| 489 | Name (ATAB, Buffer (0x1D) {}) |
| 490 | CreateByteField (ATAB, 0x00, CMDC) |
| 491 | Method (GTFB, 3, Serialized) { |
| 492 | Multiply (CMDC, 0x38, Local0) |
| 493 | Add (Local0, 0x08, Local1) |
| 494 | CreateField (ATAB, Local1, 0x38, CMDX) |
| 495 | Multiply (CMDC, 0x07, Local0) |
| 496 | CreateByteField (ATAB, Add (Local0, 0x02), A001) |
| 497 | CreateByteField (ATAB, Add (Local0, 0x06), A005) |
| 498 | Store (Arg0, CMDX) |
| 499 | Store (Arg1, A001) |
| 500 | Store (Arg2, A005) |
| 501 | Increment (CMDC) |
| 502 | } |
| 503 | Method (GTF, 2, Serialized) { |
| 504 | Store (Arg1, Debug) |
| 505 | Store (0x00, CMDC) |
| 506 | Name (ID49, 0x0C00) |
| 507 | Name (ID59, 0x00) |
| 508 | Name (ID53, 0x04) |
| 509 | Name (ID63, 0x0F00) |
| 510 | Name (ID88, 0x0F00) |
| 511 | Name (IRDY, 0x01) |
| 512 | Name (PIOT, 0x00) |
| 513 | Name (DMAT, 0x00) |
| 514 | If (LEqual (SizeOf (Arg1), 0x0200)) { |
| 515 | CreateWordField (Arg1, 0x62, IW49) |
| 516 | Store (IW49, ID49) |
| 517 | CreateWordField (Arg1, 0x6A, IW53) |
| 518 | Store (IW53, ID53) |
| 519 | CreateWordField (Arg1, 0x7E, IW63) |
| 520 | Store (IW63, ID63) |
| 521 | CreateWordField (Arg1, 0x76, IW59) |
| 522 | Store (IW59, ID59) |
| 523 | CreateWordField (Arg1, 0xB0, IW88) |
| 524 | Store (IW88, ID88) |
| 525 | } |
| 526 | Store (0xA0, Local7) |
| 527 | If (Arg0) { |
| 528 | Store (0xB0, Local7) |
| 529 | And (CHNF, 0x08, IRDY) |
| 530 | If (And (CHNF, 0x10)) { |
| 531 | Store (PIO1, PIOT) |
| 532 | } Else { |
| 533 | Store (PIO0, PIOT) |
| 534 | } |
| 535 | If (And (CHNF, 0x04)) { |
| 536 | If (And (CHNF, 0x10)) { |
| 537 | Store (DMA1, DMAT) |
| 538 | } Else { |
| 539 | Store (DMA0, DMAT) |
| 540 | } |
| 541 | } Else { |
| 542 | Store (PIO1, DMAT) |
| 543 | } |
| 544 | } Else { |
| 545 | And (CHNF, 0x02, IRDY) |
| 546 | Store (PIO0, PIOT) |
| 547 | If (And (CHNF, 0x01)) { |
| 548 | Store (DMA0, DMAT) |
| 549 | } |
| 550 | } |
| 551 | If (LAnd (LAnd (And (ID53, 0x04), And (ID88, 0xFF00)), DMAT)) { |
| 552 | Store (Match (DerefOf (Index (TIM0, 0x01)), MLE, DMAT, MTR, |
| 553 | 0x00, 0x00), Local1) |
| 554 | If (LGreater (Local1, 0x06)) { |
| 555 | Store (0x06, Local1) |
| 556 | } |
| 557 | GTFB (AT01, Or (0x40, Local1), Local7) |
| 558 | } Else { |
| 559 | If (LAnd (And (ID63, 0xFF00), PIOT)) { |
| 560 | And (Match (DerefOf (Index (TIM0, 0x00)), MGE, PIOT, MTR, |
| 561 | 0x00, 0x00), 0x07, Local0) |
| 562 | If (Local0) { |
| 563 | If (And (Local0, 0x04)) { |
| 564 | Store (0x02, Local0) |
| 565 | } Else { |
| 566 | Store (0x01, Local0) |
| 567 | } |
| 568 | } |
| 569 | Or (0x20, DerefOf (Index (DerefOf (Index (TIM0, 0x03)), Local0 |
| 570 | )), Local1) |
| 571 | GTFB (AT01, Local1, Local7) |
| 572 | } |
| 573 | } |
| 574 | If (IRDY) { |
| 575 | And (Match (DerefOf (Index (TIM0, 0x00)), MGE, PIOT, MTR, |
| 576 | 0x00, 0x00), 0x07, Local0) |
| 577 | Or (0x08, DerefOf (Index (DerefOf (Index (TIM0, 0x02)), Local0 |
| 578 | )), Local1) |
| 579 | GTFB (AT01, Local1, Local7) |
| 580 | } Else { |
| 581 | If (And (ID49, 0x0400)) { |
| 582 | GTFB (AT01, 0x01, Local7) |
| 583 | } |
| 584 | } |
| 585 | If (LAnd (And (ID59, 0x0100), And (ID59, 0xFF))) { |
| 586 | GTFB (AT03, And (ID59, 0xFF), Local7) |
| 587 | } |
| 588 | Store (ATAB, Debug) |
| 589 | Return (ATAB) |
| 590 | } |
| 591 | Method (RATA, 1, NotSerialized) { |
| 592 | CreateByteField (Arg0, 0x00, CMDN) |
| 593 | Multiply (CMDN, 0x38, Local0) |
| 594 | CreateField (Arg0, 0x08, Local0, RETB) |
| 595 | Store (RETB, Debug) |
| 596 | Return (RETB) |
| 597 | } |
| 598 | } |
| 599 | Device (PMF) { |
Elyes HAOUAS | 8ab989e | 2016-07-30 17:46:17 +0200 | [diff] [blame] | 600 | // ACPI smbus it should be 0x00040003 if 8131 present |
Oskar Enoksson | 2516f2e | 2014-02-08 00:17:21 +0100 | [diff] [blame] | 601 | Method (_ADR, 0, NotSerialized) |
| 602 | { |
| 603 | Return (DADD(\_SB.PCI0.SBDN, 0x00010003)) |
| 604 | } |
| 605 | OperationRegion (BAR0, PCI_Config, 0x00, 0xff) |
| 606 | Field (BAR0, ByteAcc, NoLock, Preserve) { |
| 607 | Offset (0x56), |
| 608 | PIRA, 4, |
| 609 | PIRB, 4, |
| 610 | PIRC, 4, |
| 611 | PIRD, 4 |
| 612 | } |
| 613 | //OperationRegion (TS3_, PCI_Config, 0xC4, 0x02) |
| 614 | //Field (TS3_, DWordAcc, NoLock, Preserve) { |
| 615 | // PTS3, 16 |
| 616 | //} |
| 617 | } |