]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOSBCB.ASL
9e0482efb98a27307aabd64568f7e3a79d919eba
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / IgdOSBCB.ASL
1 /*++
2
3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9 Module Name:
10
11 IgdOSBCB.ASL
12
13 Abstract:
14
15 IGD OpRegion/Software SCI Reference Code for the Baytrail Family.
16 This file contains the system BIOS call back functionality for the
17 OpRegion/Software SCI mechanism.
18
19 --*/
20
21
22 Method (SBCB, 0, Serialized)
23 {
24
25 // Supported Callbacks: Sub-function 0
26
27 If (LEqual(GESF, 0x0))
28 {
29
30 //<TODO> An OEM may support the driver->SBIOS status callbacks, but
31 // the supported callbacks value must be modified. The code that is
32 // executed upon reception of the callbacks must be also be updated
33 // to perform the desired functionality.
34
35 Store(0x00000000, PARM) // No callbacks supported
36
37 If(LEqual(PFLV,FMBL))
38 {
39 Store(0x000F87FD, PARM) // Mobile
40 }
41 If(LEqual(PFLV,FDTP))
42 {
43 Store(0x000F87BD, PARM) // Desktop
44 }
45
46 Store(Zero, GESF) // Clear the exit parameter
47 Return(SUCC) // "Success"
48 }
49
50 // BIOS POST Completion: Sub-function 1
51
52 If (LEqual(GESF, 1))
53 {
54 Store(Zero, GESF) // Clear the exit parameter
55 Store(Zero, PARM)
56 Return(SUCC) // Not supported, but no failure
57 }
58
59 // Pre-Hires Set Mode: Sub-function 3
60
61 If (LEqual(GESF, 3))
62 {
63 Store(Zero, GESF) // Clear the exit parameter
64 Store(Zero, PARM)
65 Return(SUCC) // Not supported, but no failure
66 }
67
68 // Post-Hires Set Mode: Sub-function 4
69
70 If (LEqual(GESF, 4))
71 {
72 Store(Zero, GESF) // Clear the exit parameter
73 Store(Zero, PARM)
74 Return(SUCC) // Not supported, but no failure
75 }
76
77 // Display Switch: Sub-function 5
78
79 If (LEqual(GESF, 5))
80 {
81 Store(Zero, GESF) // Clear the exit parameter
82 Store(Zero, PARM)
83 Return(SUCC) // Not supported, but no failure
84 }
85
86 // Set TV format: Sub-function 6
87
88 If (LEqual(GESF, 6))
89 {
90
91 //<TODO> If implemented, the input values must be saved into
92 // non-volatile storage for parsing during the next boot. The
93 // following Sample code is Intel validated implementation.
94
95 Store(And(PARM, 0x0F), ITVF)
96 Store(ShiftRight(And(PARM, 0xF0), 4), ITVM)
97 Store(Zero, GESF) // Clear the exit parameter
98 Store(Zero, PARM)
99 Return(SUCC)
100 }
101
102 // Adapter Power State: Sub-function 7
103
104 If (LEqual(GESF, 7))
105 {
106
107 // Upon notification from driver that the Adapter Power State = D0,
108 // check if previous lid event failed. If it did, retry the lid
109 // event here.
110 If(LEqual(PARM, 0))
111 {
112 Store(CLID, Local0)
113 If(And(0x80000000,Local0))
114 {
115 And(CLID, 0x0000000F, CLID)
116 GLID(CLID)
117 }
118 }
119 Store(Zero, GESF) // Clear the exit parameter
120 Store(Zero, PARM)
121 Return(SUCC) // Not supported, but no failure
122 }
123
124 // Display Power State: Sub-function 8
125
126 If (LEqual(GESF, 8))
127 {
128 Store(Zero, GESF) // Clear the exit parameter
129 Store(Zero, PARM)
130 Return(SUCC) // Not supported, but no failure
131 }
132
133 // Set Boot Display: Sub-function 9
134
135 If (LEqual(GESF, 9))
136 {
137
138 //<TODO> An OEM may elect to implement this method. In that case,
139 // the input values must be saved into non-volatile storage for
140 // parsing during the next boot. The following Sample code is Intel
141 // validated implementation.
142
143 And(PARM, 0xFF, IBTT) // Save the boot display to NVS
144 Store(Zero, GESF) // Clear the exit parameter
145 Store(Zero, PARM)
146 Return(SUCC) // Reserved, "Critical failure"
147 }
148
149 // Set Panel Details: Sub-function 10 (0Ah)
150
151 If (LEqual(GESF, 10))
152 {
153
154 //<TODO> An OEM may elect to implement this method. In that case,
155 // the input values must be saved into non-volatile storage for
156 // parsing during the next boot. The following Sample code is Intel
157 // validated implementation.
158
159 // Set the panel-related NVRAM variables based the input from the driver.
160
161 And(PARM, 0xFF, IPSC)
162
163 // Change panel type if a change is requested by the driver (Change if
164 // panel type input is non-zero). Zero=No change requested.
165
166 If(And(ShiftRight(PARM, 8), 0xFF))
167 {
168 And(ShiftRight(PARM, 8), 0xFF, IPAT)
169 Decrement(IPAT) // 0 = no change, so fit to CMOS map
170 }
171 And(ShiftRight(PARM, 18), 0x3, IBLC)
172 And(ShiftRight(PARM, 20), 0x7, IBIA)
173 Store(Zero, GESF) // Clear the exit parameter
174 Store(Zero, PARM)
175 Return(SUCC) // Success
176 }
177
178 // Set Internal Graphics: Sub-function 11 (0Bh)
179
180 If (LEqual(GESF, 11))
181 {
182
183 //<TODO> An OEM may elect to implement this method. In that case,
184 // the input values must be saved into non-volatile storage for
185 // parsing during the next boot. The following Sample code is Intel
186 // validated implementation.
187
188 And(ShiftRight(PARM, 1), 1, IF1E) // Program the function 1 option
189
190 // Fixed memory/DVMT memory
191
192 And(ShiftRight(PARM, 17), 0xF, IDMS) // Program DVMT/fixed memory size
193
194 Store(Zero, GESF) // Clear the exit parameter
195 Store(Zero, PARM)
196 Return(SUCC) // Success
197 }
198
199 // Post-Hires to DOS FS: Sub-function 16 (10h)
200
201 If (LEqual(GESF, 16))
202 {
203 Store(Zero, GESF) // Clear the exit parameter
204 Store(Zero, PARM)
205 Return(SUCC) // Not supported, but no failure
206 }
207
208 // APM Complete: Sub-function 17 (11h)
209
210 If (LEqual(GESF, 17))
211 {
212
213 Store(ShiftLeft(LIDS, 8), PARM) // Report the lid state
214 Add(PARM, 0x100, PARM) // Adjust the lid state, 0 = Unknown
215
216 Store(Zero, GESF) // Clear the exit parameter
217 Return(SUCC) // Not supported, but no failure
218 }
219
220 // Set Spread Spectrum Clocks: Sub-function 18 (12h)
221
222 If (LEqual(GESF, 18))
223 {
224
225 //<TODO> An OEM may elect to implement this method. In that case,
226 // the input values must be saved into non-volatile storage for
227 // parsing during the next boot. The following Sample code is Intel
228 // validated implementation.
229
230 If(And(PARM, 1))
231 {
232 If(LEqual(ShiftRight(PARM, 1), 1))
233 {
234 Store(1, ISSC) // Enable HW SSC, only for clock 1
235 }
236 Else
237 {
238 Store(Zero, GESF)
239 Return(CRIT) // Failure, as the SSC clock must be 1
240 }
241 }
242 Else
243 {
244 Store(0, ISSC) // Disable SSC
245 }
246 Store(Zero, GESF) // Clear the exit parameter
247 Store(Zero, PARM)
248 Return(SUCC) // Success
249 }
250
251 // Post VBE/PM Callback: Sub-function 19 (13h)
252
253 If (LEqual(GESF, 19))
254 {
255 Store(Zero, GESF) // Clear the exit parameter
256 Store(Zero, PARM)
257 Return(SUCC) // Not supported, but no failure
258 }
259
260 // Set PAVP Data: Sub-function 20 (14h)
261
262 If (LEqual(GESF, 20))
263 {
264 And(PARM, 0xF, PAVP) // Store PAVP info
265 Store(Zero, GESF) // Clear the exit parameter
266 Store(Zero, PARM)
267 Return(SUCC) // Success
268 }
269
270 // A call to a reserved "System BIOS callbacks" function was received
271
272 Store(Zero, GESF) // Clear the exit parameter
273 Return(SUCC) // Reserved, "Critical failure"
274 }