diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index c9929d665c01..670413fc37d0 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -385,8 +385,8 @@ static int uvd_v6_0_start(struct amdgpu_device *adev) | |||
385 | uint32_t mp_swap_cntl; | 385 | uint32_t mp_swap_cntl; |
386 | int i, j, r; | 386 | int i, j, r; |
387 | 387 | ||
388 | /*disable DPG */ | 388 | /* disable DPG */ |
389 | WREG32_P(mmUVD_POWER_STATUS, 0, ~(1 << 2)); | 389 | WREG32_P(mmUVD_POWER_STATUS, 0, ~UVD_POWER_STATUS__UVD_PG_MODE_MASK); |
390 | 390 | ||
391 | /* disable byte swapping */ | 391 | /* disable byte swapping */ |
392 | lmi_swap_cntl = 0; | 392 | lmi_swap_cntl = 0; |
@@ -405,17 +405,21 @@ static int uvd_v6_0_start(struct amdgpu_device *adev) | |||
405 | } | 405 | } |
406 | 406 | ||
407 | /* disable interupt */ | 407 | /* disable interupt */ |
408 | WREG32_P(mmUVD_MASTINT_EN, 0, ~(1 << 1)); | 408 | WREG32_P(mmUVD_MASTINT_EN, 0, ~UVD_MASTINT_EN__VCPU_EN_MASK); |
409 | 409 | ||
410 | /* stall UMC and register bus before resetting VCPU */ | 410 | /* stall UMC and register bus before resetting VCPU */ |
411 | WREG32_P(mmUVD_LMI_CTRL2, 1 << 8, ~(1 << 8)); | 411 | WREG32_P(mmUVD_LMI_CTRL2, UVD_LMI_CTRL2__STALL_ARB_UMC_MASK, ~UVD_LMI_CTRL2__STALL_ARB_UMC_MASK); |
412 | mdelay(1); | 412 | mdelay(1); |
413 | 413 | ||
414 | /* put LMI, VCPU, RBC etc... into reset */ | 414 | /* put LMI, VCPU, RBC etc... into reset */ |
415 | WREG32(mmUVD_SOFT_RESET, UVD_SOFT_RESET__LMI_SOFT_RESET_MASK | | 415 | WREG32(mmUVD_SOFT_RESET, |
416 | UVD_SOFT_RESET__VCPU_SOFT_RESET_MASK | UVD_SOFT_RESET__LBSI_SOFT_RESET_MASK | | 416 | UVD_SOFT_RESET__LMI_SOFT_RESET_MASK | |
417 | UVD_SOFT_RESET__RBC_SOFT_RESET_MASK | UVD_SOFT_RESET__CSM_SOFT_RESET_MASK | | 417 | UVD_SOFT_RESET__VCPU_SOFT_RESET_MASK | |
418 | UVD_SOFT_RESET__CXW_SOFT_RESET_MASK | UVD_SOFT_RESET__TAP_SOFT_RESET_MASK | | 418 | UVD_SOFT_RESET__LBSI_SOFT_RESET_MASK | |
419 | UVD_SOFT_RESET__RBC_SOFT_RESET_MASK | | ||
420 | UVD_SOFT_RESET__CSM_SOFT_RESET_MASK | | ||
421 | UVD_SOFT_RESET__CXW_SOFT_RESET_MASK | | ||
422 | UVD_SOFT_RESET__TAP_SOFT_RESET_MASK | | ||
419 | UVD_SOFT_RESET__LMI_UMC_SOFT_RESET_MASK); | 423 | UVD_SOFT_RESET__LMI_UMC_SOFT_RESET_MASK); |
420 | mdelay(5); | 424 | mdelay(5); |
421 | 425 | ||
@@ -424,8 +428,13 @@ static int uvd_v6_0_start(struct amdgpu_device *adev) | |||
424 | mdelay(5); | 428 | mdelay(5); |
425 | 429 | ||
426 | /* initialize UVD memory controller */ | 430 | /* initialize UVD memory controller */ |
427 | WREG32(mmUVD_LMI_CTRL, 0x40 | (1 << 8) | (1 << 13) | | 431 | WREG32(mmUVD_LMI_CTRL, |
428 | (1 << 21) | (1 << 9) | (1 << 20)); | 432 | (0x40 << UVD_LMI_CTRL__WRITE_CLEAN_TIMER__SHIFT) | |
433 | UVD_LMI_CTRL__WRITE_CLEAN_TIMER_EN_MASK | | ||
434 | UVD_LMI_CTRL__DATA_COHERENCY_EN_MASK | | ||
435 | UVD_LMI_CTRL__VCPU_DATA_COHERENCY_EN_MASK | | ||
436 | UVD_LMI_CTRL__REQ_MODE_MASK | | ||
437 | UVD_LMI_CTRL__DISABLE_ON_FWV_FAIL_MASK); | ||
429 | 438 | ||
430 | #ifdef __BIG_ENDIAN | 439 | #ifdef __BIG_ENDIAN |
431 | /* swap (8 in 32) RB and IB */ | 440 | /* swap (8 in 32) RB and IB */ |
@@ -447,10 +456,10 @@ static int uvd_v6_0_start(struct amdgpu_device *adev) | |||
447 | mdelay(5); | 456 | mdelay(5); |
448 | 457 | ||
449 | /* enable VCPU clock */ | 458 | /* enable VCPU clock */ |
450 | WREG32(mmUVD_VCPU_CNTL, 1 << 9); | 459 | WREG32(mmUVD_VCPU_CNTL, UVD_VCPU_CNTL__CLK_EN_MASK); |
451 | 460 | ||
452 | /* enable UMC */ | 461 | /* enable UMC */ |
453 | WREG32_P(mmUVD_LMI_CTRL2, 0, ~(1 << 8)); | 462 | WREG32_P(mmUVD_LMI_CTRL2, 0, ~UVD_LMI_CTRL2__STALL_ARB_UMC_MASK); |
454 | 463 | ||
455 | /* boot up the VCPU */ | 464 | /* boot up the VCPU */ |
456 | WREG32(mmUVD_SOFT_RESET, 0); | 465 | WREG32(mmUVD_SOFT_RESET, 0); |
@@ -484,10 +493,12 @@ static int uvd_v6_0_start(struct amdgpu_device *adev) | |||
484 | return r; | 493 | return r; |
485 | } | 494 | } |
486 | /* enable master interrupt */ | 495 | /* enable master interrupt */ |
487 | WREG32_P(mmUVD_MASTINT_EN, 3 << 1, ~(3 << 1)); | 496 | WREG32_P(mmUVD_MASTINT_EN, |
497 | (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK), | ||
498 | ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK)); | ||
488 | 499 | ||
489 | /* clear the bit 4 of UVD_STATUS */ | 500 | /* clear the bit 4 of UVD_STATUS */ |
490 | WREG32_P(mmUVD_STATUS, 0, ~(2 << 1)); | 501 | WREG32_P(mmUVD_STATUS, 0, ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT)); |
491 | 502 | ||
492 | rb_bufsz = order_base_2(ring->ring_size); | 503 | rb_bufsz = order_base_2(ring->ring_size); |
493 | tmp = 0; | 504 | tmp = 0; |