3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 IGD OpRegion/Software SCI Reference Code for the Baytrail Family.
22 This file contains the system BIOS call back functionality for the
23 OpRegion/Software SCI mechanism.
28 Method (SBCB, 0, Serialized)
31 // Supported Callbacks: Sub-function 0
33 If (LEqual(GESF, 0x0))
36 //<TODO> An OEM may support the driver->SBIOS status callbacks, but
37 // the supported callbacks value must be modified. The code that is
38 // executed upon reception of the callbacks must be also be updated
39 // to perform the desired functionality.
41 Store(0x00000000, PARM) // No callbacks supported
45 Store(0x000F87FD, PARM) // Mobile
49 Store(0x000F87BD, PARM) // Desktop
52 Store(Zero, GESF) // Clear the exit parameter
53 Return(SUCC) // "Success"
56 // BIOS POST Completion: Sub-function 1
60 Store(Zero, GESF) // Clear the exit parameter
62 Return(SUCC) // Not supported, but no failure
65 // Pre-Hires Set Mode: Sub-function 3
69 Store(Zero, GESF) // Clear the exit parameter
71 Return(SUCC) // Not supported, but no failure
74 // Post-Hires Set Mode: Sub-function 4
78 Store(Zero, GESF) // Clear the exit parameter
80 Return(SUCC) // Not supported, but no failure
83 // Display Switch: Sub-function 5
87 Store(Zero, GESF) // Clear the exit parameter
89 Return(SUCC) // Not supported, but no failure
92 // Set TV format: Sub-function 6
97 //<TODO> If implemented, the input values must be saved into
98 // non-volatile storage for parsing during the next boot. The
99 // following Sample code is Intel validated implementation.
101 Store(And(PARM, 0x0F), ITVF)
102 Store(ShiftRight(And(PARM, 0xF0), 4), ITVM)
103 Store(Zero, GESF) // Clear the exit parameter
108 // Adapter Power State: Sub-function 7
113 // Upon notification from driver that the Adapter Power State = D0,
114 // check if previous lid event failed. If it did, retry the lid
119 If(And(0x80000000,Local0))
121 And(CLID, 0x0000000F, CLID)
125 Store(Zero, GESF) // Clear the exit parameter
127 Return(SUCC) // Not supported, but no failure
130 // Display Power State: Sub-function 8
134 Store(Zero, GESF) // Clear the exit parameter
136 Return(SUCC) // Not supported, but no failure
139 // Set Boot Display: Sub-function 9
144 //<TODO> An OEM may elect to implement this method. In that case,
145 // the input values must be saved into non-volatile storage for
146 // parsing during the next boot. The following Sample code is Intel
147 // validated implementation.
149 And(PARM, 0xFF, IBTT) // Save the boot display to NVS
150 Store(Zero, GESF) // Clear the exit parameter
152 Return(SUCC) // Reserved, "Critical failure"
155 // Set Panel Details: Sub-function 10 (0Ah)
157 If (LEqual(GESF, 10))
160 //<TODO> An OEM may elect to implement this method. In that case,
161 // the input values must be saved into non-volatile storage for
162 // parsing during the next boot. The following Sample code is Intel
163 // validated implementation.
165 // Set the panel-related NVRAM variables based the input from the driver.
167 And(PARM, 0xFF, IPSC)
169 // Change panel type if a change is requested by the driver (Change if
170 // panel type input is non-zero). Zero=No change requested.
172 If(And(ShiftRight(PARM, 8), 0xFF))
174 And(ShiftRight(PARM, 8), 0xFF, IPAT)
175 Decrement(IPAT) // 0 = no change, so fit to CMOS map
177 And(ShiftRight(PARM, 18), 0x3, IBLC)
178 And(ShiftRight(PARM, 20), 0x7, IBIA)
179 Store(Zero, GESF) // Clear the exit parameter
181 Return(SUCC) // Success
184 // Set Internal Graphics: Sub-function 11 (0Bh)
186 If (LEqual(GESF, 11))
189 //<TODO> An OEM may elect to implement this method. In that case,
190 // the input values must be saved into non-volatile storage for
191 // parsing during the next boot. The following Sample code is Intel
192 // validated implementation.
194 And(ShiftRight(PARM, 1), 1, IF1E) // Program the function 1 option
196 // Fixed memory/DVMT memory
198 And(ShiftRight(PARM, 17), 0xF, IDMS) // Program DVMT/fixed memory size
200 Store(Zero, GESF) // Clear the exit parameter
202 Return(SUCC) // Success
205 // Post-Hires to DOS FS: Sub-function 16 (10h)
207 If (LEqual(GESF, 16))
209 Store(Zero, GESF) // Clear the exit parameter
211 Return(SUCC) // Not supported, but no failure
214 // APM Complete: Sub-function 17 (11h)
216 If (LEqual(GESF, 17))
219 Store(ShiftLeft(LIDS, 8), PARM) // Report the lid state
220 Add(PARM, 0x100, PARM) // Adjust the lid state, 0 = Unknown
222 Store(Zero, GESF) // Clear the exit parameter
223 Return(SUCC) // Not supported, but no failure
226 // Set Spread Spectrum Clocks: Sub-function 18 (12h)
228 If (LEqual(GESF, 18))
231 //<TODO> An OEM may elect to implement this method. In that case,
232 // the input values must be saved into non-volatile storage for
233 // parsing during the next boot. The following Sample code is Intel
234 // validated implementation.
238 If(LEqual(ShiftRight(PARM, 1), 1))
240 Store(1, ISSC) // Enable HW SSC, only for clock 1
245 Return(CRIT) // Failure, as the SSC clock must be 1
250 Store(0, ISSC) // Disable SSC
252 Store(Zero, GESF) // Clear the exit parameter
254 Return(SUCC) // Success
257 // Post VBE/PM Callback: Sub-function 19 (13h)
259 If (LEqual(GESF, 19))
261 Store(Zero, GESF) // Clear the exit parameter
263 Return(SUCC) // Not supported, but no failure
266 // Set PAVP Data: Sub-function 20 (14h)
268 If (LEqual(GESF, 20))
270 And(PARM, 0xF, PAVP) // Store PAVP info
271 Store(Zero, GESF) // Clear the exit parameter
273 Return(SUCC) // Success
276 // A call to a reserved "System BIOS callbacks" function was received
278 Store(Zero, GESF) // Clear the exit parameter
279 Return(SUCC) // Reserved, "Critical failure"