18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2013 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#ifndef SMU7_DISCRETE_H
258c2ecf20Sopenharmony_ci#define SMU7_DISCRETE_H
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#include "smu7.h"
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#pragma pack(push, 1)
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define SMU7_DTE_ITERATIONS 5
328c2ecf20Sopenharmony_ci#define SMU7_DTE_SOURCES 3
338c2ecf20Sopenharmony_ci#define SMU7_DTE_SINKS 1
348c2ecf20Sopenharmony_ci#define SMU7_NUM_CPU_TES 0
358c2ecf20Sopenharmony_ci#define SMU7_NUM_GPU_TES 1
368c2ecf20Sopenharmony_ci#define SMU7_NUM_NON_TES 2
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_cistruct SMU7_SoftRegisters
398c2ecf20Sopenharmony_ci{
408c2ecf20Sopenharmony_ci    uint32_t        RefClockFrequency;
418c2ecf20Sopenharmony_ci    uint32_t        PmTimerP;
428c2ecf20Sopenharmony_ci    uint32_t        FeatureEnables;
438c2ecf20Sopenharmony_ci    uint32_t        PreVBlankGap;
448c2ecf20Sopenharmony_ci    uint32_t        VBlankTimeout;
458c2ecf20Sopenharmony_ci    uint32_t        TrainTimeGap;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci    uint32_t        MvddSwitchTime;
488c2ecf20Sopenharmony_ci    uint32_t        LongestAcpiTrainTime;
498c2ecf20Sopenharmony_ci    uint32_t        AcpiDelay;
508c2ecf20Sopenharmony_ci    uint32_t        G5TrainTime;
518c2ecf20Sopenharmony_ci    uint32_t        DelayMpllPwron;
528c2ecf20Sopenharmony_ci    uint32_t        VoltageChangeTimeout;
538c2ecf20Sopenharmony_ci    uint32_t        HandshakeDisables;
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy1Config;
568c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy2Config;
578c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy3Config;
588c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy4Config;
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy5Config;
618c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy6Config;
628c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy7Config;
638c2ecf20Sopenharmony_ci    uint8_t         DisplayPhy8Config;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci    uint32_t        AverageGraphicsA;
668c2ecf20Sopenharmony_ci    uint32_t        AverageMemoryA;
678c2ecf20Sopenharmony_ci    uint32_t        AverageGioA;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci    uint8_t         SClkDpmEnabledLevels;
708c2ecf20Sopenharmony_ci    uint8_t         MClkDpmEnabledLevels;
718c2ecf20Sopenharmony_ci    uint8_t         LClkDpmEnabledLevels;
728c2ecf20Sopenharmony_ci    uint8_t         PCIeDpmEnabledLevels;
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci    uint8_t         UVDDpmEnabledLevels;
758c2ecf20Sopenharmony_ci    uint8_t         SAMUDpmEnabledLevels;
768c2ecf20Sopenharmony_ci    uint8_t         ACPDpmEnabledLevels;
778c2ecf20Sopenharmony_ci    uint8_t         VCEDpmEnabledLevels;
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci    uint32_t        DRAM_LOG_ADDR_H;
808c2ecf20Sopenharmony_ci    uint32_t        DRAM_LOG_ADDR_L;
818c2ecf20Sopenharmony_ci    uint32_t        DRAM_LOG_PHY_ADDR_H;
828c2ecf20Sopenharmony_ci    uint32_t        DRAM_LOG_PHY_ADDR_L;
838c2ecf20Sopenharmony_ci    uint32_t        DRAM_LOG_BUFF_SIZE;
848c2ecf20Sopenharmony_ci    uint32_t        UlvEnterC;
858c2ecf20Sopenharmony_ci    uint32_t        UlvTime;
868c2ecf20Sopenharmony_ci    uint32_t        Reserved[3];
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci};
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_citypedef struct SMU7_SoftRegisters SMU7_SoftRegisters;
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_cistruct SMU7_Discrete_VoltageLevel
938c2ecf20Sopenharmony_ci{
948c2ecf20Sopenharmony_ci    uint16_t    Voltage;
958c2ecf20Sopenharmony_ci    uint16_t    StdVoltageHiSidd;
968c2ecf20Sopenharmony_ci    uint16_t    StdVoltageLoSidd;
978c2ecf20Sopenharmony_ci    uint8_t     Smio;
988c2ecf20Sopenharmony_ci    uint8_t     padding;
998c2ecf20Sopenharmony_ci};
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_VoltageLevel SMU7_Discrete_VoltageLevel;
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_cistruct SMU7_Discrete_GraphicsLevel
1048c2ecf20Sopenharmony_ci{
1058c2ecf20Sopenharmony_ci    uint32_t    Flags;
1068c2ecf20Sopenharmony_ci    uint32_t    MinVddc;
1078c2ecf20Sopenharmony_ci    uint32_t    MinVddcPhases;
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci    uint32_t    SclkFrequency;
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci    uint8_t     padding1[2];
1128c2ecf20Sopenharmony_ci    uint16_t    ActivityLevel;
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl3;
1158c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl4;
1168c2ecf20Sopenharmony_ci    uint32_t    SpllSpreadSpectrum;
1178c2ecf20Sopenharmony_ci    uint32_t    SpllSpreadSpectrum2;
1188c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm;
1198c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm1;
1208c2ecf20Sopenharmony_ci    uint8_t     SclkDid;
1218c2ecf20Sopenharmony_ci    uint8_t     DisplayWatermark;
1228c2ecf20Sopenharmony_ci    uint8_t     EnabledForActivity;
1238c2ecf20Sopenharmony_ci    uint8_t     EnabledForThrottle;
1248c2ecf20Sopenharmony_ci    uint8_t     UpH;
1258c2ecf20Sopenharmony_ci    uint8_t     DownH;
1268c2ecf20Sopenharmony_ci    uint8_t     VoltageDownH;
1278c2ecf20Sopenharmony_ci    uint8_t     PowerThrottle;
1288c2ecf20Sopenharmony_ci    uint8_t     DeepSleepDivId;
1298c2ecf20Sopenharmony_ci    uint8_t     padding[3];
1308c2ecf20Sopenharmony_ci};
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_GraphicsLevel SMU7_Discrete_GraphicsLevel;
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_cistruct SMU7_Discrete_ACPILevel
1358c2ecf20Sopenharmony_ci{
1368c2ecf20Sopenharmony_ci    uint32_t    Flags;
1378c2ecf20Sopenharmony_ci    uint32_t    MinVddc;
1388c2ecf20Sopenharmony_ci    uint32_t    MinVddcPhases;
1398c2ecf20Sopenharmony_ci    uint32_t    SclkFrequency;
1408c2ecf20Sopenharmony_ci    uint8_t     SclkDid;
1418c2ecf20Sopenharmony_ci    uint8_t     DisplayWatermark;
1428c2ecf20Sopenharmony_ci    uint8_t     DeepSleepDivId;
1438c2ecf20Sopenharmony_ci    uint8_t     padding;
1448c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl;
1458c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl2;
1468c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl3;
1478c2ecf20Sopenharmony_ci    uint32_t    CgSpllFuncCntl4;
1488c2ecf20Sopenharmony_ci    uint32_t    SpllSpreadSpectrum;
1498c2ecf20Sopenharmony_ci    uint32_t    SpllSpreadSpectrum2;
1508c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm;
1518c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm1;
1528c2ecf20Sopenharmony_ci};
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_ACPILevel SMU7_Discrete_ACPILevel;
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_cistruct SMU7_Discrete_Ulv
1578c2ecf20Sopenharmony_ci{
1588c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm;
1598c2ecf20Sopenharmony_ci    uint32_t    CcPwrDynRm1;
1608c2ecf20Sopenharmony_ci    uint16_t    VddcOffset;
1618c2ecf20Sopenharmony_ci    uint8_t     VddcOffsetVid;
1628c2ecf20Sopenharmony_ci    uint8_t     VddcPhase;
1638c2ecf20Sopenharmony_ci    uint32_t    Reserved;
1648c2ecf20Sopenharmony_ci};
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_Ulv SMU7_Discrete_Ulv;
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistruct SMU7_Discrete_MemoryLevel
1698c2ecf20Sopenharmony_ci{
1708c2ecf20Sopenharmony_ci    uint32_t    MinVddc;
1718c2ecf20Sopenharmony_ci    uint32_t    MinVddcPhases;
1728c2ecf20Sopenharmony_ci    uint32_t    MinVddci;
1738c2ecf20Sopenharmony_ci    uint32_t    MinMvdd;
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci    uint32_t    MclkFrequency;
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci    uint8_t     EdcReadEnable;
1788c2ecf20Sopenharmony_ci    uint8_t     EdcWriteEnable;
1798c2ecf20Sopenharmony_ci    uint8_t     RttEnable;
1808c2ecf20Sopenharmony_ci    uint8_t     StutterEnable;
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci    uint8_t     StrobeEnable;
1838c2ecf20Sopenharmony_ci    uint8_t     StrobeRatio;
1848c2ecf20Sopenharmony_ci    uint8_t     EnabledForThrottle;
1858c2ecf20Sopenharmony_ci    uint8_t     EnabledForActivity;
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci    uint8_t     UpH;
1888c2ecf20Sopenharmony_ci    uint8_t     DownH;
1898c2ecf20Sopenharmony_ci    uint8_t     VoltageDownH;
1908c2ecf20Sopenharmony_ci    uint8_t     padding;
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci    uint16_t    ActivityLevel;
1938c2ecf20Sopenharmony_ci    uint8_t     DisplayWatermark;
1948c2ecf20Sopenharmony_ci    uint8_t     padding1;
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci    uint32_t    MpllFuncCntl;
1978c2ecf20Sopenharmony_ci    uint32_t    MpllFuncCntl_1;
1988c2ecf20Sopenharmony_ci    uint32_t    MpllFuncCntl_2;
1998c2ecf20Sopenharmony_ci    uint32_t    MpllAdFuncCntl;
2008c2ecf20Sopenharmony_ci    uint32_t    MpllDqFuncCntl;
2018c2ecf20Sopenharmony_ci    uint32_t    MclkPwrmgtCntl;
2028c2ecf20Sopenharmony_ci    uint32_t    DllCntl;
2038c2ecf20Sopenharmony_ci    uint32_t    MpllSs1;
2048c2ecf20Sopenharmony_ci    uint32_t    MpllSs2;
2058c2ecf20Sopenharmony_ci};
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MemoryLevel SMU7_Discrete_MemoryLevel;
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_cistruct SMU7_Discrete_LinkLevel
2108c2ecf20Sopenharmony_ci{
2118c2ecf20Sopenharmony_ci    uint8_t     PcieGenSpeed;
2128c2ecf20Sopenharmony_ci    uint8_t     PcieLaneCount;
2138c2ecf20Sopenharmony_ci    uint8_t     EnabledForActivity;
2148c2ecf20Sopenharmony_ci    uint8_t     Padding;
2158c2ecf20Sopenharmony_ci    uint32_t    DownT;
2168c2ecf20Sopenharmony_ci    uint32_t    UpT;
2178c2ecf20Sopenharmony_ci    uint32_t    Reserved;
2188c2ecf20Sopenharmony_ci};
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_LinkLevel SMU7_Discrete_LinkLevel;
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_cistruct SMU7_Discrete_MCArbDramTimingTableEntry
2248c2ecf20Sopenharmony_ci{
2258c2ecf20Sopenharmony_ci    uint32_t McArbDramTiming;
2268c2ecf20Sopenharmony_ci    uint32_t McArbDramTiming2;
2278c2ecf20Sopenharmony_ci    uint8_t  McArbBurstTime;
2288c2ecf20Sopenharmony_ci    uint8_t  padding[3];
2298c2ecf20Sopenharmony_ci};
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MCArbDramTimingTableEntry SMU7_Discrete_MCArbDramTimingTableEntry;
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_cistruct SMU7_Discrete_MCArbDramTimingTable
2348c2ecf20Sopenharmony_ci{
2358c2ecf20Sopenharmony_ci    SMU7_Discrete_MCArbDramTimingTableEntry entries[SMU__NUM_SCLK_DPM_STATE][SMU__NUM_MCLK_DPM_LEVELS];
2368c2ecf20Sopenharmony_ci};
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MCArbDramTimingTable SMU7_Discrete_MCArbDramTimingTable;
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_cistruct SMU7_Discrete_UvdLevel
2418c2ecf20Sopenharmony_ci{
2428c2ecf20Sopenharmony_ci    uint32_t VclkFrequency;
2438c2ecf20Sopenharmony_ci    uint32_t DclkFrequency;
2448c2ecf20Sopenharmony_ci    uint16_t MinVddc;
2458c2ecf20Sopenharmony_ci    uint8_t  MinVddcPhases;
2468c2ecf20Sopenharmony_ci    uint8_t  VclkDivider;
2478c2ecf20Sopenharmony_ci    uint8_t  DclkDivider;
2488c2ecf20Sopenharmony_ci    uint8_t  padding[3];
2498c2ecf20Sopenharmony_ci};
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_UvdLevel SMU7_Discrete_UvdLevel;
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_cistruct SMU7_Discrete_ExtClkLevel
2548c2ecf20Sopenharmony_ci{
2558c2ecf20Sopenharmony_ci    uint32_t Frequency;
2568c2ecf20Sopenharmony_ci    uint16_t MinVoltage;
2578c2ecf20Sopenharmony_ci    uint8_t  MinPhases;
2588c2ecf20Sopenharmony_ci    uint8_t  Divider;
2598c2ecf20Sopenharmony_ci};
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_ExtClkLevel SMU7_Discrete_ExtClkLevel;
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_cistruct SMU7_Discrete_StateInfo
2648c2ecf20Sopenharmony_ci{
2658c2ecf20Sopenharmony_ci    uint32_t SclkFrequency;
2668c2ecf20Sopenharmony_ci    uint32_t MclkFrequency;
2678c2ecf20Sopenharmony_ci    uint32_t VclkFrequency;
2688c2ecf20Sopenharmony_ci    uint32_t DclkFrequency;
2698c2ecf20Sopenharmony_ci    uint32_t SamclkFrequency;
2708c2ecf20Sopenharmony_ci    uint32_t AclkFrequency;
2718c2ecf20Sopenharmony_ci    uint32_t EclkFrequency;
2728c2ecf20Sopenharmony_ci    uint16_t MvddVoltage;
2738c2ecf20Sopenharmony_ci    uint16_t padding16;
2748c2ecf20Sopenharmony_ci    uint8_t  DisplayWatermark;
2758c2ecf20Sopenharmony_ci    uint8_t  McArbIndex;
2768c2ecf20Sopenharmony_ci    uint8_t  McRegIndex;
2778c2ecf20Sopenharmony_ci    uint8_t  SeqIndex;
2788c2ecf20Sopenharmony_ci    uint8_t  SclkDid;
2798c2ecf20Sopenharmony_ci    int8_t   SclkIndex;
2808c2ecf20Sopenharmony_ci    int8_t   MclkIndex;
2818c2ecf20Sopenharmony_ci    uint8_t  PCIeGen;
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci};
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_StateInfo SMU7_Discrete_StateInfo;
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_cistruct SMU7_Discrete_DpmTable
2898c2ecf20Sopenharmony_ci{
2908c2ecf20Sopenharmony_ci    SMU7_PIDController                  GraphicsPIDController;
2918c2ecf20Sopenharmony_ci    SMU7_PIDController                  MemoryPIDController;
2928c2ecf20Sopenharmony_ci    SMU7_PIDController                  LinkPIDController;
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_ci    uint32_t                            SystemFlags;
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci    uint32_t                            SmioMaskVddcVid;
2988c2ecf20Sopenharmony_ci    uint32_t                            SmioMaskVddcPhase;
2998c2ecf20Sopenharmony_ci    uint32_t                            SmioMaskVddciVid;
3008c2ecf20Sopenharmony_ci    uint32_t                            SmioMaskMvddVid;
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci    uint32_t                            VddcLevelCount;
3038c2ecf20Sopenharmony_ci    uint32_t                            VddciLevelCount;
3048c2ecf20Sopenharmony_ci    uint32_t                            MvddLevelCount;
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci    SMU7_Discrete_VoltageLevel          VddcLevel               [SMU7_MAX_LEVELS_VDDC];
3078c2ecf20Sopenharmony_ci//    SMU7_Discrete_VoltageLevel          VddcStandardReference   [SMU7_MAX_LEVELS_VDDC];
3088c2ecf20Sopenharmony_ci    SMU7_Discrete_VoltageLevel          VddciLevel              [SMU7_MAX_LEVELS_VDDCI];
3098c2ecf20Sopenharmony_ci    SMU7_Discrete_VoltageLevel          MvddLevel               [SMU7_MAX_LEVELS_MVDD];
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci    uint8_t                             GraphicsDpmLevelCount;
3128c2ecf20Sopenharmony_ci    uint8_t                             MemoryDpmLevelCount;
3138c2ecf20Sopenharmony_ci    uint8_t                             LinkLevelCount;
3148c2ecf20Sopenharmony_ci    uint8_t                             UvdLevelCount;
3158c2ecf20Sopenharmony_ci    uint8_t                             VceLevelCount;
3168c2ecf20Sopenharmony_ci    uint8_t                             AcpLevelCount;
3178c2ecf20Sopenharmony_ci    uint8_t                             SamuLevelCount;
3188c2ecf20Sopenharmony_ci    uint8_t                             MasterDeepSleepControl;
3198c2ecf20Sopenharmony_ci    uint32_t                            Reserved[5];
3208c2ecf20Sopenharmony_ci//    uint32_t                            SamuDefaultLevel;
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ci    SMU7_Discrete_GraphicsLevel         GraphicsLevel           [SMU7_MAX_LEVELS_GRAPHICS];
3238c2ecf20Sopenharmony_ci    SMU7_Discrete_MemoryLevel           MemoryACPILevel;
3248c2ecf20Sopenharmony_ci    SMU7_Discrete_MemoryLevel           MemoryLevel             [SMU7_MAX_LEVELS_MEMORY];
3258c2ecf20Sopenharmony_ci    SMU7_Discrete_LinkLevel             LinkLevel               [SMU7_MAX_LEVELS_LINK];
3268c2ecf20Sopenharmony_ci    SMU7_Discrete_ACPILevel             ACPILevel;
3278c2ecf20Sopenharmony_ci    SMU7_Discrete_UvdLevel              UvdLevel                [SMU7_MAX_LEVELS_UVD];
3288c2ecf20Sopenharmony_ci    SMU7_Discrete_ExtClkLevel           VceLevel                [SMU7_MAX_LEVELS_VCE];
3298c2ecf20Sopenharmony_ci    SMU7_Discrete_ExtClkLevel           AcpLevel                [SMU7_MAX_LEVELS_ACP];
3308c2ecf20Sopenharmony_ci    SMU7_Discrete_ExtClkLevel           SamuLevel               [SMU7_MAX_LEVELS_SAMU];
3318c2ecf20Sopenharmony_ci    SMU7_Discrete_Ulv                   Ulv;
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci    uint32_t                            SclkStepSize;
3348c2ecf20Sopenharmony_ci    uint32_t                            Smio                    [SMU7_MAX_ENTRIES_SMIO];
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci    uint8_t                             UvdBootLevel;
3378c2ecf20Sopenharmony_ci    uint8_t                             VceBootLevel;
3388c2ecf20Sopenharmony_ci    uint8_t                             AcpBootLevel;
3398c2ecf20Sopenharmony_ci    uint8_t                             SamuBootLevel;
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci    uint8_t                             UVDInterval;
3428c2ecf20Sopenharmony_ci    uint8_t                             VCEInterval;
3438c2ecf20Sopenharmony_ci    uint8_t                             ACPInterval;
3448c2ecf20Sopenharmony_ci    uint8_t                             SAMUInterval;
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci    uint8_t                             GraphicsBootLevel;
3478c2ecf20Sopenharmony_ci    uint8_t                             GraphicsVoltageChangeEnable;
3488c2ecf20Sopenharmony_ci    uint8_t                             GraphicsThermThrottleEnable;
3498c2ecf20Sopenharmony_ci    uint8_t                             GraphicsInterval;
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci    uint8_t                             VoltageInterval;
3528c2ecf20Sopenharmony_ci    uint8_t                             ThermalInterval;
3538c2ecf20Sopenharmony_ci    uint16_t                            TemperatureLimitHigh;
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci    uint16_t                            TemperatureLimitLow;
3568c2ecf20Sopenharmony_ci    uint8_t                             MemoryBootLevel;
3578c2ecf20Sopenharmony_ci    uint8_t                             MemoryVoltageChangeEnable;
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci    uint8_t                             MemoryInterval;
3608c2ecf20Sopenharmony_ci    uint8_t                             MemoryThermThrottleEnable;
3618c2ecf20Sopenharmony_ci    uint16_t                            VddcVddciDelta;
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci    uint16_t                            VoltageResponseTime;
3648c2ecf20Sopenharmony_ci    uint16_t                            PhaseResponseTime;
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_ci    uint8_t                             PCIeBootLinkLevel;
3678c2ecf20Sopenharmony_ci    uint8_t                             PCIeGenInterval;
3688c2ecf20Sopenharmony_ci    uint8_t                             DTEInterval;
3698c2ecf20Sopenharmony_ci    uint8_t                             DTEMode;
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci    uint8_t                             SVI2Enable;
3728c2ecf20Sopenharmony_ci    uint8_t                             VRHotGpio;
3738c2ecf20Sopenharmony_ci    uint8_t                             AcDcGpio;
3748c2ecf20Sopenharmony_ci    uint8_t                             ThermGpio;
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_ci    uint16_t                            PPM_PkgPwrLimit;
3778c2ecf20Sopenharmony_ci    uint16_t                            PPM_TemperatureLimit;
3788c2ecf20Sopenharmony_ci
3798c2ecf20Sopenharmony_ci    uint16_t                            DefaultTdp;
3808c2ecf20Sopenharmony_ci    uint16_t                            TargetTdp;
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci    uint16_t                            FpsHighT;
3838c2ecf20Sopenharmony_ci    uint16_t                            FpsLowT;
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci    uint16_t                            BAPMTI_R  [SMU7_DTE_ITERATIONS][SMU7_DTE_SOURCES][SMU7_DTE_SINKS];
3868c2ecf20Sopenharmony_ci    uint16_t                            BAPMTI_RC [SMU7_DTE_ITERATIONS][SMU7_DTE_SOURCES][SMU7_DTE_SINKS];
3878c2ecf20Sopenharmony_ci
3888c2ecf20Sopenharmony_ci    uint8_t                             DTEAmbientTempBase;
3898c2ecf20Sopenharmony_ci    uint8_t                             DTETjOffset;
3908c2ecf20Sopenharmony_ci    uint8_t                             GpuTjMax;
3918c2ecf20Sopenharmony_ci    uint8_t                             GpuTjHyst;
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_ci    uint16_t                            BootVddc;
3948c2ecf20Sopenharmony_ci    uint16_t                            BootVddci;
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci    uint16_t                            BootMVdd;
3978c2ecf20Sopenharmony_ci    uint16_t                            padding;
3988c2ecf20Sopenharmony_ci
3998c2ecf20Sopenharmony_ci    uint32_t                            BAPM_TEMP_GRADIENT;
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci    uint32_t                            LowSclkInterruptT;
4028c2ecf20Sopenharmony_ci};
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_DpmTable SMU7_Discrete_DpmTable;
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci#define SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE 16
4078c2ecf20Sopenharmony_ci#define SMU7_DISCRETE_MC_REGISTER_ARRAY_SET_COUNT SMU7_MAX_LEVELS_MEMORY
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_cistruct SMU7_Discrete_MCRegisterAddress
4108c2ecf20Sopenharmony_ci{
4118c2ecf20Sopenharmony_ci    uint16_t s0;
4128c2ecf20Sopenharmony_ci    uint16_t s1;
4138c2ecf20Sopenharmony_ci};
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MCRegisterAddress SMU7_Discrete_MCRegisterAddress;
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_cistruct SMU7_Discrete_MCRegisterSet
4188c2ecf20Sopenharmony_ci{
4198c2ecf20Sopenharmony_ci    uint32_t value[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
4208c2ecf20Sopenharmony_ci};
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MCRegisterSet SMU7_Discrete_MCRegisterSet;
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_cistruct SMU7_Discrete_MCRegisters
4258c2ecf20Sopenharmony_ci{
4268c2ecf20Sopenharmony_ci    uint8_t                             last;
4278c2ecf20Sopenharmony_ci    uint8_t                             reserved[3];
4288c2ecf20Sopenharmony_ci    SMU7_Discrete_MCRegisterAddress     address[SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE];
4298c2ecf20Sopenharmony_ci    SMU7_Discrete_MCRegisterSet         data[SMU7_DISCRETE_MC_REGISTER_ARRAY_SET_COUNT];
4308c2ecf20Sopenharmony_ci};
4318c2ecf20Sopenharmony_ci
4328c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_MCRegisters SMU7_Discrete_MCRegisters;
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_cistruct SMU7_Discrete_FanTable
4358c2ecf20Sopenharmony_ci{
4368c2ecf20Sopenharmony_ci	uint16_t FdoMode;
4378c2ecf20Sopenharmony_ci	int16_t  TempMin;
4388c2ecf20Sopenharmony_ci	int16_t  TempMed;
4398c2ecf20Sopenharmony_ci	int16_t  TempMax;
4408c2ecf20Sopenharmony_ci	int16_t  Slope1;
4418c2ecf20Sopenharmony_ci	int16_t  Slope2;
4428c2ecf20Sopenharmony_ci	int16_t  FdoMin;
4438c2ecf20Sopenharmony_ci	int16_t  HystUp;
4448c2ecf20Sopenharmony_ci	int16_t  HystDown;
4458c2ecf20Sopenharmony_ci	int16_t  HystSlope;
4468c2ecf20Sopenharmony_ci	int16_t  TempRespLim;
4478c2ecf20Sopenharmony_ci	int16_t  TempCurr;
4488c2ecf20Sopenharmony_ci	int16_t  SlopeCurr;
4498c2ecf20Sopenharmony_ci	int16_t  PwmCurr;
4508c2ecf20Sopenharmony_ci	uint32_t RefreshPeriod;
4518c2ecf20Sopenharmony_ci	int16_t  FdoMax;
4528c2ecf20Sopenharmony_ci	uint8_t  TempSrc;
4538c2ecf20Sopenharmony_ci	int8_t   Padding;
4548c2ecf20Sopenharmony_ci};
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_FanTable SMU7_Discrete_FanTable;
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_cistruct SMU7_Discrete_PmFuses {
4608c2ecf20Sopenharmony_ci  // dw0-dw1
4618c2ecf20Sopenharmony_ci  uint8_t BapmVddCVidHiSidd[8];
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci  // dw2-dw3
4648c2ecf20Sopenharmony_ci  uint8_t BapmVddCVidLoSidd[8];
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci  // dw4-dw5
4678c2ecf20Sopenharmony_ci  uint8_t VddCVid[8];
4688c2ecf20Sopenharmony_ci
4698c2ecf20Sopenharmony_ci  // dw6
4708c2ecf20Sopenharmony_ci  uint8_t SviLoadLineEn;
4718c2ecf20Sopenharmony_ci  uint8_t SviLoadLineVddC;
4728c2ecf20Sopenharmony_ci  uint8_t SviLoadLineTrimVddC;
4738c2ecf20Sopenharmony_ci  uint8_t SviLoadLineOffsetVddC;
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci  // dw7
4768c2ecf20Sopenharmony_ci  uint16_t TDC_VDDC_PkgLimit;
4778c2ecf20Sopenharmony_ci  uint8_t TDC_VDDC_ThrottleReleaseLimitPerc;
4788c2ecf20Sopenharmony_ci  uint8_t TDC_MAWt;
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ci  // dw8
4818c2ecf20Sopenharmony_ci  uint8_t TdcWaterfallCtl;
4828c2ecf20Sopenharmony_ci  uint8_t LPMLTemperatureMin;
4838c2ecf20Sopenharmony_ci  uint8_t LPMLTemperatureMax;
4848c2ecf20Sopenharmony_ci  uint8_t Reserved;
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci  // dw9-dw10
4878c2ecf20Sopenharmony_ci  uint8_t BapmVddCVidHiSidd2[8];
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_ci  // dw11-dw12
4908c2ecf20Sopenharmony_ci  int16_t FuzzyFan_ErrorSetDelta;
4918c2ecf20Sopenharmony_ci  int16_t FuzzyFan_ErrorRateSetDelta;
4928c2ecf20Sopenharmony_ci  int16_t FuzzyFan_PwmSetDelta;
4938c2ecf20Sopenharmony_ci  uint16_t CalcMeasPowerBlend;
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci  // dw13-dw16
4968c2ecf20Sopenharmony_ci  uint8_t GnbLPML[16];
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci  // dw17
4998c2ecf20Sopenharmony_ci  uint8_t GnbLPMLMaxVid;
5008c2ecf20Sopenharmony_ci  uint8_t GnbLPMLMinVid;
5018c2ecf20Sopenharmony_ci  uint8_t Reserved1[2];
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci  // dw18
5048c2ecf20Sopenharmony_ci  uint16_t BapmVddCBaseLeakageHiSidd;
5058c2ecf20Sopenharmony_ci  uint16_t BapmVddCBaseLeakageLoSidd;
5068c2ecf20Sopenharmony_ci};
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_citypedef struct SMU7_Discrete_PmFuses SMU7_Discrete_PmFuses;
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci#pragma pack(pop)
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_ci#endif
5148c2ecf20Sopenharmony_ci
515