2 * Copyright 2017 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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.
27 #if !defined(SMC_MICROCODE)
31 #define SMU__NUM_SCLK_DPM_STATE 8
32 #define SMU__NUM_MCLK_DPM_LEVELS 4
33 #define SMU__NUM_LCLK_DPM_LEVELS 8
34 #define SMU__NUM_PCIE_DPM_LEVELS 8
42 enum Poly3rdOrderCoeff
{
43 LEAKAGE_TEMPERATURE_SCALAR
,
44 LEAKAGE_VOLTAGE_SCALAR
,
45 DYNAMIC_VOLTAGE_SCALAR
,
49 struct SMU7_Poly3rdOrder_Data
{
60 typedef struct SMU7_Poly3rdOrder_Data SMU7_Poly3rdOrder_Data
;
62 struct Power_Calculator_Data
{
63 uint16_t NoLoadVoltage
;
68 uint16_t LkgTempScalar
;
69 uint16_t LkgVoltScalar
;
70 uint16_t LkgAreaScalar
;
72 uint16_t DynVoltScalar
;
75 uint32_t TotalCurrent
;
79 typedef struct Power_Calculator_Data PowerCalculatorData_t
;
81 struct Gc_Cac_Weight_Data
{
86 typedef struct Gc_Cac_Weight_Data GcCacWeight_Data
;
99 #define SMU7_CONTEXT_ID_SMC 1
100 #define SMU7_CONTEXT_ID_VBIOS 2
102 #define SMU72_MAX_LEVELS_VDDC 16
103 #define SMU72_MAX_LEVELS_VDDGFX 16
104 #define SMU72_MAX_LEVELS_VDDCI 8
105 #define SMU72_MAX_LEVELS_MVDD 4
107 #define SMU_MAX_SMIO_LEVELS 4
109 #define SMU72_MAX_LEVELS_GRAPHICS SMU__NUM_SCLK_DPM_STATE /* SCLK + SQ DPM + ULV */
110 #define SMU72_MAX_LEVELS_MEMORY SMU__NUM_MCLK_DPM_LEVELS /* MCLK Levels DPM */
111 #define SMU72_MAX_LEVELS_GIO SMU__NUM_LCLK_DPM_LEVELS /* LCLK Levels */
112 #define SMU72_MAX_LEVELS_LINK SMU__NUM_PCIE_DPM_LEVELS /* PCIe speed and number of lanes. */
113 #define SMU72_MAX_LEVELS_UVD 8 /* VCLK/DCLK levels for UVD. */
114 #define SMU72_MAX_LEVELS_VCE 8 /* ECLK levels for VCE. */
115 #define SMU72_MAX_LEVELS_ACP 8 /* ACLK levels for ACP. */
116 #define SMU72_MAX_LEVELS_SAMU 8 /* SAMCLK levels for SAMU. */
117 #define SMU72_MAX_ENTRIES_SMIO 32 /* Number of entries in SMIO table. */
119 #define DPM_NO_LIMIT 0
121 #define DPM_GO_DOWN 2
124 #define SMU7_FIRST_DPM_GRAPHICS_LEVEL 0
125 #define SMU7_FIRST_DPM_MEMORY_LEVEL 0
127 #define GPIO_CLAMP_MODE_VRHOT 1
128 #define GPIO_CLAMP_MODE_THERM 2
129 #define GPIO_CLAMP_MODE_DC 4
131 #define SCRATCH_B_TARG_PCIE_INDEX_SHIFT 0
132 #define SCRATCH_B_TARG_PCIE_INDEX_MASK (0x7<<SCRATCH_B_TARG_PCIE_INDEX_SHIFT)
133 #define SCRATCH_B_CURR_PCIE_INDEX_SHIFT 3
134 #define SCRATCH_B_CURR_PCIE_INDEX_MASK (0x7<<SCRATCH_B_CURR_PCIE_INDEX_SHIFT)
135 #define SCRATCH_B_TARG_UVD_INDEX_SHIFT 6
136 #define SCRATCH_B_TARG_UVD_INDEX_MASK (0x7<<SCRATCH_B_TARG_UVD_INDEX_SHIFT)
137 #define SCRATCH_B_CURR_UVD_INDEX_SHIFT 9
138 #define SCRATCH_B_CURR_UVD_INDEX_MASK (0x7<<SCRATCH_B_CURR_UVD_INDEX_SHIFT)
139 #define SCRATCH_B_TARG_VCE_INDEX_SHIFT 12
140 #define SCRATCH_B_TARG_VCE_INDEX_MASK (0x7<<SCRATCH_B_TARG_VCE_INDEX_SHIFT)
141 #define SCRATCH_B_CURR_VCE_INDEX_SHIFT 15
142 #define SCRATCH_B_CURR_VCE_INDEX_MASK (0x7<<SCRATCH_B_CURR_VCE_INDEX_SHIFT)
143 #define SCRATCH_B_TARG_ACP_INDEX_SHIFT 18
144 #define SCRATCH_B_TARG_ACP_INDEX_MASK (0x7<<SCRATCH_B_TARG_ACP_INDEX_SHIFT)
145 #define SCRATCH_B_CURR_ACP_INDEX_SHIFT 21
146 #define SCRATCH_B_CURR_ACP_INDEX_MASK (0x7<<SCRATCH_B_CURR_ACP_INDEX_SHIFT)
147 #define SCRATCH_B_TARG_SAMU_INDEX_SHIFT 24
148 #define SCRATCH_B_TARG_SAMU_INDEX_MASK (0x7<<SCRATCH_B_TARG_SAMU_INDEX_SHIFT)
149 #define SCRATCH_B_CURR_SAMU_INDEX_SHIFT 27
150 #define SCRATCH_B_CURR_SAMU_INDEX_MASK (0x7<<SCRATCH_B_CURR_SAMU_INDEX_SHIFT)
152 /* Virtualization Defines */
153 #define CG_XDMA_MASK 0x1
154 #define CG_XDMA_SHIFT 0
155 #define CG_UVD_MASK 0x2
156 #define CG_UVD_SHIFT 1
157 #define CG_VCE_MASK 0x4
158 #define CG_VCE_SHIFT 2
159 #define CG_SAMU_MASK 0x8
160 #define CG_SAMU_SHIFT 3
161 #define CG_GFX_MASK 0x10
162 #define CG_GFX_SHIFT 4
163 #define CG_SDMA_MASK 0x20
164 #define CG_SDMA_SHIFT 5
165 #define CG_HDP_MASK 0x40
166 #define CG_HDP_SHIFT 6
167 #define CG_MC_MASK 0x80
168 #define CG_MC_SHIFT 7
169 #define CG_DRM_MASK 0x100
170 #define CG_DRM_SHIFT 8
171 #define CG_ROM_MASK 0x200
172 #define CG_ROM_SHIFT 9
173 #define CG_BIF_MASK 0x400
174 #define CG_BIF_SHIFT 10
176 #define SMU72_DTE_ITERATIONS 5
177 #define SMU72_DTE_SOURCES 3
178 #define SMU72_DTE_SINKS 1
179 #define SMU72_NUM_CPU_TES 0
180 #define SMU72_NUM_GPU_TES 1
181 #define SMU72_NUM_NON_TES 2
182 #define SMU72_DTE_FAN_SCALAR_MIN 0x100
183 #define SMU72_DTE_FAN_SCALAR_MAX 0x166
184 #define SMU72_DTE_FAN_TEMP_MAX 93
185 #define SMU72_DTE_FAN_TEMP_MIN 83
187 #if defined SMU__FUSION_ONLY
188 #define SMU7_DTE_ITERATIONS 5
189 #define SMU7_DTE_SOURCES 5
190 #define SMU7_DTE_SINKS 3
191 #define SMU7_NUM_CPU_TES 2
192 #define SMU7_NUM_GPU_TES 1
193 #define SMU7_NUM_NON_TES 2
196 struct SMU7_HystController_Data
{
197 uint8_t waterfall_up
;
198 uint8_t waterfall_down
;
199 uint8_t waterfall_limit
;
201 uint16_t release_cnt
;
202 uint16_t release_limit
;
205 typedef struct SMU7_HystController_Data SMU7_HystController_Data
;
207 struct SMU72_PIDController
{
209 int32_t LFWindupUpperLim
;
210 int32_t LFWindupLowerLim
;
211 uint32_t StatePrecision
;
212 uint32_t LfPrecision
;
215 uint32_t MaxLfFraction
;
219 typedef struct SMU72_PIDController SMU72_PIDController
;
221 struct SMU7_LocalDpmScoreboard
{
222 uint32_t PercentageBusy
;
228 uint32_t SigmaDeltaAccum
;
229 uint32_t SigmaDeltaOutput
;
230 uint32_t SigmaDeltaLevel
;
232 uint32_t UtilizationSetpoint
;
234 uint8_t TdpClampMode
;
235 uint8_t TdcClampMode
;
236 uint8_t ThermClampMode
;
241 uint8_t LevelChangeInProgress
;
245 uint8_t VoltageDownHyst
;
250 uint8_t DpmForceLevel
;
251 uint8_t DisplayWatermark
;
254 uint32_t MinimumPerfSclk
;
259 uint8_t GpioClampMode
; /* bit0 = VRHOT: bit1 = THERM: bit2 = DC */
261 uint8_t FpsFilterWeight
;
262 uint8_t EnabledLevelsChange
;
263 uint8_t DteClampMode
;
264 uint8_t FpsClampMode
;
266 uint16_t LevelResidencyCounters
[SMU72_MAX_LEVELS_GRAPHICS
];
267 uint16_t LevelSwitchCounters
[SMU72_MAX_LEVELS_GRAPHICS
];
269 void (*TargetStateCalculator
)(uint8_t);
270 void (*SavedTargetStateCalculator
)(uint8_t);
272 uint16_t AutoDpmInterval
;
273 uint16_t AutoDpmRange
;
276 uint8_t MaxPerfLevel
;
277 uint8_t AllowLowClkInterruptToHost
;
280 uint32_t MaxAllowedFrequency
;
282 uint32_t FilteredSclkFrequency
;
283 uint32_t LastSclkFrequency
;
284 uint32_t FilteredSclkFrequencyCnt
;
287 typedef struct SMU7_LocalDpmScoreboard SMU7_LocalDpmScoreboard
;
289 #define SMU7_MAX_VOLTAGE_CLIENTS 12
291 typedef uint8_t (*VoltageChangeHandler_t
)(uint16_t, uint8_t);
293 struct SMU_VoltageLevel
{
300 typedef struct SMU_VoltageLevel SMU_VoltageLevel
;
302 struct SMU7_VoltageScoreboard
{
303 SMU_VoltageLevel CurrentVoltage
;
304 SMU_VoltageLevel TargetVoltage
;
306 uint8_t HighestVidOffset
;
307 uint8_t CurrentVidOffset
;
309 uint8_t ControllerBusy
;
311 uint8_t CurrentVddciVid
;
312 uint8_t VddGfxShutdown
; /* 0 = normal mode, 1 = shut down */
314 SMU_VoltageLevel RequestedVoltage
[SMU7_MAX_VOLTAGE_CLIENTS
];
315 uint8_t EnabledRequest
[SMU7_MAX_VOLTAGE_CLIENTS
];
319 uint8_t ControllerEnable
;
320 uint8_t ControllerRunning
;
321 uint16_t CurrentStdVoltageHiSidd
;
322 uint16_t CurrentStdVoltageLoSidd
;
323 uint8_t OverrideVoltage
;
324 uint8_t VddcUseUlvOffset
;
325 uint8_t VddGfxUseUlvOffset
;
328 VoltageChangeHandler_t ChangeVddc
;
329 VoltageChangeHandler_t ChangeVddGfx
;
330 VoltageChangeHandler_t ChangeVddci
;
331 VoltageChangeHandler_t ChangePhase
;
332 VoltageChangeHandler_t ChangeMvdd
;
334 VoltageChangeHandler_t functionLinks
[6];
336 uint8_t *VddcFollower1
;
337 uint8_t *VddcFollower2
;
338 int16_t Driver_OD_RequestedVidOffset1
;
339 int16_t Driver_OD_RequestedVidOffset2
;
343 typedef struct SMU7_VoltageScoreboard SMU7_VoltageScoreboard
;
345 #define SMU7_MAX_PCIE_LINK_SPEEDS 3 /* 0:Gen1 1:Gen2 2:Gen3 */
347 struct SMU7_PCIeLinkSpeedScoreboard
{
351 uint8_t DpmForceLevel
;
353 uint8_t CurrentLinkSpeed
;
354 uint8_t EnabledLevelsChange
;
355 uint16_t AutoDpmInterval
;
357 uint16_t AutoDpmRange
;
358 uint16_t AutoDpmCount
;
363 uint8_t CurrentLinkLevel
;
367 typedef struct SMU7_PCIeLinkSpeedScoreboard SMU7_PCIeLinkSpeedScoreboard
;
369 /* -------------------------------------------------------- CAC table ------------------------------------------------------ */
370 #define SMU7_LKGE_LUT_NUM_OF_TEMP_ENTRIES 16
371 #define SMU7_LKGE_LUT_NUM_OF_VOLT_ENTRIES 16
372 #define SMU7_SCALE_I 7
373 #define SMU7_SCALE_R 12
375 struct SMU7_PowerScoreboard
{
376 PowerCalculatorData_t VddGfxPowerData
[SID_OPTION_COUNT
];
377 PowerCalculatorData_t VddcPowerData
[SID_OPTION_COUNT
];
379 uint32_t TotalGpuPower
;
382 uint16_t VddciTotalPower
;
383 uint16_t sparesasfsdfd
;
387 uint16_t CalcMeasPowerBlend
;
388 uint8_t SidOptionPower
;
389 uint8_t SidOptionCurrent
;
393 uint16_t Telemetry_1_slope
;
394 uint16_t Telemetry_2_slope
;
395 int32_t Telemetry_1_offset
;
396 int32_t Telemetry_2_offset
;
398 uint32_t VddcCurrentTelemetry
;
399 uint32_t VddGfxCurrentTelemetry
;
400 uint32_t VddcPowerTelemetry
;
401 uint32_t VddGfxPowerTelemetry
;
402 uint32_t VddciPowerTelemetry
;
405 uint32_t VddGfxPower
;
408 uint32_t TelemetryCurrent
[2];
409 uint32_t TelemetryVoltage
[2];
410 uint32_t TelemetryPower
[2];
413 typedef struct SMU7_PowerScoreboard SMU7_PowerScoreboard
;
415 struct SMU7_ThermalScoreboard
{
418 uint16_t CurrGnbTemp
;
419 uint16_t FilteredGnbTemp
;
421 uint8_t ControllerEnable
;
422 uint8_t ControllerRunning
;
423 uint8_t AutoTmonCalInterval
;
424 uint8_t AutoTmonCalEnable
;
426 uint8_t ThermalDpmEnabled
;
427 uint8_t SclkEnabledMask
;
429 int32_t temperature_gradient
;
431 SMU7_HystController_Data HystControllerData
;
432 int32_t WeightedSensorTemperature
;
433 uint16_t TemperatureLimit
[SMU72_MAX_LEVELS_GRAPHICS
];
437 typedef struct SMU7_ThermalScoreboard SMU7_ThermalScoreboard
;
439 /* For FeatureEnables: */
440 #define SMU7_SCLK_DPM_CONFIG_MASK 0x01
441 #define SMU7_VOLTAGE_CONTROLLER_CONFIG_MASK 0x02
442 #define SMU7_THERMAL_CONTROLLER_CONFIG_MASK 0x04
443 #define SMU7_MCLK_DPM_CONFIG_MASK 0x08
444 #define SMU7_UVD_DPM_CONFIG_MASK 0x10
445 #define SMU7_VCE_DPM_CONFIG_MASK 0x20
446 #define SMU7_ACP_DPM_CONFIG_MASK 0x40
447 #define SMU7_SAMU_DPM_CONFIG_MASK 0x80
448 #define SMU7_PCIEGEN_DPM_CONFIG_MASK 0x100
450 #define SMU7_ACP_MCLK_HANDSHAKE_DISABLE 0x00000001
451 #define SMU7_ACP_SCLK_HANDSHAKE_DISABLE 0x00000002
452 #define SMU7_UVD_MCLK_HANDSHAKE_DISABLE 0x00000100
453 #define SMU7_UVD_SCLK_HANDSHAKE_DISABLE 0x00000200
454 #define SMU7_VCE_MCLK_HANDSHAKE_DISABLE 0x00010000
455 #define SMU7_VCE_SCLK_HANDSHAKE_DISABLE 0x00020000
457 /* All 'soft registers' should be uint32_t. */
458 struct SMU72_SoftRegisters
{
459 uint32_t RefClockFrequency
;
460 uint32_t PmTimerPeriod
;
461 uint32_t FeatureEnables
;
463 uint32_t PreVBlankGap
;
464 uint32_t VBlankTimeout
;
465 uint32_t TrainTimeGap
;
467 uint32_t MvddSwitchTime
;
468 uint32_t LongestAcpiTrainTime
;
470 uint32_t G5TrainTime
;
471 uint32_t DelayMpllPwron
;
472 uint32_t VoltageChangeTimeout
;
474 uint32_t HandshakeDisables
;
476 uint8_t DisplayPhy1Config
;
477 uint8_t DisplayPhy2Config
;
478 uint8_t DisplayPhy3Config
;
479 uint8_t DisplayPhy4Config
;
481 uint8_t DisplayPhy5Config
;
482 uint8_t DisplayPhy6Config
;
483 uint8_t DisplayPhy7Config
;
484 uint8_t DisplayPhy8Config
;
486 uint32_t AverageGraphicsActivity
;
487 uint32_t AverageMemoryActivity
;
488 uint32_t AverageGioActivity
;
490 uint8_t SClkDpmEnabledLevels
;
491 uint8_t MClkDpmEnabledLevels
;
492 uint8_t LClkDpmEnabledLevels
;
493 uint8_t PCIeDpmEnabledLevels
;
495 uint8_t UVDDpmEnabledLevels
;
496 uint8_t SAMUDpmEnabledLevels
;
497 uint8_t ACPDpmEnabledLevels
;
498 uint8_t VCEDpmEnabledLevels
;
500 uint32_t DRAM_LOG_ADDR_H
;
501 uint32_t DRAM_LOG_ADDR_L
;
502 uint32_t DRAM_LOG_PHY_ADDR_H
;
503 uint32_t DRAM_LOG_PHY_ADDR_L
;
504 uint32_t DRAM_LOG_BUFF_SIZE
;
505 uint32_t UlvEnterCount
;
507 uint32_t UcodeLoadStatus
;
508 uint32_t Reserved
[2];
512 typedef struct SMU72_SoftRegisters SMU72_SoftRegisters
;
514 struct SMU72_Firmware_Header
{
524 uint32_t SoftRegisters
;
527 uint32_t CacConfigTable
;
528 uint32_t CacStatusTable
;
529 uint32_t mcRegisterTable
;
530 uint32_t mcArbDramTimingTable
;
531 uint32_t PmFuseTable
;
533 uint32_t ClockStretcherTable
;
534 uint32_t Reserved
[41];
538 typedef struct SMU72_Firmware_Header SMU72_Firmware_Header
;
540 #define SMU72_FIRMWARE_HEADER_LOCATION 0x20000
558 #define MC_BLOCK_COUNT 1
559 #define CPL_BLOCK_COUNT 5
560 #define SE_BLOCK_COUNT 15
561 #define GC_BLOCK_COUNT 24
563 struct SMU7_Local_Cac
{
570 typedef struct SMU7_Local_Cac SMU7_Local_Cac
;
572 struct SMU7_Local_Cac_Table
{
573 SMU7_Local_Cac CplLocalCac
[CPL_BLOCK_COUNT
];
574 SMU7_Local_Cac McLocalCac
[MC_BLOCK_COUNT
];
575 SMU7_Local_Cac SeLocalCac
[SE_BLOCK_COUNT
];
576 SMU7_Local_Cac GcLocalCac
[GC_BLOCK_COUNT
];
579 typedef struct SMU7_Local_Cac_Table SMU7_Local_Cac_Table
;
581 #if !defined(SMC_MICROCODE)
585 /* Description of Clock Gating bitmask for Tonga: */
586 /* System Clock Gating */
587 #define CG_SYS_BITMASK_FIRST_BIT 0 /* First bit of Sys CG bitmask */
588 #define CG_SYS_BITMASK_LAST_BIT 9 /* Last bit of Sys CG bitmask */
589 #define CG_SYS_BIF_MGLS_SHIFT 0
590 #define CG_SYS_ROM_SHIFT 1
591 #define CG_SYS_MC_MGCG_SHIFT 2
592 #define CG_SYS_MC_MGLS_SHIFT 3
593 #define CG_SYS_SDMA_MGCG_SHIFT 4
594 #define CG_SYS_SDMA_MGLS_SHIFT 5
595 #define CG_SYS_DRM_MGCG_SHIFT 6
596 #define CG_SYS_HDP_MGCG_SHIFT 7
597 #define CG_SYS_HDP_MGLS_SHIFT 8
598 #define CG_SYS_DRM_MGLS_SHIFT 9
600 #define CG_SYS_BIF_MGLS_MASK 0x1
601 #define CG_SYS_ROM_MASK 0x2
602 #define CG_SYS_MC_MGCG_MASK 0x4
603 #define CG_SYS_MC_MGLS_MASK 0x8
604 #define CG_SYS_SDMA_MGCG_MASK 0x10
605 #define CG_SYS_SDMA_MGLS_MASK 0x20
606 #define CG_SYS_DRM_MGCG_MASK 0x40
607 #define CG_SYS_HDP_MGCG_MASK 0x80
608 #define CG_SYS_HDP_MGLS_MASK 0x100
609 #define CG_SYS_DRM_MGLS_MASK 0x200
611 /* Graphics Clock Gating */
612 #define CG_GFX_BITMASK_FIRST_BIT 16 /* First bit of Gfx CG bitmask */
613 #define CG_GFX_BITMASK_LAST_BIT 20 /* Last bit of Gfx CG bitmask */
614 #define CG_GFX_CGCG_SHIFT 16
615 #define CG_GFX_CGLS_SHIFT 17
616 #define CG_CPF_MGCG_SHIFT 18
617 #define CG_RLC_MGCG_SHIFT 19
618 #define CG_GFX_OTHERS_MGCG_SHIFT 20
620 #define CG_GFX_CGCG_MASK 0x00010000
621 #define CG_GFX_CGLS_MASK 0x00020000
622 #define CG_CPF_MGCG_MASK 0x00040000
623 #define CG_RLC_MGCG_MASK 0x00080000
624 #define CG_GFX_OTHERS_MGCG_MASK 0x00100000
626 /* Voltage Regulator Configuration */
627 /* VR Config info is contained in dpmTable.VRConfig */
629 #define VRCONF_VDDC_MASK 0x000000FF
630 #define VRCONF_VDDC_SHIFT 0
631 #define VRCONF_VDDGFX_MASK 0x0000FF00
632 #define VRCONF_VDDGFX_SHIFT 8
633 #define VRCONF_VDDCI_MASK 0x00FF0000
634 #define VRCONF_VDDCI_SHIFT 16
635 #define VRCONF_MVDD_MASK 0xFF000000
636 #define VRCONF_MVDD_SHIFT 24
638 #define VR_MERGED_WITH_VDDC 0
639 #define VR_SVI2_PLANE_1 1
640 #define VR_SVI2_PLANE_2 2
641 #define VR_SMIO_PATTERN_1 3
642 #define VR_SMIO_PATTERN_2 4
643 #define VR_STATIC_VOLTAGE 5
645 /* Clock Stretcher Configuration */
647 #define CLOCK_STRETCHER_MAX_ENTRIES 0x4
648 #define CKS_LOOKUPTable_MAX_ENTRIES 0x4
650 /* The 'settings' field is subdivided in the following way: */
651 #define CLOCK_STRETCHER_SETTING_DDT_MASK 0x01
652 #define CLOCK_STRETCHER_SETTING_DDT_SHIFT 0x0
653 #define CLOCK_STRETCHER_SETTING_STRETCH_AMOUNT_MASK 0x1E
654 #define CLOCK_STRETCHER_SETTING_STRETCH_AMOUNT_SHIFT 0x1
655 #define CLOCK_STRETCHER_SETTING_ENABLE_MASK 0x80
656 #define CLOCK_STRETCHER_SETTING_ENABLE_SHIFT 0x7
658 struct SMU_ClockStretcherDataTableEntry
{
664 typedef struct SMU_ClockStretcherDataTableEntry SMU_ClockStretcherDataTableEntry
;
666 struct SMU_ClockStretcherDataTable
{
667 SMU_ClockStretcherDataTableEntry ClockStretcherDataTableEntry
[CLOCK_STRETCHER_MAX_ENTRIES
];
669 typedef struct SMU_ClockStretcherDataTable SMU_ClockStretcherDataTable
;
671 struct SMU_CKS_LOOKUPTableEntry
{
678 typedef struct SMU_CKS_LOOKUPTableEntry SMU_CKS_LOOKUPTableEntry
;
680 struct SMU_CKS_LOOKUPTable
{
681 SMU_CKS_LOOKUPTableEntry CKS_LOOKUPTableEntry
[CKS_LOOKUPTable_MAX_ENTRIES
];
683 typedef struct SMU_CKS_LOOKUPTable SMU_CKS_LOOKUPTable
;