blob: d4e735e3e631caae624f6fa40aec82494993072b [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/*++
2
3Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
4
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.
9
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.
12
13
14
15Module Name:
16
17 IgdOGBDA.ASL
18
19Abstract:
20
21 IGD OpRegion/Software SCI Reference Code for the Baytrail Family.
22 This file contains Get BIOS Data Area funciton support for
23 the Integrated Graphics Device (IGD) OpRegion/Software SCI mechanism.
24
25--*/
26
27
28Method (GBDA, 0, Serialized)
29{
30
31 // Supported calls: Sub-function 0
32
33 If (LEqual(GESF, 0))
34 {
35 //<TODO> Update implementation specific supported calls. Reference
36 // code is set to Intel's validated implementation.
37
38 Store(0x0000279, PARM)
39
40 Store(Zero, GESF) // Clear the exit parameter
41 Return(SUCC) // Success
42 }
43
44 // Requested callbacks: Sub-function 1
45
46 If (LEqual(GESF, 1))
47 {
48
49 //<TODO> Update implementation specific system BIOS requested call
50 // back functions. Call back functions are where the driver calls the
51 // system BIOS at function indicated event.
52
53 Store(0x00000240, PARM)
54
55 Store(Zero, GESF) // Clear the exit parameter
56 Return(SUCC) // Success
57 }
58
59 // Get Boot display Preferences: Sub-function 4
60
61 If (LEqual(GESF, 4))
62 {
63
64 //<TODO> Update the implementation specific Get Boot Display
65 // Preferences function.
66
67 And(PARM, 0xEFFF0000, PARM) // PARM[30:16] = Boot device ports
68 And(PARM, ShiftLeft(DeRefOf(Index(DBTB, IBTT)), 16), PARM)
69 Or(IBTT, PARM, PARM) // PARM[7:0] = Boot device type
70
71 Store(Zero, GESF) // Clear the exit parameter
72 Return(SUCC) // Success
73 }
74
75 // Panel details: Sub-function 5
76
77 If (LEqual(GESF, 5))
78 {
79
80 //<TODO> Update the implementation specific Get Panel Details
81 // function.
82
83 Store(IPSC, PARM) // Report the scaling setting
84 Or(PARM, ShiftLeft(IPAT, 8), PARM)
85 Add(PARM, 0x100, PARM) // Adjust panel type, 0 = VBT default
86 Or(PARM, ShiftLeft(LIDS, 16), PARM) // Report the lid state
87 Add(PARM, 0x10000, PARM) // Adjust the lid state, 0 = Unknown
88 Or(PARM, ShiftLeft(IBLC, 18), PARM) // Report the BLC setting
89 Or(PARM, ShiftLeft(IBIA, 20), PARM) // Report the BIA setting
90 Store(Zero, GESF)
91 Return(SUCC)
92 }
93
94 // TV-standard/Video-connector: Sub-function 6
95
96 If (LEqual(GESF, 6))
97 {
98
99 //<TODO> Update the implementation specific Get
100 // TV-standard/Video-connectorPanel function.
101
102 Store(ITVF, PARM)
103 Or(PARM, ShiftLeft(ITVM, 4), PARM)
104 Store(Zero, GESF)
105 Return(SUCC)
106 }
107
108 // Internal graphics: Sub-function 7
109
110 If (LEqual(GESF, 7))
111 {
112 Store(GIVD, PARM) // PARM[0] - VGA mode(1=VGA)
113 Xor(PARM, 1, PARM) // Invert the VGA mode polarity
114 Or(PARM, ShiftLeft(GMFN, 1), PARM) // PARM[1] - # IGD PCI functions-1
115 // PARM[3:2] - Reserved
116 // PARM[4] - IGD D3 support(0=cold)
117 // PARM[10:5] - Reserved
118 Or(PARM, ShiftLeft(3, 11), PARM) // PARM[12:11] - DVMT mode(11b = 5.0)
119
120 //
121 // Report DVMT 5.0 Total Graphics memory size.
122 //
123 Or(PARM, ShiftLeft(IDMS, 17), PARM) // Bits 20:17 are for Gfx total memory size
124
125 // If the "Set Internal Graphics" call is supported, the modified
126 // settings flag must be programmed per the specification. This means
127 // that the flag must be set to indicate that system BIOS requests
128 // these settings. Once "Set Internal Graphics" is called, the
129 // modified settings flag must be cleared on all subsequent calls to
130 // this function.
131
132 // Report the graphics frequency based on DISPLAY_CLOCK_FREQUENCY_ENCODING [MMADR+0x20C8]
133
134 Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)), 21),PARM, PARM)
135
136 Store(1, GESF) // Set the modified settings flag
137 Return(SUCC)
138 }
139
140 // Spread spectrum clocks: Sub-function 10
141
142 If (LEqual(GESF, 10))
143 {
144
145 Store(0, PARM) // Assume SSC is disabled
146
147 If(ISSC)
148 {
149 Or(PARM, 3, PARM) // If SSC enabled, return SSC1+Enabled
150 }
151
152 Store(0, GESF) // Set the modified settings flag
153 Return(SUCC) // Success
154 }
155
156
157 // A call to a reserved "Get BIOS data" function was received.
158
159 Store(Zero, GESF) // Clear the exit parameter
160 Return(CRIT) // Reserved, "Critical failure"
161}