History

drm/amdgpu: use 6.1.0 register offset for HDP CLK_CNTL

Use 6.1.0 register offset and remove unused variable. v2: clean up logic (Alex)

Lang Yu committed 3 years ago

Commit f56c1941 parent dd054841 file · +16 −4Browse files

Unified · Split

drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c+16−4
@@ -28,6 +28,9 @@ · 27 unmodified lines
2828 #include "hdp/hdp_6_0_0_sh_mask.h"
2929 #include <uapi/linux/kfd_ioctl.h>
3030
31+#define regHDP_CLK_CNTL_V6_1 0xd5
32+#define regHDP_CLK_CNTL_V6_1_BASE_IDX 0
33+
3134 static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev,
3235 struct amdgpu_ring *ring)
3336 {
@@ -40,7 +43,7 @@ static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev, · 6 unmodified lines
4043 static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev,
4144 bool enable)
4245 {
43− uint32_t hdp_clk_cntl, hdp_clk_cntl1;
46+ uint32_t hdp_clk_cntl;
4447 uint32_t hdp_mem_pwr_cntl;
4548
4649 if (!(adev->cg_flags & (AMD_CG_SUPPORT_HDP_LS |
@@ -48,14 +51,20 @@ static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev, · 1 unmodified line
4851 AMD_CG_SUPPORT_HDP_SD)))
4952 return;
5053
51− hdp_clk_cntl = hdp_clk_cntl1 = RREG32_SOC15(HDP, 0,regHDP_CLK_CNTL);
54+ if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0))
55+ hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1);
56+ else
57+ hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL);
5258 hdp_mem_pwr_cntl = RREG32_SOC15(HDP, 0, regHDP_MEM_POWER_CTRL);
5359
5460 /* Before doing clock/power mode switch,
5561 * forced on IPH & RC clock */
5662 hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
5763 RC_MEM_CLK_SOFT_OVERRIDE, 1);
58− WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
64+ if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0))
65+ WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1, hdp_clk_cntl);
66+ else
67+ WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
5968
6069 /* disable clock and power gating before any changing */
6170 hdp_mem_pwr_cntl = REG_SET_FIELD(hdp_mem_pwr_cntl, HDP_MEM_POWER_CTRL,
@@ -117,7 +126,10 @@ static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev, · 55 unmodified lines
117126 /* disable IPH & RC clock override after clock/power mode changing */
118127 hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL,
119128 RC_MEM_CLK_SOFT_OVERRIDE, 0);
120− WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
129+ if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0))
130+ WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1, hdp_clk_cntl);
131+ else
132+ WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl);
121133 }
122134
123135 static void hdp_v6_0_get_clockgating_state(struct amdgpu_device *adev,