ci_smumgr.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2017 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 _CI_SMUMANAGER_H_
  24. #define _CI_SMUMANAGER_H_
  25. #define SMU__NUM_SCLK_DPM_STATE 8
  26. #define SMU__NUM_MCLK_DPM_LEVELS 6
  27. #define SMU__NUM_LCLK_DPM_LEVELS 8
  28. #define SMU__NUM_PCIE_DPM_LEVELS 8
  29. #include "smu7_discrete.h"
  30. #include <pp_endian.h>
  31. #include "ppatomctrl.h"
  32. struct ci_pt_defaults {
  33. u8 svi_load_line_en;
  34. u8 svi_load_line_vddc;
  35. u8 tdc_vddc_throttle_release_limit_perc;
  36. u8 tdc_mawt;
  37. u8 tdc_waterfall_ctl;
  38. u8 dte_ambient_temp_base;
  39. u32 display_cac;
  40. u32 bapm_temp_gradient;
  41. u16 bapmti_r[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
  42. u16 bapmti_rc[SMU7_DTE_ITERATIONS * SMU7_DTE_SOURCES * SMU7_DTE_SINKS];
  43. };
  44. struct ci_mc_reg_entry {
  45. uint32_t mclk_max;
  46. uint32_t mc_data[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  47. };
  48. struct ci_mc_reg_table {
  49. uint8_t last;
  50. uint8_t num_entries;
  51. uint16_t validflag;
  52. struct ci_mc_reg_entry mc_reg_table_entry[MAX_AC_TIMING_ENTRIES];
  53. SMU7_Discrete_MCRegisterAddress mc_reg_address[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  54. };
  55. struct ci_smumgr {
  56. uint32_t soft_regs_start;
  57. uint32_t dpm_table_start;
  58. uint32_t mc_reg_table_start;
  59. uint32_t fan_table_start;
  60. uint32_t arb_table_start;
  61. uint32_t ulv_setting_starts;
  62. struct SMU7_Discrete_DpmTable smc_state_table;
  63. struct SMU7_Discrete_PmFuses power_tune_table;
  64. const struct ci_pt_defaults *power_tune_defaults;
  65. SMU7_Discrete_MCRegisters mc_regs;
  66. struct ci_mc_reg_table mc_reg_table;
  67. };
  68. #endif