aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
diff options
context:
space:
mode:
authorHuang Rui <[email protected]>2022-05-20 03:04:04 +0000
committerAlex Deucher <[email protected]>2022-06-03 20:43:38 +0000
commit542a0f2ef9ea2ccfadf2b8a3b53368c61fc97a0f (patch)
tree2a71405fe13a593e2509694a620ab013a64010e5 /drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
parentdrm/amd/display: Use DTBCLK for valid pixel clock (diff)
downloadkernel-542a0f2ef9ea2ccfadf2b8a3b53368c61fc97a0f.tar.gz
kernel-542a0f2ef9ea2ccfadf2b8a3b53368c61fc97a0f.zip
drm/amdgpu: introduce two work mode for imu
IMU has two work mode such as debug mode and mission mode. Current GC v11_0_0 is using the debug mode. Acked-by: Alex Deucher <[email protected]> Signed-off-by: Huang Rui <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/imu_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/imu_v11_0.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
index d63d3f2b8a16..05d2b93a534c 100644
--- a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
@@ -125,9 +125,11 @@ static void imu_v11_0_setup(struct amdgpu_device *adev)
WREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_ACCESS_CTRL0, 0xffffff);
WREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_ACCESS_CTRL1, 0xffff);
- imu_reg_val = RREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_16);
- imu_reg_val |= 0x1;
- WREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_16, imu_reg_val);
+ if (adev->gfx.imu.mode == DEBUG_MODE) {
+ imu_reg_val = RREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_16);
+ imu_reg_val |= 0x1;
+ WREG32_SOC15(GC, 0, regGFX_IMU_C2PMSG_16, imu_reg_val);
+ }
//disble imu Rtavfs, SmsRepair, DfllBTC, and ClkB
imu_reg_val = RREG32_SOC15(GC, 0, regGFX_IMU_SCRATCH_10);
@@ -144,16 +146,18 @@ static int imu_v11_0_start(struct amdgpu_device *adev)
imu_reg_val &= 0xfffffffe;
WREG32_SOC15(GC, 0, regGFX_IMU_CORE_CTRL, imu_reg_val);
- for (i = 0; i < adev->usec_timeout; i++) {
- imu_reg_val = RREG32_SOC15(GC, 0, regGFX_IMU_GFX_RESET_CTRL);
- if ((imu_reg_val & 0x1f) == 0x1f)
- break;
- udelay(1);
- }
+ if (adev->gfx.imu.mode == DEBUG_MODE) {
+ for (i = 0; i < adev->usec_timeout; i++) {
+ imu_reg_val = RREG32_SOC15(GC, 0, regGFX_IMU_GFX_RESET_CTRL);
+ if ((imu_reg_val & 0x1f) == 0x1f)
+ break;
+ udelay(1);
+ }
- if (i >= adev->usec_timeout) {
- dev_err(adev->dev, "init imu: IMU start timeout\n");
- return -ETIMEDOUT;
+ if (i >= adev->usec_timeout) {
+ dev_err(adev->dev, "init imu: IMU start timeout\n");
+ return -ETIMEDOUT;
+ }
}
return 0;