3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 Baytrail PCI configuration space definition.
26 Name(_ADR, 0x00000000) // Device 0, Function 0
28 // Define various MCH Controller PCI Configuration Space
29 // registers which will be used to dynamically produce all
30 // resources in the Host Bus _CRS.
31 OperationRegion(HBUS, PCI_Config, 0x00, 0xFF)
32 Field(HBUS, DWordAcc, NoLock, Preserve)
35 SMCR, 32, // VLV Message Control Register (0xD0)
37 SMDR, 32, // VLV Message Data Register (0xD4)
39 MCRX, 32, // VLV Message Control Register Extension (0xD8)
42 // Define a method to read a 32-bit register on the VLV Message bus.
46 // Returns 32-bit register value
48 Method(RMBR, 2, Serialized)
51 // Initiate regsiter read message on VLV Message Bus MCR
53 Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
54 Or(0x100000F0, Local0, SMCR)
56 // Read register value from Message Data Register
62 // Define a method to write a 32-bit register on the VLV Message bus MDR.
65 // Arg2 = 32-bit value
67 Method(WMBR, 3, Serialized)
70 // Write register value to Message Data Register
74 // Initiate register write message on VLV Message Bus
76 Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
77 Or(0x110000F0, Local0, SMCR)
82 // BUS, I/O, and MMIO resources
84 Method(_CRS,0,Serialized)
86 //Update ISP0 reserved memory
87 CreateDwordField(RES0, ^ISP0._MIN,ISMN)
88 CreateDwordField(RES0, ^ISP0._MAX,ISMX)
89 CreateDwordField(RES0, ^ISP0._LEN,ISLN)
93 Add (ISMN, ISLN, ISMX)
94 Subtract(ISMX, 1, ISMX)
103 CreateDwordField(RES0, ^PM01._MIN,M1MN)
104 CreateDwordField(RES0, ^PM01._MAX,M1MX)
105 CreateDwordField(RES0, ^PM01._LEN,M1LN)
108 And(BMBD, 0xFF000000, M1MN)
112 Add(Subtract(M1MX, M1MN), 1, M1LN)
113 Subtract(M1MX, 1, M1MX)
115 // Create pointers to Gfx Stolen Memory Sizing values.
116 CreateDwordField(RES0, ^STOM._MIN,GSMN)
117 CreateDwordField(RES0, ^STOM._MAX,GSMX)
118 CreateDwordField(RES0, ^STOM._LEN,GSLN)
120 If (LNotEqual (\_SB.PCI0.GFX0.GSTM, 0xFFFFFFFF))
122 Store(0x00, GSMN) //Read the Stolen memory base from B0:D2:F0:R5C
125 Store(\_SB.PCI0.GFX0.GSTM, GSMN) //Read the Stolen memory base from B0:D2:F0:R5C
127 If (LNotEqual (\_SB.PCI0.GFX0.GUMA, 0xFFFFFFFF))
129 Store(0x00, GSLN) //Read the Stolen memory base from B0:D2:F0:R5C
132 ShiftLeft(\_SB.PCI0.GFX0.GUMA, 25, GSLN) //Read Stolen memory base form B0:D2:F0:R50
134 Add(GSMN, GSLN, GSMX) //Store the Stolen Memory Size
135 Subtract(GSMX, 1, GSMX)
140 Name( RES0,ResourceTemplate()
142 WORDBusNumber ( // Bus number resource (0); the bridge produces bus numbers for its subsequent buses
143 ResourceProducer, // bit 0 of general flags is 1
144 MinFixed, // Range is fixed
145 MaxFixed, // Range is fixed
146 PosDecode, // PosDecode
147 0x0000, // Granularity
150 0x0000, // Translation
151 0x0100 // Range Length = Max-Min+1
154 IO (Decode16, 0x70, 0x77, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
155 IO (Decode16, 0xCF8, 0xCF8, 0x01, 0x08) //Consumed resource (0xCF8-0xCFF)
157 WORDIO ( // Consumed-and-produced resource (all I/O below CF8)
158 ResourceProducer, // bit 0 of general flags is 0
159 MinFixed, // Range is fixed
160 MaxFixed, // Range is fixed
163 0x0000, // Granularity
166 0x0000, // Translation
167 0x0070 // Range Length
170 WORDIO ( // Consumed-and-produced resource
171 ResourceProducer, // bit 0 of general flags is 0
172 MinFixed, // Range is fixed
173 MaxFixed, // Range is fixed
176 0x0000, // Granularity
179 0x0000, // Translation
180 0x0C80 // Range Length
183 WORDIO ( // Consumed-and-produced resource (all I/O above CFF)
184 ResourceProducer, // bit 0 of general flags is 0
185 MinFixed, // Range is fixed
186 MaxFixed, // Range is fixed
189 0x0000, // Granularity
192 0x0000, // Translation
193 0xF300 // Range Length
196 DWORDMEMORY ( // Descriptor for legacy VGA video RAM
197 ResourceProducer, // bit 0 of general flags is 0
199 MinFixed, // Range is fixed
200 MaxFixed, // Range is fixed
203 0x00000000, // Granularity
206 0x00000000, // Translation
207 0x00020000 // Range Length
210 DWORDMEMORY ( // Descriptor for legacy OptionRom
211 ResourceProducer, // bit 0 of general flags is 0
213 MinFixed, // Range is fixed
214 MaxFixed, // Range is fixed
217 0x00000000, // Granularity
220 0x00000000, // Translation
221 0x00020000 // Range Length
224 DWORDMEMORY ( // Descriptor for BIOS Area
225 ResourceProducer, // bit 0 of general flags is 0
227 MinFixed, // Range is fixed
228 MaxFixed, // Range is fixed
231 0x00000000, // Granularity
234 0x00000000, // Translation
235 0x00020000 // Range Length
238 DWORDMEMORY ( // Descriptor for ISP0 reserved Mem
239 ResourceProducer, // bit 0 of general flags is 0
241 MinFixed, // Range is fixed
242 MaxFixed, // Range is fixed
245 0x00000000, // Granularity
248 0x00000000, // Translation
249 0x00400000 // Range Length
254 DWORDMEMORY ( // Descriptor for VGA Stolen Mem
255 ResourceProducer, // bit 0 of general flags is 0
257 MinFixed, // Range is fixed
258 MaxFixed, // Range is fixed
261 0x00000000, // Granularity
264 0x00000000, // Translation
265 0x04000000 // Range Length
270 DWORDMEMORY ( // Descriptor for PCI MMIO
271 ResourceProducer, // bit 0 of general flags is 0
273 MinFixed, // Range is fixed
274 MaxFixed, // Range is fixed
277 0x00000000, // Granularity
280 0x00000000, // Translation
281 0x60000000 // Range Length
287 //Name(GUID,UUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
290 0x5b, 0x4d, 0xdb, 0x33,
294 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66
298 Name(SUPP,0) // PCI _OSC Support Field value
299 Name(CTRL,0) // PCI _OSC Control Field value
301 Method(_OSC,4,Serialized)
303 // Check for proper UUID
304 // Save the capabilities buffer
307 // Create DWord-adressable fields from the Capabilties Buffer
308 CreateDWordField(Local0,0,CDW1)
309 CreateDWordField(Local0,4,CDW2)
310 CreateDWordField(Local0,8,CDW3)
312 // Check for proper UUID
313 If(LAnd(LEqual(Arg0,GUID),NEXP))
315 // Save Capabilities DWord2 & 3
319 If(Not(And(CDW1,1))) // Query flag clear?
321 // Disable GPEs for features granted native control.
326 If(And(CTRL,0x04)) // PME control granted?
332 If(LNotEqual(Arg1,One))
338 If(LNotEqual(CDW3,CTRL))
340 // Capabilities bits were masked
343 // Update DWORD3 in the buffer
350 Or(CDW1,4,CDW1) // Unrecognized UUID