Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program 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 |
| 13 | * GNU General Public License for more details. |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
Martin Roth | 1e1c7ac | 2015-12-10 08:19:27 -0700 | [diff] [blame] | 16 | #include <southbridge/amd/sb600/sb600.h> |
| 17 | |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 18 | /* DefinitionBlock Statement */ |
| 19 | DefinitionBlock ( |
| 20 | "DSDT.AML", /* Output filename */ |
| 21 | "DSDT", /* Signature */ |
| 22 | 0x02, /* DSDT Revision, needs to be 2 for 64bit */ |
| 23 | "TECHNEXION", /* OEMID */ |
Paul Menzel | 12d6024 | 2013-02-21 15:54:50 +0100 | [diff] [blame] | 24 | "COREBOOT", /* TABLE ID */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 25 | 0x00010001 /* OEM Revision */ |
| 26 | ) |
| 27 | { /* Start of ASL file */ |
Patrick Georgi | 91bd306 | 2012-02-16 19:16:14 +0100 | [diff] [blame] | 28 | /* #include <arch/x86/acpi/debug.asl> */ /* Include global debug methods if needed */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 29 | |
| 30 | /* Data to be patched by the BIOS during POST */ |
| 31 | /* FIXME the patching is not done yet! */ |
| 32 | /* Memory related values */ |
| 33 | Name(LOMH, 0x0) /* Start of unused memory in C0000-E0000 range */ |
| 34 | Name(PBAD, 0x0) /* Address of BIOS area (If TOM2 != 0, Addr >> 16) */ |
| 35 | Name(PBLN, 0x0) /* Length of BIOS area */ |
| 36 | |
| 37 | Name(PCBA, 0xE0000000) /* Base address of PCIe config space */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 38 | |
| 39 | Name(SSFG, 0x0D) /* S1 support: bit 0, S2 Support: bit 1, etc. S0 & S5 assumed */ |
| 40 | |
| 41 | /* USB overcurrent mapping pins. */ |
| 42 | Name(UOM0, 0) |
| 43 | Name(UOM1, 2) |
| 44 | Name(UOM2, 0) |
| 45 | Name(UOM3, 7) |
| 46 | Name(UOM4, 2) |
| 47 | Name(UOM5, 2) |
| 48 | Name(UOM6, 6) |
| 49 | Name(UOM7, 2) |
| 50 | Name(UOM8, 6) |
| 51 | Name(UOM9, 6) |
| 52 | |
| 53 | /* Some global data */ |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 54 | Name(OSVR, 3) /* Assume nothing. WinXp = 1, Vista = 2, Linux = 3, WinCE = 4 */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 55 | Name(OSV, Ones) /* Assume nothing */ |
| 56 | Name(PMOD, One) /* Assume APIC */ |
| 57 | |
| 58 | /* PIC IRQ mapping registers, C00h-C01h */ |
| 59 | OperationRegion(PRQM, SystemIO, 0x00000C00, 0x00000002) |
| 60 | Field(PRQM, ByteAcc, NoLock, Preserve) { |
| 61 | PRQI, 0x00000008, |
| 62 | PRQD, 0x00000008, /* Offset: 1h */ |
| 63 | } |
| 64 | IndexField(PRQI, PRQD, ByteAcc, NoLock, Preserve) { |
| 65 | PINA, 0x00000008, /* Index 0 */ |
| 66 | PINB, 0x00000008, /* Index 1 */ |
| 67 | PINC, 0x00000008, /* Index 2 */ |
| 68 | PIND, 0x00000008, /* Index 3 */ |
| 69 | AINT, 0x00000008, /* Index 4 */ |
| 70 | SINT, 0x00000008, /* Index 5 */ |
| 71 | , 0x00000008, /* Index 6 */ |
| 72 | AAUD, 0x00000008, /* Index 7 */ |
| 73 | AMOD, 0x00000008, /* Index 8 */ |
| 74 | PINE, 0x00000008, /* Index 9 */ |
| 75 | PINF, 0x00000008, /* Index A */ |
| 76 | PING, 0x00000008, /* Index B */ |
| 77 | PINH, 0x00000008, /* Index C */ |
| 78 | } |
| 79 | |
| 80 | /* PCI Error control register */ |
| 81 | OperationRegion(PERC, SystemIO, 0x00000C14, 0x00000001) |
| 82 | Field(PERC, ByteAcc, NoLock, Preserve) { |
| 83 | SENS, 0x00000001, |
| 84 | PENS, 0x00000001, |
| 85 | SENE, 0x00000001, |
| 86 | PENE, 0x00000001, |
| 87 | } |
| 88 | |
| 89 | /* Client Management index/data registers */ |
| 90 | OperationRegion(CMT, SystemIO, 0x00000C50, 0x00000002) |
| 91 | Field(CMT, ByteAcc, NoLock, Preserve) { |
| 92 | CMTI, 8, |
| 93 | /* Client Management Data register */ |
| 94 | G64E, 1, |
| 95 | G64O, 1, |
| 96 | G32O, 2, |
| 97 | , 2, |
| 98 | GPSL, 2, |
| 99 | } |
| 100 | |
| 101 | /* GPM Port register */ |
| 102 | OperationRegion(GPT, SystemIO, 0x00000C52, 0x00000001) |
| 103 | Field(GPT, ByteAcc, NoLock, Preserve) { |
| 104 | GPB0,1, |
| 105 | GPB1,1, |
| 106 | GPB2,1, |
| 107 | GPB3,1, |
| 108 | GPB4,1, |
| 109 | GPB5,1, |
| 110 | GPB6,1, |
| 111 | GPB7,1, |
| 112 | } |
| 113 | |
| 114 | /* Flash ROM program enable register */ |
| 115 | OperationRegion(FRE, SystemIO, 0x00000C6F, 0x00000001) |
| 116 | Field(FRE, ByteAcc, NoLock, Preserve) { |
| 117 | , 0x00000006, |
| 118 | FLRE, 0x00000001, |
| 119 | } |
| 120 | |
| 121 | /* PM2 index/data registers */ |
| 122 | OperationRegion(PM2R, SystemIO, 0x00000CD0, 0x00000002) |
| 123 | Field(PM2R, ByteAcc, NoLock, Preserve) { |
| 124 | PM2I, 0x00000008, |
| 125 | PM2D, 0x00000008, |
| 126 | } |
| 127 | |
| 128 | /* Power Management I/O registers */ |
| 129 | OperationRegion(PIOR, SystemIO, 0x00000CD6, 0x00000002) |
| 130 | Field(PIOR, ByteAcc, NoLock, Preserve) { |
| 131 | PIOI, 0x00000008, |
| 132 | PIOD, 0x00000008, |
| 133 | } |
| 134 | IndexField (PIOI, PIOD, ByteAcc, NoLock, Preserve) { |
| 135 | Offset(0x00), /* MiscControl */ |
| 136 | , 1, |
| 137 | T1EE, 1, |
| 138 | T2EE, 1, |
| 139 | Offset(0x01), /* MiscStatus */ |
| 140 | , 1, |
| 141 | T1E, 1, |
| 142 | T2E, 1, |
| 143 | Offset(0x04), /* SmiWakeUpEventEnable3 */ |
| 144 | , 7, |
| 145 | SSEN, 1, |
| 146 | Offset(0x07), /* SmiWakeUpEventStatus3 */ |
| 147 | , 7, |
| 148 | CSSM, 1, |
| 149 | Offset(0x10), /* AcpiEnable */ |
| 150 | , 6, |
| 151 | PWDE, 1, |
| 152 | Offset(0x1C), /* ProgramIoEnable */ |
| 153 | , 3, |
| 154 | MKME, 1, |
| 155 | IO3E, 1, |
| 156 | IO2E, 1, |
| 157 | IO1E, 1, |
| 158 | IO0E, 1, |
| 159 | Offset(0x1D), /* IOMonitorStatus */ |
| 160 | , 3, |
| 161 | MKMS, 1, |
| 162 | IO3S, 1, |
| 163 | IO2S, 1, |
| 164 | IO1S, 1, |
| 165 | IO0S,1, |
| 166 | Offset(0x20), /* AcpiPmEvtBlk */ |
| 167 | APEB, 16, |
| 168 | Offset(0x36), /* GEvtLevelConfig */ |
| 169 | , 6, |
| 170 | ELC6, 1, |
| 171 | ELC7, 1, |
| 172 | Offset(0x37), /* GPMLevelConfig0 */ |
| 173 | , 3, |
| 174 | PLC0, 1, |
| 175 | PLC1, 1, |
| 176 | PLC2, 1, |
| 177 | PLC3, 1, |
| 178 | PLC8, 1, |
| 179 | Offset(0x38), /* GPMLevelConfig1 */ |
| 180 | , 1, |
| 181 | PLC4, 1, |
| 182 | PLC5, 1, |
| 183 | , 1, |
| 184 | PLC6, 1, |
| 185 | PLC7, 1, |
| 186 | Offset(0x3B), /* PMEStatus1 */ |
| 187 | GP0S, 1, |
| 188 | GM4S, 1, |
| 189 | GM5S, 1, |
| 190 | APS, 1, |
| 191 | GM6S, 1, |
| 192 | GM7S, 1, |
| 193 | GP2S, 1, |
| 194 | STSS, 1, |
| 195 | Offset(0x55), /* SoftPciRst */ |
| 196 | SPRE, 1, |
| 197 | , 1, |
| 198 | , 1, |
| 199 | PNAT, 1, |
| 200 | PWMK, 1, |
| 201 | PWNS, 1, |
| 202 | |
| 203 | /* Offset(0x61), */ /* Options_1 */ |
| 204 | /* ,7, */ |
| 205 | /* R617,1, */ |
| 206 | |
| 207 | Offset(0x65), /* UsbPMControl */ |
| 208 | , 4, |
| 209 | URRE, 1, |
| 210 | Offset(0x68), /* MiscEnable68 */ |
| 211 | , 3, |
| 212 | TMTE, 1, |
| 213 | , 1, |
| 214 | Offset(0x92), /* GEVENTIN */ |
| 215 | , 7, |
| 216 | E7IS, 1, |
| 217 | Offset(0x96), /* GPM98IN */ |
| 218 | G8IS, 1, |
| 219 | G9IS, 1, |
| 220 | Offset(0x9A), /* EnhanceControl */ |
| 221 | ,7, |
| 222 | HPDE, 1, |
| 223 | Offset(0xA8), /* PIO7654Enable */ |
| 224 | IO4E, 1, |
| 225 | IO5E, 1, |
| 226 | IO6E, 1, |
| 227 | IO7E, 1, |
| 228 | Offset(0xA9), /* PIO7654Status */ |
| 229 | IO4S, 1, |
| 230 | IO5S, 1, |
| 231 | IO6S, 1, |
| 232 | IO7S, 1, |
| 233 | } |
| 234 | |
| 235 | /* PM1 Event Block |
| 236 | * First word is PM1_Status, Second word is PM1_Enable |
| 237 | */ |
| 238 | OperationRegion(P1EB, SystemIO, APEB, 0x04) |
| 239 | Field(P1EB, ByteAcc, NoLock, Preserve) { |
| 240 | TMST, 1, |
| 241 | , 3, |
| 242 | BMST, 1, |
| 243 | GBST, 1, |
| 244 | Offset(0x01), |
| 245 | PBST, 1, |
| 246 | , 1, |
| 247 | RTST, 1, |
| 248 | , 3, |
| 249 | PWST, 1, |
| 250 | SPWS, 1, |
| 251 | Offset(0x02), |
| 252 | TMEN, 1, |
| 253 | , 4, |
| 254 | GBEN, 1, |
| 255 | Offset(0x03), |
| 256 | PBEN, 1, |
| 257 | , 1, |
| 258 | RTEN, 1, |
| 259 | , 3, |
| 260 | PWDA, 1, |
| 261 | } |
| 262 | |
| 263 | Scope(\_SB) { |
| 264 | |
| 265 | /* PCIe Configuration Space for 16 busses */ |
| 266 | OperationRegion(PCFG, SystemMemory, PCBA, 0x01000000) /* Each bus consumes 1MB */ |
| 267 | Field(PCFG, ByteAcc, NoLock, Preserve) { |
| 268 | /* Byte offsets are computed using the following technique: |
| 269 | * ((bus number + 1) * ((device number * 8) * 4096)) + register offset |
| 270 | * The 8 comes from 8 functions per device, and 4096 bytes per function config space |
| 271 | */ |
| 272 | Offset(0x00090024), /* Byte offset to SATA register 24h - Bus 0, Device 18, Function 0 */ |
| 273 | STB5, 32, |
| 274 | Offset(0x00098042), /* Byte offset to OHCI0 register 42h - Bus 0, Device 19, Function 0 */ |
| 275 | PT0D, 1, |
| 276 | PT1D, 1, |
| 277 | PT2D, 1, |
| 278 | PT3D, 1, |
| 279 | PT4D, 1, |
| 280 | PT5D, 1, |
| 281 | PT6D, 1, |
| 282 | PT7D, 1, |
| 283 | PT8D, 1, |
| 284 | PT9D, 1, |
| 285 | Offset(0x000A0004), /* Byte offset to SMBUS register 4h - Bus 0, Device 20, Function 0 */ |
| 286 | SBIE, 1, |
| 287 | SBME, 1, |
| 288 | Offset(0x000A0008), /* Byte offset to SMBUS register 8h - Bus 0, Device 20, Function 0 */ |
| 289 | SBRI, 8, |
| 290 | Offset(0x000A0014), /* Byte offset to SMBUS register 14h - Bus 0, Device 20, Function 0 */ |
| 291 | SBB1, 32, |
| 292 | Offset(0x000A0078), /* Byte offset to SMBUS register 78h - Bus 0, Device 20, Function 0 */ |
| 293 | ,14, |
| 294 | P92E, 1, /* Port92 decode enable */ |
| 295 | } |
| 296 | |
| 297 | OperationRegion(SB5, SystemMemory, STB5, 0x1000) |
| 298 | Field(SB5, AnyAcc, NoLock, Preserve) |
| 299 | { |
| 300 | /* Port 0 */ |
| 301 | Offset(0x120), /* Port 0 Task file status */ |
| 302 | P0ER, 1, |
| 303 | , 2, |
| 304 | P0DQ, 1, |
| 305 | , 3, |
| 306 | P0BY, 1, |
| 307 | Offset(0x128), /* Port 0 Serial ATA status */ |
| 308 | P0DD, 4, |
| 309 | , 4, |
| 310 | P0IS, 4, |
| 311 | Offset(0x12C), /* Port 0 Serial ATA control */ |
| 312 | P0DI, 4, |
| 313 | Offset(0x130), /* Port 0 Serial ATA error */ |
| 314 | , 16, |
| 315 | P0PR, 1, |
| 316 | |
| 317 | /* Port 1 */ |
| 318 | offset(0x1A0), /* Port 1 Task file status */ |
| 319 | P1ER, 1, |
| 320 | , 2, |
| 321 | P1DQ, 1, |
| 322 | , 3, |
| 323 | P1BY, 1, |
| 324 | Offset(0x1A8), /* Port 1 Serial ATA status */ |
| 325 | P1DD, 4, |
| 326 | , 4, |
| 327 | P1IS, 4, |
| 328 | Offset(0x1AC), /* Port 1 Serial ATA control */ |
| 329 | P1DI, 4, |
| 330 | Offset(0x1B0), /* Port 1 Serial ATA error */ |
| 331 | , 16, |
| 332 | P1PR, 1, |
| 333 | |
| 334 | /* Port 2 */ |
| 335 | Offset(0x220), /* Port 2 Task file status */ |
| 336 | P2ER, 1, |
| 337 | , 2, |
| 338 | P2DQ, 1, |
| 339 | , 3, |
| 340 | P2BY, 1, |
| 341 | Offset(0x228), /* Port 2 Serial ATA status */ |
| 342 | P2DD, 4, |
| 343 | , 4, |
| 344 | P2IS, 4, |
| 345 | Offset(0x22C), /* Port 2 Serial ATA control */ |
| 346 | P2DI, 4, |
| 347 | Offset(0x230), /* Port 2 Serial ATA error */ |
| 348 | , 16, |
| 349 | P2PR, 1, |
| 350 | |
| 351 | /* Port 3 */ |
| 352 | Offset(0x2A0), /* Port 3 Task file status */ |
| 353 | P3ER, 1, |
| 354 | , 2, |
| 355 | P3DQ, 1, |
| 356 | , 3, |
| 357 | P3BY, 1, |
| 358 | Offset(0x2A8), /* Port 3 Serial ATA status */ |
| 359 | P3DD, 4, |
| 360 | , 4, |
| 361 | P3IS, 4, |
| 362 | Offset(0x2AC), /* Port 3 Serial ATA control */ |
| 363 | P3DI, 4, |
| 364 | Offset(0x2B0), /* Port 3 Serial ATA error */ |
| 365 | , 16, |
| 366 | P3PR, 1, |
| 367 | } |
| 368 | } |
| 369 | |
Patrick Georgi | af97d33 | 2010-02-08 15:46:37 +0000 | [diff] [blame] | 370 | #include "acpi/routing.asl" |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 371 | |
| 372 | Scope(\_SB) { |
| 373 | |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 374 | Method(OSFL, 0){ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 375 | |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 376 | if(LNotEqual(OSVR, Ones)) {Return(OSVR)} /* OS version was already detected */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 377 | |
Martin Roth | 91d9cbc | 2015-12-08 15:04:23 -0700 | [diff] [blame] | 378 | if(CondRefOf(\_OSI)) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 379 | { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 380 | Store(1, OSVR) /* Assume some form of XP */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 381 | if (\_OSI("Windows 2006")) /* Vista */ |
| 382 | { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 383 | Store(2, OSVR) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 384 | } |
| 385 | } else { |
| 386 | If(WCMP(\_OS,"Linux")) { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 387 | Store(3, OSVR) /* Linux */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 388 | } Else { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 389 | Store(4, OSVR) /* Gotta be WinCE */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 390 | } |
| 391 | } |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 392 | Return(OSVR) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | Method(_PIC, 0x01, NotSerialized) |
| 396 | { |
| 397 | If (Arg0) |
| 398 | { |
| 399 | \_SB.CIRQ() |
| 400 | } |
| 401 | Store(Arg0, PMOD) |
| 402 | } |
| 403 | |
| 404 | Method(CIRQ, 0x00, NotSerialized) |
| 405 | { |
| 406 | Store(0, PINA) |
| 407 | Store(0, PINB) |
| 408 | Store(0, PINC) |
| 409 | Store(0, PIND) |
| 410 | Store(0, PINE) |
| 411 | Store(0, PINF) |
| 412 | Store(0, PING) |
| 413 | Store(0, PINH) |
| 414 | } |
| 415 | |
| 416 | Name(IRQB, ResourceTemplate(){ |
| 417 | IRQ(Level,ActiveLow,Shared){15} |
| 418 | }) |
| 419 | |
| 420 | Name(IRQP, ResourceTemplate(){ |
| 421 | IRQ(Level,ActiveLow,Exclusive){3, 4, 5, 7, 10, 11, 12, 15} |
| 422 | }) |
| 423 | |
| 424 | Name(PITF, ResourceTemplate(){ |
| 425 | IRQ(Level,ActiveLow,Exclusive){9} |
| 426 | }) |
| 427 | |
| 428 | Device(INTA) { |
| 429 | Name(_HID, EISAID("PNP0C0F")) |
| 430 | Name(_UID, 1) |
| 431 | |
| 432 | Method(_STA, 0) { |
| 433 | if (PINA) { |
| 434 | Return(0x0B) /* sata is invisible */ |
| 435 | } else { |
| 436 | Return(0x09) /* sata is disabled */ |
| 437 | } |
| 438 | } /* End Method(_SB.INTA._STA) */ |
| 439 | |
| 440 | Method(_DIS ,0) { |
| 441 | /* DBGO("\\_SB\\LNKA\\_DIS\n") */ |
| 442 | Store(0, PINA) |
| 443 | } /* End Method(_SB.INTA._DIS) */ |
| 444 | |
| 445 | Method(_PRS ,0) { |
| 446 | /* DBGO("\\_SB\\LNKA\\_PRS\n") */ |
| 447 | Return(IRQP) |
| 448 | } /* Method(_SB.INTA._PRS) */ |
| 449 | |
| 450 | Method(_CRS ,0) { |
| 451 | /* DBGO("\\_SB\\LNKA\\_CRS\n") */ |
| 452 | CreateWordField(IRQB, 0x1, IRQN) |
| 453 | ShiftLeft(1, PINA, IRQN) |
| 454 | Return(IRQB) |
| 455 | } /* Method(_SB.INTA._CRS) */ |
| 456 | |
| 457 | Method(_SRS, 1) { |
| 458 | /* DBGO("\\_SB\\LNKA\\_CRS\n") */ |
| 459 | CreateWordField(ARG0, 1, IRQM) |
| 460 | |
| 461 | /* Use lowest available IRQ */ |
| 462 | FindSetRightBit(IRQM, Local0) |
| 463 | if (Local0) { |
| 464 | Decrement(Local0) |
| 465 | } |
| 466 | Store(Local0, PINA) |
| 467 | } /* End Method(_SB.INTA._SRS) */ |
| 468 | } /* End Device(INTA) */ |
| 469 | |
| 470 | Device(INTB) { |
| 471 | Name(_HID, EISAID("PNP0C0F")) |
| 472 | Name(_UID, 2) |
| 473 | |
| 474 | Method(_STA, 0) { |
| 475 | if (PINB) { |
| 476 | Return(0x0B) /* sata is invisible */ |
| 477 | } else { |
| 478 | Return(0x09) /* sata is disabled */ |
| 479 | } |
| 480 | } /* End Method(_SB.INTB._STA) */ |
| 481 | |
| 482 | Method(_DIS ,0) { |
| 483 | /* DBGO("\\_SB\\LNKB\\_DIS\n") */ |
| 484 | Store(0, PINB) |
| 485 | } /* End Method(_SB.INTB._DIS) */ |
| 486 | |
| 487 | Method(_PRS ,0) { |
| 488 | /* DBGO("\\_SB\\LNKB\\_PRS\n") */ |
| 489 | Return(IRQP) |
| 490 | } /* Method(_SB.INTB._PRS) */ |
| 491 | |
| 492 | Method(_CRS ,0) { |
| 493 | /* DBGO("\\_SB\\LNKB\\_CRS\n") */ |
| 494 | CreateWordField(IRQB, 0x1, IRQN) |
| 495 | ShiftLeft(1, PINB, IRQN) |
| 496 | Return(IRQB) |
| 497 | } /* Method(_SB.INTB._CRS) */ |
| 498 | |
| 499 | Method(_SRS, 1) { |
| 500 | /* DBGO("\\_SB\\LNKB\\_CRS\n") */ |
| 501 | CreateWordField(ARG0, 1, IRQM) |
| 502 | |
| 503 | /* Use lowest available IRQ */ |
| 504 | FindSetRightBit(IRQM, Local0) |
| 505 | if (Local0) { |
| 506 | Decrement(Local0) |
| 507 | } |
| 508 | Store(Local0, PINB) |
| 509 | } /* End Method(_SB.INTB._SRS) */ |
| 510 | } /* End Device(INTB) */ |
| 511 | |
| 512 | Device(INTC) { |
| 513 | Name(_HID, EISAID("PNP0C0F")) |
| 514 | Name(_UID, 3) |
| 515 | |
| 516 | Method(_STA, 0) { |
| 517 | if (PINC) { |
| 518 | Return(0x0B) /* sata is invisible */ |
| 519 | } else { |
| 520 | Return(0x09) /* sata is disabled */ |
| 521 | } |
| 522 | } /* End Method(_SB.INTC._STA) */ |
| 523 | |
| 524 | Method(_DIS ,0) { |
| 525 | /* DBGO("\\_SB\\LNKC\\_DIS\n") */ |
| 526 | Store(0, PINC) |
| 527 | } /* End Method(_SB.INTC._DIS) */ |
| 528 | |
| 529 | Method(_PRS ,0) { |
| 530 | /* DBGO("\\_SB\\LNKC\\_PRS\n") */ |
| 531 | Return(IRQP) |
| 532 | } /* Method(_SB.INTC._PRS) */ |
| 533 | |
| 534 | Method(_CRS ,0) { |
| 535 | /* DBGO("\\_SB\\LNKC\\_CRS\n") */ |
| 536 | CreateWordField(IRQB, 0x1, IRQN) |
| 537 | ShiftLeft(1, PINC, IRQN) |
| 538 | Return(IRQB) |
| 539 | } /* Method(_SB.INTC._CRS) */ |
| 540 | |
| 541 | Method(_SRS, 1) { |
| 542 | /* DBGO("\\_SB\\LNKC\\_CRS\n") */ |
| 543 | CreateWordField(ARG0, 1, IRQM) |
| 544 | |
| 545 | /* Use lowest available IRQ */ |
| 546 | FindSetRightBit(IRQM, Local0) |
| 547 | if (Local0) { |
| 548 | Decrement(Local0) |
| 549 | } |
| 550 | Store(Local0, PINC) |
| 551 | } /* End Method(_SB.INTC._SRS) */ |
| 552 | } /* End Device(INTC) */ |
| 553 | |
| 554 | Device(INTD) { |
| 555 | Name(_HID, EISAID("PNP0C0F")) |
| 556 | Name(_UID, 4) |
| 557 | |
| 558 | Method(_STA, 0) { |
| 559 | if (PIND) { |
| 560 | Return(0x0B) /* sata is invisible */ |
| 561 | } else { |
| 562 | Return(0x09) /* sata is disabled */ |
| 563 | } |
| 564 | } /* End Method(_SB.INTD._STA) */ |
| 565 | |
| 566 | Method(_DIS ,0) { |
| 567 | /* DBGO("\\_SB\\LNKD\\_DIS\n") */ |
| 568 | Store(0, PIND) |
| 569 | } /* End Method(_SB.INTD._DIS) */ |
| 570 | |
| 571 | Method(_PRS ,0) { |
| 572 | /* DBGO("\\_SB\\LNKD\\_PRS\n") */ |
| 573 | Return(IRQP) |
| 574 | } /* Method(_SB.INTD._PRS) */ |
| 575 | |
| 576 | Method(_CRS ,0) { |
| 577 | /* DBGO("\\_SB\\LNKD\\_CRS\n") */ |
| 578 | CreateWordField(IRQB, 0x1, IRQN) |
| 579 | ShiftLeft(1, PIND, IRQN) |
| 580 | Return(IRQB) |
| 581 | } /* Method(_SB.INTD._CRS) */ |
| 582 | |
| 583 | Method(_SRS, 1) { |
| 584 | /* DBGO("\\_SB\\LNKD\\_CRS\n") */ |
| 585 | CreateWordField(ARG0, 1, IRQM) |
| 586 | |
| 587 | /* Use lowest available IRQ */ |
| 588 | FindSetRightBit(IRQM, Local0) |
| 589 | if (Local0) { |
| 590 | Decrement(Local0) |
| 591 | } |
| 592 | Store(Local0, PIND) |
| 593 | } /* End Method(_SB.INTD._SRS) */ |
| 594 | } /* End Device(INTD) */ |
| 595 | |
| 596 | Device(INTE) { |
| 597 | Name(_HID, EISAID("PNP0C0F")) |
| 598 | Name(_UID, 5) |
| 599 | |
| 600 | Method(_STA, 0) { |
| 601 | if (PINE) { |
| 602 | Return(0x0B) /* sata is invisible */ |
| 603 | } else { |
| 604 | Return(0x09) /* sata is disabled */ |
| 605 | } |
| 606 | } /* End Method(_SB.INTE._STA) */ |
| 607 | |
| 608 | Method(_DIS ,0) { |
| 609 | /* DBGO("\\_SB\\LNKE\\_DIS\n") */ |
| 610 | Store(0, PINE) |
| 611 | } /* End Method(_SB.INTE._DIS) */ |
| 612 | |
| 613 | Method(_PRS ,0) { |
| 614 | /* DBGO("\\_SB\\LNKE\\_PRS\n") */ |
| 615 | Return(IRQP) |
| 616 | } /* Method(_SB.INTE._PRS) */ |
| 617 | |
| 618 | Method(_CRS ,0) { |
| 619 | /* DBGO("\\_SB\\LNKE\\_CRS\n") */ |
| 620 | CreateWordField(IRQB, 0x1, IRQN) |
| 621 | ShiftLeft(1, PINE, IRQN) |
| 622 | Return(IRQB) |
| 623 | } /* Method(_SB.INTE._CRS) */ |
| 624 | |
| 625 | Method(_SRS, 1) { |
| 626 | /* DBGO("\\_SB\\LNKE\\_CRS\n") */ |
| 627 | CreateWordField(ARG0, 1, IRQM) |
| 628 | |
| 629 | /* Use lowest available IRQ */ |
| 630 | FindSetRightBit(IRQM, Local0) |
| 631 | if (Local0) { |
| 632 | Decrement(Local0) |
| 633 | } |
| 634 | Store(Local0, PINE) |
| 635 | } /* End Method(_SB.INTE._SRS) */ |
| 636 | } /* End Device(INTE) */ |
| 637 | |
| 638 | Device(INTF) { |
| 639 | Name(_HID, EISAID("PNP0C0F")) |
| 640 | Name(_UID, 6) |
| 641 | |
| 642 | Method(_STA, 0) { |
| 643 | if (PINF) { |
| 644 | Return(0x0B) /* sata is invisible */ |
| 645 | } else { |
| 646 | Return(0x09) /* sata is disabled */ |
| 647 | } |
| 648 | } /* End Method(_SB.INTF._STA) */ |
| 649 | |
| 650 | Method(_DIS ,0) { |
| 651 | /* DBGO("\\_SB\\LNKF\\_DIS\n") */ |
| 652 | Store(0, PINF) |
| 653 | } /* End Method(_SB.INTF._DIS) */ |
| 654 | |
| 655 | Method(_PRS ,0) { |
| 656 | /* DBGO("\\_SB\\LNKF\\_PRS\n") */ |
| 657 | Return(PITF) |
| 658 | } /* Method(_SB.INTF._PRS) */ |
| 659 | |
| 660 | Method(_CRS ,0) { |
| 661 | /* DBGO("\\_SB\\LNKF\\_CRS\n") */ |
| 662 | CreateWordField(IRQB, 0x1, IRQN) |
| 663 | ShiftLeft(1, PINF, IRQN) |
| 664 | Return(IRQB) |
| 665 | } /* Method(_SB.INTF._CRS) */ |
| 666 | |
| 667 | Method(_SRS, 1) { |
| 668 | /* DBGO("\\_SB\\LNKF\\_CRS\n") */ |
| 669 | CreateWordField(ARG0, 1, IRQM) |
| 670 | |
| 671 | /* Use lowest available IRQ */ |
| 672 | FindSetRightBit(IRQM, Local0) |
| 673 | if (Local0) { |
| 674 | Decrement(Local0) |
| 675 | } |
| 676 | Store(Local0, PINF) |
| 677 | } /* End Method(_SB.INTF._SRS) */ |
| 678 | } /* End Device(INTF) */ |
| 679 | |
| 680 | Device(INTG) { |
| 681 | Name(_HID, EISAID("PNP0C0F")) |
| 682 | Name(_UID, 7) |
| 683 | |
| 684 | Method(_STA, 0) { |
| 685 | if (PING) { |
| 686 | Return(0x0B) /* sata is invisible */ |
| 687 | } else { |
| 688 | Return(0x09) /* sata is disabled */ |
| 689 | } |
| 690 | } /* End Method(_SB.INTG._STA) */ |
| 691 | |
| 692 | Method(_DIS ,0) { |
| 693 | /* DBGO("\\_SB\\LNKG\\_DIS\n") */ |
| 694 | Store(0, PING) |
| 695 | } /* End Method(_SB.INTG._DIS) */ |
| 696 | |
| 697 | Method(_PRS ,0) { |
| 698 | /* DBGO("\\_SB\\LNKG\\_PRS\n") */ |
| 699 | Return(IRQP) |
| 700 | } /* Method(_SB.INTG._CRS) */ |
| 701 | |
| 702 | Method(_CRS ,0) { |
| 703 | /* DBGO("\\_SB\\LNKG\\_CRS\n") */ |
| 704 | CreateWordField(IRQB, 0x1, IRQN) |
| 705 | ShiftLeft(1, PING, IRQN) |
| 706 | Return(IRQB) |
| 707 | } /* Method(_SB.INTG._CRS) */ |
| 708 | |
| 709 | Method(_SRS, 1) { |
| 710 | /* DBGO("\\_SB\\LNKG\\_CRS\n") */ |
| 711 | CreateWordField(ARG0, 1, IRQM) |
| 712 | |
| 713 | /* Use lowest available IRQ */ |
| 714 | FindSetRightBit(IRQM, Local0) |
| 715 | if (Local0) { |
| 716 | Decrement(Local0) |
| 717 | } |
| 718 | Store(Local0, PING) |
| 719 | } /* End Method(_SB.INTG._SRS) */ |
| 720 | } /* End Device(INTG) */ |
| 721 | |
| 722 | Device(INTH) { |
| 723 | Name(_HID, EISAID("PNP0C0F")) |
| 724 | Name(_UID, 8) |
| 725 | |
| 726 | Method(_STA, 0) { |
| 727 | if (PINH) { |
| 728 | Return(0x0B) /* sata is invisible */ |
| 729 | } else { |
| 730 | Return(0x09) /* sata is disabled */ |
| 731 | } |
| 732 | } /* End Method(_SB.INTH._STA) */ |
| 733 | |
| 734 | Method(_DIS ,0) { |
| 735 | /* DBGO("\\_SB\\LNKH\\_DIS\n") */ |
| 736 | Store(0, PINH) |
| 737 | } /* End Method(_SB.INTH._DIS) */ |
| 738 | |
| 739 | Method(_PRS ,0) { |
| 740 | /* DBGO("\\_SB\\LNKH\\_PRS\n") */ |
| 741 | Return(IRQP) |
| 742 | } /* Method(_SB.INTH._CRS) */ |
| 743 | |
| 744 | Method(_CRS ,0) { |
| 745 | /* DBGO("\\_SB\\LNKH\\_CRS\n") */ |
| 746 | CreateWordField(IRQB, 0x1, IRQN) |
| 747 | ShiftLeft(1, PINH, IRQN) |
| 748 | Return(IRQB) |
| 749 | } /* Method(_SB.INTH._CRS) */ |
| 750 | |
| 751 | Method(_SRS, 1) { |
| 752 | /* DBGO("\\_SB\\LNKH\\_CRS\n") */ |
| 753 | CreateWordField(ARG0, 1, IRQM) |
| 754 | |
| 755 | /* Use lowest available IRQ */ |
| 756 | FindSetRightBit(IRQM, Local0) |
| 757 | if (Local0) { |
| 758 | Decrement(Local0) |
| 759 | } |
| 760 | Store(Local0, PINH) |
| 761 | } /* End Method(_SB.INTH._SRS) */ |
| 762 | } /* End Device(INTH) */ |
| 763 | |
| 764 | } /* End Scope(_SB) */ |
| 765 | |
| 766 | |
| 767 | /* Supported sleep states: */ |
| 768 | Name(\_S0, Package () {0x00, 0x00, 0x00, 0x00} ) /* (S0) - working state */ |
| 769 | |
| 770 | If (LAnd(SSFG, 0x01)) { |
| 771 | Name(\_S1, Package () {0x01, 0x01, 0x00, 0x00} ) /* (S1) - sleeping w/CPU context */ |
| 772 | } |
| 773 | If (LAnd(SSFG, 0x02)) { |
| 774 | Name(\_S2, Package () {0x02, 0x02, 0x00, 0x00} ) /* (S2) - "light" Suspend to RAM */ |
| 775 | } |
| 776 | If (LAnd(SSFG, 0x04)) { |
| 777 | Name(\_S3, Package () {0x03, 0x03, 0x00, 0x00} ) /* (S3) - Suspend to RAM */ |
| 778 | } |
| 779 | If (LAnd(SSFG, 0x08)) { |
| 780 | Name(\_S4, Package () {0x04, 0x04, 0x00, 0x00} ) /* (S4) - Suspend to Disk */ |
| 781 | } |
| 782 | |
| 783 | Name(\_S5, Package () {0x05, 0x05, 0x00, 0x00} ) /* (S5) - Soft Off */ |
| 784 | |
| 785 | Name(\_SB.CSPS ,0) /* Current Sleep State (S0, S1, S2, S3, S4, S5) */ |
| 786 | Name(CSMS, 0) /* Current System State */ |
| 787 | |
| 788 | /* Wake status package */ |
| 789 | Name(WKST,Package(){Zero, Zero}) |
| 790 | |
| 791 | /* |
| 792 | * \_PTS - Prepare to Sleep method |
| 793 | * |
| 794 | * Entry: |
| 795 | * Arg0=The value of the sleeping state S1=1, S2=2, etc |
| 796 | * |
| 797 | * Exit: |
| 798 | * -none- |
| 799 | * |
| 800 | * The _PTS control method is executed at the beginning of the sleep process |
| 801 | * for S1-S5. The sleeping value is passed to the _PTS control method. This |
| 802 | * control method may be executed a relatively long time before entering the |
| 803 | * sleep state and the OS may abort the operation without notification to |
| 804 | * the ACPI driver. This method cannot modify the configuration or power |
| 805 | * state of any device in the system. |
| 806 | */ |
| 807 | Method(\_PTS, 1) { |
| 808 | /* DBGO("\\_PTS\n") */ |
| 809 | /* DBGO("From S0 to S") */ |
| 810 | /* DBGO(Arg0) */ |
| 811 | /* DBGO("\n") */ |
| 812 | |
| 813 | /* Don't allow PCIRST# to reset USB */ |
| 814 | if (LEqual(Arg0,3)){ |
| 815 | Store(0,URRE) |
| 816 | } |
| 817 | |
| 818 | /* Clear sleep SMI status flag and enable sleep SMI trap. */ |
| 819 | /*Store(One, CSSM) |
| 820 | Store(One, SSEN)*/ |
| 821 | |
| 822 | /* On older chips, clear PciExpWakeDisEn */ |
| 823 | /*if (LLessEqual(\_SB.SBRI, 0x13)) { |
| 824 | * Store(0,\_SB.PWDE) |
| 825 | *} |
| 826 | */ |
| 827 | |
| 828 | /* Clear wake status structure. */ |
| 829 | Store(0, Index(WKST,0)) |
| 830 | Store(0, Index(WKST,1)) |
| 831 | \_SB.PCI0.SIOS (Arg0) |
| 832 | } /* End Method(\_PTS) */ |
| 833 | |
| 834 | /* |
| 835 | * The following method results in a "not a valid reserved NameSeg" |
| 836 | * warning so I have commented it out for the duration. It isn't |
| 837 | * used, so it could be removed. |
| 838 | * |
| 839 | * |
| 840 | * \_GTS OEM Going To Sleep method |
| 841 | * |
| 842 | * Entry: |
| 843 | * Arg0=The value of the sleeping state S1=1, S2=2 |
| 844 | * |
| 845 | * Exit: |
| 846 | * -none- |
| 847 | * |
| 848 | * Method(\_GTS, 1) { |
| 849 | * DBGO("\\_GTS\n") |
| 850 | * DBGO("From S0 to S") |
| 851 | * DBGO(Arg0) |
| 852 | * DBGO("\n") |
| 853 | * } |
| 854 | */ |
| 855 | |
| 856 | /* |
| 857 | * \_BFS OEM Back From Sleep method |
| 858 | * |
| 859 | * Entry: |
| 860 | * Arg0=The value of the sleeping state S1=1, S2=2 |
| 861 | * |
| 862 | * Exit: |
| 863 | * -none- |
| 864 | */ |
| 865 | Method(\_BFS, 1) { |
| 866 | /* DBGO("\\_BFS\n") */ |
| 867 | /* DBGO("From S") */ |
| 868 | /* DBGO(Arg0) */ |
| 869 | /* DBGO(" to S0\n") */ |
| 870 | } |
| 871 | |
| 872 | /* |
| 873 | * \_WAK System Wake method |
| 874 | * |
| 875 | * Entry: |
| 876 | * Arg0=The value of the sleeping state S1=1, S2=2 |
| 877 | * |
| 878 | * Exit: |
| 879 | * Return package of 2 DWords |
| 880 | * Dword 1 - Status |
| 881 | * 0x00000000 wake succeeded |
| 882 | * 0x00000001 Wake was signaled but failed due to lack of power |
| 883 | * 0x00000002 Wake was signaled but failed due to thermal condition |
| 884 | * Dword 2 - Power Supply state |
| 885 | * if non-zero the effective S-state the power supply entered |
| 886 | */ |
| 887 | Method(\_WAK, 1) { |
| 888 | /* DBGO("\\_WAK\n") */ |
| 889 | /* DBGO("From S") */ |
| 890 | /* DBGO(Arg0) */ |
| 891 | /* DBGO(" to S0\n") */ |
| 892 | |
| 893 | /* Re-enable HPET */ |
| 894 | Store(1,HPDE) |
| 895 | |
| 896 | /* Restore PCIRST# so it resets USB */ |
| 897 | if (LEqual(Arg0,3)){ |
| 898 | Store(1,URRE) |
| 899 | } |
| 900 | |
| 901 | /* Arbitrarily clear PciExpWakeStatus */ |
Martin Roth | f77516c | 2015-12-08 14:00:07 -0700 | [diff] [blame] | 902 | Store(PWST, Local1) |
| 903 | Store(Local1, PWST) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 904 | |
| 905 | /* if(DeRefOf(Index(WKST,0))) { |
| 906 | * Store(0, Index(WKST,1)) |
| 907 | * } else { |
| 908 | * Store(Arg0, Index(WKST,1)) |
| 909 | * } |
| 910 | */ |
| 911 | \_SB.PCI0.SIOW (Arg0) |
| 912 | Return(WKST) |
| 913 | } /* End Method(\_WAK) */ |
| 914 | |
| 915 | Scope(\_GPE) { /* Start Scope GPE */ |
| 916 | /* General event 0 */ |
| 917 | /* Method(_L00) { |
| 918 | * DBGO("\\_GPE\\_L00\n") |
| 919 | * } |
| 920 | */ |
| 921 | |
| 922 | /* General event 1 */ |
| 923 | /* Method(_L01) { |
| 924 | * DBGO("\\_GPE\\_L00\n") |
| 925 | * } |
| 926 | */ |
| 927 | |
| 928 | /* General event 2 */ |
| 929 | /* Method(_L02) { |
| 930 | * DBGO("\\_GPE\\_L00\n") |
| 931 | * } |
| 932 | */ |
| 933 | |
| 934 | /* General event 3 */ |
| 935 | Method(_L03) { |
| 936 | /* DBGO("\\_GPE\\_L00\n") */ |
| 937 | Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 938 | } |
| 939 | |
| 940 | /* General event 4 */ |
| 941 | /* Method(_L04) { |
| 942 | * DBGO("\\_GPE\\_L00\n") |
| 943 | * } |
| 944 | */ |
| 945 | |
| 946 | /* General event 5 */ |
| 947 | /* Method(_L05) { |
| 948 | * DBGO("\\_GPE\\_L00\n") |
| 949 | * } |
| 950 | */ |
| 951 | |
| 952 | /* General event 6 - Used for GPM6, moved to USB.asl */ |
| 953 | /* Method(_L06) { |
| 954 | * DBGO("\\_GPE\\_L00\n") |
| 955 | * } |
| 956 | */ |
| 957 | |
| 958 | /* General event 7 - Used for GPM7, moved to USB.asl */ |
| 959 | /* Method(_L07) { |
| 960 | * DBGO("\\_GPE\\_L07\n") |
| 961 | * } |
| 962 | */ |
| 963 | |
| 964 | /* Legacy PM event */ |
| 965 | Method(_L08) { |
| 966 | /* DBGO("\\_GPE\\_L08\n") */ |
| 967 | } |
| 968 | |
| 969 | /* Temp warning (TWarn) event */ |
| 970 | Method(_L09) { |
| 971 | /* DBGO("\\_GPE\\_L09\n") */ |
| 972 | Notify (\_TZ.TZ00, 0x80) |
| 973 | } |
| 974 | |
| 975 | /* Reserved */ |
| 976 | /* Method(_L0A) { |
| 977 | * DBGO("\\_GPE\\_L0A\n") |
| 978 | * } |
| 979 | */ |
| 980 | |
| 981 | /* USB controller PME# */ |
| 982 | Method(_L0B) { |
| 983 | /* DBGO("\\_GPE\\_L0B\n") */ |
| 984 | Notify(\_SB.PCI0.UOH1, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 985 | Notify(\_SB.PCI0.UOH2, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 986 | Notify(\_SB.PCI0.UOH3, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 987 | Notify(\_SB.PCI0.UOH4, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 988 | Notify(\_SB.PCI0.UOH5, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 989 | Notify(\_SB.PCI0.UEH1, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 990 | Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 991 | } |
| 992 | |
| 993 | /* AC97 controller PME# */ |
| 994 | /* Method(_L0C) { |
| 995 | * DBGO("\\_GPE\\_L0C\n") |
| 996 | * } |
| 997 | */ |
| 998 | |
| 999 | /* OtherTherm PME# */ |
| 1000 | /* Method(_L0D) { |
| 1001 | * DBGO("\\_GPE\\_L0D\n") |
| 1002 | * } |
| 1003 | */ |
| 1004 | |
| 1005 | /* GPM9 SCI event - Moved to USB.asl */ |
| 1006 | /* Method(_L0E) { |
| 1007 | * DBGO("\\_GPE\\_L0E\n") |
| 1008 | * } |
| 1009 | */ |
| 1010 | |
| 1011 | /* PCIe HotPlug event */ |
| 1012 | /* Method(_L0F) { |
| 1013 | * DBGO("\\_GPE\\_L0F\n") |
| 1014 | * } |
| 1015 | */ |
| 1016 | |
| 1017 | /* ExtEvent0 SCI event */ |
| 1018 | Method(_L10) { |
| 1019 | /* DBGO("\\_GPE\\_L10\n") */ |
| 1020 | } |
| 1021 | |
| 1022 | |
| 1023 | /* ExtEvent1 SCI event */ |
| 1024 | Method(_L11) { |
| 1025 | /* DBGO("\\_GPE\\_L11\n") */ |
| 1026 | } |
| 1027 | |
| 1028 | /* PCIe PME# event */ |
| 1029 | /* Method(_L12) { |
| 1030 | * DBGO("\\_GPE\\_L12\n") |
| 1031 | * } |
| 1032 | */ |
| 1033 | |
| 1034 | /* GPM0 SCI event - Moved to USB.asl */ |
| 1035 | /* Method(_L13) { |
| 1036 | * DBGO("\\_GPE\\_L13\n") |
| 1037 | * } |
| 1038 | */ |
| 1039 | |
| 1040 | /* GPM1 SCI event - Moved to USB.asl */ |
| 1041 | /* Method(_L14) { |
| 1042 | * DBGO("\\_GPE\\_L14\n") |
| 1043 | * } |
| 1044 | */ |
| 1045 | |
| 1046 | /* GPM2 SCI event - Moved to USB.asl */ |
| 1047 | /* Method(_L15) { |
| 1048 | * DBGO("\\_GPE\\_L15\n") |
| 1049 | * } |
| 1050 | */ |
| 1051 | |
| 1052 | /* GPM3 SCI event - Moved to USB.asl */ |
| 1053 | /* Method(_L16) { |
| 1054 | * DBGO("\\_GPE\\_L16\n") |
| 1055 | * } |
| 1056 | */ |
| 1057 | |
| 1058 | /* GPM8 SCI event - Moved to USB.asl */ |
| 1059 | /* Method(_L17) { |
| 1060 | * DBGO("\\_GPE\\_L17\n") |
| 1061 | * } |
| 1062 | */ |
| 1063 | |
| 1064 | /* GPIO0 or GEvent8 event */ |
| 1065 | Method(_L18) { |
| 1066 | /* DBGO("\\_GPE\\_L18\n") */ |
| 1067 | Notify(\_SB.PCI0.PBR2, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1068 | Notify(\_SB.PCI0.PBR4, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1069 | Notify(\_SB.PCI0.PBR5, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1070 | Notify(\_SB.PCI0.PBR6, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1071 | Notify(\_SB.PCI0.PBR7, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1072 | Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1073 | } |
| 1074 | |
| 1075 | /* GPM4 SCI event - Moved to USB.asl */ |
| 1076 | /* Method(_L19) { |
| 1077 | * DBGO("\\_GPE\\_L19\n") |
| 1078 | * } |
| 1079 | */ |
| 1080 | |
| 1081 | /* GPM5 SCI event - Moved to USB.asl */ |
| 1082 | /* Method(_L1A) { |
| 1083 | * DBGO("\\_GPE\\_L1A\n") |
| 1084 | * } |
| 1085 | */ |
| 1086 | |
| 1087 | /* Azalia SCI event */ |
| 1088 | Method(_L1B) { |
| 1089 | /* DBGO("\\_GPE\\_L1B\n") */ |
| 1090 | Notify(\_SB.PCI0.AZHD, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1091 | Notify(\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */ |
| 1092 | } |
| 1093 | |
| 1094 | /* GPM6 SCI event - Reassigned to _L06 */ |
| 1095 | /* Method(_L1C) { |
| 1096 | * DBGO("\\_GPE\\_L1C\n") |
| 1097 | * } |
| 1098 | */ |
| 1099 | |
| 1100 | /* GPM7 SCI event - Reassigned to _L07 */ |
| 1101 | /* Method(_L1D) { |
| 1102 | * DBGO("\\_GPE\\_L1D\n") |
| 1103 | * } |
| 1104 | */ |
| 1105 | |
| 1106 | /* GPIO2 or GPIO66 SCI event */ |
| 1107 | /* Method(_L1E) { |
| 1108 | * DBGO("\\_GPE\\_L1E\n") |
| 1109 | * } |
| 1110 | */ |
| 1111 | |
| 1112 | /* SATA SCI event - Moved to sata.asl */ |
| 1113 | /* Method(_L1F) { |
| 1114 | * DBGO("\\_GPE\\_L1F\n") |
| 1115 | * } |
| 1116 | */ |
| 1117 | |
| 1118 | } /* End Scope GPE */ |
| 1119 | |
Patrick Georgi | af97d33 | 2010-02-08 15:46:37 +0000 | [diff] [blame] | 1120 | #include "acpi/usb.asl" |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1121 | |
| 1122 | /* South Bridge */ |
| 1123 | Scope(\_SB) { /* Start \_SB scope */ |
Patrick Georgi | 91bd306 | 2012-02-16 19:16:14 +0100 | [diff] [blame] | 1124 | #include <arch/x86/acpi/globutil.asl> /* global utility methods expected within the \_SB scope */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1125 | |
| 1126 | /* _SB.PCI0 */ |
| 1127 | /* Note: Only need HID on Primary Bus */ |
| 1128 | Device(PCI0) { |
| 1129 | External (TOM1) |
Tobias Diedrich | e0c0a82 | 2010-11-17 11:02:05 +0000 | [diff] [blame] | 1130 | External (TOM2) /* (<real tom2> >> 20) to make it fit into 32 bit for XP */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1131 | Name(_HID, EISAID("PNP0A03")) |
| 1132 | Name(_ADR, 0x00180000) /* Dev# = BSP Dev#, Func# = 0 */ |
| 1133 | Method(_BBN, 0) { /* Bus number = 0 */ |
| 1134 | Return(0) |
| 1135 | } |
| 1136 | Method(_STA, 0) { |
| 1137 | /* DBGO("\\_SB\\PCI0\\_STA\n") */ |
| 1138 | Return(0x0B) /* Status is visible */ |
| 1139 | } |
| 1140 | |
| 1141 | Method(_PRT,0) { |
| 1142 | If(PMOD){ Return(APR0) } /* APIC mode */ |
| 1143 | Return (PR0) /* PIC Mode */ |
| 1144 | } /* end _PRT */ |
| 1145 | |
| 1146 | /* Describe the Northbridge devices */ |
| 1147 | Device(AMRT) { |
| 1148 | Name(_ADR, 0x00000000) |
| 1149 | } /* end AMRT */ |
| 1150 | |
| 1151 | /* The internal GFX bridge */ |
| 1152 | Device(AGPB) { |
| 1153 | Name(_ADR, 0x00010000) |
| 1154 | Name(_PRW, Package() {0x18, 4}) |
| 1155 | Method(_PRT,0) { |
| 1156 | Return (APR1) |
| 1157 | } |
| 1158 | } /* end AGPB */ |
| 1159 | |
| 1160 | /* The external GFX bridge */ |
| 1161 | Device(PBR2) { |
| 1162 | Name(_ADR, 0x00020000) |
| 1163 | Name(_PRW, Package() {0x18, 4}) |
| 1164 | Method(_PRT,0) { |
| 1165 | If(PMOD){ Return(APS2) } /* APIC mode */ |
| 1166 | Return (PS2) /* PIC Mode */ |
| 1167 | } /* end _PRT */ |
| 1168 | } /* end PBR2 */ |
| 1169 | |
| 1170 | /* Dev3 is also an external GFX bridge, not used in Herring */ |
| 1171 | |
| 1172 | Device(PBR4) { |
| 1173 | Name(_ADR, 0x00040000) |
| 1174 | Name(_PRW, Package() {0x18, 4}) |
| 1175 | Method(_PRT,0) { |
| 1176 | If(PMOD){ Return(APS4) } /* APIC mode */ |
| 1177 | Return (PS4) /* PIC Mode */ |
| 1178 | } /* end _PRT */ |
| 1179 | } /* end PBR4 */ |
| 1180 | |
| 1181 | Device(PBR5) { |
| 1182 | Name(_ADR, 0x00050000) |
| 1183 | Name(_PRW, Package() {0x18, 4}) |
| 1184 | Method(_PRT,0) { |
| 1185 | If(PMOD){ Return(APS5) } /* APIC mode */ |
| 1186 | Return (PS5) /* PIC Mode */ |
| 1187 | } /* end _PRT */ |
| 1188 | } /* end PBR5 */ |
| 1189 | |
| 1190 | Device(PBR6) { |
| 1191 | Name(_ADR, 0x00060000) |
| 1192 | Name(_PRW, Package() {0x18, 4}) |
| 1193 | Method(_PRT,0) { |
| 1194 | If(PMOD){ Return(APS6) } /* APIC mode */ |
| 1195 | Return (PS6) /* PIC Mode */ |
| 1196 | } /* end _PRT */ |
| 1197 | } /* end PBR6 */ |
| 1198 | |
| 1199 | /* The onboard EtherNet chip */ |
| 1200 | Device(PBR7) { |
| 1201 | Name(_ADR, 0x00070000) |
| 1202 | Name(_PRW, Package() {0x18, 4}) |
| 1203 | Method(_PRT,0) { |
| 1204 | If(PMOD){ Return(APS7) } /* APIC mode */ |
| 1205 | Return (PS7) /* PIC Mode */ |
| 1206 | } /* end _PRT */ |
| 1207 | } /* end PBR7 */ |
| 1208 | |
| 1209 | |
| 1210 | /* PCI slot 1, 2, 3 */ |
| 1211 | Device(PIBR) { |
| 1212 | Name(_ADR, 0x00140004) |
| 1213 | Name(_PRW, Package() {0x18, 4}) |
| 1214 | |
| 1215 | Method(_PRT, 0) { |
| 1216 | Return (PCIB) |
| 1217 | } |
| 1218 | } |
| 1219 | |
| 1220 | /* Describe the Southbridge devices */ |
| 1221 | Device(STCR) { |
| 1222 | Name(_ADR, 0x00120000) |
Patrick Georgi | af97d33 | 2010-02-08 15:46:37 +0000 | [diff] [blame] | 1223 | #include "acpi/sata.asl" |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1224 | } /* end STCR */ |
| 1225 | |
| 1226 | Device(UOH1) { |
| 1227 | Name(_ADR, 0x00130000) |
| 1228 | Name(_PRW, Package() {0x0B, 3}) |
| 1229 | } /* end UOH1 */ |
| 1230 | |
| 1231 | Device(UOH2) { |
| 1232 | Name(_ADR, 0x00130001) |
| 1233 | Name(_PRW, Package() {0x0B, 3}) |
| 1234 | } /* end UOH2 */ |
| 1235 | |
| 1236 | Device(UOH3) { |
| 1237 | Name(_ADR, 0x00130002) |
| 1238 | Name(_PRW, Package() {0x0B, 3}) |
| 1239 | } /* end UOH3 */ |
| 1240 | |
| 1241 | Device(UOH4) { |
| 1242 | Name(_ADR, 0x00130003) |
| 1243 | Name(_PRW, Package() {0x0B, 3}) |
| 1244 | } /* end UOH4 */ |
| 1245 | |
| 1246 | Device(UOH5) { |
| 1247 | Name(_ADR, 0x00130004) |
| 1248 | Name(_PRW, Package() {0x0B, 3}) |
| 1249 | } /* end UOH5 */ |
| 1250 | |
| 1251 | Device(UEH1) { |
| 1252 | Name(_ADR, 0x00130005) |
| 1253 | Name(_PRW, Package() {0x0B, 3}) |
| 1254 | } /* end UEH1 */ |
| 1255 | |
| 1256 | Device(SBUS) { |
| 1257 | Name(_ADR, 0x00140000) |
| 1258 | } /* end SBUS */ |
| 1259 | |
| 1260 | /* Primary (and only) IDE channel */ |
| 1261 | Device(IDEC) { |
| 1262 | Name(_ADR, 0x00140001) |
Patrick Georgi | af97d33 | 2010-02-08 15:46:37 +0000 | [diff] [blame] | 1263 | #include "acpi/ide.asl" |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1264 | } /* end IDEC */ |
| 1265 | |
| 1266 | Device(AZHD) { |
| 1267 | Name(_ADR, 0x00140002) |
| 1268 | OperationRegion(AZPD, PCI_Config, 0x00, 0x100) |
| 1269 | Field(AZPD, AnyAcc, NoLock, Preserve) { |
| 1270 | offset (0x42), |
| 1271 | NSDI, 1, |
| 1272 | NSDO, 1, |
| 1273 | NSEN, 1, |
| 1274 | offset (0x44), |
| 1275 | IPCR, 4, |
| 1276 | offset (0x54), |
| 1277 | PWST, 2, |
| 1278 | , 6, |
| 1279 | PMEB, 1, |
| 1280 | , 6, |
| 1281 | PMST, 1, |
| 1282 | offset (0x62), |
| 1283 | MMCR, 1, |
| 1284 | offset (0x64), |
| 1285 | MMLA, 32, |
| 1286 | offset (0x68), |
| 1287 | MMHA, 32, |
| 1288 | offset (0x6C), |
| 1289 | MMDT, 16, |
| 1290 | } |
| 1291 | |
| 1292 | Method(_INI) { |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 1293 | If(LEqual(OSVR,3)){ /* If we are running Linux */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1294 | Store(zero, NSEN) |
| 1295 | Store(one, NSDO) |
| 1296 | Store(one, NSDI) |
| 1297 | } |
| 1298 | } |
| 1299 | } /* end AZHD */ |
| 1300 | |
| 1301 | Device(LIBR) { |
| 1302 | Name(_ADR, 0x00140003) |
| 1303 | /* Method(_INI) { |
| 1304 | * DBGO("\\_SB\\PCI0\\LpcIsaBr\\_INI\n") |
| 1305 | } */ /* End Method(_SB.SBRDG._INI) */ |
| 1306 | |
| 1307 | /* Real Time Clock Device */ |
| 1308 | Device(RTC0) { |
Scott Duplichan | 6018e1b | 2010-11-07 20:11:39 +0000 | [diff] [blame] | 1309 | Name(_HID, EISAID("PNP0B00")) /* AT Real Time Clock (not PIIX4 compatible) */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1310 | Name(_CRS, ResourceTemplate() { |
| 1311 | IRQNoFlags(){8} |
| 1312 | IO(Decode16,0x0070, 0x0070, 0, 2) |
| 1313 | /* IO(Decode16,0x0070, 0x0070, 0, 4) */ |
| 1314 | }) |
| 1315 | } /* End Device(_SB.PCI0.LpcIsaBr.RTC0) */ |
| 1316 | |
| 1317 | Device(TMR) { /* Timer */ |
| 1318 | Name(_HID,EISAID("PNP0100")) /* System Timer */ |
| 1319 | Name(_CRS, ResourceTemplate() { |
| 1320 | IRQNoFlags(){0} |
| 1321 | IO(Decode16, 0x0040, 0x0040, 0, 4) |
| 1322 | /* IO(Decode16, 0x0048, 0x0048, 0, 4) */ |
| 1323 | }) |
| 1324 | } /* End Device(_SB.PCI0.LpcIsaBr.TMR) */ |
| 1325 | |
| 1326 | Device(SPKR) { /* Speaker */ |
| 1327 | Name(_HID,EISAID("PNP0800")) /* AT style speaker */ |
| 1328 | Name(_CRS, ResourceTemplate() { |
| 1329 | IO(Decode16, 0x0061, 0x0061, 0, 1) |
| 1330 | }) |
| 1331 | } /* End Device(_SB.PCI0.LpcIsaBr.SPKR) */ |
| 1332 | |
| 1333 | Device(PIC) { |
| 1334 | Name(_HID,EISAID("PNP0000")) /* AT Interrupt Controller */ |
| 1335 | Name(_CRS, ResourceTemplate() { |
| 1336 | IRQNoFlags(){2} |
| 1337 | IO(Decode16,0x0020, 0x0020, 0, 2) |
| 1338 | IO(Decode16,0x00A0, 0x00A0, 0, 2) |
| 1339 | /* IO(Decode16, 0x00D0, 0x00D0, 0x10, 0x02) */ |
| 1340 | /* IO(Decode16, 0x04D0, 0x04D0, 0x10, 0x02) */ |
| 1341 | }) |
| 1342 | } /* End Device(_SB.PCI0.LpcIsaBr.PIC) */ |
| 1343 | |
| 1344 | Device(MAD) { /* 8257 DMA */ |
| 1345 | Name(_HID,EISAID("PNP0200")) /* Hardware Device ID */ |
| 1346 | Name(_CRS, ResourceTemplate() { |
| 1347 | DMA(Compatibility,BusMaster,Transfer8){4} |
| 1348 | IO(Decode16, 0x0000, 0x0000, 0x10, 0x10) |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1349 | IO(Decode16, 0x0081, 0x0081, 0x01, 0x03) |
| 1350 | IO(Decode16, 0x0087, 0x0087, 0x01, 0x01) |
| 1351 | IO(Decode16, 0x0089, 0x0089, 0x01, 0x03) |
| 1352 | IO(Decode16, 0x008F, 0x008F, 0x01, 0x01) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1353 | IO(Decode16, 0x00C0, 0x00C0, 0x10, 0x20) |
| 1354 | }) /* End Name(_SB.PCI0.LpcIsaBr.MAD._CRS) */ |
| 1355 | } /* End Device(_SB.PCI0.LpcIsaBr.MAD) */ |
| 1356 | |
| 1357 | Device(COPR) { |
| 1358 | Name(_HID,EISAID("PNP0C04")) /* Math Coprocessor */ |
| 1359 | Name(_CRS, ResourceTemplate() { |
| 1360 | IO(Decode16, 0x00F0, 0x00F0, 0, 0x10) |
| 1361 | IRQNoFlags(){13} |
| 1362 | }) |
| 1363 | } /* End Device(_SB.PCI0.LpcIsaBr.COPR) */ |
| 1364 | |
Martin Roth | 1e1c7ac | 2015-12-10 08:19:27 -0700 | [diff] [blame] | 1365 | Device(HPTM) { /* HPET */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1366 | Name(_HID,EISAID("PNP0103")) |
| 1367 | Name(CRS,ResourceTemplate() { |
Martin Roth | 1e1c7ac | 2015-12-10 08:19:27 -0700 | [diff] [blame] | 1368 | Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, 0x00000400, HPT) /* 1kb reserved space */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1369 | }) |
| 1370 | Method(_STA, 0) { |
Martin Roth | 1e1c7ac | 2015-12-10 08:19:27 -0700 | [diff] [blame] | 1371 | Return(0x0F) /* HPET is visible */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1372 | } |
| 1373 | Method(_CRS, 0) { |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1374 | Return(CRS) |
| 1375 | } |
Martin Roth | 1e1c7ac | 2015-12-10 08:19:27 -0700 | [diff] [blame] | 1376 | } /* End Device(_SB.PCI0.LpcIsaBr.HPTM) */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1377 | } /* end LIBR */ |
| 1378 | |
| 1379 | Device(HPBR) { |
| 1380 | Name(_ADR, 0x00140004) |
| 1381 | } /* end HostPciBr */ |
| 1382 | |
| 1383 | Device(ACAD) { |
| 1384 | Name(_ADR, 0x00140005) |
| 1385 | } /* end Ac97audio */ |
| 1386 | |
| 1387 | Device(ACMD) { |
| 1388 | Name(_ADR, 0x00140006) |
| 1389 | } /* end Ac97modem */ |
| 1390 | |
| 1391 | /* ITE IT8712F Support */ |
| 1392 | OperationRegion (IOID, SystemIO, 0x2E, 0x02) /* sometimes it is 0x4E */ |
| 1393 | Field (IOID, ByteAcc, NoLock, Preserve) |
| 1394 | { |
| 1395 | SIOI, 8, SIOD, 8 /* 0x2E and 0x2F */ |
| 1396 | } |
| 1397 | |
| 1398 | IndexField (SIOI, SIOD, ByteAcc, NoLock, Preserve) |
| 1399 | { |
| 1400 | Offset (0x07), |
| 1401 | LDN, 8, /* Logical Device Number */ |
| 1402 | Offset (0x20), |
| 1403 | CID1, 8, /* Chip ID Byte 1, 0x87 */ |
| 1404 | CID2, 8, /* Chip ID Byte 2, 0x12 */ |
| 1405 | Offset (0x30), |
| 1406 | ACTR, 8, /* Function activate */ |
| 1407 | Offset (0xF0), |
| 1408 | APC0, 8, /* APC/PME Event Enable Register */ |
| 1409 | APC1, 8, /* APC/PME Status Register */ |
| 1410 | APC2, 8, /* APC/PME Control Register 1 */ |
| 1411 | APC3, 8, /* Environment Controller Special Configuration Register */ |
| 1412 | APC4, 8 /* APC/PME Control Register 2 */ |
| 1413 | } |
| 1414 | |
| 1415 | /* Enter the IT8712F MB PnP Mode */ |
| 1416 | Method (EPNP) |
| 1417 | { |
| 1418 | Store(0x87, SIOI) |
| 1419 | Store(0x01, SIOI) |
| 1420 | Store(0x55, SIOI) |
| 1421 | Store(0x55, SIOI) /* IT8712F magic number */ |
| 1422 | } |
| 1423 | /* Exit the IT8712F MB PnP Mode */ |
| 1424 | Method (XPNP) |
| 1425 | { |
| 1426 | Store (0x02, SIOI) |
| 1427 | Store (0x02, SIOD) |
| 1428 | } |
| 1429 | |
| 1430 | /* |
| 1431 | * Keyboard PME is routed to SB600 Gevent3. We can wake |
| 1432 | * up the system by pressing the key. |
| 1433 | */ |
| 1434 | Method (SIOS, 1) |
| 1435 | { |
| 1436 | /* We only enable KBD PME for S5. */ |
| 1437 | If (LLess (Arg0, 0x05)) |
| 1438 | { |
| 1439 | EPNP() |
| 1440 | /* DBGO("IT8712F\n") */ |
| 1441 | |
| 1442 | Store (0x4, LDN) |
| 1443 | Store (One, ACTR) /* Enable EC */ |
| 1444 | /* |
| 1445 | Store (0x4, LDN) |
| 1446 | Store (0x04, APC4) |
| 1447 | */ /* falling edge. which mode? Not sure. */ |
| 1448 | |
| 1449 | Store (0x4, LDN) |
| 1450 | Store (0x08, APC1) /* clear PME status, Use 0x18 for mouse & KBD */ |
| 1451 | Store (0x4, LDN) |
| 1452 | Store (0x08, APC0) /* enable PME, Use 0x18 for mouse & KBD */ |
| 1453 | |
| 1454 | XPNP() |
| 1455 | } |
| 1456 | } |
| 1457 | Method (SIOW, 1) |
| 1458 | { |
| 1459 | EPNP() |
| 1460 | Store (0x4, LDN) |
| 1461 | Store (Zero, APC0) /* disable keyboard PME */ |
| 1462 | Store (0x4, LDN) |
| 1463 | Store (0xFF, APC1) /* clear keyboard PME status */ |
| 1464 | XPNP() |
| 1465 | } |
| 1466 | |
| 1467 | Name(CRES, ResourceTemplate() { |
| 1468 | IO(Decode16, 0x0CF8, 0x0CF8, 1, 8) |
| 1469 | |
| 1470 | WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 1471 | 0x0000, /* address granularity */ |
| 1472 | 0x0000, /* range minimum */ |
| 1473 | 0x0CF7, /* range maximum */ |
| 1474 | 0x0000, /* translation */ |
| 1475 | 0x0CF8 /* length */ |
| 1476 | ) |
| 1477 | |
| 1478 | WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 1479 | 0x0000, /* address granularity */ |
| 1480 | 0x0D00, /* range minimum */ |
| 1481 | 0xFFFF, /* range maximum */ |
| 1482 | 0x0000, /* translation */ |
| 1483 | 0xF300 /* length */ |
| 1484 | ) |
| 1485 | |
| 1486 | Memory32Fixed(READWRITE, 0, 0xA0000, BSMM) |
| 1487 | Memory32Fixed(READONLY, 0x000A0000, 0x00020000, VGAM) /* VGA memory space */ |
| 1488 | Memory32Fixed(READONLY, 0x000C0000, 0x00020000, EMM1) /* Assume C0000-E0000 empty */ |
| 1489 | Memory32Fixed(READONLY, 0x000E0000, 0x00020000, RDBS) /* BIOS ROM area */ |
| 1490 | |
| 1491 | /* DRAM Memory from 1MB to TopMem */ |
| 1492 | Memory32Fixed(READWRITE, 0x00100000, 0, DMLO) /* 1MB to TopMem */ |
| 1493 | |
| 1494 | /* BIOS space just below 4GB */ |
| 1495 | DWORDMemory( |
| 1496 | ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
| 1497 | 0x00, /* Granularity */ |
| 1498 | 0x00000000, /* Min */ |
| 1499 | 0x00000000, /* Max */ |
| 1500 | 0x00000000, /* Translation */ |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1501 | 0x00000001, /* Max-Min, RLEN */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1502 | ,, |
| 1503 | PCBM |
| 1504 | ) |
| 1505 | |
| 1506 | /* DRAM memory from 4GB to TopMem2 */ |
| 1507 | QWORDMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1508 | 0x00000000, /* Granularity */ |
| 1509 | 0x00000000, /* Min */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1510 | 0x00000000, /* Max */ |
| 1511 | 0x00000000, /* Translation */ |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1512 | 0x00000001, /* Max-Min, RLEN */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1513 | ,, |
| 1514 | DMHI |
| 1515 | ) |
| 1516 | |
| 1517 | /* BIOS space just below 16EB */ |
| 1518 | QWORDMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1519 | 0x00000000, /* Granularity */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1520 | 0x00000000, /* Min */ |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1521 | 0x00000000, /* Max */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1522 | 0x00000000, /* Translation */ |
Stefan Reinauer | 36de042 | 2010-05-21 20:40:38 +0000 | [diff] [blame] | 1523 | 0x00000001, /* Max-Min, RLEN */ |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1524 | ,, |
| 1525 | PEBM |
| 1526 | ) |
| 1527 | |
| 1528 | }) /* End Name(_SB.PCI0.CRES) */ |
| 1529 | |
| 1530 | Method(_CRS, 0) { |
| 1531 | /* DBGO("\\_SB\\PCI0\\_CRS\n") */ |
| 1532 | |
| 1533 | CreateDWordField(CRES, ^EMM1._BAS, EM1B) |
| 1534 | CreateDWordField(CRES, ^EMM1._LEN, EM1L) |
| 1535 | CreateDWordField(CRES, ^DMLO._BAS, DMLB) |
| 1536 | CreateDWordField(CRES, ^DMLO._LEN, DMLL) |
| 1537 | CreateDWordField(CRES, ^PCBM._MIN, PBMB) |
| 1538 | CreateDWordField(CRES, ^PCBM._LEN, PBML) |
| 1539 | |
| 1540 | CreateQWordField(CRES, ^DMHI._MIN, DMHB) |
| 1541 | CreateQWordField(CRES, ^DMHI._LEN, DMHL) |
| 1542 | CreateQWordField(CRES, ^PEBM._MIN, EBMB) |
| 1543 | CreateQWordField(CRES, ^PEBM._LEN, EBML) |
| 1544 | |
| 1545 | If(LGreater(LOMH, 0xC0000)){ |
| 1546 | Store(0xC0000, EM1B) /* Hole above C0000 and below E0000 */ |
| 1547 | Subtract(LOMH, 0xC0000, EM1L) /* subtract start, assumes allocation from C0000 going up */ |
| 1548 | } |
| 1549 | |
| 1550 | /* Set size of memory from 1MB to TopMem */ |
| 1551 | Subtract(TOM1, 0x100000, DMLL) |
| 1552 | |
| 1553 | /* |
| 1554 | * If(LNotEqual(TOM2, 0x00000000)){ |
| 1555 | * Store(0x100000000,DMHB) DRAM from 4GB to TopMem2 |
Tobias Diedrich | e0c0a82 | 2010-11-17 11:02:05 +0000 | [diff] [blame] | 1556 | * ShiftLeft(TOM2, 20, Local0) |
| 1557 | * Subtract(Local0, 0x100000000, DMHL) |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1558 | * } |
| 1559 | */ |
| 1560 | |
| 1561 | /* If there is no memory above 4GB, put the BIOS just below 4GB */ |
| 1562 | If(LEqual(TOM2, 0x00000000)){ |
| 1563 | Store(PBAD,PBMB) /* Reserve the "BIOS" space */ |
| 1564 | Store(PBLN,PBML) |
| 1565 | } |
| 1566 | Else { /* Otherwise, put the BIOS just below 16EB */ |
| 1567 | ShiftLeft(PBAD,16,EBMB) /* Reserve the "BIOS" space */ |
| 1568 | Store(PBLN,EBML) |
| 1569 | } |
| 1570 | |
| 1571 | Return(CRES) /* note to change the Name buffer */ |
| 1572 | } /* end of Method(_SB.PCI0._CRS) */ |
| 1573 | |
| 1574 | /* |
| 1575 | * |
| 1576 | * FIRST METHOD CALLED UPON BOOT |
| 1577 | * |
| 1578 | * 1. If debugging, print current OS and ACPI interpreter. |
| 1579 | * 2. Get PCI Interrupt routing from ACPI VSM, this |
| 1580 | * value is based on user choice in BIOS setup. |
| 1581 | */ |
| 1582 | Method(_INI, 0) { |
| 1583 | /* DBGO("\\_SB\\_INI\n") */ |
| 1584 | /* DBGO(" DSDT.ASL code from ") */ |
| 1585 | /* DBGO(__DATE__) */ |
| 1586 | /* DBGO(" ") */ |
| 1587 | /* DBGO(__TIME__) */ |
| 1588 | /* DBGO("\n Sleep states supported: ") */ |
| 1589 | /* DBGO("\n") */ |
| 1590 | /* DBGO(" \\_OS=") */ |
| 1591 | /* DBGO(\_OS) */ |
| 1592 | /* DBGO("\n \\_REV=") */ |
| 1593 | /* DBGO(\_REV) */ |
| 1594 | /* DBGO("\n") */ |
| 1595 | |
| 1596 | /* Determine the OS we're running on */ |
Edward O'Callaghan | f7d8f09 | 2014-05-31 13:57:52 +1000 | [diff] [blame] | 1597 | OSFL() |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1598 | |
| 1599 | /* On older chips, clear PciExpWakeDisEn */ |
| 1600 | /*if (LLessEqual(\SBRI, 0x13)) { |
| 1601 | * Store(0,\PWDE) |
| 1602 | * } |
| 1603 | */ |
| 1604 | } /* End Method(_SB._INI) */ |
| 1605 | } /* End Device(PCI0) */ |
| 1606 | |
| 1607 | Device(PWRB) { /* Start Power button device */ |
| 1608 | Name(_HID, EISAID("PNP0C0C")) |
| 1609 | Name(_UID, 0xAA) |
| 1610 | Name(_PRW, Package () {3, 0x04}) /* wake from S1-S4 */ |
| 1611 | Name(_STA, 0x0B) /* sata is invisible */ |
| 1612 | } |
| 1613 | } /* End \_SB scope */ |
| 1614 | |
| 1615 | Scope(\_SI) { |
| 1616 | Method(_SST, 1) { |
| 1617 | /* DBGO("\\_SI\\_SST\n") */ |
| 1618 | /* DBGO(" New Indicator state: ") */ |
| 1619 | /* DBGO(Arg0) */ |
| 1620 | /* DBGO("\n") */ |
| 1621 | } |
| 1622 | } /* End Scope SI */ |
| 1623 | |
Tobias Diedrich | a4d179a | 2015-06-21 18:58:30 +0200 | [diff] [blame] | 1624 | #include <southbridge/amd/cimx/sb800/acpi/smbus.asl> |
Daniel Toussaint | da6d92b | 2009-04-06 13:38:54 +0000 | [diff] [blame] | 1625 | |
| 1626 | /* THERMAL */ |
| 1627 | Scope(\_TZ) { |
| 1628 | Name (KELV, 2732) |
| 1629 | Name (THOT, 800) |
| 1630 | Name (TCRT, 850) |
| 1631 | |
| 1632 | ThermalZone(TZ00) { |
| 1633 | Method(_AC0,0) { /* Active Cooling 0 (0=highest fan speed) */ |
| 1634 | /* DBGO("\\_TZ\\TZ00\\_AC0\n") */ |
| 1635 | Return(Add(0, 2730)) |
| 1636 | } |
| 1637 | Method(_AL0,0) { /* Returns package of cooling device to turn on */ |
| 1638 | /* DBGO("\\_TZ\\TZ00\\_AL0\n") */ |
| 1639 | Return(Package() {\_TZ.TZ00.FAN0}) |
| 1640 | } |
| 1641 | Device (FAN0) { |
| 1642 | Name(_HID, EISAID("PNP0C0B")) |
| 1643 | Name(_PR0, Package() {PFN0}) |
| 1644 | } |
| 1645 | |
| 1646 | PowerResource(PFN0,0,0) { |
| 1647 | Method(_STA) { |
| 1648 | Store(0xF,Local0) |
| 1649 | Return(Local0) |
| 1650 | } |
| 1651 | Method(_ON) { |
| 1652 | /* DBGO("\\_TZ\\TZ00\\FAN0 _ON\n") */ |
| 1653 | } |
| 1654 | Method(_OFF) { |
| 1655 | /* DBGO("\\_TZ\\TZ00\\FAN0 _OFF\n") */ |
| 1656 | } |
| 1657 | } |
| 1658 | |
| 1659 | Method(_HOT,0) { /* return hot temp in tenths degree Kelvin */ |
| 1660 | /* DBGO("\\_TZ\\TZ00\\_HOT\n") */ |
| 1661 | Return (Add (THOT, KELV)) |
| 1662 | } |
| 1663 | Method(_CRT,0) { /* return critical temp in tenths degree Kelvin */ |
| 1664 | /* DBGO("\\_TZ\\TZ00\\_CRT\n") */ |
| 1665 | Return (Add (TCRT, KELV)) |
| 1666 | } |
| 1667 | Method(_TMP,0) { /* return current temp of this zone */ |
| 1668 | Store (SMBR (0x07, 0x4C,, 0x00), Local0) |
| 1669 | If (LGreater (Local0, 0x10)) { |
| 1670 | Store (Local0, Local1) |
| 1671 | } |
| 1672 | Else { |
| 1673 | Add (Local0, THOT, Local0) |
| 1674 | Return (Add (400, KELV)) |
| 1675 | } |
| 1676 | |
| 1677 | Store (SMBR (0x07, 0x4C, 0x01), Local0) |
| 1678 | /* only the two MSBs in the external temperature low byte are used, resolution 0.25. We ignore it */ |
| 1679 | /* Store (SMBR (0x07, 0x4C, 0x10), Local2) */ |
| 1680 | If (LGreater (Local0, 0x10)) { |
| 1681 | If (LGreater (Local0, Local1)) { |
| 1682 | Store (Local0, Local1) |
| 1683 | } |
| 1684 | |
| 1685 | Multiply (Local1, 10, Local1) |
| 1686 | Return (Add (Local1, KELV)) |
| 1687 | } |
| 1688 | Else { |
| 1689 | Add (Local0, THOT, Local0) |
| 1690 | Return (Add (400 , KELV)) |
| 1691 | } |
| 1692 | } /* end of _TMP */ |
| 1693 | } /* end of TZ00 */ |
| 1694 | } |
| 1695 | } |
| 1696 | /* End of ASL file */ |