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