smu72_discrete.h 21 KB

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