162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright 2012 Advanced Micro Devices, Inc.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
1262306a36Sopenharmony_ci * all copies or substantial portions of the Software.
1362306a36Sopenharmony_ci *
1462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1562306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1662306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1762306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1862306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1962306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2062306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
2162306a36Sopenharmony_ci *
2262306a36Sopenharmony_ci */
2362306a36Sopenharmony_ci#ifndef __NISLANDS_SMC_H__
2462306a36Sopenharmony_ci#define __NISLANDS_SMC_H__
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#pragma pack(push, 1)
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE 16
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistruct PP_NIslands_Dpm2PerfLevel
3162306a36Sopenharmony_ci{
3262306a36Sopenharmony_ci    uint8_t     MaxPS;
3362306a36Sopenharmony_ci    uint8_t     TgtAct;
3462306a36Sopenharmony_ci    uint8_t     MaxPS_StepInc;
3562306a36Sopenharmony_ci    uint8_t     MaxPS_StepDec;
3662306a36Sopenharmony_ci    uint8_t     PSST;
3762306a36Sopenharmony_ci    uint8_t     NearTDPDec;
3862306a36Sopenharmony_ci    uint8_t     AboveSafeInc;
3962306a36Sopenharmony_ci    uint8_t     BelowSafeInc;
4062306a36Sopenharmony_ci    uint8_t     PSDeltaLimit;
4162306a36Sopenharmony_ci    uint8_t     PSDeltaWin;
4262306a36Sopenharmony_ci    uint8_t     Reserved[6];
4362306a36Sopenharmony_ci};
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_citypedef struct PP_NIslands_Dpm2PerfLevel PP_NIslands_Dpm2PerfLevel;
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_cistruct PP_NIslands_DPM2Parameters
4862306a36Sopenharmony_ci{
4962306a36Sopenharmony_ci    uint32_t    TDPLimit;
5062306a36Sopenharmony_ci    uint32_t    NearTDPLimit;
5162306a36Sopenharmony_ci    uint32_t    SafePowerLimit;
5262306a36Sopenharmony_ci    uint32_t    PowerBoostLimit;
5362306a36Sopenharmony_ci};
5462306a36Sopenharmony_citypedef struct PP_NIslands_DPM2Parameters PP_NIslands_DPM2Parameters;
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_cistruct NISLANDS_SMC_SCLK_VALUE
5762306a36Sopenharmony_ci{
5862306a36Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL;
5962306a36Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_2;
6062306a36Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_3;
6162306a36Sopenharmony_ci    uint32_t        vCG_SPLL_FUNC_CNTL_4;
6262306a36Sopenharmony_ci    uint32_t        vCG_SPLL_SPREAD_SPECTRUM;
6362306a36Sopenharmony_ci    uint32_t        vCG_SPLL_SPREAD_SPECTRUM_2;
6462306a36Sopenharmony_ci    uint32_t        sclk_value;
6562306a36Sopenharmony_ci};
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_citypedef struct NISLANDS_SMC_SCLK_VALUE NISLANDS_SMC_SCLK_VALUE;
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_cistruct NISLANDS_SMC_MCLK_VALUE
7062306a36Sopenharmony_ci{
7162306a36Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL;
7262306a36Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL_1;
7362306a36Sopenharmony_ci    uint32_t        vMPLL_FUNC_CNTL_2;
7462306a36Sopenharmony_ci    uint32_t        vMPLL_AD_FUNC_CNTL;
7562306a36Sopenharmony_ci    uint32_t        vMPLL_AD_FUNC_CNTL_2;
7662306a36Sopenharmony_ci    uint32_t        vMPLL_DQ_FUNC_CNTL;
7762306a36Sopenharmony_ci    uint32_t        vMPLL_DQ_FUNC_CNTL_2;
7862306a36Sopenharmony_ci    uint32_t        vMCLK_PWRMGT_CNTL;
7962306a36Sopenharmony_ci    uint32_t        vDLL_CNTL;
8062306a36Sopenharmony_ci    uint32_t        vMPLL_SS;
8162306a36Sopenharmony_ci    uint32_t        vMPLL_SS2;
8262306a36Sopenharmony_ci    uint32_t        mclk_value;
8362306a36Sopenharmony_ci};
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_citypedef struct NISLANDS_SMC_MCLK_VALUE NISLANDS_SMC_MCLK_VALUE;
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_cistruct NISLANDS_SMC_VOLTAGE_VALUE
8862306a36Sopenharmony_ci{
8962306a36Sopenharmony_ci    uint16_t             value;
9062306a36Sopenharmony_ci    uint8_t              index;
9162306a36Sopenharmony_ci    uint8_t              padding;
9262306a36Sopenharmony_ci};
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_citypedef struct NISLANDS_SMC_VOLTAGE_VALUE NISLANDS_SMC_VOLTAGE_VALUE;
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_cistruct NISLANDS_SMC_HW_PERFORMANCE_LEVEL
9762306a36Sopenharmony_ci{
9862306a36Sopenharmony_ci    uint8_t                     arbValue;
9962306a36Sopenharmony_ci    uint8_t                     ACIndex;
10062306a36Sopenharmony_ci    uint8_t                     displayWatermark;
10162306a36Sopenharmony_ci    uint8_t                     gen2PCIE;
10262306a36Sopenharmony_ci    uint8_t                     reserved1;
10362306a36Sopenharmony_ci    uint8_t                     reserved2;
10462306a36Sopenharmony_ci    uint8_t                     strobeMode;
10562306a36Sopenharmony_ci    uint8_t                     mcFlags;
10662306a36Sopenharmony_ci    uint32_t                    aT;
10762306a36Sopenharmony_ci    uint32_t                    bSP;
10862306a36Sopenharmony_ci    NISLANDS_SMC_SCLK_VALUE     sclk;
10962306a36Sopenharmony_ci    NISLANDS_SMC_MCLK_VALUE     mclk;
11062306a36Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  vddc;
11162306a36Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  mvdd;
11262306a36Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  vddci;
11362306a36Sopenharmony_ci    NISLANDS_SMC_VOLTAGE_VALUE  std_vddc;
11462306a36Sopenharmony_ci    uint32_t                    powergate_en;
11562306a36Sopenharmony_ci    uint8_t                     hUp;
11662306a36Sopenharmony_ci    uint8_t                     hDown;
11762306a36Sopenharmony_ci    uint8_t                     stateFlags;
11862306a36Sopenharmony_ci    uint8_t                     arbRefreshState;
11962306a36Sopenharmony_ci    uint32_t                    SQPowerThrottle;
12062306a36Sopenharmony_ci    uint32_t                    SQPowerThrottle_2;
12162306a36Sopenharmony_ci    uint32_t                    reserved[2];
12262306a36Sopenharmony_ci    PP_NIslands_Dpm2PerfLevel   dpm2;
12362306a36Sopenharmony_ci};
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#define NISLANDS_SMC_STROBE_RATIO    0x0F
12662306a36Sopenharmony_ci#define NISLANDS_SMC_STROBE_ENABLE   0x10
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci#define NISLANDS_SMC_MC_EDC_RD_FLAG  0x01
12962306a36Sopenharmony_ci#define NISLANDS_SMC_MC_EDC_WR_FLAG  0x02
13062306a36Sopenharmony_ci#define NISLANDS_SMC_MC_RTT_ENABLE   0x04
13162306a36Sopenharmony_ci#define NISLANDS_SMC_MC_STUTTER_EN   0x08
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_citypedef struct NISLANDS_SMC_HW_PERFORMANCE_LEVEL NISLANDS_SMC_HW_PERFORMANCE_LEVEL;
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_cistruct NISLANDS_SMC_SWSTATE
13662306a36Sopenharmony_ci{
13762306a36Sopenharmony_ci	uint8_t                             flags;
13862306a36Sopenharmony_ci	uint8_t                             levelCount;
13962306a36Sopenharmony_ci	uint8_t                             padding2;
14062306a36Sopenharmony_ci	uint8_t                             padding3;
14162306a36Sopenharmony_ci	NISLANDS_SMC_HW_PERFORMANCE_LEVEL   levels[];
14262306a36Sopenharmony_ci};
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_citypedef struct NISLANDS_SMC_SWSTATE NISLANDS_SMC_SWSTATE;
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_cistruct NISLANDS_SMC_SWSTATE_SINGLE {
14762306a36Sopenharmony_ci	uint8_t                             flags;
14862306a36Sopenharmony_ci	uint8_t                             levelCount;
14962306a36Sopenharmony_ci	uint8_t                             padding2;
15062306a36Sopenharmony_ci	uint8_t                             padding3;
15162306a36Sopenharmony_ci	NISLANDS_SMC_HW_PERFORMANCE_LEVEL   level;
15262306a36Sopenharmony_ci};
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_VDDC  0
15562306a36Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_MVDD  1
15662306a36Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_VDDCI 2
15762306a36Sopenharmony_ci#define NISLANDS_SMC_VOLTAGEMASK_MAX   4
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_cistruct NISLANDS_SMC_VOLTAGEMASKTABLE
16062306a36Sopenharmony_ci{
16162306a36Sopenharmony_ci    uint8_t  highMask[NISLANDS_SMC_VOLTAGEMASK_MAX];
16262306a36Sopenharmony_ci    uint32_t lowMask[NISLANDS_SMC_VOLTAGEMASK_MAX];
16362306a36Sopenharmony_ci};
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_citypedef struct NISLANDS_SMC_VOLTAGEMASKTABLE NISLANDS_SMC_VOLTAGEMASKTABLE;
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci#define NISLANDS_MAX_NO_VREG_STEPS 32
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_cistruct NISLANDS_SMC_STATETABLE
17062306a36Sopenharmony_ci{
17162306a36Sopenharmony_ci	uint8_t                             thermalProtectType;
17262306a36Sopenharmony_ci	uint8_t                             systemFlags;
17362306a36Sopenharmony_ci	uint8_t                             maxVDDCIndexInPPTable;
17462306a36Sopenharmony_ci	uint8_t                             extraFlags;
17562306a36Sopenharmony_ci	uint8_t                             highSMIO[NISLANDS_MAX_NO_VREG_STEPS];
17662306a36Sopenharmony_ci	uint32_t                            lowSMIO[NISLANDS_MAX_NO_VREG_STEPS];
17762306a36Sopenharmony_ci	NISLANDS_SMC_VOLTAGEMASKTABLE       voltageMaskTable;
17862306a36Sopenharmony_ci	PP_NIslands_DPM2Parameters          dpm2Params;
17962306a36Sopenharmony_ci	struct NISLANDS_SMC_SWSTATE_SINGLE  initialState;
18062306a36Sopenharmony_ci	struct NISLANDS_SMC_SWSTATE_SINGLE  ACPIState;
18162306a36Sopenharmony_ci	struct NISLANDS_SMC_SWSTATE_SINGLE  ULVState;
18262306a36Sopenharmony_ci	NISLANDS_SMC_SWSTATE                driverState;
18362306a36Sopenharmony_ci	NISLANDS_SMC_HW_PERFORMANCE_LEVEL   dpmLevels[NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE];
18462306a36Sopenharmony_ci};
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_citypedef struct NISLANDS_SMC_STATETABLE NISLANDS_SMC_STATETABLE;
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTERS_START        0x108
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mclk_chg_timeout        0x0
19162306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_bbias             0xC
19262306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_vreg              0x10
19362306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_delay_acpi              0x2C
19462306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_seq_index               0x64
19562306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mvdd_chg_time           0x68
19662306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mclk_switch_lim         0x78
19762306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_watermark_threshold     0x80
19862306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_mc_block_delay          0x84
19962306a36Sopenharmony_ci#define NI_SMC_SOFT_REGISTER_uvd_enabled             0x98
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci#define SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES 16
20262306a36Sopenharmony_ci#define SMC_NISLANDS_LKGE_LUT_NUM_OF_TEMP_ENTRIES 16
20362306a36Sopenharmony_ci#define SMC_NISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES 16
20462306a36Sopenharmony_ci#define SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES 4
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_cistruct SMC_NISLANDS_MC_TPP_CAC_TABLE
20762306a36Sopenharmony_ci{
20862306a36Sopenharmony_ci    uint32_t    tpp[SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES];
20962306a36Sopenharmony_ci    uint32_t    cacValue[SMC_NISLANDS_MC_TPP_CAC_NUM_OF_ENTRIES];
21062306a36Sopenharmony_ci};
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_citypedef struct SMC_NISLANDS_MC_TPP_CAC_TABLE SMC_NISLANDS_MC_TPP_CAC_TABLE;
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_cistruct PP_NIslands_CACTABLES
21662306a36Sopenharmony_ci{
21762306a36Sopenharmony_ci    uint32_t                cac_bif_lut[SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES];
21862306a36Sopenharmony_ci    uint32_t                cac_lkge_lut[SMC_NISLANDS_LKGE_LUT_NUM_OF_TEMP_ENTRIES][SMC_NISLANDS_LKGE_LUT_NUM_OF_VOLT_ENTRIES];
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci    uint32_t                pwr_const;
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci    uint32_t                dc_cacValue;
22362306a36Sopenharmony_ci    uint32_t                bif_cacValue;
22462306a36Sopenharmony_ci    uint32_t                lkge_pwr;
22562306a36Sopenharmony_ci
22662306a36Sopenharmony_ci    uint8_t                 cac_width;
22762306a36Sopenharmony_ci    uint8_t                 window_size_p2;
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci    uint8_t                 num_drop_lsb;
23062306a36Sopenharmony_ci    uint8_t                 padding_0;
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci    uint32_t                last_power;
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci    uint8_t                 AllowOvrflw;
23562306a36Sopenharmony_ci    uint8_t                 MCWrWeight;
23662306a36Sopenharmony_ci    uint8_t                 MCRdWeight;
23762306a36Sopenharmony_ci    uint8_t                 padding_1[9];
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci    uint8_t                 enableWinAvg;
24062306a36Sopenharmony_ci    uint8_t                 numWin_TDP;
24162306a36Sopenharmony_ci    uint8_t                 l2numWin_TDP;
24262306a36Sopenharmony_ci    uint8_t                 WinIndex;
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci    uint32_t                dynPwr_TDP[4];
24562306a36Sopenharmony_ci    uint32_t                lkgePwr_TDP[4];
24662306a36Sopenharmony_ci    uint32_t                power_TDP[4];
24762306a36Sopenharmony_ci    uint32_t                avg_dynPwr_TDP;
24862306a36Sopenharmony_ci    uint32_t                avg_lkgePwr_TDP;
24962306a36Sopenharmony_ci    uint32_t                avg_power_TDP;
25062306a36Sopenharmony_ci    uint32_t                lts_power_TDP;
25162306a36Sopenharmony_ci    uint8_t                 lts_truncate_n;
25262306a36Sopenharmony_ci    uint8_t                 padding_2[7];
25362306a36Sopenharmony_ci};
25462306a36Sopenharmony_ci
25562306a36Sopenharmony_citypedef struct PP_NIslands_CACTABLES PP_NIslands_CACTABLES;
25662306a36Sopenharmony_ci
25762306a36Sopenharmony_ci#define SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE 32
25862306a36Sopenharmony_ci#define SMC_NISLANDS_MC_REGISTER_ARRAY_SET_COUNT 20
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_cistruct SMC_NIslands_MCRegisterAddress
26162306a36Sopenharmony_ci{
26262306a36Sopenharmony_ci    uint16_t s0;
26362306a36Sopenharmony_ci    uint16_t s1;
26462306a36Sopenharmony_ci};
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_citypedef struct SMC_NIslands_MCRegisterAddress SMC_NIslands_MCRegisterAddress;
26762306a36Sopenharmony_ci
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_cistruct SMC_NIslands_MCRegisterSet
27062306a36Sopenharmony_ci{
27162306a36Sopenharmony_ci    uint32_t value[SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE];
27262306a36Sopenharmony_ci};
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_citypedef struct SMC_NIslands_MCRegisterSet SMC_NIslands_MCRegisterSet;
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_cistruct SMC_NIslands_MCRegisters
27762306a36Sopenharmony_ci{
27862306a36Sopenharmony_ci    uint8_t                             last;
27962306a36Sopenharmony_ci    uint8_t                             reserved[3];
28062306a36Sopenharmony_ci    SMC_NIslands_MCRegisterAddress      address[SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE];
28162306a36Sopenharmony_ci    SMC_NIslands_MCRegisterSet          data[SMC_NISLANDS_MC_REGISTER_ARRAY_SET_COUNT];
28262306a36Sopenharmony_ci};
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_citypedef struct SMC_NIslands_MCRegisters SMC_NIslands_MCRegisters;
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_cistruct SMC_NIslands_MCArbDramTimingRegisterSet
28762306a36Sopenharmony_ci{
28862306a36Sopenharmony_ci    uint32_t mc_arb_dram_timing;
28962306a36Sopenharmony_ci    uint32_t mc_arb_dram_timing2;
29062306a36Sopenharmony_ci    uint8_t  mc_arb_rfsh_rate;
29162306a36Sopenharmony_ci    uint8_t  padding[3];
29262306a36Sopenharmony_ci};
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_citypedef struct SMC_NIslands_MCArbDramTimingRegisterSet SMC_NIslands_MCArbDramTimingRegisterSet;
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_cistruct SMC_NIslands_MCArbDramTimingRegisters
29762306a36Sopenharmony_ci{
29862306a36Sopenharmony_ci    uint8_t                                     arb_current;
29962306a36Sopenharmony_ci    uint8_t                                     reserved[3];
30062306a36Sopenharmony_ci    SMC_NIslands_MCArbDramTimingRegisterSet     data[20];
30162306a36Sopenharmony_ci};
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_citypedef struct SMC_NIslands_MCArbDramTimingRegisters SMC_NIslands_MCArbDramTimingRegisters;
30462306a36Sopenharmony_ci
30562306a36Sopenharmony_cistruct SMC_NISLANDS_SPLL_DIV_TABLE
30662306a36Sopenharmony_ci{
30762306a36Sopenharmony_ci    uint32_t    freq[256];
30862306a36Sopenharmony_ci    uint32_t    ss[256];
30962306a36Sopenharmony_ci};
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK  0x01ffffff
31262306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT 0
31362306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_MASK   0xfe000000
31462306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_PDIV_SHIFT  25
31562306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK   0x000fffff
31662306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT  0
31762306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK   0xfff00000
31862306a36Sopenharmony_ci#define SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT  20
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_citypedef struct SMC_NISLANDS_SPLL_DIV_TABLE SMC_NISLANDS_SPLL_DIV_TABLE;
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_LOCATION 0x100
32362306a36Sopenharmony_ci
32462306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_version                   0x0
32562306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_flags                     0x4
32662306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_softRegisters             0x8
32762306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_stateTable                0xC
32862306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_fanTable                  0x10
32962306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_cacTable                  0x14
33062306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_mcRegisterTable           0x20
33162306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_mcArbDramAutoRefreshTable 0x2C
33262306a36Sopenharmony_ci#define NISLANDS_SMC_FIRMWARE_HEADER_spllTable                 0x30
33362306a36Sopenharmony_ci
33462306a36Sopenharmony_ci#pragma pack(pop)
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ci#endif
33762306a36Sopenharmony_ci
338