Gpe.asl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. /** @file
  2. ACPI DSDT table
  3. Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. // General Purpose Events. This Scope handles the Run-time and
  7. // Wake-time SCIs. The specific method called will be determined by
  8. // the _Lxx value, where xx equals the bit location in the General
  9. // Purpose Event register(s).
  10. External(D1F0)
  11. External(D1F1)
  12. External(D1F2)
  13. External(\_SB.PCI0.PEG0.HPME, MethodObj)
  14. External(\_SB.PCI0.PEG1.HPME, MethodObj)
  15. External(\_SB.PCI0.PEG2.HPME, MethodObj)
  16. External(\_GPE.AL6F, MethodObj)
  17. External(\_SB.THDR, MethodObj)
  18. External(\_GPE.P0L6, MethodObj)
  19. External(\_GPE.P1L6, MethodObj)
  20. External(\_GPE.P2L6, MethodObj)
  21. External(SGGP)
  22. External(P1GP)
  23. External(P2GP)
  24. External(P0WK)
  25. External(P1WK)
  26. External(P2WK)
  27. External(\CPG0)
  28. External(\RPS0)
  29. External(\RPT0)
  30. External(\_PR.HWPI, IntObj)
  31. External(\_PR.DTSI, IntObj)
  32. Scope(\_GPE)
  33. {
  34. // Note:
  35. // Originally, the two GPE methods below are automatically generated, but, for ASL code restructuring,
  36. // disabled the automatic generation and declare the ASL code here.
  37. //
  38. //
  39. // This PME event (PCH's GPE 69h) is received on one or more of the PCI Express* ports or
  40. // an assert PMEGPE message received via DMI
  41. //
  42. Method(_L69, 0, serialized) {
  43. \_SB.PCI0.RP01.HPME()
  44. \_SB.PCI0.RP02.HPME()
  45. \_SB.PCI0.RP03.HPME()
  46. \_SB.PCI0.RP04.HPME()
  47. \_SB.PCI0.RP05.HPME()
  48. \_SB.PCI0.RP06.HPME()
  49. \_SB.PCI0.RP07.HPME()
  50. \_SB.PCI0.RP08.HPME()
  51. \_SB.PCI0.RP09.HPME()
  52. \_SB.PCI0.RP10.HPME()
  53. \_SB.PCI0.RP11.HPME()
  54. \_SB.PCI0.RP12.HPME()
  55. \_SB.PCI0.RP13.HPME()
  56. \_SB.PCI0.RP14.HPME()
  57. \_SB.PCI0.RP15.HPME()
  58. \_SB.PCI0.RP16.HPME()
  59. \_SB.PCI0.RP17.HPME()
  60. \_SB.PCI0.RP18.HPME()
  61. \_SB.PCI0.RP19.HPME()
  62. \_SB.PCI0.RP20.HPME()
  63. \_SB.PCI0.RP21.HPME()
  64. \_SB.PCI0.RP22.HPME()
  65. \_SB.PCI0.RP23.HPME()
  66. \_SB.PCI0.RP24.HPME()
  67. If(LEqual(D1F0,1))
  68. {
  69. \_SB.PCI0.PEG0.HPME()
  70. Notify(\_SB.PCI0.PEG0, 0x02)
  71. Notify(\_SB.PCI0.PEG0.PEGP, 0x02)
  72. }
  73. If(LEqual(D1F1,1))
  74. {
  75. \_SB.PCI0.PEG1.HPME()
  76. Notify(\_SB.PCI0.PEG1, 0x02)
  77. }
  78. If(LEqual(D1F2,1))
  79. {
  80. \_SB.PCI0.PEG2.HPME()
  81. Notify(\_SB.PCI0.PEG2, 0x02)
  82. }
  83. }
  84. // PCI Express Hot-Plug caused the wake event.
  85. Method(_L61)
  86. {
  87. Add(L01C,1,L01C) // Increment L01 Entry Count.
  88. P8XH(0,0x01) // Output information to Port 80h.
  89. P8XH(1,L01C)
  90. // Check Root Port 1 for a Hot Plug Event if the Port is
  91. // enabled.
  92. If(LAnd(LNotEqual(\_SB.PCI0.RP01.VDID,0xFFFFFFFF),\_SB.PCI0.RP01.HPSX))
  93. {
  94. // Delay for 100ms to meet the timing requirements
  95. // of the PCI Express Base Specification, Revision
  96. // 1.0A, Section 6.6 ("...software must wait at
  97. // least 100ms from the end of reset of one or more
  98. // device before it is permitted to issue
  99. // Configuration Requests to those devices").
  100. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x1),LNotEqual(TBS1,0x1)))) {
  101. Sleep(100)
  102. }
  103. If(\_SB.PCI0.RP01.PDCX)
  104. {
  105. // Clear all status bits first.
  106. Store(1,\_SB.PCI0.RP01.PDCX)
  107. Store(1,\_SB.PCI0.RP01.HPSX)
  108. //
  109. // PCH BIOS Spec Update Rev 1.03, Section 8.9 PCI Express* Hot-Plug BIOS Support
  110. // In addition, BIOS should intercept Presence Detect Changed interrupt, enable L0s on
  111. // hot plug and disable L0s on hot unplug. BIOS should also make sure the L0s is
  112. // disabled on empty slots prior booting to OS.
  113. //
  114. If(LNot(\_SB.PCI0.RP01.PDSX)) {
  115. // The PCI Express slot is empty, so disable L0s on hot unplug
  116. //
  117. Store(0,\_SB.PCI0.RP01.L0SE)
  118. }
  119. // Perform proper notification
  120. // to the OS.
  121. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x1),LNotEqual(TBS1,0x1)))) {
  122. Notify(\_SB.PCI0.RP01,0)
  123. }
  124. }
  125. Else
  126. {
  127. // False event. Clear Hot-Plug Status
  128. // then exit.
  129. Store(1,\_SB.PCI0.RP01.HPSX)
  130. }
  131. }
  132. // Check Root Port 2 for a Hot Plug Event if the Port is
  133. // enabled.
  134. If(LAnd(LNotEqual(\_SB.PCI0.RP02.VDID,0xFFFFFFFF),\_SB.PCI0.RP02.HPSX))
  135. {
  136. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x2),LNotEqual(TBS1,0x2)))) {
  137. Sleep(100)
  138. }
  139. If(\_SB.PCI0.RP02.PDCX)
  140. {
  141. Store(1,\_SB.PCI0.RP02.PDCX)
  142. Store(1,\_SB.PCI0.RP02.HPSX)
  143. If(LNot(\_SB.PCI0.RP02.PDSX)) {
  144. Store(0,\_SB.PCI0.RP02.L0SE)
  145. }
  146. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x2),LNotEqual(TBS1,0x2)))) {
  147. Notify(\_SB.PCI0.RP02,0)
  148. }
  149. }
  150. Else
  151. {
  152. Store(1,\_SB.PCI0.RP02.HPSX)
  153. }
  154. }
  155. // Check Root Port 3 for a Hot Plug Event if the Port is
  156. // enabled.
  157. If(LAnd(LNotEqual(\_SB.PCI0.RP03.VDID,0xFFFFFFFF),\_SB.PCI0.RP03.HPSX))
  158. {
  159. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x3),LNotEqual(TBS1,0x3)))) {
  160. Sleep(100)
  161. }
  162. If(\_SB.PCI0.RP03.PDCX)
  163. {
  164. Store(1,\_SB.PCI0.RP03.PDCX)
  165. Store(1,\_SB.PCI0.RP03.HPSX)
  166. If(LNot(\_SB.PCI0.RP03.PDSX)) {
  167. Store(0,\_SB.PCI0.RP03.L0SE)
  168. }
  169. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x3),LNotEqual(TBS1,0x3)))) {
  170. Notify(\_SB.PCI0.RP03,0)
  171. }
  172. }
  173. Else
  174. {
  175. Store(1,\_SB.PCI0.RP03.HPSX)
  176. }
  177. }
  178. // Check Root Port 4 for a Hot Plug Event if the Port is
  179. // enabled.
  180. If(LAnd(LNotEqual(\_SB.PCI0.RP04.VDID,0xFFFFFFFF),\_SB.PCI0.RP04.HPSX))
  181. {
  182. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x4),LNotEqual(TBS1,0x4)))) {
  183. Sleep(100)
  184. }
  185. If(\_SB.PCI0.RP04.PDCX)
  186. {
  187. Store(1,\_SB.PCI0.RP04.PDCX)
  188. Store(1,\_SB.PCI0.RP04.HPSX)
  189. If(LNot(\_SB.PCI0.RP04.PDSX)) {
  190. Store(0,\_SB.PCI0.RP04.L0SE)
  191. }
  192. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x4),LNotEqual(TBS1,0x4)))) {
  193. Notify(\_SB.PCI0.RP04,0)
  194. }
  195. }
  196. Else
  197. {
  198. Store(1,\_SB.PCI0.RP04.HPSX)
  199. }
  200. }
  201. // Check Root Port 5 for a Hot Plug Event if the Port is
  202. // enabled.
  203. If(LAnd(LNotEqual(\_SB.PCI0.RP05.VDID,0xFFFFFFFF),\_SB.PCI0.RP05.HPSX))
  204. {
  205. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x5),LNotEqual(TBS1,0x5)))) {
  206. Sleep(100)
  207. }
  208. If(\_SB.PCI0.RP05.PDCX)
  209. {
  210. Store(1,\_SB.PCI0.RP05.PDCX)
  211. Store(1,\_SB.PCI0.RP05.HPSX)
  212. If(LNot(\_SB.PCI0.RP05.PDSX)) {
  213. Store(0,\_SB.PCI0.RP05.L0SE)
  214. }
  215. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x5),LNotEqual(TBS1,0x5)))) {
  216. Notify(\_SB.PCI0.RP05,0)
  217. }
  218. }
  219. Else
  220. {
  221. Store(1,\_SB.PCI0.RP05.HPSX)
  222. }
  223. }
  224. // Check Root Port 6 for a Hot Plug Event if the Port is
  225. // enabled.
  226. If(LAnd(LNotEqual(\_SB.PCI0.RP06.VDID,0xFFFFFFFF),\_SB.PCI0.RP06.HPSX))
  227. {
  228. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x6),LNotEqual(TBS1,0x6)))) {
  229. Sleep(100)
  230. }
  231. If(\_SB.PCI0.RP06.PDCX)
  232. {
  233. Store(1,\_SB.PCI0.RP06.PDCX)
  234. Store(1,\_SB.PCI0.RP06.HPSX)
  235. If(LNot(\_SB.PCI0.RP06.PDSX)) {
  236. Store(0,\_SB.PCI0.RP06.L0SE)
  237. }
  238. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x6),LNotEqual(TBS1,0x6)))) {
  239. Notify(\_SB.PCI0.RP06,0)
  240. }
  241. }
  242. Else
  243. {
  244. Store(1,\_SB.PCI0.RP06.HPSX)
  245. }
  246. }
  247. // Check Root Port 7 for a Hot Plug Event if the Port is
  248. // enabled.
  249. If(LAnd(LNotEqual(\_SB.PCI0.RP07.VDID,0xFFFFFFFF),\_SB.PCI0.RP07.HPSX))
  250. {
  251. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x7),LNotEqual(TBS1,0x7)))) {
  252. Sleep(100)
  253. }
  254. If(\_SB.PCI0.RP07.PDCX)
  255. {
  256. Store(1,\_SB.PCI0.RP07.PDCX)
  257. Store(1,\_SB.PCI0.RP07.HPSX)
  258. If(LNot(\_SB.PCI0.RP07.PDSX)) {
  259. Store(0,\_SB.PCI0.RP07.L0SE)
  260. }
  261. }
  262. Else
  263. {
  264. Store(1,\_SB.PCI0.RP07.HPSX)
  265. }
  266. }
  267. // Check Root Port 8 for a Hot Plug Event if the Port is
  268. // enabled.
  269. If(LAnd(LNotEqual(\_SB.PCI0.RP08.VDID,0xFFFFFFFF),\_SB.PCI0.RP08.HPSX))
  270. {
  271. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x8),LNotEqual(TBS1,0x8)))) {
  272. Sleep(100)
  273. }
  274. If(\_SB.PCI0.RP08.PDCX)
  275. {
  276. Store(1,\_SB.PCI0.RP08.PDCX)
  277. Store(1,\_SB.PCI0.RP08.HPSX)
  278. If(LNot(\_SB.PCI0.RP08.PDSX)) {
  279. Store(0,\_SB.PCI0.RP08.L0SE)
  280. }
  281. }
  282. Else
  283. {
  284. Store(1,\_SB.PCI0.RP08.HPSX)
  285. }
  286. }
  287. // Check Root Port 9 for a Hot Plug Event if the Port is
  288. // enabled.
  289. If(LAnd(LNotEqual(\_SB.PCI0.RP09.VDID,0xFFFFFFFF),\_SB.PCI0.RP09.HPSX))
  290. {
  291. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x9),LNotEqual(TBS1,0x9)))) {
  292. Sleep(100)
  293. }
  294. If(\_SB.PCI0.RP09.PDCX)
  295. {
  296. Store(1,\_SB.PCI0.RP09.PDCX)
  297. Store(1,\_SB.PCI0.RP09.HPSX)
  298. If(LNot(\_SB.PCI0.RP09.PDSX)) {
  299. Store(0,\_SB.PCI0.RP09.L0SE)
  300. }
  301. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x9),LNotEqual(TBS1,0x9)))) {
  302. Notify(\_SB.PCI0.RP09,0)
  303. }
  304. }
  305. Else
  306. {
  307. Store(1,\_SB.PCI0.RP09.HPSX)
  308. }
  309. }
  310. // Check Root Port 10 for a Hot Plug Event if the Port is
  311. // enabled.
  312. If(LAnd(LNotEqual(\_SB.PCI0.RP10.VDID,0xFFFFFFFF),\_SB.PCI0.RP10.HPSX))
  313. {
  314. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xA),LNotEqual(TBS1,0xA)))) {
  315. Sleep(100)
  316. }
  317. If(\_SB.PCI0.RP10.PDCX)
  318. {
  319. Store(1,\_SB.PCI0.RP10.PDCX)
  320. Store(1,\_SB.PCI0.RP10.HPSX)
  321. If(LNot(\_SB.PCI0.RP10.PDSX)) {
  322. Store(0,\_SB.PCI0.RP10.L0SE)
  323. }
  324. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xA),LNotEqual(TBS1,0xA)))) {
  325. Notify(\_SB.PCI0.RP10,0)
  326. }
  327. }
  328. Else
  329. {
  330. Store(1,\_SB.PCI0.RP10.HPSX)
  331. }
  332. }
  333. // Check Root Port 11 for a Hot Plug Event if the Port is
  334. // enabled.
  335. If(LAnd(LNotEqual(\_SB.PCI0.RP11.VDID,0xFFFFFFFF),\_SB.PCI0.RP11.HPSX))
  336. {
  337. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xB),LNotEqual(TBS1,0xB)))) {
  338. Sleep(100)
  339. }
  340. If(\_SB.PCI0.RP11.PDCX)
  341. {
  342. Store(1,\_SB.PCI0.RP11.PDCX)
  343. Store(1,\_SB.PCI0.RP11.HPSX)
  344. If(LNot(\_SB.PCI0.RP11.PDSX)) {
  345. Store(0,\_SB.PCI0.RP11.L0SE)
  346. }
  347. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xB),LNotEqual(TBS1,0xB)))) {
  348. Notify(\_SB.PCI0.RP11,0)
  349. }
  350. }
  351. Else
  352. {
  353. Store(1,\_SB.PCI0.RP11.HPSX)
  354. }
  355. }
  356. // Check Root Port 12 for a Hot Plug Event if the Port is
  357. // enabled.
  358. If(LAnd(LNotEqual(\_SB.PCI0.RP12.VDID,0xFFFFFFFF),\_SB.PCI0.RP12.HPSX))
  359. {
  360. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xC),LNotEqual(TBS1,0xC)))) {
  361. Sleep(100)
  362. }
  363. If(\_SB.PCI0.RP12.PDCX)
  364. {
  365. Store(1,\_SB.PCI0.RP12.PDCX)
  366. Store(1,\_SB.PCI0.RP12.HPSX)
  367. If(LNot(\_SB.PCI0.RP12.PDSX)) {
  368. Store(0,\_SB.PCI0.RP12.L0SE)
  369. }
  370. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xC),LNotEqual(TBS1,0xC)))) {
  371. Notify(\_SB.PCI0.RP12,0)
  372. }
  373. }
  374. Else
  375. {
  376. Store(1,\_SB.PCI0.RP12.HPSX)
  377. }
  378. }
  379. // Check Root Port 13 for a Hot Plug Event if the Port is
  380. // enabled.
  381. If(LAnd(LNotEqual(\_SB.PCI0.RP13.VDID,0xFFFFFFFF),\_SB.PCI0.RP13.HPSX))
  382. {
  383. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xD),LNotEqual(TBS1,0xD)))) {
  384. Sleep(100)
  385. }
  386. If(\_SB.PCI0.RP13.PDCX)
  387. {
  388. Store(1,\_SB.PCI0.RP13.PDCX)
  389. Store(1,\_SB.PCI0.RP13.HPSX)
  390. If(LNot(\_SB.PCI0.RP13.PDSX)) {
  391. Store(0,\_SB.PCI0.RP13.L0SE)
  392. }
  393. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xD),LNotEqual(TBS1,0xD)))) {
  394. Notify(\_SB.PCI0.RP13,0)
  395. }
  396. }
  397. Else
  398. {
  399. Store(1,\_SB.PCI0.RP13.HPSX)
  400. }
  401. }
  402. // Check Root Port 14 for a Hot Plug Event if the Port is
  403. // enabled.
  404. If(LAnd(LNotEqual(\_SB.PCI0.RP14.VDID,0xFFFFFFFF),\_SB.PCI0.RP14.HPSX))
  405. {
  406. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xE),LNotEqual(TBS1,0xE)))) {
  407. Sleep(100)
  408. }
  409. If(\_SB.PCI0.RP14.PDCX)
  410. {
  411. Store(1,\_SB.PCI0.RP14.PDCX)
  412. Store(1,\_SB.PCI0.RP14.HPSX)
  413. If(LNot(\_SB.PCI0.RP14.PDSX)) {
  414. Store(0,\_SB.PCI0.RP14.L0SE)
  415. }
  416. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xE),LNotEqual(TBS1,0xE)))) {
  417. Notify(\_SB.PCI0.RP14,0)
  418. }
  419. }
  420. Else
  421. {
  422. Store(1,\_SB.PCI0.RP14.HPSX)
  423. }
  424. }
  425. // Check Root Port 15 for a Hot Plug Event if the Port is
  426. // enabled.
  427. If(LAnd(LNotEqual(\_SB.PCI0.RP15.VDID,0xFFFFFFFF),\_SB.PCI0.RP15.HPSX))
  428. {
  429. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xF),LNotEqual(TBS1,0xF)))) {
  430. Sleep(100)
  431. }
  432. If(\_SB.PCI0.RP15.PDCX)
  433. {
  434. Store(1,\_SB.PCI0.RP15.PDCX)
  435. Store(1,\_SB.PCI0.RP15.HPSX)
  436. If(LNot(\_SB.PCI0.RP15.PDSX)) {
  437. Store(0,\_SB.PCI0.RP15.L0SE)
  438. }
  439. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0xF),LNotEqual(TBS1,0xF)))) {
  440. Notify(\_SB.PCI0.RP15,0)
  441. }
  442. }
  443. Else
  444. {
  445. Store(1,\_SB.PCI0.RP15.HPSX)
  446. }
  447. }
  448. // Check Root Port 16 for a Hot Plug Event if the Port is
  449. // enabled.
  450. If(LAnd(LNotEqual(\_SB.PCI0.RP16.VDID,0xFFFFFFFF),\_SB.PCI0.RP16.HPSX))
  451. {
  452. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x10),LNotEqual(TBS1,0x10)))) {
  453. Sleep(100)
  454. }
  455. If(\_SB.PCI0.RP16.PDCX)
  456. {
  457. Store(1,\_SB.PCI0.RP16.PDCX)
  458. Store(1,\_SB.PCI0.RP16.HPSX)
  459. If(LNot(\_SB.PCI0.RP16.PDSX)) {
  460. Store(0,\_SB.PCI0.RP16.L0SE)
  461. }
  462. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x10),LNotEqual(TBS1,0x10)))) {
  463. Notify(\_SB.PCI0.RP16,0)
  464. }
  465. }
  466. Else
  467. {
  468. Store(1,\_SB.PCI0.RP16.HPSX)
  469. }
  470. }
  471. // Check Root Port 17 for a Hot Plug Event if the Port is
  472. // enabled.
  473. If(LAnd(LNotEqual(\_SB.PCI0.RP17.VDID,0xFFFFFFFF),\_SB.PCI0.RP17.HPSX))
  474. {
  475. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x11),LNotEqual(TBS1,0x11)))) {
  476. Sleep(100)
  477. }
  478. If(\_SB.PCI0.RP17.PDCX)
  479. {
  480. Store(1,\_SB.PCI0.RP17.PDCX)
  481. Store(1,\_SB.PCI0.RP17.HPSX)
  482. If(LNot(\_SB.PCI0.RP17.PDSX)) {
  483. Store(0,\_SB.PCI0.RP17.L0SE)
  484. }
  485. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x11),LNotEqual(TBS1,0x11)))) {
  486. Notify(\_SB.PCI0.RP17,0)
  487. }
  488. }
  489. Else
  490. {
  491. Store(1,\_SB.PCI0.RP17.HPSX)
  492. }
  493. }
  494. // Check Root Port 18 for a Hot Plug Event if the Port is
  495. // enabled.
  496. If(LAnd(LNotEqual(\_SB.PCI0.RP18.VDID,0xFFFFFFFF),\_SB.PCI0.RP18.HPSX))
  497. {
  498. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x12),LNotEqual(TBS1,0x12)))) {
  499. Sleep(100)
  500. }
  501. If(\_SB.PCI0.RP18.PDCX)
  502. {
  503. Store(1,\_SB.PCI0.RP18.PDCX)
  504. Store(1,\_SB.PCI0.RP18.HPSX)
  505. If(LNot(\_SB.PCI0.RP18.PDSX)) {
  506. Store(0,\_SB.PCI0.RP18.L0SE)
  507. }
  508. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x12),LNotEqual(TBS1,0x12)))) {
  509. Notify(\_SB.PCI0.RP18,0)
  510. }
  511. }
  512. Else
  513. {
  514. Store(1,\_SB.PCI0.RP18.HPSX)
  515. }
  516. }
  517. // Check Root Port 19 for a Hot Plug Event if the Port is
  518. // enabled.
  519. If(LAnd(LNotEqual(\_SB.PCI0.RP19.VDID,0xFFFFFFFF),\_SB.PCI0.RP19.HPSX))
  520. {
  521. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x13),LNotEqual(TBS1,0x13)))) {
  522. Sleep(100)
  523. }
  524. If(\_SB.PCI0.RP19.PDCX)
  525. {
  526. Store(1,\_SB.PCI0.RP19.PDCX)
  527. Store(1,\_SB.PCI0.RP19.HPSX)
  528. If(LNot(\_SB.PCI0.RP19.PDSX)) {
  529. Store(0,\_SB.PCI0.RP19.L0SE)
  530. }
  531. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x13),LNotEqual(TBS1,0x13)))) {
  532. Notify(\_SB.PCI0.RP19,0)
  533. }
  534. }
  535. Else
  536. {
  537. Store(1,\_SB.PCI0.RP19.HPSX)
  538. }
  539. }
  540. // Check Root Port 20 for a Hot Plug Event if the Port is
  541. // enabled.
  542. If(LAnd(LNotEqual(\_SB.PCI0.RP20.VDID,0xFFFFFFFF),\_SB.PCI0.RP20.HPSX))
  543. {
  544. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x14),LNotEqual(TBS1,0x14)))) {
  545. Sleep(100)
  546. }
  547. If(\_SB.PCI0.RP20.PDCX)
  548. {
  549. Store(1,\_SB.PCI0.RP20.PDCX)
  550. Store(1,\_SB.PCI0.RP20.HPSX)
  551. If(LNot(\_SB.PCI0.RP20.PDSX)) {
  552. Store(0,\_SB.PCI0.RP20.L0SE)
  553. }
  554. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x14),LNotEqual(TBS1,0x14)))) {
  555. Notify(\_SB.PCI0.RP20,0)
  556. }
  557. }
  558. Else
  559. {
  560. Store(1,\_SB.PCI0.RP20.HPSX)
  561. }
  562. }
  563. // Check Root Port 21 for a Hot Plug Event if the Port is
  564. // enabled.
  565. If(LAnd(LNotEqual(\_SB.PCI0.RP21.VDID,0xFFFFFFFF),\_SB.PCI0.RP21.HPSX))
  566. {
  567. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x21),LNotEqual(TBS1,0x21)))) {
  568. Sleep(100)
  569. }
  570. If(\_SB.PCI0.RP21.PDCX)
  571. {
  572. Store(1,\_SB.PCI0.RP21.PDCX)
  573. Store(1,\_SB.PCI0.RP21.HPSX)
  574. If(LNot(\_SB.PCI0.RP21.PDSX)) {
  575. Store(0,\_SB.PCI0.RP21.L0SE)
  576. }
  577. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x21),LNotEqual(TBS1,0x21)))) {
  578. Notify(\_SB.PCI0.RP21,0)
  579. }
  580. }
  581. Else
  582. {
  583. Store(1,\_SB.PCI0.RP21.HPSX)
  584. }
  585. }
  586. // Check Root Port 22 for a Hot Plug Event if the Port is
  587. // enabled.
  588. If(LAnd(LNotEqual(\_SB.PCI0.RP22.VDID,0xFFFFFFFF),\_SB.PCI0.RP22.HPSX))
  589. {
  590. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x22),LNotEqual(TBS1,0x22)))) {
  591. Sleep(100)
  592. }
  593. If(\_SB.PCI0.RP22.PDCX)
  594. {
  595. Store(1,\_SB.PCI0.RP22.PDCX)
  596. Store(1,\_SB.PCI0.RP22.HPSX)
  597. If(LNot(\_SB.PCI0.RP22.PDSX)) {
  598. Store(0,\_SB.PCI0.RP22.L0SE)
  599. }
  600. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x22),LNotEqual(TBS1,0x22)))) {
  601. Notify(\_SB.PCI0.RP22,0)
  602. }
  603. }
  604. Else
  605. {
  606. Store(1,\_SB.PCI0.RP22.HPSX)
  607. }
  608. }
  609. // Check Root Port 23 for a Hot Plug Event if the Port is
  610. // enabled.
  611. If(LAnd(LNotEqual(\_SB.PCI0.RP23.VDID,0xFFFFFFFF),\_SB.PCI0.RP23.HPSX))
  612. {
  613. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x23),LNotEqual(TBS1,0x23)))) {
  614. Sleep(100)
  615. }
  616. If(\_SB.PCI0.RP23.PDCX)
  617. {
  618. Store(1,\_SB.PCI0.RP23.PDCX)
  619. Store(1,\_SB.PCI0.RP23.HPSX)
  620. If(LNot(\_SB.PCI0.RP23.PDSX)) {
  621. Store(0,\_SB.PCI0.RP23.L0SE)
  622. }
  623. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x23),LNotEqual(TBS1,0x23)))) {
  624. Notify(\_SB.PCI0.RP23,0)
  625. }
  626. }
  627. Else
  628. {
  629. Store(1,\_SB.PCI0.RP23.HPSX)
  630. }
  631. }
  632. // Check Root Port 24 for a Hot Plug Event if the Port is
  633. // enabled.
  634. If(LAnd(LNotEqual(\_SB.PCI0.RP24.VDID,0xFFFFFFFF),\_SB.PCI0.RP24.HPSX))
  635. {
  636. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x24),LNotEqual(TBS1,0x24)))) {
  637. Sleep(100)
  638. }
  639. If(\_SB.PCI0.RP24.PDCX)
  640. {
  641. Store(1,\_SB.PCI0.RP24.PDCX)
  642. Store(1,\_SB.PCI0.RP24.HPSX)
  643. If(LNot(\_SB.PCI0.RP24.PDSX)) {
  644. Store(0,\_SB.PCI0.RP24.L0SE)
  645. }
  646. If(LOr(LNotEqual(TBTS, 0x01),LOr(LNotEqual(TBSE,0x24),LNotEqual(TBS1,0x24)))) {
  647. Notify(\_SB.PCI0.RP24,0)
  648. }
  649. }
  650. Else
  651. {
  652. Store(1,\_SB.PCI0.RP24.HPSX)
  653. }
  654. }
  655. }
  656. //
  657. // Software GPE caused the event.
  658. //
  659. Method(_L62)
  660. {
  661. // Clear GPE status bit.
  662. Store(0,GPEC)
  663. //
  664. // Handle DTS Thermal SCI Event.
  665. //
  666. If(CondRefOf(\_PR.DTSE)){
  667. If(LGreaterEqual(\_PR.DTSE, 0x01)){
  668. If(LEqual(\_PR.DTSI, 1)){
  669. Notify(\_TZ.TZ00,0x80)
  670. Notify(\_TZ.TZ01,0x80)
  671. ///
  672. /// Clear HWP interrupt status
  673. ///
  674. Store(0,\_PR.DTSI)
  675. }
  676. }
  677. }
  678. ///
  679. /// Handle HWP SCI event
  680. ///
  681. External(\_GPE.HLVT, MethodObj)
  682. If(LEqual(\_PR.HWPI, 1)){
  683. If(CondRefOf(\_GPE.HLVT)){
  684. \_GPE.HLVT()
  685. }
  686. ///
  687. /// Clear HWP interrupt status
  688. ///
  689. Store(0,\_PR.HWPI)
  690. }
  691. }
  692. // IGD OpRegion SCI event (see IGD OpRegion/Software SCI BIOS SPEC).
  693. Method(_L66)
  694. {
  695. If(LAnd(\_SB.PCI0.GFX0.GSSE, LNot(GSMI))) // Graphics software SCI event?
  696. {
  697. \_SB.PCI0.GFX0.GSCI() // Handle the SWSCI
  698. }
  699. }
  700. //
  701. // BIOS Needs to implement appropriate handler based on CIO_PLUG_EVENT GPIO
  702. // This is generic 2-tier GPIO handler
  703. //
  704. Method(_L6F)
  705. {
  706. \_SB.THDR(\CPG0,\RPS0,\RPT0) // Check for TBT Hotplug Handler event (2-tier GPI GPE event architecture)
  707. }
  708. }