IgdOGBDA.ASL 4.5 KB

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