drm/amdgpu: export ta fw info
authorxinhui pan <xinhui.pan@amd.com>
Tue, 20 Nov 2018 02:22:36 +0000 (10:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:36:50 +0000 (15:36 -0500)
Output the ta fw, aka xgmi/ras, via debugfs.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h

index b65e181011085cf880378500a50009cdb21937ca..4d0ccca891cbeaf1eeef324284082ad915145a55 100644 (file)
@@ -295,6 +295,17 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
                fw_info->ver = adev->pm.fw_version;
                fw_info->feature = 0;
                break;
+       case AMDGPU_INFO_FW_TA:
+               if (query_fw->index > 1)
+                       return -EINVAL;
+               if (query_fw->index == 0) {
+                       fw_info->ver = adev->psp.ta_fw_version;
+                       fw_info->feature = adev->psp.ta_xgmi_ucode_version;
+               } else {
+                       fw_info->ver = adev->psp.ta_fw_version;
+                       fw_info->feature = adev->psp.ta_ras_ucode_version;
+               }
+               break;
        case AMDGPU_INFO_FW_SDMA:
                if (query_fw->index >= adev->sdma.num_instances)
                        return -EINVAL;
@@ -1327,6 +1338,16 @@ static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data)
        seq_printf(m, "ASD feature version: %u, firmware version: 0x%08x\n",
                   fw_info.feature, fw_info.ver);
 
+       query_fw.fw_type = AMDGPU_INFO_FW_TA;
+       for (i = 0; i < 2; i++) {
+               query_fw.index = i;
+               ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
+               if (ret)
+                       continue;
+               seq_printf(m, "TA %s feature version: %u, firmware version: 0x%08x\n",
+                               i ? "RAS" : "XGMI", fw_info.feature, fw_info.ver);
+       }
+
        /* SMC */
        query_fw.fw_type = AMDGPU_INFO_FW_SMC;
        ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
index 4a53f6cfa0341590c3be9b84bb88d49b2d5d4994..e5275d4481f56be14f5de3c8584b5fc32b40a198 100644 (file)
@@ -680,6 +680,7 @@ struct drm_amdgpu_cs_chunk_data {
        #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11
        /* Subquery id: Query DMCU firmware version */
        #define AMDGPU_INFO_FW_DMCU             0x12
+       #define AMDGPU_INFO_FW_TA               0x13
 /* number of bytes moved for TTM migration */
 #define AMDGPU_INFO_NUM_BYTES_MOVED            0x0f
 /* the used VRAM size */