lpc.asl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2007-2009 coresystems GmbH
  4. * Copyright (C) 2013 Google Inc.
  5. * Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
  6. *
  7. * Modified from coreboot src/soc/intel/baytrail/acpi/lpc.asl
  8. */
  9. /* Intel LPC Bus Device - 0:1f.0 */
  10. Scope (\)
  11. {
  12. /* Intel Legacy Block */
  13. OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
  14. Field(ILBS, AnyAcc, NoLock, Preserve) {
  15. Offset (0x8),
  16. PRTA, 8,
  17. PRTB, 8,
  18. PRTC, 8,
  19. PRTD, 8,
  20. PRTE, 8,
  21. PRTF, 8,
  22. PRTG, 8,
  23. PRTH, 8,
  24. Offset (0x88),
  25. , 3,
  26. UI3E, 1,
  27. UI4E, 1
  28. }
  29. }
  30. Device (LPCB)
  31. {
  32. Name(_ADR, 0x001f0000)
  33. OperationRegion(LPC0, PCI_Config, 0x00, 0x100)
  34. Field(LPC0, AnyAcc, NoLock, Preserve) {
  35. Offset(0x08),
  36. SRID, 8,
  37. Offset(0x80),
  38. C1EN, 1,
  39. Offset(0x84)
  40. }
  41. #include <asm/acpi/irqlinks.asl>
  42. /* Firmware Hub */
  43. Device (FWH)
  44. {
  45. Name(_HID, EISAID("INT0800"))
  46. Name(_CRS, ResourceTemplate()
  47. {
  48. Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
  49. })
  50. }
  51. /* 8259 Interrupt Controller */
  52. Device (PIC)
  53. {
  54. Name(_HID, EISAID("PNP0000"))
  55. Name(_CRS, ResourceTemplate()
  56. {
  57. IO(Decode16, 0x20, 0x20, 0x01, 0x02)
  58. IO(Decode16, 0x24, 0x24, 0x01, 0x02)
  59. IO(Decode16, 0x28, 0x28, 0x01, 0x02)
  60. IO(Decode16, 0x2c, 0x2c, 0x01, 0x02)
  61. IO(Decode16, 0x30, 0x30, 0x01, 0x02)
  62. IO(Decode16, 0x34, 0x34, 0x01, 0x02)
  63. IO(Decode16, 0x38, 0x38, 0x01, 0x02)
  64. IO(Decode16, 0x3c, 0x3c, 0x01, 0x02)
  65. IO(Decode16, 0xa0, 0xa0, 0x01, 0x02)
  66. IO(Decode16, 0xa4, 0xa4, 0x01, 0x02)
  67. IO(Decode16, 0xa8, 0xa8, 0x01, 0x02)
  68. IO(Decode16, 0xac, 0xac, 0x01, 0x02)
  69. IO(Decode16, 0xb0, 0xb0, 0x01, 0x02)
  70. IO(Decode16, 0xb4, 0xb4, 0x01, 0x02)
  71. IO(Decode16, 0xb8, 0xb8, 0x01, 0x02)
  72. IO(Decode16, 0xbc, 0xbc, 0x01, 0x02)
  73. IO(Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
  74. IRQNoFlags () { 2 }
  75. })
  76. }
  77. /* 8254 timer */
  78. Device (TIMR)
  79. {
  80. Name(_HID, EISAID("PNP0100"))
  81. Name(_CRS, ResourceTemplate()
  82. {
  83. IO(Decode16, 0x40, 0x40, 0x01, 0x04)
  84. IO(Decode16, 0x50, 0x50, 0x10, 0x04)
  85. IRQNoFlags() { 0 }
  86. })
  87. }
  88. /* HPET */
  89. Device (HPET)
  90. {
  91. Name(_HID, EISAID("PNP0103"))
  92. Name(_CID, 0x010CD041)
  93. Name(_CRS, ResourceTemplate()
  94. {
  95. Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, HPET_BASE_SIZE)
  96. })
  97. Method(_STA)
  98. {
  99. Return (STA_VISIBLE)
  100. }
  101. }
  102. /* Internal UART */
  103. Device (IURT)
  104. {
  105. Name(_HID, EISAID("PNP0501"))
  106. Name(_UID, 1)
  107. Method(_STA, 0, Serialized)
  108. {
  109. If (LEqual(IURE, 1)) {
  110. Store(1, UI3E)
  111. Store(1, UI4E)
  112. Store(1, C1EN)
  113. Return (STA_VISIBLE)
  114. } Else {
  115. Return (STA_MISSING)
  116. }
  117. }
  118. Method(_DIS, 0, Serialized)
  119. {
  120. Store(0, UI3E)
  121. Store(0, UI4E)
  122. Store(0, C1EN)
  123. }
  124. Method(_CRS, 0, Serialized)
  125. {
  126. Name(BUF0, ResourceTemplate()
  127. {
  128. IO(Decode16, 0x03f8, 0x03f8, 0x01, 0x08)
  129. IRQNoFlags() { 3 }
  130. })
  131. Name(BUF1, ResourceTemplate()
  132. {
  133. IO(Decode16, 0x03f8, 0x03f8, 0x01, 0x08)
  134. IRQNoFlags() { 4 }
  135. })
  136. If (LLessEqual(SRID, 0x04)) {
  137. Return (BUF0)
  138. } Else {
  139. Return (BUF1)
  140. }
  141. }
  142. }
  143. /* Real Time Clock */
  144. Device (RTC)
  145. {
  146. Name(_HID, EISAID("PNP0B00"))
  147. Name(_CRS, ResourceTemplate()
  148. {
  149. IO(Decode16, 0x70, 0x70, 1, 8)
  150. /*
  151. * Disable as Windows doesn't like it, and systems
  152. * don't seem to use it
  153. */
  154. /* IRQNoFlags() { 8 } */
  155. })
  156. }
  157. /* LPC device: Resource consumption */
  158. Device (LDRC)
  159. {
  160. Name(_HID, EISAID("PNP0C02"))
  161. Name(_UID, 2)
  162. Name(RBUF, ResourceTemplate()
  163. {
  164. IO(Decode16, 0x61, 0x61, 0x1, 0x01) /* NMI Status */
  165. IO(Decode16, 0x63, 0x63, 0x1, 0x01) /* CPU Reserved */
  166. IO(Decode16, 0x65, 0x65, 0x1, 0x01) /* CPU Reserved */
  167. IO(Decode16, 0x67, 0x67, 0x1, 0x01) /* CPU Reserved */
  168. IO(Decode16, 0x80, 0x80, 0x1, 0x01) /* Port 80 Post */
  169. IO(Decode16, 0x92, 0x92, 0x1, 0x01) /* CPU Reserved */
  170. IO(Decode16, 0xb2, 0xb2, 0x1, 0x02) /* SWSMI */
  171. })
  172. Method(_CRS, 0, NotSerialized)
  173. {
  174. Return (RBUF)
  175. }
  176. }
  177. }