aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2016-09-27 04:39:58 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-25 14:38:23 -0400
commit4c2b2453ef9be2e105a987cd13cf3ce14e53f5e0 (patch)
treeb96f0d2e60cecaa71b44d3ceda72ff50629fa4bf /drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
parentbed5712e1a52bb5d177722bc0d76c2a3a71b8338 (diff)
drm/amdgpu:properly fix some JumpTable issues
we found some MEC ucode leads to IB test fail or even ring test fail if Jump Table of it is not start in FW bo with page aligned address, fixed by always make JT address page aligned. we don't need to patch JT2 for MEC2, because for VI, MEC2 is a copy of MEC1, thus when converting fw_type for MEC_JT2 we just return MEC1,hw can use the same JT for both MEC1 & MEC2. above two change fixed some ring/ib test failure issue for some version of MEC ucode. Signed-off-by: Frank Min <Frank.Min@amd.com> Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index e6b1bf3dc292..34049d67a0d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -687,11 +687,14 @@ static uint32_t fw_type_convert(struct cgs_device *cgs_device, uint32_t fw_type)
687 result = AMDGPU_UCODE_ID_CP_MEC1; 687 result = AMDGPU_UCODE_ID_CP_MEC1;
688 break; 688 break;
689 case CGS_UCODE_ID_CP_MEC_JT2: 689 case CGS_UCODE_ID_CP_MEC_JT2:
690 if (adev->asic_type == CHIP_TONGA || adev->asic_type == CHIP_POLARIS11 690 /* for VI. JT2 should be the same as JT1, because:
691 || adev->asic_type == CHIP_POLARIS10) 691 1, MEC2 and MEC1 use exactly same FW.
692 result = AMDGPU_UCODE_ID_CP_MEC2; 692 2, JT2 is not pached but JT1 is.
693 else 693 */
694 if (adev->asic_type >= CHIP_TOPAZ)
694 result = AMDGPU_UCODE_ID_CP_MEC1; 695 result = AMDGPU_UCODE_ID_CP_MEC1;
696 else
697 result = AMDGPU_UCODE_ID_CP_MEC2;
695 break; 698 break;
696 case CGS_UCODE_ID_RLC_G: 699 case CGS_UCODE_ID_RLC_G:
697 result = AMDGPU_UCODE_ID_RLC_G; 700 result = AMDGPU_UCODE_ID_RLC_G;
@@ -781,12 +784,18 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
781 784
782 if ((type == CGS_UCODE_ID_CP_MEC_JT1) || 785 if ((type == CGS_UCODE_ID_CP_MEC_JT1) ||
783 (type == CGS_UCODE_ID_CP_MEC_JT2)) { 786 (type == CGS_UCODE_ID_CP_MEC_JT2)) {
784 gpu_addr += le32_to_cpu(header->jt_offset) << 2; 787 gpu_addr += ALIGN(le32_to_cpu(header->header.ucode_size_bytes), PAGE_SIZE);
785 data_size = le32_to_cpu(header->jt_size) << 2; 788 data_size = le32_to_cpu(header->jt_size) << 2;
786 } 789 }
787 info->mc_addr = gpu_addr; 790
791 info->kptr = ucode->kaddr;
788 info->image_size = data_size; 792 info->image_size = data_size;
793 info->mc_addr = gpu_addr;
789 info->version = (uint16_t)le32_to_cpu(header->header.ucode_version); 794 info->version = (uint16_t)le32_to_cpu(header->header.ucode_version);
795
796 if (CGS_UCODE_ID_CP_MEC == type)
797 info->image_size = (header->jt_offset) << 2;
798
790 info->fw_version = amdgpu_get_firmware_version(cgs_device, type); 799 info->fw_version = amdgpu_get_firmware_version(cgs_device, type);
791 info->feature_version = (uint16_t)le32_to_cpu(header->ucode_feature_version); 800 info->feature_version = (uint16_t)le32_to_cpu(header->ucode_feature_version);
792 } else { 801 } else {