]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / IgdOpRn.ASL
CommitLineData
3cbfba02
DW
1/*++\r
2\r
3Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved\r
4\r
7ede8060 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
3cbfba02
DW
6\r
7\r
8\r
9Module Name:\r
10\r
11 IgdOpRn.ASL\r
12\r
13Abstract:\r
14\r
15 IGD OpRegion/Software SCI Reference Code for the Baytrail Family.\r
16 This file contains the interrupt handler code for the Integrated\r
17 Graphics Device (IGD) OpRegion/Software SCI mechanism.\r
18\r
19--*/\r
20\r
21\r
22//NOTES:\r
23//\r
24// (1) The code contained in this file inherits the scope in which it\r
25// was included. So BIOS developers must be sure to include this\r
26// file in the scope associated with the graphics device\r
27// (ex. \_SB.PCI0.GFX0).\r
28// (2) Create a _L06 method under the GPE scope to handle the event\r
29// generated by the graphics driver. The _L06 method must call\r
30// the GSCI method in this file.\r
31// (3) The MCHP operation region assumes that _ADR and _BBN names\r
32// corresponding to bus 0, device0, function 0 have been declared\r
33// under the PCI0 scope.\r
34// (4) Before the first execution of the GSCI method, the base address\r
35// of the GMCH SCI OpRegion must be programmed where the driver can\r
36// access it. A 32bit scratch register at 0xFC in the IGD PCI\r
37// configuration space (B0/D2/F0/R0FCh) is used for this purpose.\r
38\r
39// Define an OperationRegion to cover the GMCH PCI configuration space as\r
40// described in the IGD OpRegion specificiation.\r
41\r
42// Define an OperationRegion to cover the IGD PCI configuration space as\r
43// described in the IGD OpRegion specificiation.\r
44\r
45OperationRegion(IGDP, PCI_Config,0x00,0x100)\r
46Field(IGDP, AnyAcc, NoLock, Preserve)\r
47{\r
48 Offset(0x10), // GTTMMADR\r
49 MADR, 32,\r
50 Offset(0x50), // GMCH Graphics Control Register\r
51 , 1,\r
52 GIVD, 1, // IGD VGA disable bit\r
53 , 1,\r
54 GUMA, 5, // Stolen memory size\r
55 , 8,\r
56 Offset(0x54),\r
57 , 4,\r
58 GMFN, 1, // Gfx function 1 enable\r
59 , 27,\r
60 Offset(0x5C), // Stolen Memory Base Address\r
61 GSTM, 32,\r
62 Offset(0xE0), // Reg 0xE8, SWSCI control register\r
63 GSSE, 1, // Graphics SCI event (1=event pending)\r
64 GSSB, 14, // Graphics SCI scratchpad bits\r
65 GSES, 1, // Graphics event select (1=SCI)\r
66 Offset(0xE4),\r
67 ASLE, 8, // Reg 0xE4, ASLE interrupt register\r
68 , 24, // Only use first byte of ASLE reg\r
69 Offset(0xFC),\r
70 ASLS, 32, // Reg 0xFC, Address of the IGD OpRegion\r
71}\r
72\r
73Method (MCHK, 0, Serialized)\r
74{\r
75\r
76 If (LNotEqual (MADR, 0xFFFFFFFF))\r
77 {\r
78 OperationRegion(IGMM,SystemMemory,MADR,0x3000)\r
79 Field(IGMM,AnyAcc, NoLock, Preserve)\r
80 {\r
81 Offset(0X20C8),\r
82 , 4,\r
83 DCFE, 4, // DISPLAY_CLOCK_FREQUENCY_ENCODING\r
84 }\r
85 }\r
86}\r
87\r
88\r
89// Define an OperationRegion to cover the IGD OpRegion layout.\r
90\r
91OperationRegion(IGDM, SystemMemory, ASLB, 0x2000)\r
92Field(IGDM, AnyAcc, NoLock, Preserve)\r
93{\r
94\r
95 // OpRegion Header\r
96\r
97 SIGN, 128, // Signature-"IntelGraphicsMem"\r
98 SIZE, 32, // OpRegion Size\r
99 OVER, 32, // OpRegion Version\r
100 SVER, 256, // System BIOS Version\r
101 VVER, 128, // VBIOS Version\r
102 GVER, 128, // Driver version\r
103 MBOX, 32, // Mailboxes supported\r
104 DMOD, 32, // Driver Model\r
105 PCON, 32, // 96, Platform Configuration\r
106\r
107 // OpRegion Mailbox 1 (Public ACPI Methods)\r
108 // Note: Mailbox 1 is normally reserved for desktop platforms.\r
109\r
110 Offset(0x100),\r
111 DRDY, 32, // Driver readiness (ACPI notification)\r
112 CSTS, 32, // Notification status\r
113 CEVT, 32, // Current event\r
114 Offset(0x120),\r
115 DIDL, 32, // Supported display device ID list\r
116 DDL2, 32, // Allows for 8 devices\r
117 DDL3, 32,\r
118 DDL4, 32,\r
119 DDL5, 32,\r
120 DDL6, 32,\r
121 DDL7, 32,\r
122 DDL8, 32,\r
123 CPDL, 32, // Currently present display list\r
124 CPL2, 32, // Allows for 8 devices\r
125 CPL3, 32,\r
126 CPL4, 32,\r
127 CPL5, 32,\r
128 CPL6, 32,\r
129 CPL7, 32,\r
130 CPL8, 32,\r
131 CAD1, 32, // Currently active display list\r
132 CAL2, 32, // Allows for 8 devices\r
133 CAL3, 32,\r
134 CAL4, 32,\r
135 CAL5, 32,\r
136 CAL6, 32,\r
137 CAL7, 32,\r
138 CAL8, 32,\r
139 NADL, 32, // Next active display list\r
140 NDL2, 32, // Allows for 8 devices\r
141 NDL3, 32,\r
142 NDL4, 32,\r
143 NDL5, 32,\r
144 NDL6, 32,\r
145 NDL7, 32,\r
146 NDL8, 32,\r
147 ASLP, 32, // ASL sleep timeout\r
148 TIDX, 32, // Toggle table index\r
149 CHPD, 32, // Current hot plug enable indicator\r
150 CLID, 32, // Current lid state indicator\r
151 CDCK, 32, // Current docking state indicator\r
152 SXSW, 32, // Display switch notify on resume\r
153 EVTS, 32, // Events supported by ASL (diag only)\r
154 CNOT, 32, // Current OS notifications (diag only)\r
155 NRDY, 32,\r
156\r
157 // OpRegion Mailbox 2 (Software SCI Interface)\r
158\r
159 Offset(0x200), // SCIC\r
160 SCIE, 1, // SCI entry bit (1=call unserviced)\r
161 GEFC, 4, // Entry function code\r
162 GXFC, 3, // Exit result\r
163 GESF, 8, // Entry/exit sub-function/parameter\r
164 , 16, // SCIC[31:16] reserved\r
165 Offset(0x204), // PARM\r
166 PARM, 32, // PARM register (extra parameters)\r
167 DSLP, 32, // Driver sleep time out\r
168\r
169 // OpRegion Mailbox 3 (BIOS to Driver Notification)\r
170 // Note: Mailbox 3 is normally reserved for desktop platforms.\r
171\r
172 Offset(0x300),\r
173 ARDY, 32, // Driver readiness (power conservation)\r
174 ASLC, 32, // ASLE interrupt command/status\r
175 TCHE, 32, // Technology enabled indicator\r
176 ALSI, 32, // Current ALS illuminance reading\r
177 BCLP, 32, // Backlight brightness\r
178 PFIT, 32, // Panel fitting state or request\r
179 CBLV, 32, // Current brightness level\r
180 BCLM, 320, // Backlight brightness level duty cycle mapping table\r
181 CPFM, 32, // Current panel fitting mode\r
182 EPFM, 32, // Enabled panel fitting modes\r
183 PLUT, 592, // Optional. 74-byte Panel LUT Table\r
184 PFMB, 32, // Optional. PWM Frequency and Minimum Brightness\r
185 CCDV, 32, // Optional. Gamma, Brightness, Contrast values.\r
186 PCFT, 32, // Optional. Power Conservation Features\r
187\r
188 Offset(0x3B6),\r
189 STAT, 32, // Status register\r
190\r
191 // OpRegion Mailbox 4 (VBT)\r
192\r
193 Offset(0x400),\r
194 GVD1, 0xC000, // 6K bytes maximum VBT image\r
195\r
196 // OpRegion Mailbox 5 (BIOS to Driver Notification Extension)\r
197\r
198 Offset(0x1C00),\r
199 PHED, 32, // Panel Header\r
200 BDDC, 2048, // Panel EDID (Max 256 bytes)\r
201\r
202}\r
203\r
204\r
205\r
206// Convert boot display type into a port mask.\r
207\r
208Name (DBTB, Package()\r
209{\r
210 0x0000, // Automatic\r
211 0x0007, // Port-0 : Integrated CRT\r
212 0x0038, // Port-1 : DVO-A, or Integrated LVDS\r
213 0x01C0, // Port-2 : SDVO-B, or SDVO-B/C\r
214 0x0E00, // Port-3 : SDVO-C\r
215 0x003F, // [CRT + DVO-A / Integrated LVDS]\r
216 0x01C7, // [CRT + SDVO-B] or [CRT + SDVO-B/C]\r
217 0x0E07, // [CRT + SDVO-C]\r
218 0x01F8, // [DVO-A / Integrated LVDS + SDVO-B]\r
219 0x0E38, // [DVO-A / Integrated LVDS + SDVO-C]\r
220 0x0FC0, // [SDVO-B + SDVO-C]\r
221 0x0000, // Reserved\r
222 0x0000, // Reserved\r
223 0x0000, // Reserved\r
224 0x0000, // Reserved\r
225 0x0000, // Reserved\r
226 0x7000, // Port-4: Integrated TV\r
227 0x7007, // [Integrated TV + CRT]\r
228 0x7038, // [Integrated TV + LVDS]\r
229 0x71C0, // [Integrated TV + DVOB]\r
230 0x7E00 // [Integrated TV + DVOC]\r
231})\r
232\r
233// Core display clock value table.\r
234\r
235Name (CDCT, Package()\r
236{\r
237 Package() {160},\r
238 Package() {200},\r
239 Package() {267},\r
240 Package() {320},\r
241 Package() {356},\r
242 Package() {400},\r
243})\r
244\r
245// Defined exit result values:\r
246\r
247Name (SUCC, 1) // Exit result: Success\r
248Name (NVLD, 2) // Exit result: Invalid parameter\r
249Name (CRIT, 4) // Exit result: Critical failure\r
250Name (NCRT, 6) // Exit result: Non-critical failure\r
251\r
252\r
253/************************************************************************;\r
254;*\r
255;* Name: GSCI\r
256;*\r
257;* Description: Handles an SCI generated by the graphics driver. The\r
258;* PARM and SCIC input fields are parsed to determine the\r
259;* functionality requested by the driver. GBDA or SBCB\r
260;* is called based on the input data in SCIC.\r
261;*\r
262;* Usage: The method must be called in response to a GPE 06 event\r
263;* which will be generated by the graphics driver.\r
264;* Ex: Method(\_GPE._L06) {Return(\_SB.PCI0.GFX0.GSCI())}\r
265;*\r
266;* Input: PARM and SCIC are indirect inputs\r
267;*\r
268;* Output: PARM and SIC are indirect outputs\r
269;*\r
270;* References: GBDA (Get BIOS Data method), SBCB (System BIOS Callback\r
271;* method)\r
272;*\r
273;************************************************************************/\r
274\r
275Method (GSCI, 0, Serialized)\r
276{\r
277 Include("IgdOGBDA.ASL") // "Get BIOS Data" Functions\r
278 Include("IgdOSBCB.ASL") // "System BIOS CallBacks"\r
279\r
280 If (LEqual(GEFC, 4))\r
281 {\r
282 Store(GBDA(), GXFC) // Process Get BIOS Data functions\r
283 }\r
284\r
285 If (LEqual(GEFC, 6))\r
286 {\r
287 Store(SBCB(), GXFC) // Process BIOS Callback functions\r
288 }\r
289\r
290 Store(0, GEFC) // Wipe out the entry function code\r
291 Store(1, SCIS) // Clear the GUNIT SCI status bit in PCH ACPI I/O space.\r
292 Store(0, GSSE) // Clear the SCI generation bit in PCI space.\r
293 Store(0, SCIE) // Clr SCI serviced bit to signal completion\r
294\r
295 Return(Zero)\r
296}\r
297\r
298// Include MOBLFEAT.ASL for mobile systems only. Remove for desktop.\r
299Include("IgdOMOBF.ASL") // IGD SCI mobile features\r