rs780_dpm.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 __RS780_DPM_H__
  24. #define __RS780_DPM_H__
  25. enum rs780_vddc_level {
  26. RS780_VDDC_LEVEL_UNKNOWN = 0,
  27. RS780_VDDC_LEVEL_LOW = 1,
  28. RS780_VDDC_LEVEL_HIGH = 2,
  29. };
  30. struct igp_power_info {
  31. /* flags */
  32. bool invert_pwm_required;
  33. bool pwm_voltage_control;
  34. bool voltage_control;
  35. bool gfx_clock_gating;
  36. /* stored values */
  37. u32 system_config;
  38. u32 bootup_uma_clk;
  39. u16 max_voltage;
  40. u16 min_voltage;
  41. u16 boot_voltage;
  42. u16 inter_voltage_low;
  43. u16 inter_voltage_high;
  44. u16 num_of_cycles_in_period;
  45. /* variable */
  46. int crtc_id;
  47. int refresh_rate;
  48. };
  49. struct igp_ps {
  50. enum rs780_vddc_level min_voltage;
  51. enum rs780_vddc_level max_voltage;
  52. u32 sclk_low;
  53. u32 sclk_high;
  54. u32 flags;
  55. };
  56. #define RS780_CGFTV_DFLT 0x0303000f
  57. #define RS780_FBDIVTIMERVAL_DFLT 0x2710
  58. #define RS780_FVTHROTUTC0_DFLT 0x04010040
  59. #define RS780_FVTHROTUTC1_DFLT 0x04010040
  60. #define RS780_FVTHROTUTC2_DFLT 0x04010040
  61. #define RS780_FVTHROTUTC3_DFLT 0x04010040
  62. #define RS780_FVTHROTUTC4_DFLT 0x04010040
  63. #define RS780_FVTHROTDTC0_DFLT 0x04010040
  64. #define RS780_FVTHROTDTC1_DFLT 0x04010040
  65. #define RS780_FVTHROTDTC2_DFLT 0x04010040
  66. #define RS780_FVTHROTDTC3_DFLT 0x04010040
  67. #define RS780_FVTHROTDTC4_DFLT 0x04010040
  68. #define RS780_FVTHROTFBUSREG0_DFLT 0x00001001
  69. #define RS780_FVTHROTFBUSREG1_DFLT 0x00002002
  70. #define RS780_FVTHROTFBDSREG0_DFLT 0x00004001
  71. #define RS780_FVTHROTFBDSREG1_DFLT 0x00020010
  72. #define RS780_FVTHROTPWMUSREG0_DFLT 0x00002001
  73. #define RS780_FVTHROTPWMUSREG1_DFLT 0x00004003
  74. #define RS780_FVTHROTPWMDSREG0_DFLT 0x00002001
  75. #define RS780_FVTHROTPWMDSREG1_DFLT 0x00004003
  76. #define RS780_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x37
  77. #define RS780_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x4b
  78. #define RS780_FVTHROTPWMFBDIVRANGEREG2_DFLT 0x8b
  79. #define RS780D_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x8b
  80. #define RS780D_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x8c
  81. #define RS780D_FVTHROTPWMFBDIVRANGEREG2_DFLT 0xb5
  82. #define RS880D_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x8d
  83. #define RS880D_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x8e
  84. #define RS880D_FVTHROTPWMFBDIVRANGEREG2_DFLT 0xBa
  85. #define RS780_FVTHROTPWMRANGE0_GPIO_DFLT 0x1a
  86. #define RS780_FVTHROTPWMRANGE1_GPIO_DFLT 0x1a
  87. #define RS780_FVTHROTPWMRANGE2_GPIO_DFLT 0x0
  88. #define RS780_FVTHROTPWMRANGE3_GPIO_DFLT 0x0
  89. #define RS780_SLOWCLKFEEDBACKDIV_DFLT 110
  90. #define RS780_CGCLKGATING_DFLT 0x0000E204
  91. #define RS780_DEFAULT_VCLK_FREQ 53300 /* 10 khz */
  92. #define RS780_DEFAULT_DCLK_FREQ 40000 /* 10 khz */
  93. #endif