smu72_discrete.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  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 SMU72_DISCRETE_H
  24. #define SMU72_DISCRETE_H
  25. #include "smu72.h"
  26. #if !defined(SMC_MICROCODE)
  27. #pragma pack(push, 1)
  28. #endif
  29. struct SMIO_Pattern {
  30. uint16_t Voltage;
  31. uint8_t Smio;
  32. uint8_t padding;
  33. };
  34. typedef struct SMIO_Pattern SMIO_Pattern;
  35. struct SMIO_Table {
  36. SMIO_Pattern Pattern[SMU_MAX_SMIO_LEVELS];
  37. };
  38. typedef struct SMIO_Table SMIO_Table;
  39. struct SMU72_Discrete_GraphicsLevel {
  40. SMU_VoltageLevel MinVoltage;
  41. uint32_t SclkFrequency;
  42. uint8_t pcieDpmLevel;
  43. uint8_t DeepSleepDivId;
  44. uint16_t ActivityLevel;
  45. uint32_t CgSpllFuncCntl3;
  46. uint32_t CgSpllFuncCntl4;
  47. uint32_t SpllSpreadSpectrum;
  48. uint32_t SpllSpreadSpectrum2;
  49. uint32_t CcPwrDynRm;
  50. uint32_t CcPwrDynRm1;
  51. uint8_t SclkDid;
  52. uint8_t DisplayWatermark;
  53. uint8_t EnabledForActivity;
  54. uint8_t EnabledForThrottle;
  55. uint8_t UpHyst;
  56. uint8_t DownHyst;
  57. uint8_t VoltageDownHyst;
  58. uint8_t PowerThrottle;
  59. };
  60. typedef struct SMU72_Discrete_GraphicsLevel SMU72_Discrete_GraphicsLevel;
  61. struct SMU72_Discrete_ACPILevel {
  62. uint32_t Flags;
  63. SMU_VoltageLevel MinVoltage;
  64. uint32_t SclkFrequency;
  65. uint8_t SclkDid;
  66. uint8_t DisplayWatermark;
  67. uint8_t DeepSleepDivId;
  68. uint8_t padding;
  69. uint32_t CgSpllFuncCntl;
  70. uint32_t CgSpllFuncCntl2;
  71. uint32_t CgSpllFuncCntl3;
  72. uint32_t CgSpllFuncCntl4;
  73. uint32_t SpllSpreadSpectrum;
  74. uint32_t SpllSpreadSpectrum2;
  75. uint32_t CcPwrDynRm;
  76. uint32_t CcPwrDynRm1;
  77. };
  78. typedef struct SMU72_Discrete_ACPILevel SMU72_Discrete_ACPILevel;
  79. struct SMU72_Discrete_Ulv {
  80. uint32_t CcPwrDynRm;
  81. uint32_t CcPwrDynRm1;
  82. uint16_t VddcOffset;
  83. uint8_t VddcOffsetVid;
  84. uint8_t VddcPhase;
  85. uint32_t Reserved;
  86. };
  87. typedef struct SMU72_Discrete_Ulv SMU72_Discrete_Ulv;
  88. struct SMU72_Discrete_MemoryLevel {
  89. SMU_VoltageLevel MinVoltage;
  90. uint32_t MinMvdd;
  91. uint32_t MclkFrequency;
  92. uint8_t EdcReadEnable;
  93. uint8_t EdcWriteEnable;
  94. uint8_t RttEnable;
  95. uint8_t StutterEnable;
  96. uint8_t StrobeEnable;
  97. uint8_t StrobeRatio;
  98. uint8_t EnabledForThrottle;
  99. uint8_t EnabledForActivity;
  100. uint8_t UpHyst;
  101. uint8_t DownHyst;
  102. uint8_t VoltageDownHyst;
  103. uint8_t padding;
  104. uint16_t ActivityLevel;
  105. uint8_t DisplayWatermark;
  106. uint8_t padding1;
  107. uint32_t MpllFuncCntl;
  108. uint32_t MpllFuncCntl_1;
  109. uint32_t MpllFuncCntl_2;
  110. uint32_t MpllAdFuncCntl;
  111. uint32_t MpllDqFuncCntl;
  112. uint32_t MclkPwrmgtCntl;
  113. uint32_t DllCntl;
  114. uint32_t MpllSs1;
  115. uint32_t MpllSs2;
  116. };
  117. typedef struct SMU72_Discrete_MemoryLevel SMU72_Discrete_MemoryLevel;
  118. struct SMU72_Discrete_LinkLevel {
  119. uint8_t PcieGenSpeed; /*< 0:PciE-gen1 1:PciE-gen2 2:PciE-gen3 */
  120. uint8_t PcieLaneCount; /*< 1=x1, 2=x2, 3=x4, 4=x8, 5=x12, 6=x16 */
  121. uint8_t EnabledForActivity;
  122. uint8_t SPC;
  123. uint32_t DownThreshold;
  124. uint32_t UpThreshold;
  125. uint32_t Reserved;
  126. };
  127. typedef struct SMU72_Discrete_LinkLevel SMU72_Discrete_LinkLevel;
  128. /* MC ARB DRAM Timing registers. */
  129. struct SMU72_Discrete_MCArbDramTimingTableEntry {
  130. uint32_t McArbDramTiming;
  131. uint32_t McArbDramTiming2;
  132. uint8_t McArbBurstTime;
  133. uint8_t padding[3];
  134. };
  135. typedef struct SMU72_Discrete_MCArbDramTimingTableEntry SMU72_Discrete_MCArbDramTimingTableEntry;
  136. struct SMU72_Discrete_MCArbDramTimingTable {
  137. SMU72_Discrete_MCArbDramTimingTableEntry entries[SMU__NUM_SCLK_DPM_STATE][SMU__NUM_MCLK_DPM_LEVELS];
  138. };
  139. typedef struct SMU72_Discrete_MCArbDramTimingTable SMU72_Discrete_MCArbDramTimingTable;
  140. /* UVD VCLK/DCLK state (level) definition. */
  141. struct SMU72_Discrete_UvdLevel {
  142. uint32_t VclkFrequency;
  143. uint32_t DclkFrequency;
  144. SMU_VoltageLevel MinVoltage;
  145. uint8_t VclkDivider;
  146. uint8_t DclkDivider;
  147. uint8_t padding[2];
  148. };
  149. typedef struct SMU72_Discrete_UvdLevel SMU72_Discrete_UvdLevel;
  150. /* Clocks for other external blocks (VCE, ACP, SAMU). */
  151. struct SMU72_Discrete_ExtClkLevel {
  152. uint32_t Frequency;
  153. SMU_VoltageLevel MinVoltage;
  154. uint8_t Divider;
  155. uint8_t padding[3];
  156. };
  157. typedef struct SMU72_Discrete_ExtClkLevel SMU72_Discrete_ExtClkLevel;
  158. struct SMU72_Discrete_StateInfo {
  159. uint32_t SclkFrequency;
  160. uint32_t MclkFrequency;
  161. uint32_t VclkFrequency;
  162. uint32_t DclkFrequency;
  163. uint32_t SamclkFrequency;
  164. uint32_t AclkFrequency;
  165. uint32_t EclkFrequency;
  166. uint16_t MvddVoltage;
  167. uint16_t padding16;
  168. uint8_t DisplayWatermark;
  169. uint8_t McArbIndex;
  170. uint8_t McRegIndex;
  171. uint8_t SeqIndex;
  172. uint8_t SclkDid;
  173. int8_t SclkIndex;
  174. int8_t MclkIndex;
  175. uint8_t PCIeGen;
  176. };
  177. typedef struct SMU72_Discrete_StateInfo SMU72_Discrete_StateInfo;
  178. struct SMU72_Discrete_DpmTable {
  179. /* Multi-DPM controller settings */
  180. SMU72_PIDController GraphicsPIDController;
  181. SMU72_PIDController MemoryPIDController;
  182. SMU72_PIDController LinkPIDController;
  183. uint32_t SystemFlags;
  184. /* SMIO masks for voltage and phase controls */
  185. uint32_t VRConfig;
  186. uint32_t SmioMask1;
  187. uint32_t SmioMask2;
  188. SMIO_Table SmioTable1;
  189. SMIO_Table SmioTable2;
  190. uint32_t VddcLevelCount;
  191. uint32_t VddciLevelCount;
  192. uint32_t VddGfxLevelCount;
  193. uint32_t MvddLevelCount;
  194. uint16_t VddcTable[SMU72_MAX_LEVELS_VDDC];
  195. uint16_t VddGfxTable[SMU72_MAX_LEVELS_VDDGFX];
  196. uint16_t VddciTable[SMU72_MAX_LEVELS_VDDCI];
  197. uint8_t BapmVddGfxVidHiSidd[SMU72_MAX_LEVELS_VDDGFX];
  198. uint8_t BapmVddGfxVidLoSidd[SMU72_MAX_LEVELS_VDDGFX];
  199. uint8_t BapmVddGfxVidHiSidd2[SMU72_MAX_LEVELS_VDDGFX];
  200. uint8_t BapmVddcVidHiSidd[SMU72_MAX_LEVELS_VDDC];
  201. uint8_t BapmVddcVidLoSidd[SMU72_MAX_LEVELS_VDDC];
  202. uint8_t BapmVddcVidHiSidd2[SMU72_MAX_LEVELS_VDDC];
  203. uint8_t GraphicsDpmLevelCount;
  204. uint8_t MemoryDpmLevelCount;
  205. uint8_t LinkLevelCount;
  206. uint8_t MasterDeepSleepControl;
  207. uint8_t UvdLevelCount;
  208. uint8_t VceLevelCount;
  209. uint8_t AcpLevelCount;
  210. uint8_t SamuLevelCount;
  211. uint8_t ThermOutGpio;
  212. uint8_t ThermOutPolarity;
  213. uint8_t ThermOutMode;
  214. uint8_t DPMFreezeAndForced;
  215. uint32_t Reserved[4];
  216. /* State table entries for each DPM state */
  217. SMU72_Discrete_GraphicsLevel GraphicsLevel[SMU72_MAX_LEVELS_GRAPHICS];
  218. SMU72_Discrete_MemoryLevel MemoryACPILevel;
  219. SMU72_Discrete_MemoryLevel MemoryLevel[SMU72_MAX_LEVELS_MEMORY];
  220. SMU72_Discrete_LinkLevel LinkLevel[SMU72_MAX_LEVELS_LINK];
  221. SMU72_Discrete_ACPILevel ACPILevel;
  222. SMU72_Discrete_UvdLevel UvdLevel[SMU72_MAX_LEVELS_UVD];
  223. SMU72_Discrete_ExtClkLevel VceLevel[SMU72_MAX_LEVELS_VCE];
  224. SMU72_Discrete_ExtClkLevel AcpLevel[SMU72_MAX_LEVELS_ACP];
  225. SMU72_Discrete_ExtClkLevel SamuLevel[SMU72_MAX_LEVELS_SAMU];
  226. SMU72_Discrete_Ulv Ulv;
  227. uint32_t SclkStepSize;
  228. uint32_t Smio[SMU72_MAX_ENTRIES_SMIO];
  229. uint8_t UvdBootLevel;
  230. uint8_t VceBootLevel;
  231. uint8_t AcpBootLevel;
  232. uint8_t SamuBootLevel;
  233. uint8_t GraphicsBootLevel;
  234. uint8_t GraphicsVoltageChangeEnable;
  235. uint8_t GraphicsThermThrottleEnable;
  236. uint8_t GraphicsInterval;
  237. uint8_t VoltageInterval;
  238. uint8_t ThermalInterval;
  239. uint16_t TemperatureLimitHigh;
  240. uint16_t TemperatureLimitLow;
  241. uint8_t MemoryBootLevel;
  242. uint8_t MemoryVoltageChangeEnable;
  243. uint16_t BootMVdd;
  244. uint8_t MemoryInterval;
  245. uint8_t MemoryThermThrottleEnable;
  246. uint16_t VoltageResponseTime;
  247. uint16_t PhaseResponseTime;
  248. uint8_t PCIeBootLinkLevel;
  249. uint8_t PCIeGenInterval;
  250. uint8_t DTEInterval;
  251. uint8_t DTEMode;
  252. uint8_t SVI2Enable;
  253. uint8_t VRHotGpio;
  254. uint8_t AcDcGpio;
  255. uint8_t ThermGpio;
  256. uint16_t PPM_PkgPwrLimit;
  257. uint16_t PPM_TemperatureLimit;
  258. uint16_t DefaultTdp;
  259. uint16_t TargetTdp;
  260. uint16_t FpsHighThreshold;
  261. uint16_t FpsLowThreshold;
  262. uint16_t BAPMTI_R[SMU72_DTE_ITERATIONS][SMU72_DTE_SOURCES][SMU72_DTE_SINKS];
  263. uint16_t BAPMTI_RC[SMU72_DTE_ITERATIONS][SMU72_DTE_SOURCES][SMU72_DTE_SINKS];
  264. uint8_t DTEAmbientTempBase;
  265. uint8_t DTETjOffset;
  266. uint8_t GpuTjMax;
  267. uint8_t GpuTjHyst;
  268. SMU_VoltageLevel BootVoltage;
  269. uint32_t BAPM_TEMP_GRADIENT;
  270. uint32_t LowSclkInterruptThreshold;
  271. uint32_t VddGfxReChkWait;
  272. uint8_t ClockStretcherAmount;
  273. uint8_t Sclk_CKS_masterEn0_7;
  274. uint8_t Sclk_CKS_masterEn8_15;
  275. uint8_t padding[1];
  276. uint8_t Sclk_voltageOffset[8];
  277. SMU_ClockStretcherDataTable ClockStretcherDataTable;
  278. SMU_CKS_LOOKUPTable CKS_LOOKUPTable;
  279. };
  280. typedef struct SMU72_Discrete_DpmTable SMU72_Discrete_DpmTable;
  281. /* --------------------------------------------------- AC Timing Parameters ------------------------------------------------ */
  282. #define SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE 16
  283. #define SMU72_DISCRETE_MC_REGISTER_ARRAY_SET_COUNT SMU72_MAX_LEVELS_MEMORY /* DPM */
  284. struct SMU72_Discrete_MCRegisterAddress {
  285. uint16_t s0;
  286. uint16_t s1;
  287. };
  288. typedef struct SMU72_Discrete_MCRegisterAddress SMU72_Discrete_MCRegisterAddress;
  289. struct SMU72_Discrete_MCRegisterSet {
  290. uint32_t value[SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  291. };
  292. typedef struct SMU72_Discrete_MCRegisterSet SMU72_Discrete_MCRegisterSet;
  293. struct SMU72_Discrete_MCRegisters {
  294. uint8_t last;
  295. uint8_t reserved[3];
  296. SMU72_Discrete_MCRegisterAddress address[SMU72_DISCRETE_MC_REGISTER_ARRAY_SIZE];
  297. SMU72_Discrete_MCRegisterSet data[SMU72_DISCRETE_MC_REGISTER_ARRAY_SET_COUNT];
  298. };
  299. typedef struct SMU72_Discrete_MCRegisters SMU72_Discrete_MCRegisters;
  300. /* --------------------------------------------------- Fan Table ----------------------------------------------------------- */
  301. struct SMU72_Discrete_FanTable {
  302. uint16_t FdoMode;
  303. int16_t TempMin;
  304. int16_t TempMed;
  305. int16_t TempMax;
  306. int16_t Slope1;
  307. int16_t Slope2;
  308. int16_t FdoMin;
  309. int16_t HystUp;
  310. int16_t HystDown;
  311. int16_t HystSlope;
  312. int16_t TempRespLim;
  313. int16_t TempCurr;
  314. int16_t SlopeCurr;
  315. int16_t PwmCurr;
  316. uint32_t RefreshPeriod;
  317. int16_t FdoMax;
  318. uint8_t TempSrc;
  319. int8_t FanControl_GL_Flag;
  320. };
  321. typedef struct SMU72_Discrete_FanTable SMU72_Discrete_FanTable;
  322. #define SMU7_DISCRETE_GPIO_SCLK_DEBUG 4
  323. #define SMU7_DISCRETE_GPIO_SCLK_DEBUG_BIT (0x1 << SMU7_DISCRETE_GPIO_SCLK_DEBUG)
  324. struct SMU7_MclkDpmScoreboard {
  325. uint32_t PercentageBusy;
  326. int32_t PIDError;
  327. int32_t PIDIntegral;
  328. int32_t PIDOutput;
  329. uint32_t SigmaDeltaAccum;
  330. uint32_t SigmaDeltaOutput;
  331. uint32_t SigmaDeltaLevel;
  332. uint32_t UtilizationSetpoint;
  333. uint8_t TdpClampMode;
  334. uint8_t TdcClampMode;
  335. uint8_t ThermClampMode;
  336. uint8_t VoltageBusy;
  337. int8_t CurrLevel;
  338. int8_t TargLevel;
  339. uint8_t LevelChangeInProgress;
  340. uint8_t UpHyst;
  341. uint8_t DownHyst;
  342. uint8_t VoltageDownHyst;
  343. uint8_t DpmEnable;
  344. uint8_t DpmRunning;
  345. uint8_t DpmForce;
  346. uint8_t DpmForceLevel;
  347. uint8_t DisplayWatermark;
  348. uint8_t McArbIndex;
  349. uint32_t MinimumPerfMclk;
  350. uint8_t AcpiReq;
  351. uint8_t AcpiAck;
  352. uint8_t MclkSwitchInProgress;
  353. uint8_t MclkSwitchCritical;
  354. uint8_t IgnoreVBlank;
  355. uint8_t TargetMclkIndex;
  356. uint8_t TargetMvddIndex;
  357. uint8_t MclkSwitchResult;
  358. uint16_t VbiFailureCount;
  359. uint8_t VbiWaitCounter;
  360. uint8_t EnabledLevelsChange;
  361. uint16_t LevelResidencyCountersN[SMU72_MAX_LEVELS_MEMORY];
  362. uint16_t LevelSwitchCounters[SMU72_MAX_LEVELS_MEMORY];
  363. void (*TargetStateCalculator)(uint8_t);
  364. void (*SavedTargetStateCalculator)(uint8_t);
  365. uint16_t AutoDpmInterval;
  366. uint16_t AutoDpmRange;
  367. uint16_t VbiTimeoutCount;
  368. uint16_t MclkSwitchingTime;
  369. uint8_t fastSwitch;
  370. uint8_t Save_PIC_VDDGFX_EXIT;
  371. uint8_t Save_PIC_VDDGFX_ENTER;
  372. uint8_t padding;
  373. };
  374. typedef struct SMU7_MclkDpmScoreboard SMU7_MclkDpmScoreboard;
  375. struct SMU7_UlvScoreboard {
  376. uint8_t EnterUlv;
  377. uint8_t ExitUlv;
  378. uint8_t UlvActive;
  379. uint8_t WaitingForUlv;
  380. uint8_t UlvEnable;
  381. uint8_t UlvRunning;
  382. uint8_t UlvMasterEnable;
  383. uint8_t padding;
  384. uint32_t UlvAbortedCount;
  385. uint32_t UlvTimeStamp;
  386. };
  387. typedef struct SMU7_UlvScoreboard SMU7_UlvScoreboard;
  388. struct VddgfxSavedRegisters {
  389. uint32_t GPU_DBG[3];
  390. uint32_t MEC_BaseAddress_Hi;
  391. uint32_t MEC_BaseAddress_Lo;
  392. uint32_t THM_TMON0_CTRL2__RDIR_PRESENT;
  393. uint32_t THM_TMON1_CTRL2__RDIR_PRESENT;
  394. uint32_t CP_INT_CNTL;
  395. };
  396. typedef struct VddgfxSavedRegisters VddgfxSavedRegisters;
  397. struct SMU7_VddGfxScoreboard {
  398. uint8_t VddGfxEnable;
  399. uint8_t VddGfxActive;
  400. uint8_t VPUResetOccured;
  401. uint8_t padding;
  402. uint32_t VddGfxEnteredCount;
  403. uint32_t VddGfxAbortedCount;
  404. uint32_t VddGfxVid;
  405. VddgfxSavedRegisters SavedRegisters;
  406. };
  407. typedef struct SMU7_VddGfxScoreboard SMU7_VddGfxScoreboard;
  408. struct SMU7_TdcLimitScoreboard {
  409. uint8_t Enable;
  410. uint8_t Running;
  411. uint16_t Alpha;
  412. uint32_t FilteredIddc;
  413. uint32_t IddcLimit;
  414. uint32_t IddcHyst;
  415. SMU7_HystController_Data HystControllerData;
  416. };
  417. typedef struct SMU7_TdcLimitScoreboard SMU7_TdcLimitScoreboard;
  418. struct SMU7_PkgPwrLimitScoreboard {
  419. uint8_t Enable;
  420. uint8_t Running;
  421. uint16_t Alpha;
  422. uint32_t FilteredPkgPwr;
  423. uint32_t Limit;
  424. uint32_t Hyst;
  425. uint32_t LimitFromDriver;
  426. SMU7_HystController_Data HystControllerData;
  427. };
  428. typedef struct SMU7_PkgPwrLimitScoreboard SMU7_PkgPwrLimitScoreboard;
  429. struct SMU7_BapmScoreboard {
  430. uint32_t source_powers[SMU72_DTE_SOURCES];
  431. uint32_t source_powers_last[SMU72_DTE_SOURCES];
  432. int32_t entity_temperatures[SMU72_NUM_GPU_TES];
  433. int32_t initial_entity_temperatures[SMU72_NUM_GPU_TES];
  434. int32_t Limit;
  435. int32_t Hyst;
  436. int32_t therm_influence_coeff_table[SMU72_DTE_ITERATIONS * SMU72_DTE_SOURCES * SMU72_DTE_SINKS * 2];
  437. int32_t therm_node_table[SMU72_DTE_ITERATIONS * SMU72_DTE_SOURCES * SMU72_DTE_SINKS];
  438. uint16_t ConfigTDPPowerScalar;
  439. uint16_t FanSpeedPowerScalar;
  440. uint16_t OverDrivePowerScalar;
  441. uint16_t OverDriveLimitScalar;
  442. uint16_t FinalPowerScalar;
  443. uint8_t VariantID;
  444. uint8_t spare997;
  445. SMU7_HystController_Data HystControllerData;
  446. int32_t temperature_gradient_slope;
  447. int32_t temperature_gradient;
  448. uint32_t measured_temperature;
  449. };
  450. typedef struct SMU7_BapmScoreboard SMU7_BapmScoreboard;
  451. struct SMU7_AcpiScoreboard {
  452. uint32_t SavedInterruptMask[2];
  453. uint8_t LastACPIRequest;
  454. uint8_t CgBifResp;
  455. uint8_t RequestType;
  456. uint8_t Padding;
  457. SMU72_Discrete_ACPILevel D0Level;
  458. };
  459. typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard;
  460. struct SMU72_Discrete_PmFuses {
  461. /* dw1 */
  462. uint8_t SviLoadLineEn;
  463. uint8_t SviLoadLineVddC;
  464. uint8_t SviLoadLineTrimVddC;
  465. uint8_t SviLoadLineOffsetVddC;
  466. /* dw2 */
  467. uint16_t TDC_VDDC_PkgLimit;
  468. uint8_t TDC_VDDC_ThrottleReleaseLimitPerc;
  469. uint8_t TDC_MAWt;
  470. /* dw3 */
  471. uint8_t TdcWaterfallCtl;
  472. uint8_t LPMLTemperatureMin;
  473. uint8_t LPMLTemperatureMax;
  474. uint8_t Reserved;
  475. /* dw4-dw7 */
  476. uint8_t LPMLTemperatureScaler[16];
  477. /* dw8-dw9 */
  478. int16_t FuzzyFan_ErrorSetDelta;
  479. int16_t FuzzyFan_ErrorRateSetDelta;
  480. int16_t FuzzyFan_PwmSetDelta;
  481. uint16_t Reserved6;
  482. /* dw10-dw14 */
  483. uint8_t GnbLPML[16];
  484. /* dw15 */
  485. uint8_t GnbLPMLMaxVid;
  486. uint8_t GnbLPMLMinVid;
  487. uint8_t Reserved1[2];
  488. /* dw16 */
  489. uint16_t BapmVddCBaseLeakageHiSidd;
  490. uint16_t BapmVddCBaseLeakageLoSidd;
  491. };
  492. typedef struct SMU72_Discrete_PmFuses SMU72_Discrete_PmFuses;
  493. struct SMU7_Discrete_Log_Header_Table {
  494. uint32_t version;
  495. uint32_t asic_id;
  496. uint16_t flags;
  497. uint16_t entry_size;
  498. uint32_t total_size;
  499. uint32_t num_of_entries;
  500. uint8_t type;
  501. uint8_t mode;
  502. uint8_t filler_0[2];
  503. uint32_t filler_1[2];
  504. };
  505. typedef struct SMU7_Discrete_Log_Header_Table SMU7_Discrete_Log_Header_Table;
  506. struct SMU7_Discrete_Log_Cntl {
  507. uint8_t Enabled;
  508. uint8_t Type;
  509. uint8_t padding[2];
  510. uint32_t BufferSize;
  511. uint32_t SamplesLogged;
  512. uint32_t SampleSize;
  513. uint32_t AddrL;
  514. uint32_t AddrH;
  515. };
  516. typedef struct SMU7_Discrete_Log_Cntl SMU7_Discrete_Log_Cntl;
  517. #define CAC_ACC_NW_NUM_OF_SIGNALS 87
  518. struct SMU7_Discrete_Cac_Collection_Table {
  519. uint32_t temperature;
  520. uint32_t cac_acc_nw[CAC_ACC_NW_NUM_OF_SIGNALS];
  521. };
  522. typedef struct SMU7_Discrete_Cac_Collection_Table SMU7_Discrete_Cac_Collection_Table;
  523. struct SMU7_Discrete_Cac_Verification_Table {
  524. uint32_t VddcTotalPower;
  525. uint32_t VddcLeakagePower;
  526. uint32_t VddcConstantPower;
  527. uint32_t VddcGfxDynamicPower;
  528. uint32_t VddcUvdDynamicPower;
  529. uint32_t VddcVceDynamicPower;
  530. uint32_t VddcAcpDynamicPower;
  531. uint32_t VddcPcieDynamicPower;
  532. uint32_t VddcDceDynamicPower;
  533. uint32_t VddcCurrent;
  534. uint32_t VddcVoltage;
  535. uint32_t VddciTotalPower;
  536. uint32_t VddciLeakagePower;
  537. uint32_t VddciConstantPower;
  538. uint32_t VddciDynamicPower;
  539. uint32_t Vddr1TotalPower;
  540. uint32_t Vddr1LeakagePower;
  541. uint32_t Vddr1ConstantPower;
  542. uint32_t Vddr1DynamicPower;
  543. uint32_t spare[4];
  544. uint32_t temperature;
  545. };
  546. typedef struct SMU7_Discrete_Cac_Verification_Table SMU7_Discrete_Cac_Verification_Table;
  547. struct SMU7_Discrete_Pm_Status_Table {
  548. /* Thermal entities */
  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. /*Voltage domains */
  557. uint32_t I_calc_max;
  558. uint32_t I_calc_acc;
  559. uint32_t I_calc_acc_vddci;
  560. uint32_t V_calc_noload_acc;
  561. uint32_t V_calc_load_acc;
  562. uint32_t V_calc_noload_acc_vddci;
  563. uint32_t P_meas_acc;
  564. uint32_t V_meas_noload_acc;
  565. uint32_t V_meas_load_acc;
  566. uint32_t I_meas_acc;
  567. uint32_t P_meas_acc_vddci;
  568. uint32_t V_meas_noload_acc_vddci;
  569. uint32_t V_meas_load_acc_vddci;
  570. uint32_t I_meas_acc_vddci;
  571. /*Frequency */
  572. uint16_t Sclk_dpm_residency[8];
  573. uint16_t Uvd_dpm_residency[8];
  574. uint16_t Vce_dpm_residency[8];
  575. uint16_t Mclk_dpm_residency[4];
  576. /*Chip */
  577. uint32_t P_vddci_acc;
  578. uint32_t P_vddr1_acc;
  579. uint32_t P_nte1_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 AccCnt;
  587. };
  588. typedef struct SMU7_Discrete_Pm_Status_Table SMU7_Discrete_Pm_Status_Table;
  589. /*FIXME THESE NEED TO BE UPDATED */
  590. #define SMU7_SCLK_CAC 0x561
  591. #define SMU7_MCLK_CAC 0xF9
  592. #define SMU7_VCLK_CAC 0x2DE
  593. #define SMU7_DCLK_CAC 0x2DE
  594. #define SMU7_ECLK_CAC 0x25E
  595. #define SMU7_ACLK_CAC 0x25E
  596. #define SMU7_SAMCLK_CAC 0x25E
  597. #define SMU7_DISPCLK_CAC 0x100
  598. #define SMU7_CAC_CONSTANT 0x2EE3430
  599. #define SMU7_CAC_CONSTANT_SHIFT 18
  600. #define SMU7_VDDCI_MCLK_CONST 1765
  601. #define SMU7_VDDCI_MCLK_CONST_SHIFT 16
  602. #define SMU7_VDDCI_VDDCI_CONST 50958
  603. #define SMU7_VDDCI_VDDCI_CONST_SHIFT 14
  604. #define SMU7_VDDCI_CONST 11781
  605. #define SMU7_12C_VDDCI_MCLK_CONST 1623
  606. #define SMU7_12C_VDDCI_MCLK_CONST_SHIFT 15
  607. #define SMU7_12C_VDDCI_VDDCI_CONST 40088
  608. #define SMU7_12C_VDDCI_VDDCI_CONST_SHIFT 13
  609. #define SMU7_12C_VDDCI_CONST 20856
  610. #define SMU7_VDDCI_STROBE_PWR 1331
  611. #define SMU7_VDDR1_CONST 693
  612. #define SMU7_VDDR1_CAC_WEIGHT 20
  613. #define SMU7_VDDR1_CAC_WEIGHT_SHIFT 19
  614. #define SMU7_VDDR1_STROBE_PWR 512
  615. #define SMU7_AREA_COEFF_UVD 0xA78
  616. #define SMU7_AREA_COEFF_VCE 0x190A
  617. #define SMU7_AREA_COEFF_ACP 0x22D1
  618. #define SMU7_AREA_COEFF_SAMU 0x534
  619. /*ThermOutMode values */
  620. #define SMU7_THERM_OUT_MODE_DISABLE 0x0
  621. #define SMU7_THERM_OUT_MODE_THERM_ONLY 0x1
  622. #define SMU7_THERM_OUT_MODE_THERM_VRHOT 0x2
  623. #if !defined(SMC_MICROCODE)
  624. #pragma pack(pop)
  625. #endif
  626. #endif