Dsdt.asl 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. /** @file
  2. Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. DefinitionBlock("Dsdt.aml", "DSDT", 0x02, "Ampere", "Jade", 1) {
  6. //
  7. // Board Model
  8. Name(\BDMD, "Jade Board")
  9. Name(AERF, 0) // PCIe AER Firmware-First
  10. Scope(\_SB) {
  11. //
  12. // Hardware Monitor
  13. Device(HM00) {
  14. Name(_HID, "APMC0D29")
  15. Name(_UID, "HWM0")
  16. Name(_DDN, "HWM0")
  17. Name(_CCA, ONE)
  18. Name(_STR, Unicode("Hardware Monitor Device"))
  19. Method(_STA, 0, NotSerialized) {
  20. return (0xF)
  21. }
  22. Name (_DSD, Package () {
  23. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  24. Package() {
  25. Package() {"pcc-channel", 14}
  26. }
  27. })
  28. }
  29. //
  30. // Hardware Monitor
  31. Device(HM01) {
  32. Name(_HID, "APMC0D29")
  33. Name(_UID, "HWM1")
  34. Name(_DDN, "HWM1")
  35. Name(_CCA, ONE)
  36. Name(_STR, Unicode("Hardware Monitor Device"))
  37. Method(_STA, 0, NotSerialized) {
  38. return (0xF)
  39. }
  40. Name (_DSD, Package () {
  41. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  42. Package() {
  43. Package() {"pcc-channel", 29}
  44. }
  45. })
  46. }
  47. //
  48. // Hardware Monitor
  49. Device(HM02) {
  50. Name(_HID, "AMPC0005")
  51. Name(_UID, "HWM2")
  52. Name(_DDN, "HWM2")
  53. Name(_CCA, ONE)
  54. Name(_STR, Unicode("AC01 SoC Hardware Monitor Device"))
  55. Method(_STA, 0, NotSerialized) {
  56. return (0xF)
  57. }
  58. Name(_CRS, ResourceTemplate() {
  59. QWordMemory (
  60. ResourceProducer, // ResourceUsage
  61. PosDecode, // Decode
  62. MinFixed, // IsMinFixed
  63. MaxFixed, // IsMaxFixed
  64. Cacheable, // Cacheable
  65. ReadWrite, // ReadAndWrite
  66. 0x0000000000000000, // AddressGranularity - GRA
  67. 0x0000000088900000, // AddressMinimum - MIN
  68. 0x000000008891FFFF, // AddressMaximum - MAX
  69. 0x0000000000000000, // AddressTranslation - TRA
  70. 0x0000000000020000 // RangeLength - LEN
  71. )
  72. })
  73. }
  74. //
  75. // Hardware Monitor
  76. Device(HM03) {
  77. Name(_HID, "AMPC0005")
  78. Name(_UID, "HWM3")
  79. Name(_DDN, "HWM3")
  80. Name(_CCA, ONE)
  81. Name(_STR, Unicode("AC01 SoC Hardware Monitor Device"))
  82. Method(_STA, 0, NotSerialized) {
  83. return (0xF)
  84. }
  85. Name(_CRS, ResourceTemplate() {
  86. QWordMemory (
  87. ResourceProducer, // ResourceUsage
  88. PosDecode, // Decode
  89. MinFixed, // IsMinFixed
  90. MaxFixed, // IsMaxFixed
  91. Cacheable, // Cacheable
  92. ReadWrite, // ReadAndWrite
  93. 0x0000000000000000, // AddressGranularity - GRA
  94. 0x00000000C0000000, // AddressMinimum - MIN
  95. 0x00000000C001FFFF, // AddressMaximum - MAX
  96. 0x0000000000000000, // AddressTranslation - TRA
  97. 0x0000000000020000 // RangeLength - LEN
  98. )
  99. })
  100. }
  101. //
  102. // DesignWare I2C on AHBC bus
  103. Device(I2C4) {
  104. Name(_HID, "APMC0D0F")
  105. Name(_UID, 4)
  106. Name(_STR, Unicode("Altra I2C Device"))
  107. Method(_STA, 0, NotSerialized) {
  108. return (0x0f)
  109. }
  110. Name(_CCA, ONE)
  111. Name(_CRS, ResourceTemplate() {
  112. QWordMemory (
  113. ResourceProducer, // ResourceUsage
  114. PosDecode, // Decode
  115. MinFixed, // IsMinFixed
  116. MaxFixed, // IsMaxFixed
  117. NonCacheable, // Cacheable
  118. ReadWrite, // ReadAndWrite
  119. 0x0000000000000000, // AddressGranularity - GRA
  120. 0x00001000026B0000, // AddressMinimum - MIN
  121. 0x00001000026BFFFF, // AddressMaximum - MAX
  122. 0x0000000000000000, // AddressTranslation - TRA
  123. 0x0000000000010000 // RangeLength - LEN
  124. )
  125. Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 105 }
  126. })
  127. Device (IPI) {
  128. Name(_HID, "AMPC0004")
  129. Name(_CID, "IPI0001")
  130. Name(_STR, Unicode("IPMI_SSIF"))
  131. Name(_UID, 0)
  132. Name(_CCA, ONE)
  133. Method(_STA, 0, NotSerialized) {
  134. Return (0x0f)
  135. }
  136. Method(_IFT) {
  137. Return(0x04) // IPMI SSIF
  138. }
  139. Method(_ADR) {
  140. Return(0x10) // SSIF slave address
  141. }
  142. Method(_SRV) {
  143. Return(0x0200) // IPMI Specification Revision
  144. }
  145. Name(_CRS, ResourceTemplate ()
  146. {
  147. I2cSerialBusV2 (0x0010, ControllerInitiated, 0x00061A80,
  148. AddressingMode7Bit, "\\_SB.I2C4",
  149. 0x00, ResourceConsumer,, Exclusive,
  150. // Vendor specific data:
  151. // "BMC0",
  152. // Flags (2 bytes): SMBUS variable length (Bit 0), Read Checksum (Bit 1), Verify Checksum (Bit 2)
  153. RawDataBuffer () { 0x42, 0x4D, 0x43, 0x30, 0x7, 0x0 }
  154. )
  155. })
  156. }
  157. Name(SSCN, Package() { 0x3E2, 0x47D, 0 })
  158. Name(FMCN, Package() { 0xA4, 0x13F, 0 })
  159. }
  160. //
  161. // Report APEI Errors to GHES via SCI notification.
  162. // SCI notification requires one GED and one HED Device
  163. // GED = Generic Event Device (ACPI0013)
  164. // HED = Hardware Error Device (PNP0C33)
  165. //
  166. Device(GED0) {
  167. Name(_HID, "ACPI0013")
  168. Name(_UID, Zero)
  169. Method(_STA) {
  170. Return (0xF)
  171. }
  172. Name(_CRS, ResourceTemplate () {
  173. Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 84 } // GHES
  174. })
  175. Method(_EVT, 1, Serialized) {
  176. Switch (ToInteger(Arg0)) {
  177. Case (84) { // GHES interrupt
  178. Notify (HED0, 0x80)
  179. }
  180. }
  181. }
  182. }
  183. // Shutdown button using GED.
  184. Device(GED1) {
  185. Name(_HID, "ACPI0013")
  186. Name(_CID, "ACPI0013")
  187. Name(_UID, One)
  188. Method(_STA) {
  189. Return (0xF)
  190. }
  191. Name(_CRS, ResourceTemplate () {
  192. Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 327 }
  193. })
  194. OperationRegion(PDDR, SystemMemory, 0x1000027B0004, 4)
  195. Field(PDDR, DWordAcc, NoLock, Preserve) {
  196. STDI, 8
  197. }
  198. OperationRegion(INTE, SystemMemory, 0x1000027B0030, 4)
  199. Field(INTE, DWordAcc, NoLock, Preserve) {
  200. STDE, 8
  201. }
  202. OperationRegion(INTT, SystemMemory, 0x1000027B0034, 4)
  203. Field(INTT, DWordAcc, NoLock, Preserve) {
  204. TYPE, 8
  205. }
  206. OperationRegion(INTP, SystemMemory, 0x1000027B0038, 4)
  207. Field(INTP, DWordAcc, NoLock, Preserve) {
  208. POLA, 8
  209. }
  210. OperationRegion(INTS, SystemMemory, 0x1000027B003c, 4)
  211. Field(INTS, DWordAcc, NoLock, Preserve) {
  212. STDS, 8
  213. }
  214. OperationRegion(INTC, SystemMemory, 0x1000027B0040, 4)
  215. Field(INTC, DWordAcc, NoLock, Preserve) {
  216. SINT, 8
  217. }
  218. OperationRegion(INTM, SystemMemory, 0x1000027B0044, 4)
  219. Field(INTM, DWordAcc, NoLock, Preserve) {
  220. MASK, 8
  221. }
  222. Method(_INI, 0, NotSerialized) {
  223. // Set level type, low active (shutdown)
  224. Store (0x00, TYPE)
  225. Store (0x00, POLA)
  226. // Set Input type (shutdown)
  227. Store (0x00, STDI)
  228. // Enable interrupt (shutdown)
  229. Store (0x80, STDE)
  230. // Unmask the interrupt.
  231. Store (0x00, MASK)
  232. }
  233. Method(_EVT, 1, Serialized) {
  234. Switch (ToInteger(Arg0)) {
  235. Case (327) {
  236. if (And (STDS, 0x80)) {
  237. //Clear the interrupt.
  238. Store (0x80, SINT)
  239. // Notify OSPM the power button is pressed
  240. Notify (\_SB.PWRB, 0x80)
  241. }
  242. }
  243. }
  244. }
  245. }
  246. // Power button device description
  247. Device(PWRB) {
  248. Name(_HID, EISAID("PNP0C0C"))
  249. Name(_UID, 0)
  250. Name(_CCA, ONE)
  251. Method(_STA, 0, Notserialized) {
  252. Return (0x0b)
  253. }
  254. }
  255. //
  256. // UART0 PL011
  257. Device(URT0) {
  258. Name(_HID, "ARMH0011")
  259. Name(_UID, 0)
  260. Name(_CCA, ONE)
  261. Method(_STA, 0, NotSerialized) {
  262. return (0x0f)
  263. }
  264. Name(_CRS, ResourceTemplate() {
  265. QWordMemory (
  266. ResourceProducer, // ResourceUsage
  267. PosDecode, // Decode
  268. MinFixed, // IsMinFixed
  269. MaxFixed, // IsMaxFixed
  270. NonCacheable, // Cacheable
  271. ReadWrite, // ReadAndWrite
  272. 0x0000000000000000, // AddressGranularity - GRA
  273. 0x0000100002600000, // AddressMinimum - MIN
  274. 0x0000100002600FFF, // AddressMaximum - MAX
  275. 0x0000000000000000, // AddressTranslation - TRA
  276. 0x0000000000001000 // RangeLength - LEN
  277. )
  278. Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 98 }
  279. })
  280. } // UART0
  281. //
  282. // UART2 PL011
  283. Device(URT2) {
  284. Name(_HID, "ARMH0011")
  285. Name(_UID, 1)
  286. Name(_CCA, ONE)
  287. Method(_STA, 0, NotSerialized) {
  288. return (0x0f)
  289. }
  290. Name(_CRS, ResourceTemplate() {
  291. QWordMemory (
  292. ResourceProducer, // ResourceUsage
  293. PosDecode, // Decode
  294. MinFixed, // IsMinFixed
  295. MaxFixed, // IsMaxFixed
  296. NonCacheable, // Cacheable
  297. ReadWrite, // ReadAndWrite
  298. 0x0000000000000000, // AddressGranularity - GRA
  299. 0x0000100002620000, // AddressMinimum - MIN
  300. 0x0000100002620FFF, // AddressMaximum - MAX
  301. 0x0000000000000000, // AddressTranslation - TRA
  302. 0x0000000000001000 // RangeLength - LEN
  303. )
  304. Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 100 }
  305. })
  306. } // UART1
  307. Device(HED0)
  308. {
  309. Name(_HID, EISAID("PNP0C33"))
  310. Name(_UID, Zero)
  311. }
  312. Device(NVDR) {
  313. Name(_HID, "ACPI0012")
  314. Method(_STA, 0, NotSerialized) {
  315. return (0xf)
  316. }
  317. Method (_DSM, 0x4, Serialized) {
  318. // Not support any functions for now
  319. Return (Buffer() {0})
  320. }
  321. Device (NVD1) {
  322. Name(_ADR, 0x0330)
  323. Name(SMRT, Buffer(13) {0})
  324. CreateDWordField(SMRT, 0, BSTA)
  325. CreateWordField(SMRT, 4, BHTH)
  326. CreateWordField(SMRT, 6, BTMP)
  327. CreateByteField(SMRT, 8, BETH)
  328. CreateByteField(SMRT, 9, BWTH)
  329. CreateByteField(SMRT, 10, BNLF)
  330. OperationRegion(BUF1, SystemMemory, 0x88980000, 16)
  331. Field (BUF1, DWordAcc, NoLock, Preserve) {
  332. STAT, 32, //Status
  333. HLTH, 16, //Module Health
  334. CTMP, 16, //Module Current Status
  335. ETHS, 8, //Error Threshold Status
  336. WTHS, 8, //Warning Threshold Status
  337. NVLF, 8, //NVM Lifetime
  338. , 40 //Reserve
  339. }
  340. Method (_DSM, 0x4, Serialized) {
  341. //Accept only MSF Family type NVDIMM DSM functions
  342. If(LEqual(Arg0, ToUUID ("1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"))) {
  343. //Handle Func 0 query implemented commands
  344. If(LEqual(Arg2, 0)) {
  345. //Check revision and returned proper implemented commands
  346. //Support only health check for now
  347. Return (Buffer() {0x01, 0x08}) //Byte 0: 0x1
  348. }
  349. //Handle MSF DSM Func 11 Get Smart and Health Info
  350. If(LEqual(Arg2, 11)) {
  351. Store(\_SB.NVDR.NVD1.STAT, BSTA)
  352. Store(\_SB.NVDR.NVD1.HLTH, BHTH)
  353. Store(\_SB.NVDR.NVD1.CTMP, BTMP)
  354. Store(\_SB.NVDR.NVD1.ETHS, BETH)
  355. Store(\_SB.NVDR.NVD1.WTHS, BWTH)
  356. Store(\_SB.NVDR.NVD1.NVLF, BNLF)
  357. Return (SMRT)
  358. }
  359. }
  360. Return (Buffer() {0})
  361. }
  362. Method(_STA, 0, NotSerialized) {
  363. return (0xf)
  364. }
  365. }
  366. Device (NVD2) {
  367. Name(_ADR, 0x0770)
  368. Name(SMRT, Buffer(13) {0})
  369. CreateDWordField(SMRT, 0, BSTA)
  370. CreateWordField(SMRT, 4, BHTH)
  371. CreateWordField(SMRT, 6, BTMP)
  372. CreateByteField(SMRT, 8, BETH)
  373. CreateByteField(SMRT, 9, BWTH)
  374. CreateByteField(SMRT, 10, BNLF)
  375. OperationRegion(BUF1, SystemMemory, 0x88988000, 16)
  376. Field (BUF1, DWordAcc, NoLock, Preserve) {
  377. STAT, 32, //Status
  378. HLTH, 16, //Module Health
  379. CTMP, 16, //Module Current Status
  380. ETHS, 8, //Error Threshold Status
  381. WTHS, 8, //Warning Threshold Status
  382. NVLF, 8, //NVM Lifetime
  383. , 40 //Reserve
  384. }
  385. Method (_DSM, 0x4, Serialized) {
  386. //Accept only MSF Family type NVDIMM DSM functions
  387. If(LEqual(Arg0, ToUUID ("1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"))) {
  388. //Handle Func 0 query implemented commands
  389. If(LEqual(Arg2, 0)) {
  390. //Check revision and returned proper implemented commands
  391. //Support only health check for now
  392. Return (Buffer() {0x01, 0x08}) //Byte 0: 0x1
  393. }
  394. //Handle MSF DSM Func 11 Get Smart and Health Info
  395. If(LEqual(Arg2, 11)) {
  396. Store(\_SB.NVDR.NVD2.STAT, BSTA)
  397. Store(\_SB.NVDR.NVD2.HLTH, BHTH)
  398. Store(\_SB.NVDR.NVD2.CTMP, BTMP)
  399. Store(\_SB.NVDR.NVD2.ETHS, BETH)
  400. Store(\_SB.NVDR.NVD2.WTHS, BWTH)
  401. Store(\_SB.NVDR.NVD2.NVLF, BNLF)
  402. Return (SMRT)
  403. }
  404. }
  405. Return (Buffer() {0})
  406. }
  407. Method(_STA, 0, NotSerialized) {
  408. return (0xf)
  409. }
  410. }
  411. Device (NVD3) {
  412. Name(_ADR, 0x1330)
  413. Name(SMRT, Buffer(13) {0})
  414. CreateDWordField(SMRT, 0, BSTA)
  415. CreateWordField(SMRT, 4, BHTH)
  416. CreateWordField(SMRT, 6, BTMP)
  417. CreateByteField(SMRT, 8, BETH)
  418. CreateByteField(SMRT, 9, BWTH)
  419. CreateByteField(SMRT, 10, BNLF)
  420. OperationRegion(BUF1, SystemMemory, 0xC0080000, 16)
  421. Field (BUF1, DWordAcc, NoLock, Preserve) {
  422. STAT, 32, //Status
  423. HLTH, 16, //Module Health
  424. CTMP, 16, //Module Current Status
  425. ETHS, 8, //Error Threshold Status
  426. WTHS, 8, //Warning Threshold Status
  427. NVLF, 8, //NVM Lifetime
  428. , 40 //Reserve
  429. }
  430. Method (_DSM, 0x4, Serialized) {
  431. //Accept only MSF Family type NVDIMM DSM functions
  432. If(LEqual(Arg0, ToUUID ("1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"))) {
  433. //Handle Func 0 query implemented commands
  434. If(LEqual(Arg2, 0)) {
  435. //Check revision and returned proper implemented commands
  436. //Support only health check for now
  437. Return (Buffer() {0x01, 0x08}) //Byte 0: 0x1
  438. }
  439. //Handle MSF DSM Func 11 Get Smart and Health Info
  440. If(LEqual(Arg2, 11)) {
  441. Store(\_SB.NVDR.NVD3.STAT, BSTA)
  442. Store(\_SB.NVDR.NVD3.HLTH, BHTH)
  443. Store(\_SB.NVDR.NVD3.CTMP, BTMP)
  444. Store(\_SB.NVDR.NVD3.ETHS, BETH)
  445. Store(\_SB.NVDR.NVD3.WTHS, BWTH)
  446. Store(\_SB.NVDR.NVD3.NVLF, BNLF)
  447. Return (SMRT)
  448. }
  449. }
  450. Return (Buffer() {0})
  451. }
  452. Method(_STA, 0, NotSerialized) {
  453. return (0xf)
  454. }
  455. }
  456. Device (NVD4) {
  457. Name(_ADR, 0x1770)
  458. Name(SMRT, Buffer(13) {0})
  459. CreateDWordField(SMRT, 0, BSTA)
  460. CreateWordField(SMRT, 4, BHTH)
  461. CreateWordField(SMRT, 6, BTMP)
  462. CreateByteField(SMRT, 8, BETH)
  463. CreateByteField(SMRT, 9, BWTH)
  464. CreateByteField(SMRT, 10, BNLF)
  465. OperationRegion(BUF1, SystemMemory, 0xC0088000, 16)
  466. Field (BUF1, DWordAcc, NoLock, Preserve) {
  467. STAT, 32, //Status
  468. HLTH, 16, //Module Health
  469. CTMP, 16, //Module Current Status
  470. ETHS, 8, //Error Threshold Status
  471. WTHS, 8, //Warning Threshold Status
  472. NVLF, 8, //NVM Lifetime
  473. , 40 //Reserve
  474. }
  475. Method (_DSM, 0x4, Serialized) {
  476. //Accept only MSF Family type NVDIMM DSM functions
  477. If(LEqual(Arg0, ToUUID ("1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05"))) {
  478. //Handle Func 0 query implemented commands
  479. If(LEqual(Arg2, 0)) {
  480. //Check revision and returned proper implemented commands
  481. //Support only health check for now
  482. Return (Buffer() {0x01, 0x08}) //Byte 0: 0x1
  483. }
  484. //Handle MSF DSM Func 11 Get Smart and Health Info
  485. If(LEqual(Arg2, 11)) {
  486. Store(\_SB.NVDR.NVD4.STAT, BSTA)
  487. Store(\_SB.NVDR.NVD4.HLTH, BHTH)
  488. Store(\_SB.NVDR.NVD4.CTMP, BTMP)
  489. Store(\_SB.NVDR.NVD4.ETHS, BETH)
  490. Store(\_SB.NVDR.NVD4.WTHS, BWTH)
  491. Store(\_SB.NVDR.NVD4.NVLF, BNLF)
  492. Return (SMRT)
  493. }
  494. }
  495. Return (Buffer() {0})
  496. }
  497. Method(_STA, 0, NotSerialized) {
  498. return (0xf)
  499. }
  500. }
  501. }
  502. Include ("PCI-S0.Rca01.asi")
  503. Include ("PCI-S0.asi")
  504. Include ("PCI-S1.asi")
  505. Include ("PCI-PDRC.asi")
  506. }
  507. Include ("CPU.asi")
  508. Include ("PMU.asi")
  509. } // DSDT