smu75_discrete.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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 SMU75_DISCRETE_H
  24. #define SMU75_DISCRETE_H
  25. #include "smu75.h"
  26. #pragma pack(push, 1)
  27. #define NUM_SCLK_RANGE 8
  28. #define VCO_3_6 1
  29. #define VCO_2_4 3
  30. #define POSTDIV_DIV_BY_1 0
  31. #define POSTDIV_DIV_BY_2 1
  32. #define POSTDIV_DIV_BY_4 2
  33. #define POSTDIV_DIV_BY_8 3
  34. #define POSTDIV_DIV_BY_16 4
  35. struct sclkFcwRange_t {
  36. uint8_t vco_setting; /* 1: 3-6GHz, 3: 2-4GHz */
  37. uint8_t postdiv; /* divide by 2^n */
  38. uint16_t fcw_pcc;
  39. uint16_t fcw_trans_upper;
  40. uint16_t fcw_trans_lower;
  41. };
  42. typedef struct sclkFcwRange_t sclkFcwRange_t;
  43. struct SMIO_Pattern {
  44. uint16_t Voltage;
  45. uint8_t Smio;
  46. uint8_t padding;
  47. };
  48. typedef struct SMIO_Pattern SMIO_Pattern;
  49. struct SMIO_Table {
  50. SMIO_Pattern Pattern[SMU_MAX_SMIO_LEVELS];
  51. };
  52. typedef struct SMIO_Table SMIO_Table;
  53. struct SMU_SclkSetting {
  54. uint32_t SclkFrequency;
  55. uint16_t Fcw_int;
  56. uint16_t Fcw_frac;
  57. uint16_t Pcc_fcw_int;
  58. uint8_t PllRange;
  59. uint8_t SSc_En;
  60. uint16_t Sclk_slew_rate;
  61. uint16_t Pcc_up_slew_rate;
  62. uint16_t Pcc_down_slew_rate;
  63. uint16_t Fcw1_int;
  64. uint16_t Fcw1_frac;
  65. uint16_t Sclk_ss_slew_rate;
  66. };
  67. typedef struct SMU_SclkSetting SMU_SclkSetting;
  68. struct SMU75_Discrete_GraphicsLevel {
  69. SMU_VoltageLevel MinVoltage;
  70. uint8_t pcieDpmLevel;
  71. uint8_t DeepSleepDivId;
  72. uint16_t ActivityLevel;
  73. uint32_t CgSpllFuncCntl3;
  74. uint32_t CgSpllFuncCntl4;
  75. uint32_t CcPwrDynRm;
  76. uint32_t CcPwrDynRm1;
  77. uint8_t SclkDid;
  78. uint8_t padding;
  79. uint8_t EnabledForActivity;
  80. uint8_t EnabledForThrottle;
  81. uint8_t UpHyst;
  82. uint8_t DownHyst;
  83. uint8_t VoltageDownHyst;
  84. uint8_t PowerThrottle;
  85. SMU_SclkSetting SclkSetting;
  86. uint8_t ScksStretchThreshVid[NUM_SCKS_STATE_TYPES];
  87. uint16_t Padding;
  88. };
  89. typedef struct SMU75_Discrete_GraphicsLevel SMU75_Discrete_GraphicsLevel;
  90. struct SMU75_Discrete_ACPILevel {
  91. uint32_t Flags;
  92. SMU_VoltageLevel MinVoltage;
  93. uint32_t SclkFrequency;
  94. uint8_t SclkDid;
  95. uint8_t DisplayWatermark;
  96. uint8_t DeepSleepDivId;
  97. uint8_t padding;
  98. uint32_t CcPwrDynRm;
  99. uint32_t CcPwrDynRm1;
  100. SMU_SclkSetting SclkSetting;
  101. };
  102. typedef struct SMU75_Discrete_ACPILevel SMU75_Discrete_ACPILevel;
  103. struct SMU75_Discrete_Ulv {
  104. uint32_t CcPwrDynRm;
  105. uint32_t CcPwrDynRm1;
  106. uint16_t VddcOffset;
  107. uint8_t VddcOffsetVid;
  108. uint8_t VddcPhase;
  109. uint16_t BifSclkDfs;
  110. uint16_t Reserved;
  111. };
  112. typedef struct SMU75_Discrete_Ulv SMU75_Discrete_Ulv;
  113. struct SMU75_Discrete_MemoryLevel {
  114. SMU_VoltageLevel MinVoltage;
  115. uint32_t MinMvdd;
  116. uint32_t MclkFrequency;
  117. uint8_t StutterEnable;
  118. uint8_t EnabledForThrottle;
  119. uint8_t EnabledForActivity;
  120. uint8_t padding_0;
  121. uint8_t UpHyst;
  122. uint8_t DownHyst;
  123. uint8_t VoltageDownHyst;
  124. uint8_t padding_1;
  125. uint16_t ActivityLevel;
  126. uint8_t DisplayWatermark;
  127. uint8_t padding_2;
  128. uint16_t Fcw_int;
  129. uint16_t Fcw_frac;
  130. uint8_t Postdiv;
  131. uint8_t padding_3[3];
  132. };
  133. typedef struct SMU75_Discrete_MemoryLevel SMU75_Discrete_MemoryLevel;
  134. struct SMU75_Discrete_LinkLevel {
  135. uint8_t PcieGenSpeed;
  136. uint8_t PcieLaneCount;
  137. uint8_t EnabledForActivity;
  138. uint8_t SPC;
  139. uint32_t DownThreshold;
  140. uint32_t UpThreshold;
  141. uint16_t BifSclkDfs;
  142. uint16_t Reserved;
  143. };
  144. typedef struct SMU75_Discrete_LinkLevel SMU75_Discrete_LinkLevel;
  145. /* MC ARB DRAM Timing registers. */
  146. struct SMU75_Discrete_MCArbDramTimingTableEntry {
  147. uint32_t McArbDramTiming;
  148. uint32_t McArbDramTiming2;
  149. uint32_t McArbBurstTime;
  150. uint32_t McArbRfshRate;
  151. uint32_t McArbMisc3;
  152. };
  153. typedef struct SMU75_Discrete_MCArbDramTimingTableEntry SMU75_Discrete_MCArbDramTimingTableEntry;
  154. struct SMU75_Discrete_MCArbDramTimingTable {
  155. SMU75_Discrete_MCArbDramTimingTableEntry entries[SMU__NUM_SCLK_DPM_STATE][SMU__NUM_MCLK_DPM_LEVELS];
  156. };
  157. typedef struct SMU75_Discrete_MCArbDramTimingTable SMU75_Discrete_MCArbDramTimingTable;
  158. /* UVD VCLK/DCLK state (level) definition. */
  159. struct SMU75_Discrete_UvdLevel {
  160. uint32_t VclkFrequency;
  161. uint32_t DclkFrequency;
  162. SMU_VoltageLevel MinVoltage;
  163. uint8_t VclkDivider;
  164. uint8_t DclkDivider;
  165. uint8_t padding[2];
  166. };
  167. typedef struct SMU75_Discrete_UvdLevel SMU75_Discrete_UvdLevel;
  168. /* Clocks for other external blocks (VCE, ACP, SAMU). */
  169. struct SMU75_Discrete_ExtClkLevel {
  170. uint32_t Frequency;
  171. SMU_VoltageLevel MinVoltage;
  172. uint8_t Divider;
  173. uint8_t padding[3];
  174. };
  175. typedef struct SMU75_Discrete_ExtClkLevel SMU75_Discrete_ExtClkLevel;
  176. struct SMU75_Discrete_StateInfo {
  177. uint32_t SclkFrequency;
  178. uint32_t MclkFrequency;
  179. uint32_t VclkFrequency;
  180. uint32_t DclkFrequency;
  181. uint32_t SamclkFrequency;
  182. uint32_t AclkFrequency;
  183. uint32_t EclkFrequency;
  184. uint16_t MvddVoltage;
  185. uint16_t padding16;
  186. uint8_t DisplayWatermark;
  187. uint8_t McArbIndex;
  188. uint8_t McRegIndex;
  189. uint8_t SeqIndex;
  190. uint8_t SclkDid;
  191. int8_t SclkIndex;
  192. int8_t MclkIndex;
  193. uint8_t PCIeGen;
  194. };
  195. typedef struct SMU75_Discrete_StateInfo SMU75_Discrete_StateInfo;
  196. struct SMU75_Discrete_DpmTable {
  197. SMU75_PIDController GraphicsPIDController;
  198. SMU75_PIDController MemoryPIDController;
  199. SMU75_PIDController LinkPIDController;
  200. uint32_t SystemFlags;
  201. uint32_t VRConfig;
  202. uint32_t SmioMask1;
  203. uint32_t SmioMask2;
  204. SMIO_Table SmioTable1;
  205. SMIO_Table SmioTable2;
  206. uint32_t MvddLevelCount;
  207. uint8_t BapmVddcVidHiSidd [SMU75_MAX_LEVELS_VDDC];
  208. uint8_t BapmVddcVidLoSidd [SMU75_MAX_LEVELS_VDDC];
  209. uint8_t BapmVddcVidHiSidd2 [SMU75_MAX_LEVELS_VDDC];
  210. uint8_t GraphicsDpmLevelCount;
  211. uint8_t MemoryDpmLevelCount;
  212. uint8_t LinkLevelCount;
  213. uint8_t MasterDeepSleepControl;
  214. uint8_t UvdLevelCount;
  215. uint8_t VceLevelCount;
  216. uint8_t AcpLevelCount;
  217. uint8_t SamuLevelCount;
  218. uint8_t ThermOutGpio;
  219. uint8_t ThermOutPolarity;
  220. uint8_t ThermOutMode;
  221. uint8_t BootPhases;
  222. uint8_t VRHotLevel;
  223. uint8_t LdoRefSel;
  224. uint8_t Reserved1[2];
  225. uint16_t FanStartTemperature;
  226. uint16_t FanStopTemperature;
  227. uint16_t MaxVoltage;
  228. uint16_t Reserved2;
  229. uint32_t Reserved;
  230. SMU75_Discrete_GraphicsLevel GraphicsLevel [SMU75_MAX_LEVELS_GRAPHICS];
  231. SMU75_Discrete_MemoryLevel MemoryACPILevel;
  232. SMU75_Discrete_MemoryLevel MemoryLevel [SMU75_MAX_LEVELS_MEMORY];
  233. SMU75_Discrete_LinkLevel LinkLevel [SMU75_MAX_LEVELS_LINK];
  234. SMU75_Discrete_ACPILevel ACPILevel;
  235. SMU75_Discrete_UvdLevel UvdLevel [SMU75_MAX_LEVELS_UVD];
  236. SMU75_Discrete_ExtClkLevel VceLevel [SMU75_MAX_LEVELS_VCE];
  237. SMU75_Discrete_ExtClkLevel AcpLevel [SMU75_MAX_LEVELS_ACP];
  238. SMU75_Discrete_ExtClkLevel SamuLevel [SMU75_MAX_LEVELS_SAMU];
  239. SMU75_Discrete_Ulv Ulv;
  240. uint8_t DisplayWatermark [SMU75_MAX_LEVELS_MEMORY][SMU75_MAX_LEVELS_GRAPHICS];
  241. uint32_t SclkStepSize;
  242. uint32_t Smio [SMU75_MAX_ENTRIES_SMIO];
  243. uint8_t UvdBootLevel;
  244. uint8_t VceBootLevel;
  245. uint8_t AcpBootLevel;
  246. uint8_t SamuBootLevel;
  247. uint8_t GraphicsBootLevel;
  248. uint8_t GraphicsVoltageChangeEnable;
  249. uint8_t GraphicsThermThrottleEnable;
  250. uint8_t GraphicsInterval;
  251. uint8_t VoltageInterval;
  252. uint8_t ThermalInterval;
  253. uint16_t TemperatureLimitHigh;
  254. uint16_t TemperatureLimitLow;
  255. uint8_t MemoryBootLevel;
  256. uint8_t MemoryVoltageChangeEnable;
  257. uint16_t BootMVdd;
  258. uint8_t MemoryInterval;
  259. uint8_t MemoryThermThrottleEnable;
  260. uint16_t VoltageResponseTime;
  261. uint16_t PhaseResponseTime;
  262. uint8_t PCIeBootLinkLevel;
  263. uint8_t PCIeGenInterval;
  264. uint8_t DTEInterval;
  265. uint8_t DTEMode;
  266. uint8_t SVI2Enable;
  267. uint8_t VRHotGpio;
  268. uint8_t AcDcGpio;
  269. uint8_t ThermGpio;
  270. uint16_t PPM_PkgPwrLimit;
  271. uint16_t PPM_TemperatureLimit;
  272. uint16_t DefaultTdp;
  273. uint16_t TargetTdp;
  274. uint16_t FpsHighThreshold;
  275. uint16_t FpsLowThreshold;
  276. uint16_t BAPMTI_R [SMU75_DTE_ITERATIONS][SMU75_DTE_SOURCES][SMU75_DTE_SINKS];
  277. uint16_t BAPMTI_RC [SMU75_DTE_ITERATIONS][SMU75_DTE_SOURCES][SMU75_DTE_SINKS];
  278. uint16_t TemperatureLimitEdge;
  279. uint16_t TemperatureLimitHotspot;
  280. uint16_t BootVddc;
  281. uint16_t BootVddci;
  282. uint16_t FanGainEdge;
  283. uint16_t FanGainHotspot;
  284. uint32_t LowSclkInterruptThreshold;
  285. uint32_t VddGfxReChkWait;
  286. uint8_t ClockStretcherAmount;
  287. uint8_t Sclk_CKS_masterEn0_7;
  288. uint8_t Sclk_CKS_masterEn8_15;
  289. uint8_t DPMFreezeAndForced;
  290. uint8_t Sclk_voltageOffset[8];
  291. SMU_ClockStretcherDataTable ClockStretcherDataTable;
  292. SMU_CKS_LOOKUPTable CKS_LOOKUPTable;
  293. uint32_t CurrSclkPllRange;
  294. sclkFcwRange_t SclkFcwRangeTable[NUM_SCLK_RANGE];
  295. GB_VDROOP_TABLE_t BTCGB_VDROOP_TABLE[BTCGB_VDROOP_TABLE_MAX_ENTRIES];
  296. SMU_QuadraticCoeffs AVFSGB_FUSE_TABLE[AVFSGB_VDROOP_TABLE_MAX_ENTRIES];
  297. };
  298. typedef struct SMU75_Discrete_DpmTable SMU75_Discrete_DpmTable;
  299. struct SMU75_Discrete_FanTable {
  300. uint16_t FdoMode;
  301. int16_t TempMin;
  302. int16_t TempMed;
  303. int16_t TempMax;
  304. int16_t Slope1;
  305. int16_t Slope2;
  306. int16_t FdoMin;
  307. int16_t HystUp;
  308. int16_t HystDown;
  309. int16_t HystSlope;
  310. int16_t TempRespLim;
  311. int16_t TempCurr;
  312. int16_t SlopeCurr;
  313. int16_t PwmCurr;
  314. uint32_t RefreshPeriod;
  315. int16_t FdoMax;
  316. uint8_t TempSrc;
  317. int8_t Padding;
  318. };
  319. typedef struct SMU75_Discrete_FanTable SMU75_Discrete_FanTable;
  320. #define SMU7_DISCRETE_GPIO_SCLK_DEBUG 4
  321. #define SMU7_DISCRETE_GPIO_SCLK_DEBUG_BIT (0x1 << SMU7_DISCRETE_GPIO_SCLK_DEBUG)
  322. struct SMU7_MclkDpmScoreboard {
  323. uint32_t PercentageBusy;
  324. int32_t PIDError;
  325. int32_t PIDIntegral;
  326. int32_t PIDOutput;
  327. uint32_t SigmaDeltaAccum;
  328. uint32_t SigmaDeltaOutput;
  329. uint32_t SigmaDeltaLevel;
  330. uint32_t UtilizationSetpoint;
  331. uint8_t TdpClampMode;
  332. uint8_t TdcClampMode;
  333. uint8_t ThermClampMode;
  334. uint8_t VoltageBusy;
  335. int8_t CurrLevel;
  336. int8_t TargLevel;
  337. uint8_t LevelChangeInProgress;
  338. uint8_t UpHyst;
  339. uint8_t DownHyst;
  340. uint8_t VoltageDownHyst;
  341. uint8_t DpmEnable;
  342. uint8_t DpmRunning;
  343. uint8_t DpmForce;
  344. uint8_t DpmForceLevel;
  345. uint8_t padding2;
  346. uint8_t McArbIndex;
  347. uint32_t MinimumPerfMclk;
  348. uint8_t AcpiReq;
  349. uint8_t AcpiAck;
  350. uint8_t MclkSwitchInProgress;
  351. uint8_t MclkSwitchCritical;
  352. uint8_t IgnoreVBlank;
  353. uint8_t TargetMclkIndex;
  354. uint8_t TargetMvddIndex;
  355. uint8_t MclkSwitchResult;
  356. uint16_t VbiFailureCount;
  357. uint8_t VbiWaitCounter;
  358. uint8_t EnabledLevelsChange;
  359. uint16_t LevelResidencyCounters [SMU75_MAX_LEVELS_MEMORY];
  360. uint16_t LevelSwitchCounters [SMU75_MAX_LEVELS_MEMORY];
  361. void (*TargetStateCalculator)(uint8_t);
  362. void (*SavedTargetStateCalculator)(uint8_t);
  363. uint16_t AutoDpmInterval;
  364. uint16_t AutoDpmRange;
  365. uint16_t VbiTimeoutCount;
  366. uint16_t MclkSwitchingTime;
  367. uint8_t fastSwitch;
  368. uint8_t Save_PIC_VDDGFX_EXIT;
  369. uint8_t Save_PIC_VDDGFX_ENTER;
  370. uint8_t VbiTimeout;
  371. uint32_t HbmTempRegBackup;
  372. };
  373. typedef struct SMU7_MclkDpmScoreboard SMU7_MclkDpmScoreboard;
  374. struct SMU7_UlvScoreboard {
  375. uint8_t EnterUlv;
  376. uint8_t ExitUlv;
  377. uint8_t UlvActive;
  378. uint8_t WaitingForUlv;
  379. uint8_t UlvEnable;
  380. uint8_t UlvRunning;
  381. uint8_t UlvMasterEnable;
  382. uint8_t padding;
  383. uint32_t UlvAbortedCount;
  384. uint32_t UlvTimeStamp;
  385. };
  386. typedef struct SMU7_UlvScoreboard SMU7_UlvScoreboard;
  387. struct VddgfxSavedRegisters {
  388. uint32_t GPU_DBG[3];
  389. uint32_t MEC_BaseAddress_Hi;
  390. uint32_t MEC_BaseAddress_Lo;
  391. uint32_t THM_TMON0_CTRL2__RDIR_PRESENT;
  392. uint32_t THM_TMON1_CTRL2__RDIR_PRESENT;
  393. uint32_t CP_INT_CNTL;
  394. };
  395. typedef struct VddgfxSavedRegisters VddgfxSavedRegisters;
  396. struct SMU7_VddGfxScoreboard {
  397. uint8_t VddGfxEnable;
  398. uint8_t VddGfxActive;
  399. uint8_t VPUResetOccured;
  400. uint8_t padding;
  401. uint32_t VddGfxEnteredCount;
  402. uint32_t VddGfxAbortedCount;
  403. uint32_t VddGfxVid;
  404. VddgfxSavedRegisters SavedRegisters;
  405. };
  406. typedef struct SMU7_VddGfxScoreboard SMU7_VddGfxScoreboard;
  407. struct SMU7_TdcLimitScoreboard {
  408. uint8_t Enable;
  409. uint8_t Running;
  410. uint16_t Alpha;
  411. uint32_t FilteredIddc;
  412. uint32_t IddcLimit;
  413. uint32_t IddcHyst;
  414. SMU7_HystController_Data HystControllerData;
  415. };
  416. typedef struct SMU7_TdcLimitScoreboard SMU7_TdcLimitScoreboard;
  417. struct SMU7_PkgPwrLimitScoreboard {
  418. uint8_t Enable;
  419. uint8_t Running;
  420. uint16_t Alpha;
  421. uint32_t FilteredPkgPwr;
  422. uint32_t Limit;
  423. uint32_t Hyst;
  424. uint32_t LimitFromDriver;
  425. uint8_t PowerSharingEnabled;
  426. uint8_t PowerSharingCounter;
  427. uint8_t PowerSharingINTEnabled;
  428. uint8_t GFXActivityCounterEnabled;
  429. uint32_t EnergyCount;
  430. uint32_t PSACTCount;
  431. uint8_t RollOverRequired;
  432. uint8_t RollOverCount;
  433. uint8_t padding[2];
  434. SMU7_HystController_Data HystControllerData;
  435. };
  436. typedef struct SMU7_PkgPwrLimitScoreboard SMU7_PkgPwrLimitScoreboard;
  437. struct SMU7_BapmScoreboard {
  438. uint32_t source_powers[SMU75_DTE_SOURCES];
  439. uint32_t source_powers_last[SMU75_DTE_SOURCES];
  440. int32_t entity_temperatures[SMU75_NUM_GPU_TES];
  441. int32_t initial_entity_temperatures[SMU75_NUM_GPU_TES];
  442. int32_t Limit;
  443. int32_t Hyst;
  444. int32_t therm_influence_coeff_table[SMU75_DTE_ITERATIONS * SMU75_DTE_SOURCES * SMU75_DTE_SINKS * 2];
  445. int32_t therm_node_table[SMU75_DTE_ITERATIONS * SMU75_DTE_SOURCES * SMU75_DTE_SINKS];
  446. uint16_t ConfigTDPPowerScalar;
  447. uint16_t FanSpeedPowerScalar;
  448. uint16_t OverDrivePowerScalar;
  449. uint16_t OverDriveLimitScalar;
  450. uint16_t FinalPowerScalar;
  451. uint8_t VariantID;
  452. uint8_t spare997;
  453. SMU7_HystController_Data HystControllerData;
  454. int32_t temperature_gradient_slope;
  455. int32_t temperature_gradient;
  456. uint32_t measured_temperature;
  457. };
  458. typedef struct SMU7_BapmScoreboard SMU7_BapmScoreboard;
  459. struct SMU7_AcpiScoreboard {
  460. uint32_t SavedInterruptMask[2];
  461. uint8_t LastACPIRequest;
  462. uint8_t CgBifResp;
  463. uint8_t RequestType;
  464. uint8_t Padding;
  465. SMU75_Discrete_ACPILevel D0Level;
  466. };
  467. typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard;
  468. struct SMU75_Discrete_PmFuses {
  469. uint8_t BapmVddCVidHiSidd[8];
  470. uint8_t BapmVddCVidLoSidd[8];
  471. uint8_t VddCVid[8];
  472. uint8_t SviLoadLineEn;
  473. uint8_t SviLoadLineVddC;
  474. uint8_t SviLoadLineTrimVddC;
  475. uint8_t SviLoadLineOffsetVddC;
  476. uint16_t TDC_VDDC_PkgLimit;
  477. uint8_t TDC_VDDC_ThrottleReleaseLimitPerc;
  478. uint8_t TDC_MAWt;
  479. uint8_t TdcWaterfallCtl;
  480. uint8_t LPMLTemperatureMin;
  481. uint8_t LPMLTemperatureMax;
  482. uint8_t Reserved;
  483. uint8_t LPMLTemperatureScaler[16];
  484. int16_t FuzzyFan_ErrorSetDelta;
  485. int16_t FuzzyFan_ErrorRateSetDelta;
  486. int16_t FuzzyFan_PwmSetDelta;
  487. uint16_t Reserved6;
  488. uint8_t GnbLPML[16];
  489. uint8_t GnbLPMLMaxVid;
  490. uint8_t GnbLPMLMinVid;
  491. uint8_t Reserved1[2];
  492. uint16_t BapmVddCBaseLeakageHiSidd;
  493. uint16_t BapmVddCBaseLeakageLoSidd;
  494. uint16_t VFT_Temp[3];
  495. uint8_t Version;
  496. uint8_t padding;
  497. SMU_QuadraticCoeffs VFT_ATE[3];
  498. SMU_QuadraticCoeffs AVFS_GB;
  499. SMU_QuadraticCoeffs ATE_ACBTC_GB;
  500. SMU_QuadraticCoeffs P2V;
  501. uint32_t PsmCharzFreq;
  502. uint16_t InversionVoltage;
  503. uint16_t PsmCharzTemp;
  504. uint32_t EnabledAvfsModules;
  505. SMU_QuadraticCoeffs BtcGbv_CksOff;
  506. };
  507. typedef struct SMU75_Discrete_PmFuses SMU75_Discrete_PmFuses;
  508. struct SMU7_Discrete_Log_Header_Table {
  509. uint32_t version;
  510. uint32_t asic_id;
  511. uint16_t flags;
  512. uint16_t entry_size;
  513. uint32_t total_size;
  514. uint32_t num_of_entries;
  515. uint8_t type;
  516. uint8_t mode;
  517. uint8_t filler_0[2];
  518. uint32_t filler_1[2];
  519. };
  520. typedef struct SMU7_Discrete_Log_Header_Table SMU7_Discrete_Log_Header_Table;
  521. struct SMU7_Discrete_Log_Cntl {
  522. uint8_t Enabled;
  523. uint8_t Type;
  524. uint8_t padding[2];
  525. uint32_t BufferSize;
  526. uint32_t SamplesLogged;
  527. uint32_t SampleSize;
  528. uint32_t AddrL;
  529. uint32_t AddrH;
  530. };
  531. typedef struct SMU7_Discrete_Log_Cntl SMU7_Discrete_Log_Cntl;
  532. #if defined SMU__DGPU_ONLY
  533. #define CAC_ACC_NW_NUM_OF_SIGNALS 87
  534. #endif
  535. struct SMU7_Discrete_Cac_Collection_Table {
  536. uint32_t temperature;
  537. uint32_t cac_acc_nw[CAC_ACC_NW_NUM_OF_SIGNALS];
  538. };
  539. typedef struct SMU7_Discrete_Cac_Collection_Table SMU7_Discrete_Cac_Collection_Table;
  540. struct SMU7_Discrete_Cac_Verification_Table {
  541. uint32_t VddcTotalPower;
  542. uint32_t VddcLeakagePower;
  543. uint32_t VddcConstantPower;
  544. uint32_t VddcGfxDynamicPower;
  545. uint32_t VddcUvdDynamicPower;
  546. uint32_t VddcVceDynamicPower;
  547. uint32_t VddcAcpDynamicPower;
  548. uint32_t VddcPcieDynamicPower;
  549. uint32_t VddcDceDynamicPower;
  550. uint32_t VddcCurrent;
  551. uint32_t VddcVoltage;
  552. uint32_t VddciTotalPower;
  553. uint32_t VddciLeakagePower;
  554. uint32_t VddciConstantPower;
  555. uint32_t VddciDynamicPower;
  556. uint32_t Vddr1TotalPower;
  557. uint32_t Vddr1LeakagePower;
  558. uint32_t Vddr1ConstantPower;
  559. uint32_t Vddr1DynamicPower;
  560. uint32_t spare[4];
  561. uint32_t temperature;
  562. };
  563. typedef struct SMU7_Discrete_Cac_Verification_Table SMU7_Discrete_Cac_Verification_Table;
  564. struct SMU7_Discrete_Pm_Status_Table {
  565. int32_t T_meas_max[SMU75_THERMAL_INPUT_LOOP_COUNT];
  566. int32_t T_meas_acc[SMU75_THERMAL_INPUT_LOOP_COUNT];
  567. uint32_t I_calc_max;
  568. uint32_t I_calc_acc;
  569. uint32_t P_meas_acc;
  570. uint32_t V_meas_load_acc;
  571. uint32_t I_meas_acc;
  572. uint32_t P_meas_acc_vddci;
  573. uint32_t V_meas_load_acc_vddci;
  574. uint32_t I_meas_acc_vddci;
  575. uint16_t Sclk_dpm_residency[8];
  576. uint16_t Uvd_dpm_residency[8];
  577. uint16_t Vce_dpm_residency[8];
  578. uint16_t Mclk_dpm_residency[4];
  579. uint32_t P_roc_acc;
  580. uint32_t PkgPwr_max;
  581. uint32_t PkgPwr_acc;
  582. uint32_t MclkSwitchingTime_max;
  583. uint32_t MclkSwitchingTime_acc;
  584. uint32_t FanPwm_acc;
  585. uint32_t FanRpm_acc;
  586. uint32_t Gfx_busy_acc;
  587. uint32_t Mc_busy_acc;
  588. uint32_t Fps_acc;
  589. uint32_t AccCnt;
  590. };
  591. typedef struct SMU7_Discrete_Pm_Status_Table SMU7_Discrete_Pm_Status_Table;
  592. struct SMU7_Discrete_AutoWattMan_Status_Table {
  593. int32_t T_meas_acc[SMU75_THERMAL_INPUT_LOOP_COUNT];
  594. uint16_t Sclk_dpm_residency[8];
  595. uint16_t Mclk_dpm_residency[4];
  596. uint32_t TgpPwr_acc;
  597. uint32_t Gfx_busy_acc;
  598. uint32_t Mc_busy_acc;
  599. uint32_t AccCnt;
  600. };
  601. typedef struct SMU7_Discrete_AutoWattMan_Status_Table SMU7_Discrete_AutoWattMan_Status_Table;
  602. #define SMU7_MAX_GFX_CU_COUNT 24
  603. #define SMU7_MIN_GFX_CU_COUNT 8
  604. #define SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_SHIFT 0
  605. #define SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_MASK (0xFFFF << SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_SHIFT)
  606. #define SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_SHIFT 16
  607. #define SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_MASK (0xFFFF << SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_SHIFT)
  608. struct SMU7_GfxCuPgScoreboard {
  609. uint8_t Enabled;
  610. uint8_t WaterfallUp;
  611. uint8_t WaterfallDown;
  612. uint8_t WaterfallLimit;
  613. uint8_t CurrMaxCu;
  614. uint8_t TargMaxCu;
  615. uint8_t ClampMode;
  616. uint8_t Active;
  617. uint8_t MaxSupportedCu;
  618. uint8_t MinSupportedCu;
  619. uint8_t PendingGfxCuHostInterrupt;
  620. uint8_t LastFilteredMaxCuInteger;
  621. uint16_t FilteredMaxCu;
  622. uint16_t FilteredMaxCuAlpha;
  623. uint16_t FilterResetCount;
  624. uint16_t FilterResetCountLimit;
  625. uint8_t ForceCu;
  626. uint8_t ForceCuCount;
  627. uint8_t AcModeMaxCu;
  628. uint8_t DcModeMaxCu;
  629. };
  630. typedef struct SMU7_GfxCuPgScoreboard SMU7_GfxCuPgScoreboard;
  631. #define SMU7_SCLK_CAC 0x561
  632. #define SMU7_MCLK_CAC 0xF9
  633. #define SMU7_VCLK_CAC 0x2DE
  634. #define SMU7_DCLK_CAC 0x2DE
  635. #define SMU7_ECLK_CAC 0x25E
  636. #define SMU7_ACLK_CAC 0x25E
  637. #define SMU7_SAMCLK_CAC 0x25E
  638. #define SMU7_DISPCLK_CAC 0x100
  639. #define SMU7_CAC_CONSTANT 0x2EE3430
  640. #define SMU7_CAC_CONSTANT_SHIFT 18
  641. #define SMU7_VDDCI_MCLK_CONST 1765
  642. #define SMU7_VDDCI_MCLK_CONST_SHIFT 16
  643. #define SMU7_VDDCI_VDDCI_CONST 50958
  644. #define SMU7_VDDCI_VDDCI_CONST_SHIFT 14
  645. #define SMU7_VDDCI_CONST 11781
  646. #define SMU7_VDDCI_STROBE_PWR 1331
  647. #define SMU7_VDDR1_CONST 693
  648. #define SMU7_VDDR1_CAC_WEIGHT 20
  649. #define SMU7_VDDR1_CAC_WEIGHT_SHIFT 19
  650. #define SMU7_VDDR1_STROBE_PWR 512
  651. #define SMU7_AREA_COEFF_UVD 0xA78
  652. #define SMU7_AREA_COEFF_VCE 0x190A
  653. #define SMU7_AREA_COEFF_ACP 0x22D1
  654. #define SMU7_AREA_COEFF_SAMU 0x534
  655. #define SMU7_THERM_OUT_MODE_DISABLE 0x0
  656. #define SMU7_THERM_OUT_MODE_THERM_ONLY 0x1
  657. #define SMU7_THERM_OUT_MODE_THERM_VRHOT 0x2
  658. #define SQ_Enable_MASK 0x1
  659. #define SQ_IR_MASK 0x2
  660. #define SQ_PCC_MASK 0x4
  661. #define SQ_EDC_MASK 0x8
  662. #define TCP_Enable_MASK 0x100
  663. #define TCP_IR_MASK 0x200
  664. #define TCP_PCC_MASK 0x400
  665. #define TCP_EDC_MASK 0x800
  666. #define TD_Enable_MASK 0x10000
  667. #define TD_IR_MASK 0x20000
  668. #define TD_PCC_MASK 0x40000
  669. #define TD_EDC_MASK 0x80000
  670. #define DB_Enable_MASK 0x1000000
  671. #define DB_IR_MASK 0x2000000
  672. #define DB_PCC_MASK 0x4000000
  673. #define DB_EDC_MASK 0x8000000
  674. #define SQ_Enable_SHIFT 0
  675. #define SQ_IR_SHIFT 1
  676. #define SQ_PCC_SHIFT 2
  677. #define SQ_EDC_SHIFT 3
  678. #define TCP_Enable_SHIFT 8
  679. #define TCP_IR_SHIFT 9
  680. #define TCP_PCC_SHIFT 10
  681. #define TCP_EDC_SHIFT 11
  682. #define TD_Enable_SHIFT 16
  683. #define TD_IR_SHIFT 17
  684. #define TD_PCC_SHIFT 18
  685. #define TD_EDC_SHIFT 19
  686. #define DB_Enable_SHIFT 24
  687. #define DB_IR_SHIFT 25
  688. #define DB_PCC_SHIFT 26
  689. #define DB_EDC_SHIFT 27
  690. #define PMFUSES_AVFSSIZE 104
  691. #define BTCGB0_Vdroop_Enable_MASK 0x1
  692. #define BTCGB1_Vdroop_Enable_MASK 0x2
  693. #define AVFSGB0_Vdroop_Enable_MASK 0x4
  694. #define AVFSGB1_Vdroop_Enable_MASK 0x8
  695. #define BTCGB0_Vdroop_Enable_SHIFT 0
  696. #define BTCGB1_Vdroop_Enable_SHIFT 1
  697. #define AVFSGB0_Vdroop_Enable_SHIFT 2
  698. #define AVFSGB1_Vdroop_Enable_SHIFT 3
  699. #pragma pack(pop)
  700. #endif