summaryrefslogtreecommitdiffstats
path: root/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
blob: 4482db6906289b7035b12db15bc40780b4f72b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*++

Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved

  SPDX-License-Identifier: BSD-2-Clause-Patent



Module Name:

  IgdOGBDA.ASL

Abstract:

  IGD OpRegion/Software SCI Reference Code for the Baytrail Family.
  This file contains Get BIOS Data Area funciton support for
  the Integrated Graphics Device (IGD) OpRegion/Software SCI mechanism.

--*/


Method (GBDA, 0, Serialized)
{

  // Supported calls: Sub-function 0

  If (LEqual(GESF, 0))
  {
    //<TODO> Update implementation specific supported calls.  Reference
    // code is set to Intel's validated implementation.

    Store(0x0000279, PARM)

    Store(Zero, GESF)               // Clear the exit parameter
    Return(SUCC)                    // Success
  }

  // Requested callbacks: Sub-function 1

  If (LEqual(GESF, 1))
  {

    //<TODO> Update implementation specific system BIOS requested call
    // back functions.  Call back functions are where the driver calls the
    // system BIOS at function indicated event.

    Store(0x00000240, PARM)

    Store(Zero, GESF)               // Clear the exit parameter
    Return(SUCC)                    // Success
  }

  // Get Boot display Preferences: Sub-function 4

  If (LEqual(GESF, 4))
  {

    //<TODO> Update the implementation specific Get Boot Display
    // Preferences function.

    And(PARM, 0xEFFF0000, PARM)     // PARM[30:16] = Boot device ports
    And(PARM, ShiftLeft(DeRefOf(Index(DBTB, IBTT)), 16), PARM)
    Or(IBTT, PARM, PARM)            // PARM[7:0] = Boot device type

    Store(Zero, GESF)               // Clear the exit parameter
    Return(SUCC)                    // Success
  }

  // Panel details: Sub-function 5

  If (LEqual(GESF, 5))
  {

    //<TODO> Update the implementation specific Get Panel Details
    // function.

    Store(IPSC, PARM)               // Report the scaling setting
    Or(PARM, ShiftLeft(IPAT, 8), PARM)
    Add(PARM, 0x100, PARM)          // Adjust panel type, 0 = VBT default
    Or(PARM, ShiftLeft(LIDS, 16), PARM) // Report the lid state
    Add(PARM, 0x10000, PARM)        // Adjust the lid state, 0 = Unknown
    Or(PARM, ShiftLeft(IBLC, 18), PARM) // Report the BLC setting
    Or(PARM, ShiftLeft(IBIA, 20), PARM) // Report the BIA setting
    Store(Zero, GESF)
    Return(SUCC)
  }

  // TV-standard/Video-connector: Sub-function 6

  If (LEqual(GESF, 6))
  {

    //<TODO> Update the implementation specific Get
    // TV-standard/Video-connectorPanel function.

    Store(ITVF, PARM)
    Or(PARM, ShiftLeft(ITVM, 4), PARM)
    Store(Zero, GESF)
    Return(SUCC)
  }

  // Internal graphics: Sub-function 7

  If (LEqual(GESF, 7))
  {
    Store(GIVD, PARM)               // PARM[0]      - VGA mode(1=VGA)
    Xor(PARM, 1, PARM)              // Invert the VGA mode polarity
    Or(PARM, ShiftLeft(GMFN, 1), PARM) // PARM[1]   - # IGD PCI functions-1
    // PARM[3:2]    - Reserved
    // PARM[4]      - IGD D3 support(0=cold)
    // PARM[10:5]   - Reserved
    Or(PARM, ShiftLeft(3, 11), PARM) // PARM[12:11] - DVMT mode(11b = 5.0)

    //
    // Report DVMT 5.0 Total Graphics memory size.
    //
    Or(PARM, ShiftLeft(IDMS, 17), PARM)   // Bits 20:17 are for Gfx total memory size

    // If the "Set Internal Graphics" call is supported, the modified
    // settings flag must be programmed per the specification.  This means
    // that the flag must be set to indicate that system BIOS requests
    // these settings.  Once "Set Internal Graphics" is called, the
    //  modified settings flag must be cleared on all subsequent calls to
    // this function.

    // Report the graphics frequency based on DISPLAY_CLOCK_FREQUENCY_ENCODING [MMADR+0x20C8]

    Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)), 21),PARM, PARM)

    Store(1, GESF)                  // Set the modified settings flag
    Return(SUCC)
  }

  // Spread spectrum clocks: Sub-function 10

  If (LEqual(GESF, 10))
  {

    Store(0, PARM)                  // Assume SSC is disabled

    If(ISSC)
    {
      Or(PARM, 3, PARM)       // If SSC enabled, return SSC1+Enabled
    }

    Store(0, GESF)                  // Set the modified settings flag
    Return(SUCC)                    // Success
  }


  // A call to a reserved "Get BIOS data" function was received.

  Store(Zero, GESF)                     // Clear the exit parameter
  Return(CRIT)                          // Reserved, "Critical failure"
}