rv6xx_dpm.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. * Authors: Alex Deucher
  23. */
  24. #ifndef __RV6XX_DPM_H__
  25. #define __RV6XX_DPM_H__
  26. #include "r600_dpm.h"
  27. /* Represents a single SCLK step. */
  28. struct rv6xx_sclk_stepping
  29. {
  30. u32 vco_frequency;
  31. u32 post_divider;
  32. };
  33. struct rv6xx_pm_hw_state {
  34. u32 sclks[R600_PM_NUMBER_OF_ACTIVITY_LEVELS];
  35. u32 mclks[R600_PM_NUMBER_OF_MCLKS];
  36. u16 vddc[R600_PM_NUMBER_OF_VOLTAGE_LEVELS];
  37. bool backbias[R600_PM_NUMBER_OF_VOLTAGE_LEVELS];
  38. bool pcie_gen2[R600_PM_NUMBER_OF_ACTIVITY_LEVELS];
  39. u8 high_sclk_index;
  40. u8 medium_sclk_index;
  41. u8 low_sclk_index;
  42. u8 high_mclk_index;
  43. u8 medium_mclk_index;
  44. u8 low_mclk_index;
  45. u8 high_vddc_index;
  46. u8 medium_vddc_index;
  47. u8 low_vddc_index;
  48. u8 rp[R600_PM_NUMBER_OF_ACTIVITY_LEVELS];
  49. u8 lp[R600_PM_NUMBER_OF_ACTIVITY_LEVELS];
  50. };
  51. struct rv6xx_power_info {
  52. /* flags */
  53. bool voltage_control;
  54. bool sclk_ss;
  55. bool mclk_ss;
  56. bool dynamic_ss;
  57. bool dynamic_pcie_gen2;
  58. bool thermal_protection;
  59. bool display_gap;
  60. bool gfx_clock_gating;
  61. /* clk values */
  62. u32 fb_div_scale;
  63. u32 spll_ref_div;
  64. u32 mpll_ref_div;
  65. u32 bsu;
  66. u32 bsp;
  67. /* */
  68. u32 active_auto_throttle_sources;
  69. /* current power state */
  70. u32 restricted_levels;
  71. struct rv6xx_pm_hw_state hw;
  72. };
  73. struct rv6xx_pl {
  74. u32 sclk;
  75. u32 mclk;
  76. u16 vddc;
  77. u32 flags;
  78. };
  79. struct rv6xx_ps {
  80. struct rv6xx_pl high;
  81. struct rv6xx_pl medium;
  82. struct rv6xx_pl low;
  83. };
  84. #define RV6XX_DEFAULT_VCLK_FREQ 40000 /* 10 khz */
  85. #define RV6XX_DEFAULT_DCLK_FREQ 30000 /* 10 khz */
  86. #endif