smu74_discrete.h 23 KB

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