3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 SPDX-License-Identifier: BSD-2-Clause-Patent
15 Baytrail PCI configuration space definition.
20 Name(_ADR, 0x00000000) // Device 0, Function 0
22 // Define various MCH Controller PCI Configuration Space
23 // registers which will be used to dynamically produce all
24 // resources in the Host Bus _CRS.
25 OperationRegion(HBUS, PCI_Config, 0x00, 0xFF)
26 Field(HBUS, DWordAcc, NoLock, Preserve)
29 SMCR, 32, // VLV Message Control Register (0xD0)
31 SMDR, 32, // VLV Message Data Register (0xD4)
33 MCRX, 32, // VLV Message Control Register Extension (0xD8)
36 // Define a method to read a 32-bit register on the VLV Message bus.
40 // Returns 32-bit register value
42 Method(RMBR, 2, Serialized)
45 // Initiate regsiter read message on VLV Message Bus MCR
47 Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
48 Or(0x100000F0, Local0, SMCR)
50 // Read register value from Message Data Register
56 // Define a method to write a 32-bit register on the VLV Message bus MDR.
59 // Arg2 = 32-bit value
61 Method(WMBR, 3, Serialized)
64 // Write register value to Message Data Register
68 // Initiate register write message on VLV Message Bus
70 Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
71 Or(0x110000F0, Local0, SMCR)
76 // BUS, I/O, and MMIO resources
78 Method(_CRS,0,Serialized)
80 //Update ISP0 reserved memory
81 CreateDwordField(RES0, ^ISP0._MIN,ISMN)
82 CreateDwordField(RES0, ^ISP0._MAX,ISMX)
83 CreateDwordField(RES0, ^ISP0._LEN,ISLN)
87 Add (ISMN, ISLN, ISMX)
88 Subtract(ISMX, 1, ISMX)
97 CreateDwordField(RES0, ^PM01._MIN,M1MN)
98 CreateDwordField(RES0, ^PM01._MAX,M1MX)
99 CreateDwordField(RES0, ^PM01._LEN,M1LN)
102 And(BMBD, 0xFF000000, M1MN)
106 Add(Subtract(M1MX, M1MN), 1, M1LN)
107 Subtract(M1MX, 1, M1MX)
109 // Create pointers to Gfx Stolen Memory Sizing values.
110 CreateDwordField(RES0, ^STOM._MIN,GSMN)
111 CreateDwordField(RES0, ^STOM._MAX,GSMX)
112 CreateDwordField(RES0, ^STOM._LEN,GSLN)
114 If (LNotEqual (\_SB.PCI0.GFX0.GSTM, 0xFFFFFFFF))
116 Store(0x00, GSMN) //Read the Stolen memory base from B0:D2:F0:R5C
119 Store(\_SB.PCI0.GFX0.GSTM, GSMN) //Read the Stolen memory base from B0:D2:F0:R5C
121 If (LNotEqual (\_SB.PCI0.GFX0.GUMA, 0xFFFFFFFF))
123 Store(0x00, GSLN) //Read the Stolen memory base from B0:D2:F0:R5C
126 ShiftLeft(\_SB.PCI0.GFX0.GUMA, 25, GSLN) //Read Stolen memory base form B0:D2:F0:R50
128 Add(GSMN, GSLN, GSMX) //Store the Stolen Memory Size
129 Subtract(GSMX, 1, GSMX)
134 Name( RES0,ResourceTemplate()
136 WORDBusNumber ( // Bus number resource (0); the bridge produces bus numbers for its subsequent buses
137 ResourceProducer, // bit 0 of general flags is 1
138 MinFixed, // Range is fixed
139 MaxFixed, // Range is fixed
140 PosDecode, // PosDecode
141 0x0000, // Granularity
144 0x0000, // Translation
145 0x0100 // Range Length = Max-Min+1
148 IO (Decode16, 0x70, 0x77, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
149 IO (Decode16, 0xCF8, 0xCF8, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
151 WORDIO ( // Consumed-and-produced resource (all I/O below CF8)
152 ResourceProducer, // bit 0 of general flags is 0
153 MinFixed, // Range is fixed
154 MaxFixed, // Range is fixed
157 0x0000, // Granularity
160 0x0000, // Translation
161 0x0070 // Range Length
164 WORDIO ( // Consumed-and-produced resource
165 ResourceProducer, // bit 0 of general flags is 0
166 MinFixed, // Range is fixed
167 MaxFixed, // Range is fixed
170 0x0000, // Granularity
173 0x0000, // Translation
174 0x0C80 // Range Length
177 WORDIO ( // Consumed-and-produced resource (all I/O above CFF)
178 ResourceProducer, // bit 0 of general flags is 0
179 MinFixed, // Range is fixed
180 MaxFixed, // Range is fixed
183 0x0000, // Granularity
186 0x0000, // Translation
187 0xF300 // Range Length
190 DWORDMEMORY ( // Descriptor for legacy VGA video RAM
191 ResourceProducer, // bit 0 of general flags is 0
193 MinFixed, // Range is fixed
194 MaxFixed, // Range is fixed
197 0x00000000, // Granularity
200 0x00000000, // Translation
201 0x00020000 // Range Length
204 DWORDMEMORY ( // Descriptor for legacy OptionRom
205 ResourceProducer, // bit 0 of general flags is 0
207 MinFixed, // Range is fixed
208 MaxFixed, // Range is fixed
211 0x00000000, // Granularity
214 0x00000000, // Translation
215 0x00020000 // Range Length
218 DWORDMEMORY ( // Descriptor for BIOS Area
219 ResourceProducer, // bit 0 of general flags is 0
221 MinFixed, // Range is fixed
222 MaxFixed, // Range is fixed
225 0x00000000, // Granularity
228 0x00000000, // Translation
229 0x00020000 // Range Length
232 DWORDMEMORY ( // Descriptor for ISP0 reserved Mem
233 ResourceProducer, // bit 0 of general flags is 0
235 MinFixed, // Range is fixed
236 MaxFixed, // Range is fixed
239 0x00000000, // Granularity
242 0x00000000, // Translation
243 0x00400000 // Range Length
248 DWORDMEMORY ( // Descriptor for VGA Stolen Mem
249 ResourceProducer, // bit 0 of general flags is 0
251 MinFixed, // Range is fixed
252 MaxFixed, // Range is fixed
255 0x00000000, // Granularity
258 0x00000000, // Translation
259 0x04000000 // Range Length
264 DWORDMEMORY ( // Descriptor for PCI MMIO
265 ResourceProducer, // bit 0 of general flags is 0
267 MinFixed, // Range is fixed
268 MaxFixed, // Range is fixed
271 0x00000000, // Granularity
274 0x00000000, // Translation
275 0x60000000 // Range Length
281 //Name(GUID,UUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
284 0x5b, 0x4d, 0xdb, 0x33,
288 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66
292 Name(SUPP,0) // PCI _OSC Support Field value
293 Name(CTRL,0) // PCI _OSC Control Field value
295 Method(_OSC,4,Serialized)
297 // Check for proper UUID
298 // Save the capabilities buffer
301 // Create DWord-adressable fields from the Capabilties Buffer
302 CreateDWordField(Local0,0,CDW1)
303 CreateDWordField(Local0,4,CDW2)
304 CreateDWordField(Local0,8,CDW3)
306 // Check for proper UUID
307 If(LAnd(LEqual(Arg0,GUID),NEXP))
309 // Save Capabilities DWord2 & 3
313 If(Not(And(CDW1,1))) // Query flag clear?
315 // Disable GPEs for features granted native control.
320 If(And(CTRL,0x04)) // PME control granted?
326 If(LNotEqual(Arg1,One))
332 If(LNotEqual(CDW3,CTRL))
334 // Capabilities bits were masked
337 // Update DWORD3 in the buffer
344 Or(CDW1,4,CDW1) // Unrecognized UUID