tonga_smumgr.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright 2015 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 _TONGA_SMUMGR_H_
  24. #define _TONGA_SMUMGR_H_
  25. #include "smu72_discrete.h"
  26. #include "smu7_smumgr.h"
  27. #include "smu72.h"
  28. #define ASICID_IS_TONGA_P(wDID, bRID) \
  29. (((wDID == 0x6930) && ((bRID == 0xF0) || (bRID == 0xF1) || (bRID == 0xFF))) \
  30. || ((wDID == 0x6920) && ((bRID == 0) || (bRID == 1))))
  31. struct tonga_pt_defaults {
  32. uint8_t svi_load_line_en;
  33. uint8_t svi_load_line_vddC;
  34. uint8_t tdc_vddc_throttle_release_limit_perc;
  35. uint8_t tdc_mawt;
  36. uint8_t tdc_waterfall_ctl;
  37. uint8_t dte_ambient_temp_base;
  38. uint32_t display_cac;
  39. uint32_t bapm_temp_gradient;
  40. uint16_t bapmti_r[SMU72_DTE_ITERATIONS * SMU72_DTE_SOURCES * SMU72_DTE_SINKS];
  41. uint16_t bapmti_rc[SMU72_DTE_ITERATIONS * SMU72_DTE_SOURCES * SMU72_DTE_SINKS];
  42. };
  43. struct tonga_mc_reg_entry {
  44. uint32_t mclk_max;
  45. uint32_t mc_data[SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  46. };
  47. struct tonga_mc_reg_table {
  48. uint8_t last; /* number of registers*/
  49. uint8_t num_entries; /* number of entries in mc_reg_table_entry used*/
  50. uint16_t validflag; /* indicate the corresponding register is valid or not. 1: valid, 0: invalid. bit0->address[0], bit1->address[1], etc.*/
  51. struct tonga_mc_reg_entry mc_reg_table_entry[MAX_AC_TIMING_ENTRIES];
  52. SMU72_Discrete_MCRegisterAddress mc_reg_address[SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  53. };
  54. struct tonga_smumgr {
  55. struct smu7_smumgr smu7_data;
  56. struct SMU72_Discrete_DpmTable smc_state_table;
  57. struct SMU72_Discrete_Ulv ulv_setting;
  58. struct SMU72_Discrete_PmFuses power_tune_table;
  59. const struct tonga_pt_defaults *power_tune_defaults;
  60. SMU72_Discrete_MCRegisters mc_regs;
  61. struct tonga_mc_reg_table mc_reg_table;
  62. };
  63. #endif