18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2012 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#ifndef __NISLANDS_SMC_H__
248c2ecf20Sopenharmony_ci#define __NISLANDS_SMC_H__
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#pragma pack(push, 1)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE 16
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_cistruct PP_NIslands_Dpm2PerfLevel
318c2ecf20Sopenharmony_ci{
328c2ecf20Sopenharmony_ci    uint8_t     MaxPS;
338c2ecf20Sopenharmony_ci    uint8_t     TgtAct;
348c2ecf20Sopenharmony_ci    uint8_t     MaxPS_StepInc;
358c2ecf20Sopenharmony_ci    uint8_t     MaxPS_StepDec;
368c2ecf20Sopenharmony_ci    uint8_t     PSST;
378c2ecf20Sopenharmony_ci    uint8_t     NearTDPDec;
388c2ecf20Sopenharmony_ci    uint8_t     AboveSafeInc;
398c2ecf20Sopenharmony_ci    uint8_t     BelowSafeInc;
408c2ecf20Sopenharmony_ci    uint8_t     PSDeltaLimit;
418c2ecf20Sopenharmony_ci    uint8_t     PSDeltaWin;
428c2ecf20Sopenharmony_ci    uint8_t     Reserved[6];
438c2ecf20Sopenharmony_ci};
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_citypedef struct PP_NIslands_Dpm2PerfLevel PP_NIslands_Dpm2PerfLevel;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_cistruct PP_NIslands_DPM2Parameters
488c2ecf20Sopenharmony_ci{
498c2ecf20Sopenharmony_ci    uint32_t    TDPLimit;
508c2ecf20Sopenharmony_ci    uint32_t    NearTDPLimit;
518c2ecf20Sopenharmony_ci    uint32_t    SafePowerLimit;
528c2ecf20Sopenharmony_ci    uint32_t    PowerBoostLimit;
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_citypedef struct PP_NIslands_DPM2Parameters PP_NIslands_DPM2Parameters;
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_cistruct NISLANDS_SMC_SCLK_VALUE
578c2ecf20Sopenharmony_ci{
588c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL;
598c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_2;
608c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_3;
618c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_4;
628c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_SPREAD_SPECTRUM;
638c2ecf20Sopenharmony_ci    uint32_t        vCG_SPLL_SPREAD_SPECTRUM_2;
648c2ecf20Sopenharmony_ci    uint32_t        sclk_value;
658c2ecf20Sopenharmony_ci};
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_SCLK_VALUE NISLANDS_SMC_SCLK_VALUE;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cistruct NISLANDS_SMC_MCLK_VALUE
708c2ecf20Sopenharmony_ci{
718c2ecf20Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL;
728c2ecf20Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL_1;
738c2ecf20Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL_2;
748c2ecf20Sopenharmony_ci    uint32_t        vMPLL_AD_FUNC_CNTL;
758c2ecf20Sopenharmony_ci    uint32_t        vMPLL_AD_FUNC_CNTL_2;
768c2ecf20Sopenharmony_ci    uint32_t        vMPLL_DQ_FUNC_CNTL;
778c2ecf20Sopenharmony_ci    uint32_t        vMPLL_DQ_FUNC_CNTL_2;
788c2ecf20Sopenharmony_ci    uint32_t        vMCLK_PWRMGT_CNTL;
798c2ecf20Sopenharmony_ci    uint32_t        vDLL_CNTL;
808c2ecf20Sopenharmony_ci    uint32_t        vMPLL_SS;
818c2ecf20Sopenharmony_ci    uint32_t        vMPLL_SS2;
828c2ecf20Sopenharmony_ci    uint32_t        mclk_value;
838c2ecf20Sopenharmony_ci};
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_MCLK_VALUE NISLANDS_SMC_MCLK_VALUE;
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_cistruct NISLANDS_SMC_VOLTAGE_VALUE
888c2ecf20Sopenharmony_ci{
898c2ecf20Sopenharmony_ci    uint16_t             value;
908c2ecf20Sopenharmony_ci    uint8_t              index;
918c2ecf20Sopenharmony_ci    uint8_t              padding;
928c2ecf20Sopenharmony_ci};
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_VOLTAGE_VALUE NISLANDS_SMC_VOLTAGE_VALUE;
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cistruct NISLANDS_SMC_HW_PERFORMANCE_LEVEL
978c2ecf20Sopenharmony_ci{
988c2ecf20Sopenharmony_ci    uint8_t                     arbValue;
998c2ecf20Sopenharmony_ci    uint8_t                     ACIndex;
1008c2ecf20Sopenharmony_ci    uint8_t                     displayWatermark;
1018c2ecf20Sopenharmony_ci    uint8_t                     gen2PCIE;
1028c2ecf20Sopenharmony_ci    uint8_t                     reserved1;
1038c2ecf20Sopenharmony_ci    uint8_t                     reserved2;
1048c2ecf20Sopenharmony_ci    uint8_t                     strobeMode;
1058c2ecf20Sopenharmony_ci    uint8_t                     mcFlags;
1068c2ecf20Sopenharmony_ci    uint32_t                    aT;
1078c2ecf20Sopenharmony_ci    uint32_t                    bSP;
1088c2ecf20Sopenharmony_ci    NISLANDS_SMC_SCLK_VALUE     sclk;
1098c2ecf20Sopenharmony_ci    NISLANDS_SMC_MCLK_VALUE     mclk;
1108c2ecf20Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  vddc;
1118c2ecf20Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  mvdd;
1128c2ecf20Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  vddci;
1138c2ecf20Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  std_vddc;
1148c2ecf20Sopenharmony_ci    uint32_t                    powergate_en;
1158c2ecf20Sopenharmony_ci    uint8_t                     hUp;
1168c2ecf20Sopenharmony_ci    uint8_t                     hDown;
1178c2ecf20Sopenharmony_ci    uint8_t                     stateFlags;
1188c2ecf20Sopenharmony_ci    uint8_t                     arbRefreshState;
1198c2ecf20Sopenharmony_ci    uint32_t                    SQPowerThrottle;
1208c2ecf20Sopenharmony_ci    uint32_t                    SQPowerThrottle_2;
1218c2ecf20Sopenharmony_ci    uint32_t                    reserved[2];
1228c2ecf20Sopenharmony_ci    PP_NIslands_Dpm2PerfLevel   dpm2;
1238c2ecf20Sopenharmony_ci};
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define NISLANDS_SMC_STROBE_RATIO    0x0F
1268c2ecf20Sopenharmony_ci#define NISLANDS_SMC_STROBE_ENABLE   0x10
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define NISLANDS_SMC_MC_EDC_RD_FLAG  0x01
1298c2ecf20Sopenharmony_ci#define NISLANDS_SMC_MC_EDC_WR_FLAG  0x02
1308c2ecf20Sopenharmony_ci#define NISLANDS_SMC_MC_RTT_ENABLE   0x04
1318c2ecf20Sopenharmony_ci#define NISLANDS_SMC_MC_STUTTER_EN   0x08
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_HW_PERFORMANCE_LEVEL NISLANDS_SMC_HW_PERFORMANCE_LEVEL;
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_cistruct NISLANDS_SMC_SWSTATE
1368c2ecf20Sopenharmony_ci{
1378c2ecf20Sopenharmony_ci    uint8_t                             flags;
1388c2ecf20Sopenharmony_ci    uint8_t                             levelCount;
1398c2ecf20Sopenharmony_ci    uint8_t                             padding2;
1408c2ecf20Sopenharmony_ci    uint8_t                             padding3;
1418c2ecf20Sopenharmony_ci    NISLANDS_SMC_HW_PERFORMANCE_LEVEL   levels[1];
1428c2ecf20Sopenharmony_ci};
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_SWSTATE NISLANDS_SMC_SWSTATE;
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_VDDC  0
1478c2ecf20Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_MVDD  1
1488c2ecf20Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_VDDCI 2
1498c2ecf20Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_MAX   4
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_cistruct NISLANDS_SMC_VOLTAGEMASKTABLE
1528c2ecf20Sopenharmony_ci{
1538c2ecf20Sopenharmony_ci    uint8_t  highMask[NISLANDS_SMC_VOLTAGEMASK_MAX];
1548c2ecf20Sopenharmony_ci    uint32_t lowMask[NISLANDS_SMC_VOLTAGEMASK_MAX];
1558c2ecf20Sopenharmony_ci};
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_VOLTAGEMASKTABLE NISLANDS_SMC_VOLTAGEMASKTABLE;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci#define NISLANDS_MAX_NO_VREG_STEPS 32
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_cistruct NISLANDS_SMC_STATETABLE
1628c2ecf20Sopenharmony_ci{
1638c2ecf20Sopenharmony_ci    uint8_t                             thermalProtectType;
1648c2ecf20Sopenharmony_ci    uint8_t                             systemFlags;
1658c2ecf20Sopenharmony_ci    uint8_t                             maxVDDCIndexInPPTable;
1668c2ecf20Sopenharmony_ci    uint8_t                             extraFlags;
1678c2ecf20Sopenharmony_ci    uint8_t                             highSMIO[NISLANDS_MAX_NO_VREG_STEPS];
1688c2ecf20Sopenharmony_ci    uint32_t                            lowSMIO[NISLANDS_MAX_NO_VREG_STEPS];
1698c2ecf20Sopenharmony_ci    NISLANDS_SMC_VOLTAGEMASKTABLE       voltageMaskTable;
1708c2ecf20Sopenharmony_ci    PP_NIslands_DPM2Parameters          dpm2Params;
1718c2ecf20Sopenharmony_ci    NISLANDS_SMC_SWSTATE                initialState;
1728c2ecf20Sopenharmony_ci    NISLANDS_SMC_SWSTATE                ACPIState;
1738c2ecf20Sopenharmony_ci    NISLANDS_SMC_SWSTATE                ULVState;
1748c2ecf20Sopenharmony_ci    NISLANDS_SMC_SWSTATE                driverState;
1758c2ecf20Sopenharmony_ci    NISLANDS_SMC_HW_PERFORMANCE_LEVEL   dpmLevels[NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE - 1];
1768c2ecf20Sopenharmony_ci};
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_citypedef struct NISLANDS_SMC_STATETABLE NISLANDS_SMC_STATETABLE;
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTERS_START        0x108
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mclk_chg_timeout        0x0
1838c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_bbias             0xC
1848c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_vreg              0x10
1858c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_acpi              0x2C
1868c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_seq_index               0x64
1878c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mvdd_chg_time           0x68
1888c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mclk_switch_lim         0x78
1898c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_watermark_threshold     0x80
1908c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mc_block_delay          0x84
1918c2ecf20Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_uvd_enabled             0x98
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES 16
1948c2ecf20Sopenharmony_ci#define SMC_NISLANDS_LKGE_LUT_NUM_OF_TEMP_ENTRIES 16
1958c2ecf20Sopenharmony_ci#define SMC_NISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES 16
1968c2ecf20Sopenharmony_ci#define SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES 4
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_cistruct SMC_NISLANDS_MC_TPP_CAC_TABLE
1998c2ecf20Sopenharmony_ci{
2008c2ecf20Sopenharmony_ci    uint32_t    tpp[SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES];
2018c2ecf20Sopenharmony_ci    uint32_t    cacValue[SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES];
2028c2ecf20Sopenharmony_ci};
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_citypedef struct SMC_NISLANDS_MC_TPP_CAC_TABLE SMC_NISLANDS_MC_TPP_CAC_TABLE;
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_cistruct PP_NIslands_CACTABLES
2088c2ecf20Sopenharmony_ci{
2098c2ecf20Sopenharmony_ci    uint32_t                cac_bif_lut[SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES];
2108c2ecf20Sopenharmony_ci    uint32_t                cac_lkge_lut[SMC_NISLANDS_LKGE_LUT_NUM_OF_TEMP_ENTRIES][SMC_NISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES];
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci    uint32_t                pwr_const;
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci    uint32_t                dc_cacValue;
2158c2ecf20Sopenharmony_ci    uint32_t                bif_cacValue;
2168c2ecf20Sopenharmony_ci    uint32_t                lkge_pwr;
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci    uint8_t                 cac_width;
2198c2ecf20Sopenharmony_ci    uint8_t                 window_size_p2;
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci    uint8_t                 num_drop_lsb;
2228c2ecf20Sopenharmony_ci    uint8_t                 padding_0;
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci    uint32_t                last_power;
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci    uint8_t                 AllowOvrflw;
2278c2ecf20Sopenharmony_ci    uint8_t                 MCWrWeight;
2288c2ecf20Sopenharmony_ci    uint8_t                 MCRdWeight;
2298c2ecf20Sopenharmony_ci    uint8_t                 padding_1[9];
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci    uint8_t                 enableWinAvg;
2328c2ecf20Sopenharmony_ci    uint8_t                 numWin_TDP;
2338c2ecf20Sopenharmony_ci    uint8_t                 l2numWin_TDP;
2348c2ecf20Sopenharmony_ci    uint8_t                 WinIndex;
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci    uint32_t                dynPwr_TDP[4];
2378c2ecf20Sopenharmony_ci    uint32_t                lkgePwr_TDP[4];
2388c2ecf20Sopenharmony_ci    uint32_t                power_TDP[4];
2398c2ecf20Sopenharmony_ci    uint32_t                avg_dynPwr_TDP;
2408c2ecf20Sopenharmony_ci    uint32_t                avg_lkgePwr_TDP;
2418c2ecf20Sopenharmony_ci    uint32_t                avg_power_TDP;
2428c2ecf20Sopenharmony_ci    uint32_t                lts_power_TDP;
2438c2ecf20Sopenharmony_ci    uint8_t                 lts_truncate_n;
2448c2ecf20Sopenharmony_ci    uint8_t                 padding_2[7];
2458c2ecf20Sopenharmony_ci};
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_citypedef struct PP_NIslands_CACTABLES PP_NIslands_CACTABLES;
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci#define SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE 32
2508c2ecf20Sopenharmony_ci#define SMC_NISLANDS_MC_REGISTER_ARRAY_SET_COUNT 20
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_cistruct SMC_NIslands_MCRegisterAddress
2538c2ecf20Sopenharmony_ci{
2548c2ecf20Sopenharmony_ci    uint16_t s0;
2558c2ecf20Sopenharmony_ci    uint16_t s1;
2568c2ecf20Sopenharmony_ci};
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_citypedef struct SMC_NIslands_MCRegisterAddress SMC_NIslands_MCRegisterAddress;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_cistruct SMC_NIslands_MCRegisterSet
2628c2ecf20Sopenharmony_ci{
2638c2ecf20Sopenharmony_ci    uint32_t value[SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE];
2648c2ecf20Sopenharmony_ci};
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_citypedef struct SMC_NIslands_MCRegisterSet SMC_NIslands_MCRegisterSet;
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_cistruct SMC_NIslands_MCRegisters
2698c2ecf20Sopenharmony_ci{
2708c2ecf20Sopenharmony_ci    uint8_t                             last;
2718c2ecf20Sopenharmony_ci    uint8_t                             reserved[3];
2728c2ecf20Sopenharmony_ci    SMC_NIslands_MCRegisterAddress      address[SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE];
2738c2ecf20Sopenharmony_ci    SMC_NIslands_MCRegisterSet          data[SMC_NISLANDS_MC_REGISTER_ARRAY_SET_COUNT];
2748c2ecf20Sopenharmony_ci};
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_citypedef struct SMC_NIslands_MCRegisters SMC_NIslands_MCRegisters;
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_cistruct SMC_NIslands_MCArbDramTimingRegisterSet
2798c2ecf20Sopenharmony_ci{
2808c2ecf20Sopenharmony_ci    uint32_t mc_arb_dram_timing;
2818c2ecf20Sopenharmony_ci    uint32_t mc_arb_dram_timing2;
2828c2ecf20Sopenharmony_ci    uint8_t  mc_arb_rfsh_rate;
2838c2ecf20Sopenharmony_ci    uint8_t  padding[3];
2848c2ecf20Sopenharmony_ci};
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_citypedef struct SMC_NIslands_MCArbDramTimingRegisterSet SMC_NIslands_MCArbDramTimingRegisterSet;
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_cistruct SMC_NIslands_MCArbDramTimingRegisters
2898c2ecf20Sopenharmony_ci{
2908c2ecf20Sopenharmony_ci    uint8_t                                     arb_current;
2918c2ecf20Sopenharmony_ci    uint8_t                                     reserved[3];
2928c2ecf20Sopenharmony_ci    SMC_NIslands_MCArbDramTimingRegisterSet     data[20];
2938c2ecf20Sopenharmony_ci};
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_citypedef struct SMC_NIslands_MCArbDramTimingRegisters SMC_NIslands_MCArbDramTimingRegisters;
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_cistruct SMC_NISLANDS_SPLL_DIV_TABLE
2988c2ecf20Sopenharmony_ci{
2998c2ecf20Sopenharmony_ci    uint32_t    freq[256];
3008c2ecf20Sopenharmony_ci    uint32_t    ss[256];
3018c2ecf20Sopenharmony_ci};
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK  0x01ffffff
3048c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT 0
3058c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_MASK   0xfe000000
3068c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_SHIFT  25
3078c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK   0x000fffff
3088c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT  0
3098c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK   0xfff00000
3108c2ecf20Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT  20
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_citypedef struct SMC_NISLANDS_SPLL_DIV_TABLE SMC_NISLANDS_SPLL_DIV_TABLE;
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_LOCATION 0x100
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_version                   0x0
3178c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_flags                     0x4
3188c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_softRegisters             0x8
3198c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_stateTable                0xC
3208c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_fanTable                  0x10
3218c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_cacTable                  0x14
3228c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_mcRegisterTable           0x20
3238c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_mcArbDramAutoRefreshTable 0x2C
3248c2ecf20Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_spllTable                 0x30
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci#pragma pack(pop)
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci#endif
3298c2ecf20Sopenharmony_ci
330