2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 Name(_HID,EISAID("PNP0A08")) // PCIe
19 Name(_CID,EISAID("PNP0A03")) // PCI
26 Name(_ADR, 0x00000000) // 0:0.0
28 OperationRegion(MCHP, PCI_Config, 0x00, 0x100)
29 Field (MCHP, DWordAcc, NoLock, Preserve)
31 Offset (0x40), // EPBAR
36 Offset (0x48), // MCHBAR
41 Offset (0x60), // PCIe BAR
47 Offset (0x68), // DMIBAR
52 Offset (0x70), // ME Base Address
57 Offset (0x80), // PAM0
61 Offset (0x81), // PAM1
66 Offset (0x82), // PAM2
71 Offset (0x83), // PAM3
76 Offset (0x84), // PAM4
81 Offset (0x85), // PAM5
86 Offset (0x86), // PAM6
92 Offset (0xa0), // Top of Used Memory
95 Offset (0xbc), // Top of Low Used Memory
99 Mutex (CTCM, 1) /* CTDP Switch Mutex (sync level 1) */
100 Name (CTCC, 0) /* CTDP Current Selection */
101 Name (CTCN, 0) /* CTDP Nominal Select */
102 Name (CTCD, 1) /* CTDP Down Select */
103 Name (CTCU, 2) /* CTDP Up Select */
104 Name (SPL1, 0) /* Saved PL1 value */
106 OperationRegion (MCHB, SystemMemory, Add(DEFAULT_MCHBAR,0x5000), 0x1000)
107 Field (MCHB, DWordAcc, Lock, Preserve)
109 Offset (0x930), /* PACKAGE_POWER_SKU */
110 CTDN, 15, /* CTDP Nominal PL1 */
111 Offset (0x938), /* PACKAGE_POWER_SKU_UNIT */
112 PUNI, 4, /* Power Units */
114 EUNI, 5, /* Energy Units */
116 TUNI, 4, /* Time Units */
117 Offset (0x958), /* PLATFORM_INFO */
119 LFM_, 8, /* Maximum Efficiency Ratio (LFM) */
120 Offset (0x9a0), /* TURBO_POWER_LIMIT1 */
121 PL1V, 15, /* Power Limit 1 Value */
122 PL1E, 1, /* Power Limit 1 Enable */
123 PL1C, 1, /* Power Limit 1 Clamp */
124 PL1T, 7, /* Power Limit 1 Time */
125 Offset (0x9a4), /* TURBO_POWER_LIMIT2 */
126 PL2V, 15, /* Power Limit 2 Value */
127 PL2E, 1, /* Power Limit 2 Enable */
128 PL2C, 1, /* Power Limit 2 Clamp */
129 PL2T, 7, /* Power Limit 2 Time */
130 Offset (0xf3c), /* CONFIG_TDP_NOMINAL */
131 TARN, 8, /* CTDP Nominal Turbo Activation Ratio */
132 Offset (0xf40), /* CONFIG_TDP_LEVEL1 */
133 CTDD, 15, /* CTDP Down PL1 */
135 TARD, 8, /* CTDP Down Turbo Activation Ratio */
136 Offset (0xf48), /* MSR_CONFIG_TDP_LEVEL2 */
137 CTDU, 15, /* CTDP Up PL1 */
139 TARU, 8, /* CTDP Up Turbo Activation Ratio */
140 Offset (0xf50), /* CONFIG_TDP_CONTROL */
141 CTCS, 2, /* CTDP Select */
142 Offset (0xf54), /* TURBO_ACTIVATION_RATIO */
143 TARS, 8, /* Turbo Activation Ratio Select */
147 * Search CPU0 _PSS looking for control = arg0 and then
148 * return previous P-state entry number for new _PPC
151 * Name (_PSS, Package () {
152 * Package (6) { freq, power, tlat, blat, control, status }
155 External (\_PR.CP00._PSS)
156 Method (PSSS, 1, NotSerialized)
158 Store (One, Local0) /* Start at P1 */
159 Store (SizeOf (\_PR.CP00._PSS), Local1)
161 While (LLess (Local0, Local1)) {
162 /* Store _PSS entry Control value to Local2 */
163 ShiftRight (DeRefOf (Index (DeRefOf (Index
164 (\_PR.CP00._PSS, Local0)), 4)), 8, Local2)
165 If (LEqual (Local2, Arg0)) {
166 Return (Subtract (Local0, 1))
174 /* Calculate PL2 based on chip type */
175 Method (CPL2, 1, NotSerialized)
178 /* Haswell ULT PL2 = 25W */
179 Return (Multiply (25, 8))
181 /* Haswell Mobile PL2 = 1.25 * PL1 */
182 Return (Divide (Multiply (Arg0, 125), 100))
186 /* Set Config TDP Down */
187 Method (STND, 0, Serialized)
189 If (Acquire (CTCM, 100)) {
192 If (LEqual (CTCD, CTCC)) {
197 Store ("Set TDP Down", Debug)
205 /* Set PPC limit and notify OS */
206 Store (PSSS (TARD), PPCM)
210 Store (CPL2 (CTDD), PL2V)
215 /* Store the new TDP Down setting */
222 /* Set Config TDP Nominal from Down */
223 Method (STDN, 0, Serialized)
225 If (Acquire (CTCM, 100)) {
228 If (LEqual (CTCN, CTCC)) {
233 Store ("Set TDP Nominal", Debug)
239 Store (CPL2 (CTDN), PL2V)
241 /* Set PPC limit and notify OS */
242 Store (PSSS (TARN), PPCM)
251 /* Store the new TDP Nominal setting */
258 /* Calculate PL1 value based on requested TDP */
259 Method (TDPP, 1, NotSerialized)
261 Return (Multiply (ShiftLeft (Subtract (PUNI, 1), 2), Arg0))
264 /* Enable Controllable TDP to limit PL1 to requested value */
265 Method (CTLE, 1, Serialized)
267 If (Acquire (CTCM, 100)) {
271 Store ("Enable PL1 Limit", Debug)
273 /* Set _PPC to LFM */
274 Store (PSSS (LFM_), Local0)
275 Add (Local0, 1, PPCM)
278 /* Set TAR to LFM-1 */
279 Subtract (LFM_, 1, TARS)
281 /* Set PL1 to desired value */
283 Store (TDPP (Arg0), PL1V)
285 /* Set PL1 CLAMP bit */
292 /* Disable Controllable TDP */
293 Method (CTLD, 0, Serialized)
295 If (Acquire (CTCM, 100)) {
299 Store ("Disable PL1 Limit", Debug)
301 /* Clear PL1 CLAMP bit */
304 /* Set PL1 to normal value */
319 // Current Resource Settings
320 Name (MCRS, ResourceTemplate()
323 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
324 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100,,, PB00)
327 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
328 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8,,, PI00)
331 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
334 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
335 0x0000, 0x0d00, 0xffff, 0x0000, 0xf300,,, PI01)
337 // VGA memory (0xa0000-0xbffff)
338 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
339 Cacheable, ReadWrite,
340 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
343 // OPROM reserved (0xc0000-0xc3fff)
344 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
345 Cacheable, ReadWrite,
346 0x00000000, 0x000c0000, 0x000c3fff, 0x00000000,
349 // OPROM reserved (0xc4000-0xc7fff)
350 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
351 Cacheable, ReadWrite,
352 0x00000000, 0x000c4000, 0x000c7fff, 0x00000000,
355 // OPROM reserved (0xc8000-0xcbfff)
356 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
357 Cacheable, ReadWrite,
358 0x00000000, 0x000c8000, 0x000cbfff, 0x00000000,
361 // OPROM reserved (0xcc000-0xcffff)
362 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
363 Cacheable, ReadWrite,
364 0x00000000, 0x000cc000, 0x000cffff, 0x00000000,
367 // OPROM reserved (0xd0000-0xd3fff)
368 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
369 Cacheable, ReadWrite,
370 0x00000000, 0x000d0000, 0x000d3fff, 0x00000000,
373 // OPROM reserved (0xd4000-0xd7fff)
374 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
375 Cacheable, ReadWrite,
376 0x00000000, 0x000d4000, 0x000d7fff, 0x00000000,
379 // OPROM reserved (0xd8000-0xdbfff)
380 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
381 Cacheable, ReadWrite,
382 0x00000000, 0x000d8000, 0x000dbfff, 0x00000000,
385 // OPROM reserved (0xdc000-0xdffff)
386 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
387 Cacheable, ReadWrite,
388 0x00000000, 0x000dc000, 0x000dffff, 0x00000000,
391 // BIOS Extension (0xe0000-0xe3fff)
392 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
393 Cacheable, ReadWrite,
394 0x00000000, 0x000e0000, 0x000e3fff, 0x00000000,
397 // BIOS Extension (0xe4000-0xe7fff)
398 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
399 Cacheable, ReadWrite,
400 0x00000000, 0x000e4000, 0x000e7fff, 0x00000000,
403 // BIOS Extension (0xe8000-0xebfff)
404 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
405 Cacheable, ReadWrite,
406 0x00000000, 0x000e8000, 0x000ebfff, 0x00000000,
409 // BIOS Extension (0xec000-0xeffff)
410 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
411 Cacheable, ReadWrite,
412 0x00000000, 0x000ec000, 0x000effff, 0x00000000,
415 // System BIOS (0xf0000-0xfffff)
416 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
417 Cacheable, ReadWrite,
418 0x00000000, 0x000f0000, 0x000fffff, 0x00000000,
421 // PCI Memory Region (Top of memory-CONFIG_MMCONF_BASE_ADDRESS)
422 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
423 Cacheable, ReadWrite,
424 0x00000000, 0x00000000, 0x00000000, 0x00000000,
427 // TPM Area (0xfed40000-0xfed44fff)
428 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
429 Cacheable, ReadWrite,
430 0x00000000, 0xfed40000, 0xfed44fff, 0x00000000,
434 Method (_CRS, 0, Serialized)
436 // Find PCI resource area in MCRS
437 CreateDwordField(MCRS, ^PM01._MIN, PMIN)
438 CreateDwordField(MCRS, ^PM01._MAX, PMAX)
439 CreateDwordField(MCRS, ^PM01._LEN, PLEN)
441 // Fix up PCI memory region
442 // Start with Top of Lower Usable DRAM
443 Store (^MCHC.TLUD, Local0)
444 Store (^MCHC.MEBA, Local1)
446 // Check if ME base is equal
447 If (LEqual (Local0, Local1)) {
448 // Use Top Of Memory instead
449 Store (^MCHC.TOM, Local0)
453 Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX)
454 Add(Subtract(PMAX, PMIN), 1, PLEN)
459 /* IRQ assignment is mainboard specific. Get it from mainboard ACPI code */
460 #include "acpi/haswell_pci_irqs.asl"