RTD3.asl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /**************************************************************************;
  2. ;* *;
  3. ;* *;
  4. ;* Intel Corporation - ACPI Reference Code for the Baytrail *;
  5. ;* Family of Customer Reference Boards. *;
  6. ;* *;
  7. ;* *;
  8. ;* Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved *;
  9. ;
  10. ; SPDX-License-Identifier: BSD-2-Clause-Patent
  11. ;
  12. ;* *;
  13. ;* *;
  14. ;**************************************************************************/
  15. DefinitionBlock (
  16. "Rtd3.aml",
  17. "SSDT",
  18. 1,
  19. "AcpiRef",
  20. "Msg_Rtd3",
  21. 0x1000
  22. )
  23. {
  24. External(RTD3) //flag if RTD3 is enabled
  25. If(LEqual(RTD3,1))
  26. {
  27. Scope (\_SB)
  28. {
  29. Name(OSCI, 0) // \_SB._OSC DWORD2 input
  30. Name(OSCO, 0) // \_SB._OSC DWORD2 output
  31. //Arg0 -- A buffer containing UUID
  32. //Arg1 -- An Interger containing a Revision ID of the buffer format
  33. //Arg2 -- An interger containing a count of entries in Arg3
  34. //Arg3 -- A buffer containing a list of DWORD capacities
  35. Method(_OSC, 4, NotSerialized)
  36. {
  37. // Check for proper UUID
  38. If(LEqual(Arg0, ToUUID("0811B06E-4A27-44F9-8D60-3CBBC22E7B48")))
  39. {
  40. CreateDWordField(Arg3,0,CDW1) //bit1,2 is always clear
  41. CreateDWordField(Arg3,4,CDW2) //Table 6-147 from ACPI spec
  42. Store(CDW2, OSCI) // Save DWord2
  43. Or(OSCI, 0x4, OSCO) // Only allow _PR3 support
  44. If(LNotEqual(Arg1,One))
  45. {
  46. Or(CDW1,0x08,CDW1) // Unknown revision
  47. }
  48. If(LNotEqual(OSCI, OSCO))
  49. {
  50. Or(CDW1,0x10,CDW1) // Capabilities bits were masked
  51. }
  52. Store(OSCO, CDW2) // Replace DWord2
  53. Return(Arg3)
  54. } Else
  55. {
  56. Or(CDW1,4,CDW1) // Unrecognized UUID
  57. Return(Arg3)
  58. }
  59. }// End _OSC
  60. }
  61. }//end of RTD3 condition
  62. //USB RTD3 code
  63. If(LEqual(RTD3,1))
  64. {
  65. Scope(\_SB.PCI0.EHC1.HUBN.PR01.PR13)
  66. {
  67. Name(_PR0, Package() {\PR34})
  68. Name(_PR3, Package() {\PR34})
  69. Method(_S0W, 0)
  70. {
  71. If(And(\_SB.OSCO, 0x04)) // PMEs can be genrated from D3cold
  72. {
  73. Return(4) // OS comprehends D3cold, as described via \_SB._OSC
  74. } Else
  75. {
  76. Return(3)
  77. }
  78. } // End _S0W
  79. }
  80. Scope(\_SB.PCI0.EHC1.HUBN.PR01.PR14)
  81. {
  82. Name(_PR0, Package() {\PR34})
  83. Name(_PR3, Package() {\PR34})
  84. Method(_S0W, 0)
  85. {
  86. If(And(\_SB.OSCO, 0x04))
  87. {
  88. Return(4)
  89. } Else
  90. {
  91. Return(3)
  92. }
  93. } // End _S0W
  94. }
  95. Scope(\_SB.PCI0.EHC1.HUBN.PR01.PR15)
  96. {
  97. Name(_PR0, Package() {\PR56})
  98. Name(_PR3, Package() {\PR56})
  99. Method(_S0W, 0)
  100. {
  101. If(And(\_SB.OSCO, 0x04))
  102. {
  103. Return(4)
  104. } Else
  105. {
  106. Return(3)
  107. }
  108. } // End _S0W
  109. }
  110. Scope(\_SB.PCI0.EHC1.HUBN.PR01.PR16)
  111. {
  112. Name(_PR0, Package() {\PR56})
  113. Name(_PR3, Package() {\PR56})
  114. Method(_S0W, 0)
  115. {
  116. If(And(\_SB.OSCO, 0x04))
  117. {
  118. Return(4)
  119. } Else
  120. {
  121. Return(3)
  122. }
  123. } // End _S0W
  124. }
  125. Scope(\_SB.PCI0.XHC1) // XHCI host only controller
  126. {
  127. Method(_PS0,0,Serialized) // set device into D0 state
  128. {
  129. }
  130. Method(_PS3,0,Serialized) // place device into D3H state
  131. {
  132. //write to PMCSR
  133. }
  134. Method(_DSW, 3,Serialized) // enable or disable the device’s ability to wake a sleeping system.
  135. {
  136. }
  137. }
  138. Scope(\_SB.PCI0.XHC1.RHUB.HS01)
  139. {
  140. }
  141. Scope(\_SB.PCI0.XHC1.RHUB.SSP1)
  142. {
  143. }
  144. Scope(\_SB.PCI0.XHC2) // OTG
  145. {
  146. Method(_PS0,0,Serialized) // set device into D0 state
  147. {
  148. }
  149. Method(_PS3,0,Serialized) // place device into D3H state
  150. {
  151. //write to PMCSR
  152. }
  153. Method(_DSW, 3,Serialized) // enable or disable the device’s ability to wake a sleeping system.
  154. {
  155. }
  156. }
  157. Scope(\_SB.PCI0.XHC2.RHUB.HS01)
  158. {
  159. }
  160. Scope(\_SB.PCI0.XHC2.RHUB.SSP1)
  161. {
  162. }
  163. } //If(LEqual(RTD3,1)) USB
  164. }//end of SSDT