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