irqlinks.asl 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2007-2009 coresystems GmbH
  4. * Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
  5. *
  6. * Modified from coreboot src/soc/intel/baytrail/acpi/irqlinks.asl
  7. */
  8. /*
  9. * Intel chipset PIRQ routing control ASL description
  10. *
  11. * The programming interface is common to most Intel chipsets. But the PRTx
  12. * registers may be mapped to different blocks. Some chipsets map them to LPC
  13. * device (00:1f:00) PCI configuration space (like TunnelCreek, Quark), while
  14. * some newer Atom SoCs (like BayTrail, Braswell) map them to Intel Legacy
  15. * Block (ILB) memory space.
  16. *
  17. * This file defines 8 PCI IRQ link devices which corresponds to 8 PIRQ lines
  18. * PIRQ A/B/C/D/E/F/G/H. To incorperate this file, the PRTx registers must be
  19. * defined somewhere else in the platform's ASL files.
  20. */
  21. Device (LNKA)
  22. {
  23. Name(_HID, EISAID("PNP0C0F"))
  24. Name(_UID, 1)
  25. /* Disable method */
  26. Method(_DIS, 0, Serialized)
  27. {
  28. Store(0x80, PRTA)
  29. }
  30. /* Possible Resource Settings for this Link */
  31. Name(_PRS, ResourceTemplate()
  32. {
  33. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  34. })
  35. /* Current Resource Settings for this link */
  36. Method(_CRS, 0, Serialized)
  37. {
  38. Name(RTLA, ResourceTemplate()
  39. {
  40. IRQ(Level, ActiveLow, Shared) {}
  41. })
  42. CreateWordField(RTLA, 1, IRQ0)
  43. /* Clear the WordField */
  44. Store(Zero, IRQ0)
  45. /* Set the bit from PRTA */
  46. ShiftLeft(1, And(PRTA, 0x0f), IRQ0)
  47. Return (RTLA)
  48. }
  49. /* Set Resource Setting for this IRQ link */
  50. Method(_SRS, 1, Serialized)
  51. {
  52. CreateWordField(Arg0, 1, IRQ0)
  53. /* Which bit is set? */
  54. FindSetRightBit(IRQ0, Local0)
  55. Decrement(Local0)
  56. Store(Local0, PRTA)
  57. }
  58. /* Status */
  59. Method(_STA, 0, Serialized)
  60. {
  61. If (And(PRTA, 0x80)) {
  62. Return (STA_DISABLED)
  63. } Else {
  64. Return (STA_INVISIBLE)
  65. }
  66. }
  67. }
  68. Device (LNKB)
  69. {
  70. Name(_HID, EISAID("PNP0C0F"))
  71. Name(_UID, 2)
  72. /* Disable method */
  73. Method(_DIS, 0, Serialized)
  74. {
  75. Store(0x80, PRTB)
  76. }
  77. /* Possible Resource Settings for this Link */
  78. Name(_PRS, ResourceTemplate()
  79. {
  80. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  81. })
  82. /* Current Resource Settings for this link */
  83. Method(_CRS, 0, Serialized)
  84. {
  85. Name(RTLB, ResourceTemplate()
  86. {
  87. IRQ(Level, ActiveLow, Shared) {}
  88. })
  89. CreateWordField(RTLB, 1, IRQ0)
  90. /* Clear the WordField */
  91. Store(Zero, IRQ0)
  92. /* Set the bit from PRTB */
  93. ShiftLeft(1, And(PRTB, 0x0f), IRQ0)
  94. Return (RTLB)
  95. }
  96. /* Set Resource Setting for this IRQ link */
  97. Method(_SRS, 1, Serialized)
  98. {
  99. CreateWordField(Arg0, 1, IRQ0)
  100. /* Which bit is set? */
  101. FindSetRightBit(IRQ0, Local0)
  102. Decrement(Local0)
  103. Store(Local0, PRTB)
  104. }
  105. /* Status */
  106. Method(_STA, 0, Serialized)
  107. {
  108. If (And(PRTB, 0x80)) {
  109. Return (STA_DISABLED)
  110. } Else {
  111. Return (STA_INVISIBLE)
  112. }
  113. }
  114. }
  115. Device (LNKC)
  116. {
  117. Name(_HID, EISAID("PNP0C0F"))
  118. Name(_UID, 3)
  119. /* Disable method */
  120. Method(_DIS, 0, Serialized)
  121. {
  122. Store(0x80, PRTC)
  123. }
  124. /* Possible Resource Settings for this Link */
  125. Name(_PRS, ResourceTemplate()
  126. {
  127. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  128. })
  129. /* Current Resource Settings for this link */
  130. Method(_CRS, 0, Serialized)
  131. {
  132. Name(RTLC, ResourceTemplate()
  133. {
  134. IRQ(Level, ActiveLow, Shared) {}
  135. })
  136. CreateWordField(RTLC, 1, IRQ0)
  137. /* Clear the WordField */
  138. Store(Zero, IRQ0)
  139. /* Set the bit from PRTC */
  140. ShiftLeft(1, And(PRTC, 0x0f), IRQ0)
  141. Return (RTLC)
  142. }
  143. /* Set Resource Setting for this IRQ link */
  144. Method(_SRS, 1, Serialized)
  145. {
  146. CreateWordField(Arg0, 1, IRQ0)
  147. /* Which bit is set? */
  148. FindSetRightBit(IRQ0, Local0)
  149. Decrement(Local0)
  150. Store(Local0, PRTC)
  151. }
  152. /* Status */
  153. Method(_STA, 0, Serialized)
  154. {
  155. If (And(PRTC, 0x80)) {
  156. Return (STA_DISABLED)
  157. } Else {
  158. Return (STA_INVISIBLE)
  159. }
  160. }
  161. }
  162. Device (LNKD)
  163. {
  164. Name(_HID, EISAID("PNP0C0F"))
  165. Name(_UID, 4)
  166. /* Disable method */
  167. Method(_DIS, 0, Serialized)
  168. {
  169. Store(0x80, PRTD)
  170. }
  171. /* Possible Resource Settings for this Link */
  172. Name(_PRS, ResourceTemplate()
  173. {
  174. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  175. })
  176. /* Current Resource Settings for this link */
  177. Method(_CRS, 0, Serialized)
  178. {
  179. Name(RTLD, ResourceTemplate()
  180. {
  181. IRQ(Level, ActiveLow, Shared) {}
  182. })
  183. CreateWordField(RTLD, 1, IRQ0)
  184. /* Clear the WordField */
  185. Store(Zero, IRQ0)
  186. /* Set the bit from PRTD */
  187. ShiftLeft(1, And(PRTD, 0x0f), IRQ0)
  188. Return (RTLD)
  189. }
  190. /* Set Resource Setting for this IRQ link */
  191. Method(_SRS, 1, Serialized)
  192. {
  193. CreateWordField(Arg0, 1, IRQ0)
  194. /* Which bit is set? */
  195. FindSetRightBit(IRQ0, Local0)
  196. Decrement(Local0)
  197. Store(Local0, PRTD)
  198. }
  199. /* Status */
  200. Method(_STA, 0, Serialized)
  201. {
  202. If (And(PRTD, 0x80)) {
  203. Return (STA_DISABLED)
  204. } Else {
  205. Return (STA_INVISIBLE)
  206. }
  207. }
  208. }
  209. Device (LNKE)
  210. {
  211. Name(_HID, EISAID("PNP0C0F"))
  212. Name(_UID, 5)
  213. /* Disable method */
  214. Method(_DIS, 0, Serialized)
  215. {
  216. Store(0x80, PRTE)
  217. }
  218. /* Possible Resource Settings for this Link */
  219. Name(_PRS, ResourceTemplate()
  220. {
  221. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  222. })
  223. /* Current Resource Settings for this link */
  224. Method(_CRS, 0, Serialized)
  225. {
  226. Name(RTLE, ResourceTemplate()
  227. {
  228. IRQ(Level, ActiveLow, Shared) {}
  229. })
  230. CreateWordField(RTLE, 1, IRQ0)
  231. /* Clear the WordField */
  232. Store(Zero, IRQ0)
  233. /* Set the bit from PRTE */
  234. ShiftLeft(1, And(PRTE, 0x0f), IRQ0)
  235. Return (RTLE)
  236. }
  237. /* Set Resource Setting for this IRQ link */
  238. Method(_SRS, 1, Serialized)
  239. {
  240. CreateWordField(Arg0, 1, IRQ0)
  241. /* Which bit is set? */
  242. FindSetRightBit(IRQ0, Local0)
  243. Decrement(Local0)
  244. Store(Local0, PRTE)
  245. }
  246. /* Status */
  247. Method(_STA, 0, Serialized)
  248. {
  249. If (And(PRTE, 0x80)) {
  250. Return (STA_DISABLED)
  251. } Else {
  252. Return (STA_INVISIBLE)
  253. }
  254. }
  255. }
  256. Device (LNKF)
  257. {
  258. Name(_HID, EISAID("PNP0C0F"))
  259. Name(_UID, 6)
  260. /* Disable method */
  261. Method(_DIS, 0, Serialized)
  262. {
  263. Store(0x80, PRTF)
  264. }
  265. /* Possible Resource Settings for this Link */
  266. Name(_PRS, ResourceTemplate()
  267. {
  268. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  269. })
  270. /* Current Resource Settings for this link */
  271. Method(_CRS, 0, Serialized)
  272. {
  273. Name(RTLF, ResourceTemplate()
  274. {
  275. IRQ(Level, ActiveLow, Shared) {}
  276. })
  277. CreateWordField(RTLF, 1, IRQ0)
  278. /* Clear the WordField */
  279. Store(Zero, IRQ0)
  280. /* Set the bit from PRTF */
  281. ShiftLeft(1, And(PRTF, 0x0f), IRQ0)
  282. Return (RTLF)
  283. }
  284. /* Set Resource Setting for this IRQ link */
  285. Method(_SRS, 1, Serialized)
  286. {
  287. CreateWordField(Arg0, 1, IRQ0)
  288. /* Which bit is set? */
  289. FindSetRightBit(IRQ0, Local0)
  290. Decrement(Local0)
  291. Store(Local0, PRTF)
  292. }
  293. /* Status */
  294. Method(_STA, 0, Serialized)
  295. {
  296. If (And(PRTF, 0x80)) {
  297. Return (STA_DISABLED)
  298. } Else {
  299. Return (STA_INVISIBLE)
  300. }
  301. }
  302. }
  303. Device (LNKG)
  304. {
  305. Name(_HID, EISAID("PNP0C0F"))
  306. Name(_UID, 7)
  307. /* Disable method */
  308. Method(_DIS, 0, Serialized)
  309. {
  310. Store(0x80, PRTG)
  311. }
  312. /* Possible Resource Settings for this Link */
  313. Name(_PRS, ResourceTemplate()
  314. {
  315. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  316. })
  317. /* Current Resource Settings for this link */
  318. Method(_CRS, 0, Serialized)
  319. {
  320. Name(RTLG, ResourceTemplate()
  321. {
  322. IRQ(Level, ActiveLow, Shared) {}
  323. })
  324. CreateWordField(RTLG, 1, IRQ0)
  325. /* Clear the WordField */
  326. Store(Zero, IRQ0)
  327. /* Set the bit from PRTG */
  328. ShiftLeft(1, And(PRTG, 0x0f), IRQ0)
  329. Return (RTLG)
  330. }
  331. /* Set Resource Setting for this IRQ link */
  332. Method(_SRS, 1, Serialized)
  333. {
  334. CreateWordField(Arg0, 1, IRQ0)
  335. /* Which bit is set? */
  336. FindSetRightBit(IRQ0, Local0)
  337. Decrement(Local0)
  338. Store(Local0, PRTG)
  339. }
  340. /* Status */
  341. Method(_STA, 0, Serialized)
  342. {
  343. If (And(PRTG, 0x80)) {
  344. Return (STA_DISABLED)
  345. } Else {
  346. Return (STA_INVISIBLE)
  347. }
  348. }
  349. }
  350. Device (LNKH)
  351. {
  352. Name(_HID, EISAID("PNP0C0F"))
  353. Name(_UID, 8)
  354. /* Disable method */
  355. Method(_DIS, 0, Serialized)
  356. {
  357. Store(0x80, PRTH)
  358. }
  359. /* Possible Resource Settings for this Link */
  360. Name(_PRS, ResourceTemplate()
  361. {
  362. IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
  363. })
  364. /* Current Resource Settings for this link */
  365. Method(_CRS, 0, Serialized)
  366. {
  367. Name(RTLH, ResourceTemplate()
  368. {
  369. IRQ(Level, ActiveLow, Shared) {}
  370. })
  371. CreateWordField(RTLH, 1, IRQ0)
  372. /* Clear the WordField */
  373. Store(Zero, IRQ0)
  374. /* Set the bit from PRTH */
  375. ShiftLeft(1, And(PRTH, 0x0f), IRQ0)
  376. Return (RTLH)
  377. }
  378. /* Set Resource Setting for this IRQ link */
  379. Method(_SRS, 1, Serialized)
  380. {
  381. CreateWordField(Arg0, 1, IRQ0)
  382. /* Which bit is set? */
  383. FindSetRightBit(IRQ0, Local0)
  384. Decrement(Local0)
  385. Store(Local0, PRTH)
  386. }
  387. /* Status */
  388. Method(_STA, 0, Serialized)
  389. {
  390. If (And(PRTH, 0x80)) {
  391. Return (STA_DISABLED)
  392. } Else {
  393. Return (STA_INVISIBLE)
  394. }
  395. }
  396. }