rs780d.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * Copyright 2011 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef __RS780D_H__
  24. #define __RS780D_H__
  25. #define CG_SPLL_FUNC_CNTL 0x600
  26. # define SPLL_RESET (1 << 0)
  27. # define SPLL_SLEEP (1 << 1)
  28. # define SPLL_REF_DIV(x) ((x) << 2)
  29. # define SPLL_REF_DIV_MASK (7 << 2)
  30. # define SPLL_REF_DIV_SHIFT 2
  31. # define SPLL_FB_DIV(x) ((x) << 5)
  32. # define SPLL_FB_DIV_MASK (0xff << 2)
  33. # define SPLL_FB_DIV_SHIFT 2
  34. # define SPLL_PULSEEN (1 << 13)
  35. # define SPLL_PULSENUM(x) ((x) << 14)
  36. # define SPLL_PULSENUM_MASK (3 << 14)
  37. # define SPLL_SW_HILEN(x) ((x) << 16)
  38. # define SPLL_SW_HILEN_MASK (0xf << 16)
  39. # define SPLL_SW_HILEN_SHIFT 16
  40. # define SPLL_SW_LOLEN(x) ((x) << 20)
  41. # define SPLL_SW_LOLEN_MASK (0xf << 20)
  42. # define SPLL_SW_LOLEN_SHIFT 20
  43. # define SPLL_DIVEN (1 << 24)
  44. # define SPLL_BYPASS_EN (1 << 25)
  45. # define SPLL_CHG_STATUS (1 << 29)
  46. # define SPLL_CTLREQ (1 << 30)
  47. # define SPLL_CTLACK (1 << 31)
  48. /* RS780/RS880 PM */
  49. #define FVTHROT_CNTRL_REG 0x3000
  50. #define DONT_WAIT_FOR_FBDIV_WRAP (1 << 0)
  51. #define MINIMUM_CIP(x) ((x) << 1)
  52. #define MINIMUM_CIP_SHIFT 1
  53. #define MINIMUM_CIP_MASK 0x1fffffe
  54. #define REFRESH_RATE_DIVISOR(x) ((x) << 25)
  55. #define REFRESH_RATE_DIVISOR_SHIFT 25
  56. #define REFRESH_RATE_DIVISOR_MASK (0x3 << 25)
  57. #define ENABLE_FV_THROT (1 << 27)
  58. #define ENABLE_FV_UPDATE (1 << 28)
  59. #define TREND_SEL_MODE (1 << 29)
  60. #define FORCE_TREND_SEL (1 << 30)
  61. #define ENABLE_FV_THROT_IO (1 << 31)
  62. #define FVTHROT_TARGET_REG 0x3004
  63. #define TARGET_IDLE_COUNT(x) ((x) << 0)
  64. #define TARGET_IDLE_COUNT_MASK 0xffffff
  65. #define TARGET_IDLE_COUNT_SHIFT 0
  66. #define FVTHROT_CB1 0x3008
  67. #define FVTHROT_CB2 0x300c
  68. #define FVTHROT_CB3 0x3010
  69. #define FVTHROT_CB4 0x3014
  70. #define FVTHROT_UTC0 0x3018
  71. #define FVTHROT_UTC1 0x301c
  72. #define FVTHROT_UTC2 0x3020
  73. #define FVTHROT_UTC3 0x3024
  74. #define FVTHROT_UTC4 0x3028
  75. #define FVTHROT_DTC0 0x302c
  76. #define FVTHROT_DTC1 0x3030
  77. #define FVTHROT_DTC2 0x3034
  78. #define FVTHROT_DTC3 0x3038
  79. #define FVTHROT_DTC4 0x303c
  80. #define FVTHROT_FBDIV_REG0 0x3040
  81. #define MIN_FEEDBACK_DIV(x) ((x) << 0)
  82. #define MIN_FEEDBACK_DIV_MASK 0xfff
  83. #define MIN_FEEDBACK_DIV_SHIFT 0
  84. #define MAX_FEEDBACK_DIV(x) ((x) << 12)
  85. #define MAX_FEEDBACK_DIV_MASK (0xfff << 12)
  86. #define MAX_FEEDBACK_DIV_SHIFT 12
  87. #define FVTHROT_FBDIV_REG1 0x3044
  88. #define MAX_FEEDBACK_STEP(x) ((x) << 0)
  89. #define MAX_FEEDBACK_STEP_MASK 0xfff
  90. #define MAX_FEEDBACK_STEP_SHIFT 0
  91. #define STARTING_FEEDBACK_DIV(x) ((x) << 12)
  92. #define STARTING_FEEDBACK_DIV_MASK (0xfff << 12)
  93. #define STARTING_FEEDBACK_DIV_SHIFT 12
  94. #define FORCE_FEEDBACK_DIV (1 << 24)
  95. #define FVTHROT_FBDIV_REG2 0x3048
  96. #define FORCED_FEEDBACK_DIV(x) ((x) << 0)
  97. #define FORCED_FEEDBACK_DIV_MASK 0xfff
  98. #define FORCED_FEEDBACK_DIV_SHIFT 0
  99. #define FB_DIV_TIMER_VAL(x) ((x) << 12)
  100. #define FB_DIV_TIMER_VAL_MASK (0xffff << 12)
  101. #define FB_DIV_TIMER_VAL_SHIFT 12
  102. #define FVTHROT_FB_US_REG0 0x304c
  103. #define FVTHROT_FB_US_REG1 0x3050
  104. #define FVTHROT_FB_DS_REG0 0x3054
  105. #define FVTHROT_FB_DS_REG1 0x3058
  106. #define FVTHROT_PWM_CTRL_REG0 0x305c
  107. #define STARTING_PWM_HIGHTIME(x) ((x) << 0)
  108. #define STARTING_PWM_HIGHTIME_MASK 0xfff
  109. #define STARTING_PWM_HIGHTIME_SHIFT 0
  110. #define NUMBER_OF_CYCLES_IN_PERIOD(x) ((x) << 12)
  111. #define NUMBER_OF_CYCLES_IN_PERIOD_MASK (0xfff << 12)
  112. #define NUMBER_OF_CYCLES_IN_PERIOD_SHIFT 12
  113. #define FORCE_STARTING_PWM_HIGHTIME (1 << 24)
  114. #define INVERT_PWM_WAVEFORM (1 << 25)
  115. #define FVTHROT_PWM_CTRL_REG1 0x3060
  116. #define MIN_PWM_HIGHTIME(x) ((x) << 0)
  117. #define MIN_PWM_HIGHTIME_MASK 0xfff
  118. #define MIN_PWM_HIGHTIME_SHIFT 0
  119. #define MAX_PWM_HIGHTIME(x) ((x) << 12)
  120. #define MAX_PWM_HIGHTIME_MASK (0xfff << 12)
  121. #define MAX_PWM_HIGHTIME_SHIFT 12
  122. #define FVTHROT_PWM_US_REG0 0x3064
  123. #define FVTHROT_PWM_US_REG1 0x3068
  124. #define FVTHROT_PWM_DS_REG0 0x306c
  125. #define FVTHROT_PWM_DS_REG1 0x3070
  126. #define FVTHROT_STATUS_REG0 0x3074
  127. #define CURRENT_FEEDBACK_DIV_MASK 0xfff
  128. #define CURRENT_FEEDBACK_DIV_SHIFT 0
  129. #define FVTHROT_STATUS_REG1 0x3078
  130. #define FVTHROT_STATUS_REG2 0x307c
  131. #define CG_INTGFX_MISC 0x3080
  132. #define FVTHROT_VBLANK_SEL (1 << 9)
  133. #define FVTHROT_PWM_FEEDBACK_DIV_REG1 0x308c
  134. #define RANGE0_PWM_FEEDBACK_DIV(x) ((x) << 0)
  135. #define RANGE0_PWM_FEEDBACK_DIV_MASK 0xfff
  136. #define RANGE0_PWM_FEEDBACK_DIV_SHIFT 0
  137. #define RANGE_PWM_FEEDBACK_DIV_EN (1 << 12)
  138. #define FVTHROT_PWM_FEEDBACK_DIV_REG2 0x3090
  139. #define RANGE1_PWM_FEEDBACK_DIV(x) ((x) << 0)
  140. #define RANGE1_PWM_FEEDBACK_DIV_MASK 0xfff
  141. #define RANGE1_PWM_FEEDBACK_DIV_SHIFT 0
  142. #define RANGE2_PWM_FEEDBACK_DIV(x) ((x) << 12)
  143. #define RANGE2_PWM_FEEDBACK_DIV_MASK (0xfff << 12)
  144. #define RANGE2_PWM_FEEDBACK_DIV_SHIFT 12
  145. #define FVTHROT_PWM_FEEDBACK_DIV_REG3 0x3094
  146. #define RANGE0_PWM(x) ((x) << 0)
  147. #define RANGE0_PWM_MASK 0xfff
  148. #define RANGE0_PWM_SHIFT 0
  149. #define RANGE1_PWM(x) ((x) << 12)
  150. #define RANGE1_PWM_MASK (0xfff << 12)
  151. #define RANGE1_PWM_SHIFT 12
  152. #define FVTHROT_PWM_FEEDBACK_DIV_REG4 0x3098
  153. #define RANGE2_PWM(x) ((x) << 0)
  154. #define RANGE2_PWM_MASK 0xfff
  155. #define RANGE2_PWM_SHIFT 0
  156. #define RANGE3_PWM(x) ((x) << 12)
  157. #define RANGE3_PWM_MASK (0xfff << 12)
  158. #define RANGE3_PWM_SHIFT 12
  159. #define FVTHROT_SLOW_CLK_FEEDBACK_DIV_REG1 0x30ac
  160. #define RANGE0_SLOW_CLK_FEEDBACK_DIV(x) ((x) << 0)
  161. #define RANGE0_SLOW_CLK_FEEDBACK_DIV_MASK 0xfff
  162. #define RANGE0_SLOW_CLK_FEEDBACK_DIV_SHIFT 0
  163. #define RANGE_SLOW_CLK_FEEDBACK_DIV_EN (1 << 12)
  164. #define GFX_MACRO_BYPASS_CNTL 0x30c0
  165. #define SPLL_BYPASS_CNTL (1 << 0)
  166. #define UPLL_BYPASS_CNTL (1 << 1)
  167. #endif