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 system BIOS call back functionality for the
17 OpRegion/Software SCI mechanism.
22 Method (SBCB, 0, Serialized)
25 // Supported Callbacks: Sub-function 0
27 If (LEqual(GESF, 0x0))
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.
35 Store(0x00000000, PARM) // No callbacks supported
39 Store(0x000F87FD, PARM) // Mobile
43 Store(0x000F87BD, PARM) // Desktop
46 Store(Zero, GESF) // Clear the exit parameter
47 Return(SUCC) // "Success"
50 // BIOS POST Completion: Sub-function 1
54 Store(Zero, GESF) // Clear the exit parameter
56 Return(SUCC) // Not supported, but no failure
59 // Pre-Hires Set Mode: Sub-function 3
63 Store(Zero, GESF) // Clear the exit parameter
65 Return(SUCC) // Not supported, but no failure
68 // Post-Hires Set Mode: Sub-function 4
72 Store(Zero, GESF) // Clear the exit parameter
74 Return(SUCC) // Not supported, but no failure
77 // Display Switch: Sub-function 5
81 Store(Zero, GESF) // Clear the exit parameter
83 Return(SUCC) // Not supported, but no failure
86 // Set TV format: Sub-function 6
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.
95 Store(And(PARM, 0x0F), ITVF)
96 Store(ShiftRight(And(PARM, 0xF0), 4), ITVM)
97 Store(Zero, GESF) // Clear the exit parameter
102 // Adapter Power State: Sub-function 7
107 // Upon notification from driver that the Adapter Power State = D0,
108 // check if previous lid event failed. If it did, retry the lid
113 If(And(0x80000000,Local0))
115 And(CLID, 0x0000000F, CLID)
119 Store(Zero, GESF) // Clear the exit parameter
121 Return(SUCC) // Not supported, but no failure
124 // Display Power State: Sub-function 8
128 Store(Zero, GESF) // Clear the exit parameter
130 Return(SUCC) // Not supported, but no failure
133 // Set Boot Display: Sub-function 9
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.
143 And(PARM, 0xFF, IBTT) // Save the boot display to NVS
144 Store(Zero, GESF) // Clear the exit parameter
146 Return(SUCC) // Reserved, "Critical failure"
149 // Set Panel Details: Sub-function 10 (0Ah)
151 If (LEqual(GESF, 10))
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.
159 // Set the panel-related NVRAM variables based the input from the driver.
161 And(PARM, 0xFF, IPSC)
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.
166 If(And(ShiftRight(PARM, 8), 0xFF))
168 And(ShiftRight(PARM, 8), 0xFF, IPAT)
169 Decrement(IPAT) // 0 = no change, so fit to CMOS map
171 And(ShiftRight(PARM, 18), 0x3, IBLC)
172 And(ShiftRight(PARM, 20), 0x7, IBIA)
173 Store(Zero, GESF) // Clear the exit parameter
175 Return(SUCC) // Success
178 // Set Internal Graphics: Sub-function 11 (0Bh)
180 If (LEqual(GESF, 11))
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.
188 And(ShiftRight(PARM, 1), 1, IF1E) // Program the function 1 option
190 // Fixed memory/DVMT memory
192 And(ShiftRight(PARM, 17), 0xF, IDMS) // Program DVMT/fixed memory size
194 Store(Zero, GESF) // Clear the exit parameter
196 Return(SUCC) // Success
199 // Post-Hires to DOS FS: Sub-function 16 (10h)
201 If (LEqual(GESF, 16))
203 Store(Zero, GESF) // Clear the exit parameter
205 Return(SUCC) // Not supported, but no failure
208 // APM Complete: Sub-function 17 (11h)
210 If (LEqual(GESF, 17))
213 Store(ShiftLeft(LIDS, 8), PARM) // Report the lid state
214 Add(PARM, 0x100, PARM) // Adjust the lid state, 0 = Unknown
216 Store(Zero, GESF) // Clear the exit parameter
217 Return(SUCC) // Not supported, but no failure
220 // Set Spread Spectrum Clocks: Sub-function 18 (12h)
222 If (LEqual(GESF, 18))
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.
232 If(LEqual(ShiftRight(PARM, 1), 1))
234 Store(1, ISSC) // Enable HW SSC, only for clock 1
239 Return(CRIT) // Failure, as the SSC clock must be 1
244 Store(0, ISSC) // Disable SSC
246 Store(Zero, GESF) // Clear the exit parameter
248 Return(SUCC) // Success
251 // Post VBE/PM Callback: Sub-function 19 (13h)
253 If (LEqual(GESF, 19))
255 Store(Zero, GESF) // Clear the exit parameter
257 Return(SUCC) // Not supported, but no failure
260 // Set PAVP Data: Sub-function 20 (14h)
262 If (LEqual(GESF, 20))
264 And(PARM, 0xF, PAVP) // Store PAVP info
265 Store(Zero, GESF) // Clear the exit parameter
267 Return(SUCC) // Success
270 // A call to a reserved "System BIOS callbacks" function was received
272 Store(Zero, GESF) // Clear the exit parameter
273 Return(SUCC) // Reserved, "Critical failure"