PC16.asi 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /** @file
  2. Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. Name (SUPP, 0)
  6. Name (CTRL, 0)
  7. Method(_PXM) {
  8. if (LEqual (CLOD, 0)) {
  9. Return(2)
  10. } else {
  11. Return(5)
  12. }
  13. }
  14. Method(_OSC,4) {
  15. //
  16. // Create DWord-addressable fields from the capabilities Buffer
  17. //
  18. CreateDWordField(Arg3,0,CDW1)
  19. If (LEqual(Arg0,ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) {
  20. //
  21. // Create DWord-addressable fields from the capabilities Buffer
  22. //
  23. CreateDWordField(Arg3,4,CDW2)
  24. //
  25. // Fill 3rd capability DWORD only if the count is greater than 2.
  26. //
  27. If(LGreater(Arg2,2)) {
  28. CreateDWordField(Arg3,8,CDW3)
  29. }
  30. //
  31. // Save Capabilities DWord2 & 3
  32. //
  33. Store(CDW2,SUPP)
  34. Store(CDW3,CTRL)
  35. //
  36. // Disable Native PCIe AER handling from OS so that it uses Firmware First model in WHEA
  37. //
  38. And (CTRL, 0x17, CTRL)
  39. If (LNotEqual(Arg1,one)) { // unknown revision
  40. Or(CDW1,0x08,CDW1)
  41. }
  42. If(LNotEqual(CDW3,CTRL)) { // capabilities bits were masked
  43. Or(CDW1,0x10,CDW1)
  44. }
  45. //
  46. // update DWORD3 in the buffer
  47. //
  48. Store(CTRL,CDW3)
  49. Return(Arg3)
  50. } Else {
  51. //
  52. // Just indicate unrecognized UUID
  53. // Leave it at that
  54. //
  55. Or (CDW1,4,CDW1)
  56. Store (0xEE, IO80)
  57. Return(Arg3)
  58. }
  59. } // End _OSC
  60. Method(_STA){
  61. // Have to account for logical offline condition which IIOx stack is still in QPI fabric, but not OS visible
  62. ShiftRight(PRBM, 2, Local1)
  63. And(Local1, 0x1, Local1)
  64. // Check if Socket is present
  65. if(LEqual(Local1, 0x1)) {
  66. // Account for Socket 2 in bitmap (8 x Socket #)
  67. ShiftRight(IIOH, 16, Local1)
  68. // Shift for IIO Stack 4
  69. ShiftRight(Local1, 4, Local1)
  70. And(Local1, 0x1, Local1)
  71. // Check if IIO Stack is present
  72. if(LEqual(Local1, 0x1)) {
  73. // IIOx stack present and logically online
  74. Return(0x0F)
  75. }
  76. }
  77. // IIOx stack logically offline
  78. Return(0x00)
  79. } // End Method STA
  80. Name(PR16, ResourceTemplate() {
  81. //RESOURCE_CHUNK1_OFF
  82. WORDBusNumber( //Bus number resource (0); the bridge produces bus numbers for its subsequent buses
  83. ResourceProducer, // bit 0 of general flags is 1
  84. MinFixed, // Range is fixed
  85. MaxFixed, // Range is fixed
  86. PosDecode, // PosDecode
  87. 0x0000, // Granularity (FIX1 - Patched by ACPI Platform Driver during POST)
  88. 0x0000, // Min (FIX1 - Patched by ACPI Platform Driver during POST)
  89. 0x0000, // Max (FIX1 - Patched by ACPI Platform Driver during POST)
  90. 0x0000, // Translation
  91. 0x0001, // Range Length = Max-Min+1 (FIX1 - Patched by ACPI Platform Driver during POST)
  92. ,
  93. ,
  94. FIX1 // DescriptorName populated so iASL outputs offset for it in a .h file
  95. )
  96. //: Off board video card not detected in device manager when it is connected to CPU
  97. //RESOURCE_CHUNK5_OFF
  98. DWORDMEMORY( // descriptor for video RAM on video card
  99. ResourceProducer, // bit 0 of general flags is 0
  100. PosDecode,
  101. MinFixed, // Range is fixed
  102. MaxFixed, // Range is Fixed
  103. Cacheable,
  104. ReadWrite,
  105. 0x00000000, // Granularity (FIX5 - Patched by ACPI Platform Driver during POST)
  106. 0x00000000, // Min (FIX5 - Patched by ACPI Platform Driver during POST)
  107. 0x00000000, // Max (FIX5 - Patched by ACPI Platform Driver during POST)
  108. 0x00000000, // Translation
  109. 0x00000000, // Range Length (FIX5 - Patched by ACPI Platform Driver during POST)
  110. ,
  111. ,
  112. FIX5 // DescriptorName populated so iASL outputs offset for it in a .h file
  113. )
  114. //RESOURCE_CHUNK2_OFF
  115. WORDIO( //Consumed-and-produced resource (all I/O above CFF)
  116. ResourceProducer, // bit 0 of general flags is 0
  117. MinFixed, // Range is fixed
  118. MaxFixed, // Range is fixed
  119. PosDecode,
  120. EntireRange,
  121. 0x0000, // Granularity (FIX2 - Patched by ACPI Platform Driver during POST)
  122. 0x0000, // Min (FIX2 - Patched by ACPI Platform Driver during POST)
  123. 0x0000, // Max (FIX2 - Patched by ACPI Platform Driver during POST)
  124. 0x0000, // Translation
  125. 0x0001, // Range Length = Max-Min+1 (FIX2 - Patched by ACPI Platform Driver during POST)
  126. ,
  127. ,
  128. FIX2 // DescriptorName populated so iASL outputs offset for it in a .h file
  129. )
  130. //Off board video card not detected in device manager when it is connected to CPU
  131. //Descriptor for IO space of the video card.
  132. WORDIO( // Consumed-and-produced resource (all I/O below CF8)
  133. ResourceProducer, // bit 0 of general flags is 0
  134. MinFixed, // Range is fixed
  135. MaxFixed, // Range is fixed
  136. PosDecode,
  137. EntireRange,
  138. 0x0000, // Granularity (FIX6 - Patched by ACPI Platform Driver during POST)
  139. 0x0000, // Min (FIX6 - Patched by ACPI Platform Driver during POST)
  140. 0x0000, // Max (FIX6 - Patched by ACPI Platform Driver during POST)
  141. 0x0000, // Translation
  142. 0x0000, // Range Length
  143. ,
  144. ,
  145. FIX6 // DescriptorName populated so iASL outputs offset for it in a .h file
  146. )
  147. //Off board video card not detected in device manager when it is connected to CPU
  148. //Descriptor for IO space of the video card.
  149. WORDIO( // Consumed-and-produced resource (all I/O below CF8)
  150. ResourceProducer, // bit 0 of general flags is 0
  151. MinFixed, // Range is fixed
  152. MaxFixed, // Range is fixed
  153. PosDecode,
  154. EntireRange,
  155. 0x0000, // Granularity (FIX7 - Patched by ACPI Platform Driver during POST)
  156. 0x0000, // Min (FIX7 - Patched by ACPI Platform Driver during POST)
  157. 0x0000, // Max (FIX7 - Patched by ACPI Platform Driver during POST)
  158. 0x0000, // Translation
  159. 0x0000, // Range Length
  160. ,
  161. ,
  162. FIX7 // DescriptorName populated so iASL outputs offset for it in a .h file
  163. )
  164. //
  165. // PCI RESOURCE_32bit
  166. //
  167. DWORDMemory( // Consumed-and-produced resource(all of memory space)
  168. ResourceProducer, // bit 0 of general flags is 0
  169. PosDecode, // positive Decode
  170. MinFixed, // Range is fixed
  171. MaxFixed, // Range is fixed
  172. NonCacheable,
  173. ReadWrite,
  174. 0x00000000, // Granularity (FIX3 - Patched by ACPI Platform Driver during POST)
  175. 0x00000000, // Min (calculated dynamically) (FIX3 - Patched by ACPI Platform Driver during POST)
  176. 0x00000000, // Max = 4GB - 1MB (fwh + fwh alias) (FIX3 - Patched by ACPI Platform Driver during POST)
  177. 0x00000000, // Translation
  178. 0x00000000, // Range Length (calculated dynamically) (FIX3 - Patched by ACPI Platform Driver during POST)
  179. ,
  180. ,
  181. FIX3 // DescriptorName populated so iASL outputs offset for it in a .h file
  182. )
  183. //
  184. // PCI RESOURCE_64bit
  185. //
  186. QWORDMemory( // Consumed-and-produced resource(all of memory space)
  187. ResourceProducer, // bit 0 of general flags is 0
  188. PosDecode, // positive Decode
  189. MinFixed, // Range is fixed
  190. MaxFixed, // Range is fixed
  191. NonCacheable,
  192. ReadWrite,
  193. 0x00000000000, // Granularity (FIX4 - Patched by ACPI Platform Driver during POST)
  194. 0x00000000000, // Min (calculated dynamically) (FIX4 - Patched by ACPI Platform Driver during POST)
  195. 0x00000000000, // Max = 4GB - 1MB (fwh + fwh alias) (FIX4 - Patched by ACPI Platform Driver during POST)
  196. 0x00000000000, // Translation
  197. 0x00000000000, // Range Length (calculated dynamically) (FIX4 - Patched by ACPI Platform Driver during POST)
  198. ,
  199. ,
  200. FIX4 // DescriptorName populated so iASL outputs offset for it in a .h file
  201. )
  202. }) // end of PR16 Buffer
  203. // Current resource template return
  204. Method(_CRS, 0x0, NotSerialized) {
  205. Return(PR16)
  206. }