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