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 * Authors: Alex Deucher 2362306a36Sopenharmony_ci */ 2462306a36Sopenharmony_ci#ifndef _SUMOD_H_ 2562306a36Sopenharmony_ci#define _SUMOD_H_ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci/* pm registers */ 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* rcu */ 3062306a36Sopenharmony_ci#define RCU_FW_VERSION 0x30c 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#define RCU_PWR_GATING_SEQ0 0x408 3362306a36Sopenharmony_ci#define RCU_PWR_GATING_SEQ1 0x40c 3462306a36Sopenharmony_ci#define RCU_PWR_GATING_CNTL 0x410 3562306a36Sopenharmony_ci# define PWR_GATING_EN (1 << 0) 3662306a36Sopenharmony_ci# define RSVD_MASK (0x3 << 1) 3762306a36Sopenharmony_ci# define PCV(x) ((x) << 3) 3862306a36Sopenharmony_ci# define PCV_MASK (0x1f << 3) 3962306a36Sopenharmony_ci# define PCV_SHIFT 3 4062306a36Sopenharmony_ci# define PCP(x) ((x) << 8) 4162306a36Sopenharmony_ci# define PCP_MASK (0xf << 8) 4262306a36Sopenharmony_ci# define PCP_SHIFT 8 4362306a36Sopenharmony_ci# define RPW(x) ((x) << 16) 4462306a36Sopenharmony_ci# define RPW_MASK (0xf << 16) 4562306a36Sopenharmony_ci# define RPW_SHIFT 16 4662306a36Sopenharmony_ci# define ID(x) ((x) << 24) 4762306a36Sopenharmony_ci# define ID_MASK (0xf << 24) 4862306a36Sopenharmony_ci# define ID_SHIFT 24 4962306a36Sopenharmony_ci# define PGS(x) ((x) << 28) 5062306a36Sopenharmony_ci# define PGS_MASK (0xf << 28) 5162306a36Sopenharmony_ci# define PGS_SHIFT 28 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci#define RCU_ALTVDDNB_NOTIFY 0x430 5462306a36Sopenharmony_ci#define RCU_LCLK_SCALING_CNTL 0x434 5562306a36Sopenharmony_ci# define LCLK_SCALING_EN (1 << 0) 5662306a36Sopenharmony_ci# define LCLK_SCALING_TYPE (1 << 1) 5762306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PRESCALER(x) ((x) << 4) 5862306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PRESCALER_MASK (0xf << 4) 5962306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PRESCALER_SHIFT 4 6062306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PERIOD(x) ((x) << 16) 6162306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PERIOD_MASK (0xf << 16) 6262306a36Sopenharmony_ci# define LCLK_SCALING_TIMER_PERIOD_SHIFT 16 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define RCU_PWR_GATING_CNTL_2 0x4a0 6562306a36Sopenharmony_ci# define MPPU(x) ((x) << 0) 6662306a36Sopenharmony_ci# define MPPU_MASK (0xffff << 0) 6762306a36Sopenharmony_ci# define MPPU_SHIFT 0 6862306a36Sopenharmony_ci# define MPPD(x) ((x) << 16) 6962306a36Sopenharmony_ci# define MPPD_MASK (0xffff << 16) 7062306a36Sopenharmony_ci# define MPPD_SHIFT 16 7162306a36Sopenharmony_ci#define RCU_PWR_GATING_CNTL_3 0x4a4 7262306a36Sopenharmony_ci# define DPPU(x) ((x) << 0) 7362306a36Sopenharmony_ci# define DPPU_MASK (0xffff << 0) 7462306a36Sopenharmony_ci# define DPPU_SHIFT 0 7562306a36Sopenharmony_ci# define DPPD(x) ((x) << 16) 7662306a36Sopenharmony_ci# define DPPD_MASK (0xffff << 16) 7762306a36Sopenharmony_ci# define DPPD_SHIFT 16 7862306a36Sopenharmony_ci#define RCU_PWR_GATING_CNTL_4 0x4a8 7962306a36Sopenharmony_ci# define RT(x) ((x) << 0) 8062306a36Sopenharmony_ci# define RT_MASK (0xffff << 0) 8162306a36Sopenharmony_ci# define RT_SHIFT 0 8262306a36Sopenharmony_ci# define IT(x) ((x) << 16) 8362306a36Sopenharmony_ci# define IT_MASK (0xffff << 16) 8462306a36Sopenharmony_ci# define IT_SHIFT 16 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci/* yes these two have the same address */ 8762306a36Sopenharmony_ci#define RCU_PWR_GATING_CNTL_5 0x504 8862306a36Sopenharmony_ci#define RCU_GPU_BOOST_DISABLE 0x508 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci#define MCU_M3ARB_INDEX 0x504 9162306a36Sopenharmony_ci#define MCU_M3ARB_PARAMS 0x508 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci#define RCU_GNB_PWR_REP_TIMER_CNTL 0x50C 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define RCU_SclkDpmTdpLimit01 0x514 9662306a36Sopenharmony_ci#define RCU_SclkDpmTdpLimit23 0x518 9762306a36Sopenharmony_ci#define RCU_SclkDpmTdpLimit47 0x51C 9862306a36Sopenharmony_ci#define RCU_SclkDpmTdpLimitPG 0x520 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci#define GNB_TDP_LIMIT 0x540 10162306a36Sopenharmony_ci#define RCU_BOOST_MARGIN 0x544 10262306a36Sopenharmony_ci#define RCU_THROTTLE_MARGIN 0x548 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define SMU_PCIE_PG_ARGS 0x58C 10562306a36Sopenharmony_ci#define SMU_PCIE_PG_ARGS_2 0x598 10662306a36Sopenharmony_ci#define SMU_PCIE_PG_ARGS_3 0x59C 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci/* mmio */ 10962306a36Sopenharmony_ci#define RCU_STATUS 0x11c 11062306a36Sopenharmony_ci# define GMC_PWR_GATER_BUSY (1 << 8) 11162306a36Sopenharmony_ci# define GFX_PWR_GATER_BUSY (1 << 9) 11262306a36Sopenharmony_ci# define UVD_PWR_GATER_BUSY (1 << 10) 11362306a36Sopenharmony_ci# define PCIE_PWR_GATER_BUSY (1 << 11) 11462306a36Sopenharmony_ci# define GMC_PWR_GATER_STATE (1 << 12) 11562306a36Sopenharmony_ci# define GFX_PWR_GATER_STATE (1 << 13) 11662306a36Sopenharmony_ci# define UVD_PWR_GATER_STATE (1 << 14) 11762306a36Sopenharmony_ci# define PCIE_PWR_GATER_STATE (1 << 15) 11862306a36Sopenharmony_ci# define GFX1_PWR_GATER_BUSY (1 << 16) 11962306a36Sopenharmony_ci# define GFX2_PWR_GATER_BUSY (1 << 17) 12062306a36Sopenharmony_ci# define GFX1_PWR_GATER_STATE (1 << 18) 12162306a36Sopenharmony_ci# define GFX2_PWR_GATER_STATE (1 << 19) 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define GFX_INT_REQ 0x120 12462306a36Sopenharmony_ci# define INT_REQ (1 << 0) 12562306a36Sopenharmony_ci# define SERV_INDEX(x) ((x) << 1) 12662306a36Sopenharmony_ci# define SERV_INDEX_MASK (0xff << 1) 12762306a36Sopenharmony_ci# define SERV_INDEX_SHIFT 1 12862306a36Sopenharmony_ci#define GFX_INT_STATUS 0x124 12962306a36Sopenharmony_ci# define INT_ACK (1 << 0) 13062306a36Sopenharmony_ci# define INT_DONE (1 << 1) 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci#define CG_SCLK_CNTL 0x600 13362306a36Sopenharmony_ci# define SCLK_DIVIDER(x) ((x) << 0) 13462306a36Sopenharmony_ci# define SCLK_DIVIDER_MASK (0x7f << 0) 13562306a36Sopenharmony_ci# define SCLK_DIVIDER_SHIFT 0 13662306a36Sopenharmony_ci#define CG_SCLK_STATUS 0x604 13762306a36Sopenharmony_ci# define SCLK_OVERCLK_DETECT (1 << 2) 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci#define CG_DCLK_CNTL 0x610 14062306a36Sopenharmony_ci# define DCLK_DIVIDER_MASK 0x7f 14162306a36Sopenharmony_ci# define DCLK_DIR_CNTL_EN (1 << 8) 14262306a36Sopenharmony_ci#define CG_DCLK_STATUS 0x614 14362306a36Sopenharmony_ci# define DCLK_STATUS (1 << 0) 14462306a36Sopenharmony_ci#define CG_VCLK_CNTL 0x618 14562306a36Sopenharmony_ci# define VCLK_DIVIDER_MASK 0x7f 14662306a36Sopenharmony_ci# define VCLK_DIR_CNTL_EN (1 << 8) 14762306a36Sopenharmony_ci#define CG_VCLK_STATUS 0x61c 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci#define GENERAL_PWRMGT 0x63c 15062306a36Sopenharmony_ci# define STATIC_PM_EN (1 << 1) 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ci#define SCLK_PWRMGT_CNTL 0x644 15362306a36Sopenharmony_ci# define SCLK_PWRMGT_OFF (1 << 0) 15462306a36Sopenharmony_ci# define SCLK_LOW_D1 (1 << 1) 15562306a36Sopenharmony_ci# define FIR_RESET (1 << 4) 15662306a36Sopenharmony_ci# define FIR_FORCE_TREND_SEL (1 << 5) 15762306a36Sopenharmony_ci# define FIR_TREND_MODE (1 << 6) 15862306a36Sopenharmony_ci# define DYN_GFX_CLK_OFF_EN (1 << 7) 15962306a36Sopenharmony_ci# define GFX_CLK_FORCE_ON (1 << 8) 16062306a36Sopenharmony_ci# define GFX_CLK_REQUEST_OFF (1 << 9) 16162306a36Sopenharmony_ci# define GFX_CLK_FORCE_OFF (1 << 10) 16262306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D1 (1 << 11) 16362306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D2 (1 << 12) 16462306a36Sopenharmony_ci# define GFX_CLK_OFF_ACPI_D3 (1 << 13) 16562306a36Sopenharmony_ci# define GFX_VOLTAGE_CHANGE_EN (1 << 16) 16662306a36Sopenharmony_ci# define GFX_VOLTAGE_CHANGE_MODE (1 << 17) 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c 16962306a36Sopenharmony_ci# define TARG_SCLK_INDEX(x) ((x) << 6) 17062306a36Sopenharmony_ci# define TARG_SCLK_INDEX_MASK (0x7 << 6) 17162306a36Sopenharmony_ci# define TARG_SCLK_INDEX_SHIFT 6 17262306a36Sopenharmony_ci# define CURR_SCLK_INDEX(x) ((x) << 9) 17362306a36Sopenharmony_ci# define CURR_SCLK_INDEX_MASK (0x7 << 9) 17462306a36Sopenharmony_ci# define CURR_SCLK_INDEX_SHIFT 9 17562306a36Sopenharmony_ci# define TARG_INDEX(x) ((x) << 12) 17662306a36Sopenharmony_ci# define TARG_INDEX_MASK (0x7 << 12) 17762306a36Sopenharmony_ci# define TARG_INDEX_SHIFT 12 17862306a36Sopenharmony_ci# define CURR_INDEX(x) ((x) << 15) 17962306a36Sopenharmony_ci# define CURR_INDEX_MASK (0x7 << 15) 18062306a36Sopenharmony_ci# define CURR_INDEX_SHIFT 15 18162306a36Sopenharmony_ci 18262306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL 0x684 18362306a36Sopenharmony_ci# define SCLK_FSTATE_0_DIV(x) ((x) << 0) 18462306a36Sopenharmony_ci# define SCLK_FSTATE_0_DIV_MASK (0x7f << 0) 18562306a36Sopenharmony_ci# define SCLK_FSTATE_0_DIV_SHIFT 0 18662306a36Sopenharmony_ci# define SCLK_FSTATE_0_VLD (1 << 7) 18762306a36Sopenharmony_ci# define SCLK_FSTATE_1_DIV(x) ((x) << 8) 18862306a36Sopenharmony_ci# define SCLK_FSTATE_1_DIV_MASK (0x7f << 8) 18962306a36Sopenharmony_ci# define SCLK_FSTATE_1_DIV_SHIFT 8 19062306a36Sopenharmony_ci# define SCLK_FSTATE_1_VLD (1 << 15) 19162306a36Sopenharmony_ci# define SCLK_FSTATE_2_DIV(x) ((x) << 16) 19262306a36Sopenharmony_ci# define SCLK_FSTATE_2_DIV_MASK (0x7f << 16) 19362306a36Sopenharmony_ci# define SCLK_FSTATE_2_DIV_SHIFT 16 19462306a36Sopenharmony_ci# define SCLK_FSTATE_2_VLD (1 << 23) 19562306a36Sopenharmony_ci# define SCLK_FSTATE_3_DIV(x) ((x) << 24) 19662306a36Sopenharmony_ci# define SCLK_FSTATE_3_DIV_MASK (0x7f << 24) 19762306a36Sopenharmony_ci# define SCLK_FSTATE_3_DIV_SHIFT 24 19862306a36Sopenharmony_ci# define SCLK_FSTATE_3_VLD (1 << 31) 19962306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_2 0x688 20062306a36Sopenharmony_ci#define CG_GCOOR 0x68c 20162306a36Sopenharmony_ci# define PHC(x) ((x) << 0) 20262306a36Sopenharmony_ci# define PHC_MASK (0x1f << 0) 20362306a36Sopenharmony_ci# define PHC_SHIFT 0 20462306a36Sopenharmony_ci# define SDC(x) ((x) << 9) 20562306a36Sopenharmony_ci# define SDC_MASK (0x3ff << 9) 20662306a36Sopenharmony_ci# define SDC_SHIFT 9 20762306a36Sopenharmony_ci# define SU(x) ((x) << 23) 20862306a36Sopenharmony_ci# define SU_MASK (0xf << 23) 20962306a36Sopenharmony_ci# define SU_SHIFT 23 21062306a36Sopenharmony_ci# define DIV_ID(x) ((x) << 28) 21162306a36Sopenharmony_ci# define DIV_ID_MASK (0x7 << 28) 21262306a36Sopenharmony_ci# define DIV_ID_SHIFT 28 21362306a36Sopenharmony_ci 21462306a36Sopenharmony_ci#define CG_FTV 0x690 21562306a36Sopenharmony_ci#define CG_FFCT_0 0x694 21662306a36Sopenharmony_ci# define UTC_0(x) ((x) << 0) 21762306a36Sopenharmony_ci# define UTC_0_MASK (0x3ff << 0) 21862306a36Sopenharmony_ci# define UTC_0_SHIFT 0 21962306a36Sopenharmony_ci# define DTC_0(x) ((x) << 10) 22062306a36Sopenharmony_ci# define DTC_0_MASK (0x3ff << 10) 22162306a36Sopenharmony_ci# define DTC_0_SHIFT 10 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_ci#define CG_GIT 0x6d8 22462306a36Sopenharmony_ci# define CG_GICST(x) ((x) << 0) 22562306a36Sopenharmony_ci# define CG_GICST_MASK (0xffff << 0) 22662306a36Sopenharmony_ci# define CG_GICST_SHIFT 0 22762306a36Sopenharmony_ci# define CG_GIPOT(x) ((x) << 16) 22862306a36Sopenharmony_ci# define CG_GIPOT_MASK (0xffff << 16) 22962306a36Sopenharmony_ci# define CG_GIPOT_SHIFT 16 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_3 0x6e0 23262306a36Sopenharmony_ci# define FORCE_SCLK_STATE(x) ((x) << 0) 23362306a36Sopenharmony_ci# define FORCE_SCLK_STATE_MASK (0x7 << 0) 23462306a36Sopenharmony_ci# define FORCE_SCLK_STATE_SHIFT 0 23562306a36Sopenharmony_ci# define FORCE_SCLK_STATE_EN (1 << 3) 23662306a36Sopenharmony_ci# define GNB_TT(x) ((x) << 8) 23762306a36Sopenharmony_ci# define GNB_TT_MASK (0xff << 8) 23862306a36Sopenharmony_ci# define GNB_TT_SHIFT 8 23962306a36Sopenharmony_ci# define GNB_THERMTHRO_MASK (1 << 16) 24062306a36Sopenharmony_ci# define CNB_THERMTHRO_MASK_SCLK (1 << 17) 24162306a36Sopenharmony_ci# define DPM_SCLK_ENABLE (1 << 18) 24262306a36Sopenharmony_ci# define GNB_SLOW_FSTATE_0_MASK (1 << 23) 24362306a36Sopenharmony_ci# define GNB_SLOW_FSTATE_0_SHIFT 23 24462306a36Sopenharmony_ci# define FORCE_NB_PSTATE_1 (1 << 31) 24562306a36Sopenharmony_ci 24662306a36Sopenharmony_ci#define CG_SSP 0x6e8 24762306a36Sopenharmony_ci# define SST(x) ((x) << 0) 24862306a36Sopenharmony_ci# define SST_MASK (0xffff << 0) 24962306a36Sopenharmony_ci# define SST_SHIFT 0 25062306a36Sopenharmony_ci# define SSTU(x) ((x) << 16) 25162306a36Sopenharmony_ci# define SSTU_MASK (0xffff << 16) 25262306a36Sopenharmony_ci# define SSTU_SHIFT 16 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_ci#define CG_ACPI_CNTL 0x70c 25562306a36Sopenharmony_ci# define SCLK_ACPI_DIV(x) ((x) << 0) 25662306a36Sopenharmony_ci# define SCLK_ACPI_DIV_MASK (0x7f << 0) 25762306a36Sopenharmony_ci# define SCLK_ACPI_DIV_SHIFT 0 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_4 0x71c 26062306a36Sopenharmony_ci# define DC_HDC(x) ((x) << 14) 26162306a36Sopenharmony_ci# define DC_HDC_MASK (0x3fff << 14) 26262306a36Sopenharmony_ci# define DC_HDC_SHIFT 14 26362306a36Sopenharmony_ci# define DC_HU(x) ((x) << 28) 26462306a36Sopenharmony_ci# define DC_HU_MASK (0xf << 28) 26562306a36Sopenharmony_ci# define DC_HU_SHIFT 28 26662306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_5 0x720 26762306a36Sopenharmony_ci# define SCLK_FSTATE_BOOTUP(x) ((x) << 0) 26862306a36Sopenharmony_ci# define SCLK_FSTATE_BOOTUP_MASK (0x7 << 0) 26962306a36Sopenharmony_ci# define SCLK_FSTATE_BOOTUP_SHIFT 0 27062306a36Sopenharmony_ci# define TT_TP(x) ((x) << 3) 27162306a36Sopenharmony_ci# define TT_TP_MASK (0xffff << 3) 27262306a36Sopenharmony_ci# define TT_TP_SHIFT 3 27362306a36Sopenharmony_ci# define TT_TU(x) ((x) << 19) 27462306a36Sopenharmony_ci# define TT_TU_MASK (0xff << 19) 27562306a36Sopenharmony_ci# define TT_TU_SHIFT 19 27662306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_6 0x724 27762306a36Sopenharmony_ci#define CG_AT_0 0x728 27862306a36Sopenharmony_ci# define CG_R(x) ((x) << 0) 27962306a36Sopenharmony_ci# define CG_R_MASK (0xffff << 0) 28062306a36Sopenharmony_ci# define CG_R_SHIFT 0 28162306a36Sopenharmony_ci# define CG_L(x) ((x) << 16) 28262306a36Sopenharmony_ci# define CG_L_MASK (0xffff << 16) 28362306a36Sopenharmony_ci# define CG_L_SHIFT 16 28462306a36Sopenharmony_ci#define CG_AT_1 0x72c 28562306a36Sopenharmony_ci#define CG_AT_2 0x730 28662306a36Sopenharmony_ci#define CG_THERMAL_INT 0x734 28762306a36Sopenharmony_ci#define DIG_THERM_INTH(x) ((x) << 8) 28862306a36Sopenharmony_ci#define DIG_THERM_INTH_MASK 0x0000FF00 28962306a36Sopenharmony_ci#define DIG_THERM_INTH_SHIFT 8 29062306a36Sopenharmony_ci#define DIG_THERM_INTL(x) ((x) << 16) 29162306a36Sopenharmony_ci#define DIG_THERM_INTL_MASK 0x00FF0000 29262306a36Sopenharmony_ci#define DIG_THERM_INTL_SHIFT 16 29362306a36Sopenharmony_ci#define THERM_INT_MASK_HIGH (1 << 24) 29462306a36Sopenharmony_ci#define THERM_INT_MASK_LOW (1 << 25) 29562306a36Sopenharmony_ci#define CG_AT_3 0x738 29662306a36Sopenharmony_ci#define CG_AT_4 0x73c 29762306a36Sopenharmony_ci#define CG_AT_5 0x740 29862306a36Sopenharmony_ci#define CG_AT_6 0x744 29962306a36Sopenharmony_ci#define CG_AT_7 0x748 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_ci#define CG_BSP_0 0x750 30262306a36Sopenharmony_ci# define BSP(x) ((x) << 0) 30362306a36Sopenharmony_ci# define BSP_MASK (0xffff << 0) 30462306a36Sopenharmony_ci# define BSP_SHIFT 0 30562306a36Sopenharmony_ci# define BSU(x) ((x) << 16) 30662306a36Sopenharmony_ci# define BSU_MASK (0xf << 16) 30762306a36Sopenharmony_ci# define BSU_SHIFT 16 30862306a36Sopenharmony_ci 30962306a36Sopenharmony_ci#define CG_CG_VOLTAGE_CNTL 0x770 31062306a36Sopenharmony_ci# define REQ (1 << 0) 31162306a36Sopenharmony_ci# define LEVEL(x) ((x) << 1) 31262306a36Sopenharmony_ci# define LEVEL_MASK (0x3 << 1) 31362306a36Sopenharmony_ci# define LEVEL_SHIFT 1 31462306a36Sopenharmony_ci# define CG_VOLTAGE_EN (1 << 3) 31562306a36Sopenharmony_ci# define FORCE (1 << 4) 31662306a36Sopenharmony_ci# define PERIOD(x) ((x) << 8) 31762306a36Sopenharmony_ci# define PERIOD_MASK (0xffff << 8) 31862306a36Sopenharmony_ci# define PERIOD_SHIFT 8 31962306a36Sopenharmony_ci# define UNIT(x) ((x) << 24) 32062306a36Sopenharmony_ci# define UNIT_MASK (0xf << 24) 32162306a36Sopenharmony_ci# define UNIT_SHIFT 24 32262306a36Sopenharmony_ci 32362306a36Sopenharmony_ci#define CG_ACPI_VOLTAGE_CNTL 0x780 32462306a36Sopenharmony_ci# define ACPI_VOLTAGE_EN (1 << 8) 32562306a36Sopenharmony_ci 32662306a36Sopenharmony_ci#define CG_DPM_VOLTAGE_CNTL 0x788 32762306a36Sopenharmony_ci# define DPM_STATE0_LEVEL_MASK (0x3 << 0) 32862306a36Sopenharmony_ci# define DPM_STATE0_LEVEL_SHIFT 0 32962306a36Sopenharmony_ci# define DPM_VOLTAGE_EN (1 << 16) 33062306a36Sopenharmony_ci 33162306a36Sopenharmony_ci#define CG_PWR_GATING_CNTL 0x7ac 33262306a36Sopenharmony_ci# define DYN_PWR_DOWN_EN (1 << 0) 33362306a36Sopenharmony_ci# define ACPI_PWR_DOWN_EN (1 << 1) 33462306a36Sopenharmony_ci# define GFX_CLK_OFF_PWR_DOWN_EN (1 << 2) 33562306a36Sopenharmony_ci# define IOC_DISGPU_PWR_DOWN_EN (1 << 3) 33662306a36Sopenharmony_ci# define FORCE_POWR_ON (1 << 4) 33762306a36Sopenharmony_ci# define PGP(x) ((x) << 8) 33862306a36Sopenharmony_ci# define PGP_MASK (0xffff << 8) 33962306a36Sopenharmony_ci# define PGP_SHIFT 8 34062306a36Sopenharmony_ci# define PGU(x) ((x) << 24) 34162306a36Sopenharmony_ci# define PGU_MASK (0xf << 24) 34262306a36Sopenharmony_ci# define PGU_SHIFT 24 34362306a36Sopenharmony_ci 34462306a36Sopenharmony_ci#define CG_CGTT_LOCAL_0 0x7d0 34562306a36Sopenharmony_ci#define CG_CGTT_LOCAL_1 0x7d4 34662306a36Sopenharmony_ci 34762306a36Sopenharmony_ci#define DEEP_SLEEP_CNTL 0x818 34862306a36Sopenharmony_ci# define R_DIS (1 << 3) 34962306a36Sopenharmony_ci# define HS(x) ((x) << 4) 35062306a36Sopenharmony_ci# define HS_MASK (0xfff << 4) 35162306a36Sopenharmony_ci# define HS_SHIFT 4 35262306a36Sopenharmony_ci# define ENABLE_DS (1 << 31) 35362306a36Sopenharmony_ci#define DEEP_SLEEP_CNTL2 0x81c 35462306a36Sopenharmony_ci# define LB_UFP_EN (1 << 0) 35562306a36Sopenharmony_ci# define INOUT_C(x) ((x) << 4) 35662306a36Sopenharmony_ci# define INOUT_C_MASK (0xff << 4) 35762306a36Sopenharmony_ci# define INOUT_C_SHIFT 4 35862306a36Sopenharmony_ci 35962306a36Sopenharmony_ci#define CG_SCRATCH2 0x824 36062306a36Sopenharmony_ci 36162306a36Sopenharmony_ci#define CG_SCLK_DPM_CTRL_11 0x830 36262306a36Sopenharmony_ci 36362306a36Sopenharmony_ci#define HW_REV 0x5564 36462306a36Sopenharmony_ci# define ATI_REV_ID_MASK (0xf << 28) 36562306a36Sopenharmony_ci# define ATI_REV_ID_SHIFT 28 36662306a36Sopenharmony_ci/* 0 = A0, 1 = A1, 2 = B0, 3 = C0, etc. */ 36762306a36Sopenharmony_ci 36862306a36Sopenharmony_ci#define DOUT_SCRATCH3 0x611c 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ci#define GB_ADDR_CONFIG 0x98f8 37162306a36Sopenharmony_ci 37262306a36Sopenharmony_ci#endif 373