3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 SPDX-License-Identifier: BSD-2-Clause-Patent
15 IGD OpRegion/Software SCI Reference Code for the Baytrail Family.
16 This file contains the interrupt handler code for the Integrated
17 Graphics Device (IGD) OpRegion/Software SCI mechanism.
24 // (1) The code contained in this file inherits the scope in which it
25 // was included. So BIOS developers must be sure to include this
26 // file in the scope associated with the graphics device
27 // (ex. \_SB.PCI0.GFX0).
28 // (2) Create a _L06 method under the GPE scope to handle the event
29 // generated by the graphics driver. The _L06 method must call
30 // the GSCI method in this file.
31 // (3) The MCHP operation region assumes that _ADR and _BBN names
32 // corresponding to bus 0, device0, function 0 have been declared
33 // under the PCI0 scope.
34 // (4) Before the first execution of the GSCI method, the base address
35 // of the GMCH SCI OpRegion must be programmed where the driver can
36 // access it. A 32bit scratch register at 0xFC in the IGD PCI
37 // configuration space (B0/D2/F0/R0FCh) is used for this purpose.
39 // Define an OperationRegion to cover the GMCH PCI configuration space as
40 // described in the IGD OpRegion specificiation.
42 // Define an OperationRegion to cover the IGD PCI configuration space as
43 // described in the IGD OpRegion specificiation.
45 OperationRegion(IGDP, PCI_Config,0x00,0x100)
46 Field(IGDP, AnyAcc, NoLock, Preserve)
48 Offset(0x10), // GTTMMADR
50 Offset(0x50), // GMCH Graphics Control Register
52 GIVD, 1, // IGD VGA disable bit
54 GUMA, 5, // Stolen memory size
58 GMFN, 1, // Gfx function 1 enable
60 Offset(0x5C), // Stolen Memory Base Address
62 Offset(0xE0), // Reg 0xE8, SWSCI control register
63 GSSE, 1, // Graphics SCI event (1=event pending)
64 GSSB, 14, // Graphics SCI scratchpad bits
65 GSES, 1, // Graphics event select (1=SCI)
67 ASLE, 8, // Reg 0xE4, ASLE interrupt register
68 , 24, // Only use first byte of ASLE reg
70 ASLS, 32, // Reg 0xFC, Address of the IGD OpRegion
73 Method (MCHK, 0, Serialized)
76 If (LNotEqual (MADR, 0xFFFFFFFF))
78 OperationRegion(IGMM,SystemMemory,MADR,0x3000)
79 Field(IGMM,AnyAcc, NoLock, Preserve)
83 DCFE, 4, // DISPLAY_CLOCK_FREQUENCY_ENCODING
89 // Define an OperationRegion to cover the IGD OpRegion layout.
91 OperationRegion(IGDM, SystemMemory, ASLB, 0x2000)
92 Field(IGDM, AnyAcc, NoLock, Preserve)
97 SIGN, 128, // Signature-"IntelGraphicsMem"
98 SIZE, 32, // OpRegion Size
99 OVER, 32, // OpRegion Version
100 SVER, 256, // System BIOS Version
101 VVER, 128, // VBIOS Version
102 GVER, 128, // Driver version
103 MBOX, 32, // Mailboxes supported
104 DMOD, 32, // Driver Model
105 PCON, 32, // 96, Platform Configuration
107 // OpRegion Mailbox 1 (Public ACPI Methods)
108 // Note: Mailbox 1 is normally reserved for desktop platforms.
111 DRDY, 32, // Driver readiness (ACPI notification)
112 CSTS, 32, // Notification status
113 CEVT, 32, // Current event
115 DIDL, 32, // Supported display device ID list
116 DDL2, 32, // Allows for 8 devices
123 CPDL, 32, // Currently present display list
124 CPL2, 32, // Allows for 8 devices
131 CAD1, 32, // Currently active display list
132 CAL2, 32, // Allows for 8 devices
139 NADL, 32, // Next active display list
140 NDL2, 32, // Allows for 8 devices
147 ASLP, 32, // ASL sleep timeout
148 TIDX, 32, // Toggle table index
149 CHPD, 32, // Current hot plug enable indicator
150 CLID, 32, // Current lid state indicator
151 CDCK, 32, // Current docking state indicator
152 SXSW, 32, // Display switch notify on resume
153 EVTS, 32, // Events supported by ASL (diag only)
154 CNOT, 32, // Current OS notifications (diag only)
157 // OpRegion Mailbox 2 (Software SCI Interface)
159 Offset(0x200), // SCIC
160 SCIE, 1, // SCI entry bit (1=call unserviced)
161 GEFC, 4, // Entry function code
162 GXFC, 3, // Exit result
163 GESF, 8, // Entry/exit sub-function/parameter
164 , 16, // SCIC[31:16] reserved
165 Offset(0x204), // PARM
166 PARM, 32, // PARM register (extra parameters)
167 DSLP, 32, // Driver sleep time out
169 // OpRegion Mailbox 3 (BIOS to Driver Notification)
170 // Note: Mailbox 3 is normally reserved for desktop platforms.
173 ARDY, 32, // Driver readiness (power conservation)
174 ASLC, 32, // ASLE interrupt command/status
175 TCHE, 32, // Technology enabled indicator
176 ALSI, 32, // Current ALS illuminance reading
177 BCLP, 32, // Backlight brightness
178 PFIT, 32, // Panel fitting state or request
179 CBLV, 32, // Current brightness level
180 BCLM, 320, // Backlight brightness level duty cycle mapping table
181 CPFM, 32, // Current panel fitting mode
182 EPFM, 32, // Enabled panel fitting modes
183 PLUT, 592, // Optional. 74-byte Panel LUT Table
184 PFMB, 32, // Optional. PWM Frequency and Minimum Brightness
185 CCDV, 32, // Optional. Gamma, Brightness, Contrast values.
186 PCFT, 32, // Optional. Power Conservation Features
189 STAT, 32, // Status register
191 // OpRegion Mailbox 4 (VBT)
194 GVD1, 0xC000, // 6K bytes maximum VBT image
196 // OpRegion Mailbox 5 (BIOS to Driver Notification Extension)
199 PHED, 32, // Panel Header
200 BDDC, 2048, // Panel EDID (Max 256 bytes)
206 // Convert boot display type into a port mask.
208 Name (DBTB, Package()
211 0x0007, // Port-0 : Integrated CRT
212 0x0038, // Port-1 : DVO-A, or Integrated LVDS
213 0x01C0, // Port-2 : SDVO-B, or SDVO-B/C
214 0x0E00, // Port-3 : SDVO-C
215 0x003F, // [CRT + DVO-A / Integrated LVDS]
216 0x01C7, // [CRT + SDVO-B] or [CRT + SDVO-B/C]
217 0x0E07, // [CRT + SDVO-C]
218 0x01F8, // [DVO-A / Integrated LVDS + SDVO-B]
219 0x0E38, // [DVO-A / Integrated LVDS + SDVO-C]
220 0x0FC0, // [SDVO-B + SDVO-C]
226 0x7000, // Port-4: Integrated TV
227 0x7007, // [Integrated TV + CRT]
228 0x7038, // [Integrated TV + LVDS]
229 0x71C0, // [Integrated TV + DVOB]
230 0x7E00 // [Integrated TV + DVOC]
233 // Core display clock value table.
235 Name (CDCT, Package()
245 // Defined exit result values:
247 Name (SUCC, 1) // Exit result: Success
248 Name (NVLD, 2) // Exit result: Invalid parameter
249 Name (CRIT, 4) // Exit result: Critical failure
250 Name (NCRT, 6) // Exit result: Non-critical failure
253 /************************************************************************;
257 ;* Description: Handles an SCI generated by the graphics driver. The
258 ;* PARM and SCIC input fields are parsed to determine the
259 ;* functionality requested by the driver. GBDA or SBCB
260 ;* is called based on the input data in SCIC.
262 ;* Usage: The method must be called in response to a GPE 06 event
263 ;* which will be generated by the graphics driver.
264 ;* Ex: Method(\_GPE._L06) {Return(\_SB.PCI0.GFX0.GSCI())}
266 ;* Input: PARM and SCIC are indirect inputs
268 ;* Output: PARM and SIC are indirect outputs
270 ;* References: GBDA (Get BIOS Data method), SBCB (System BIOS Callback
273 ;************************************************************************/
275 Method (GSCI, 0, Serialized)
277 Include("IgdOGBDA.ASL") // "Get BIOS Data" Functions
278 Include("IgdOSBCB.ASL") // "System BIOS CallBacks"
282 Store(GBDA(), GXFC) // Process Get BIOS Data functions
287 Store(SBCB(), GXFC) // Process BIOS Callback functions
290 Store(0, GEFC) // Wipe out the entry function code
291 Store(1, SCIS) // Clear the GUNIT SCI status bit in PCH ACPI I/O space.
292 Store(0, GSSE) // Clear the SCI generation bit in PCI space.
293 Store(0, SCIE) // Clr SCI serviced bit to signal completion
298 // Include MOBLFEAT.ASL for mobile systems only. Remove for desktop.
299 Include("IgdOMOBF.ASL") // IGD SCI mobile features