aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorYong Zhao <yong.zhao@amd.com>2017-12-21 16:19:03 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-19 14:17:38 -0500
commitc8553f4bd29d681706dd97519e2daddf90505978 (patch)
treefcf3b0f7071236cff64b1c743a35f223b3e02b66 /drivers/gpu/drm/amd
parent6d9ac917e6269c3446e19cb6adecd51aefa5fedf (diff)
drm/amdgpu: Update MMHUB power gating register settings
The new register settings are needed to fix a tlb invalidation issue when MMHUB power gating is turned on for Raven. Signed-off-by: Yong Zhao <yong.zhao@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Eric Huang <JinhuiEric.Huang@amd.com> Reviewed-by: Eric Huang <JinhuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
index ffd5b7ee49c4..bdf94c61f246 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
@@ -272,21 +272,21 @@ static const struct pctl_data pctl0_data[] = {
272 {0x11, 0x6a684}, 272 {0x11, 0x6a684},
273 {0x19, 0xea68e}, 273 {0x19, 0xea68e},
274 {0x29, 0xa69e}, 274 {0x29, 0xa69e},
275 {0x2b, 0x34a6c0}, 275 {0x2b, 0x0010a6c0},
276 {0x61, 0x83a707}, 276 {0x3d, 0x83a707},
277 {0xe6, 0x8a7a4}, 277 {0xc2, 0x8a7a4},
278 {0xf0, 0x1a7b8}, 278 {0xcc, 0x1a7b8},
279 {0xf3, 0xfa7cc}, 279 {0xcf, 0xfa7cc},
280 {0x104, 0x17a7dd}, 280 {0xe0, 0x17a7dd},
281 {0x11d, 0xa7dc}, 281 {0xf9, 0xa7dc},
282 {0x11f, 0x12a7f5}, 282 {0xfb, 0x12a7f5},
283 {0x133, 0xa808}, 283 {0x10f, 0xa808},
284 {0x135, 0x12a810}, 284 {0x111, 0x12a810},
285 {0x149, 0x7a82c} 285 {0x125, 0x7a82c}
286}; 286};
287#define PCTL0_DATA_LEN (ARRAY_SIZE(pctl0_data)) 287#define PCTL0_DATA_LEN (ARRAY_SIZE(pctl0_data))
288 288
289#define PCTL0_RENG_EXEC_END_PTR 0x151 289#define PCTL0_RENG_EXEC_END_PTR 0x12d
290#define PCTL0_STCTRL_REG_SAVE_RANGE0_BASE 0xa640 290#define PCTL0_STCTRL_REG_SAVE_RANGE0_BASE 0xa640
291#define PCTL0_STCTRL_REG_SAVE_RANGE0_LIMIT 0xa833 291#define PCTL0_STCTRL_REG_SAVE_RANGE0_LIMIT 0xa833
292 292
@@ -385,10 +385,9 @@ void mmhub_v1_0_initialize_power_gating(struct amdgpu_device *adev)
385 if (amdgpu_sriov_vf(adev)) 385 if (amdgpu_sriov_vf(adev))
386 return; 386 return;
387 387
388 /****************** pctl0 **********************/
388 pctl0_misc = RREG32_SOC15(MMHUB, 0, mmPCTL0_MISC); 389 pctl0_misc = RREG32_SOC15(MMHUB, 0, mmPCTL0_MISC);
389 pctl0_reng_execute = RREG32_SOC15(MMHUB, 0, mmPCTL0_RENG_EXECUTE); 390 pctl0_reng_execute = RREG32_SOC15(MMHUB, 0, mmPCTL0_RENG_EXECUTE);
390 pctl1_misc = RREG32_SOC15(MMHUB, 0, mmPCTL1_MISC);
391 pctl1_reng_execute = RREG32_SOC15(MMHUB, 0, mmPCTL1_RENG_EXECUTE);
392 391
393 /* Light sleep must be disabled before writing to pctl0 registers */ 392 /* Light sleep must be disabled before writing to pctl0 registers */
394 pctl0_misc &= ~PCTL0_MISC__RENG_MEM_LS_ENABLE_MASK; 393 pctl0_misc &= ~PCTL0_MISC__RENG_MEM_LS_ENABLE_MASK;
@@ -402,12 +401,13 @@ void mmhub_v1_0_initialize_power_gating(struct amdgpu_device *adev)
402 pctl0_data[i].data); 401 pctl0_data[i].data);
403 } 402 }
404 403
405 /* Set the reng execute end ptr for pctl0 */ 404 /* Re-enable light sleep */
406 pctl0_reng_execute = REG_SET_FIELD(pctl0_reng_execute, 405 pctl0_misc |= PCTL0_MISC__RENG_MEM_LS_ENABLE_MASK;
407 PCTL0_RENG_EXECUTE, 406 WREG32_SOC15(MMHUB, 0, mmPCTL0_MISC, pctl0_misc);
408 RENG_EXECUTE_END_PTR, 407
409 PCTL0_RENG_EXEC_END_PTR); 408 /****************** pctl1 **********************/
410 WREG32_SOC15(MMHUB, 0, mmPCTL0_RENG_EXECUTE, pctl0_reng_execute); 409 pctl1_misc = RREG32_SOC15(MMHUB, 0, mmPCTL1_MISC);
410 pctl1_reng_execute = RREG32_SOC15(MMHUB, 0, mmPCTL1_RENG_EXECUTE);
411 411
412 /* Light sleep must be disabled before writing to pctl1 registers */ 412 /* Light sleep must be disabled before writing to pctl1 registers */
413 pctl1_misc &= ~PCTL1_MISC__RENG_MEM_LS_ENABLE_MASK; 413 pctl1_misc &= ~PCTL1_MISC__RENG_MEM_LS_ENABLE_MASK;
@@ -421,20 +421,25 @@ void mmhub_v1_0_initialize_power_gating(struct amdgpu_device *adev)
421 pctl1_data[i].data); 421 pctl1_data[i].data);
422 } 422 }
423 423
424 /* Re-enable light sleep */
425 pctl1_misc |= PCTL1_MISC__RENG_MEM_LS_ENABLE_MASK;
426 WREG32_SOC15(MMHUB, 0, mmPCTL1_MISC, pctl1_misc);
427
428 mmhub_v1_0_power_gating_write_save_ranges(adev);
429
430 /* Set the reng execute end ptr for pctl0 */
431 pctl0_reng_execute = REG_SET_FIELD(pctl0_reng_execute,
432 PCTL0_RENG_EXECUTE,
433 RENG_EXECUTE_END_PTR,
434 PCTL0_RENG_EXEC_END_PTR);
435 WREG32_SOC15(MMHUB, 0, mmPCTL0_RENG_EXECUTE, pctl0_reng_execute);
436
424 /* Set the reng execute end ptr for pctl1 */ 437 /* Set the reng execute end ptr for pctl1 */
425 pctl1_reng_execute = REG_SET_FIELD(pctl1_reng_execute, 438 pctl1_reng_execute = REG_SET_FIELD(pctl1_reng_execute,
426 PCTL1_RENG_EXECUTE, 439 PCTL1_RENG_EXECUTE,
427 RENG_EXECUTE_END_PTR, 440 RENG_EXECUTE_END_PTR,
428 PCTL1_RENG_EXEC_END_PTR); 441 PCTL1_RENG_EXEC_END_PTR);
429 WREG32_SOC15(MMHUB, 0, mmPCTL1_RENG_EXECUTE, pctl1_reng_execute); 442 WREG32_SOC15(MMHUB, 0, mmPCTL1_RENG_EXECUTE, pctl1_reng_execute);
430
431 mmhub_v1_0_power_gating_write_save_ranges(adev);
432
433 /* Re-enable light sleep */
434 pctl0_misc |= PCTL0_MISC__RENG_MEM_LS_ENABLE_MASK;
435 WREG32_SOC15(MMHUB, 0, mmPCTL0_MISC, pctl0_misc);
436 pctl1_misc |= PCTL1_MISC__RENG_MEM_LS_ENABLE_MASK;
437 WREG32_SOC15(MMHUB, 0, mmPCTL1_MISC, pctl1_misc);
438} 443}
439 444
440void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev, 445void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev,