drm/amdgpu: drop psp v13 query_boot_status implementation
authorHawking Zhang <Hawking.Zhang@amd.com>
Thu, 28 Dec 2023 08:04:02 +0000 (16:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Jan 2024 23:35:35 +0000 (18:35 -0500)
Will replace it with new implementation to cover
boot fails in ip discovery phase.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c

index ecbc58269951c31151d4972d3e55e7a0b47dceb8..19ca0519c034f3f54c8f8e2b29729d430eca7cf0 100644 (file)
@@ -1218,8 +1218,6 @@ static int amdgpu_device_asic_init(struct amdgpu_device *adev)
            amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0)) {
                amdgpu_psp_wait_for_bootloader(adev);
                ret = amdgpu_atomfirmware_asic_init(adev, true);
-               /* TODO: check the return val and stop device initialization if boot fails */
-               amdgpu_psp_query_boot_status(adev);
                return ret;
        } else {
                return amdgpu_atom_asic_init(adev->mode_info.atom_context);
index 215994409ac1db6bb380457db88e4c577104da2a..6bb857f7581bd81c399288ad308ec3d1fd91539a 100644 (file)
@@ -2128,21 +2128,6 @@ int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev)
        return ret;
 }
 
-int amdgpu_psp_query_boot_status(struct amdgpu_device *adev)
-{
-       struct psp_context *psp = &adev->psp;
-       int ret = 0;
-
-       if (amdgpu_sriov_vf(adev) || (adev->flags & AMD_IS_APU))
-               return 0;
-
-       if (psp->funcs &&
-           psp->funcs->query_boot_status)
-               ret = psp->funcs->query_boot_status(psp);
-
-       return ret;
-}
-
 static int psp_hw_start(struct psp_context *psp)
 {
        struct amdgpu_device *adev = psp->adev;
index c4d9cbde55b9bc58799aa1acc9fe4eea29d1a98a..09d1f8f72a9cc97c384b47cb474d2609af28a90e 100644 (file)
@@ -134,7 +134,6 @@ struct psp_funcs {
        int (*update_spirom)(struct psp_context *psp, uint64_t fw_pri_mc_addr);
        int (*vbflash_stat)(struct psp_context *psp);
        int (*fatal_error_recovery_quirk)(struct psp_context *psp);
-       int (*query_boot_status)(struct psp_context *psp);
 };
 
 struct ta_funcs {
@@ -538,7 +537,4 @@ int psp_spatial_partition(struct psp_context *psp, int mode);
 int is_psp_fw_valid(struct psp_bin_desc bin);
 
 int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev);
-
-int amdgpu_psp_query_boot_status(struct amdgpu_device *adev);
-
 #endif
index df1844d0800f2e5d9bcbc9d546ef3e52e060b733..6fad451a85be2b0f4900d2e9aa353e3ea74a7ee7 100644 (file)
@@ -763,83 +763,6 @@ static int psp_v13_0_fatal_error_recovery_quirk(struct psp_context *psp)
        return 0;
 }
 
-
-static void psp_v13_0_boot_error_reporting(struct amdgpu_device *adev,
-                                          uint32_t inst,
-                                          uint32_t boot_error)
-{
-       uint32_t socket_id;
-       uint32_t aid_id;
-       uint32_t hbm_id;
-       uint32_t reg_data;
-
-       socket_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, SOCKET_ID);
-       aid_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, AID_ID);
-       hbm_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, HBM_ID);
-
-       reg_data = RREG32_SOC15(MP0, inst, regMP0_SMN_C2PMSG_109);
-       dev_info(adev->dev, "socket: %d, aid: %d, firmware boot failed, fw status is 0x%x\n",
-                socket_id, aid_id, reg_data);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_MEM_TRAINING))
-               dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, memory training failed\n",
-                        socket_id, aid_id, hbm_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_FW_LOAD))
-               dev_info(adev->dev, "socket: %d, aid: %d, firmware load failed at boot time\n",
-                        socket_id, aid_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_WAFL_LINK_TRAINING))
-               dev_info(adev->dev, "socket: %d, aid: %d, wafl link training failed\n",
-                        socket_id, aid_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_XGMI_LINK_TRAINING))
-               dev_info(adev->dev, "socket: %d, aid: %d, xgmi link training failed\n",
-                        socket_id, aid_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_USR_CP_LINK_TRAINING))
-               dev_info(adev->dev, "socket: %d, aid: %d, usr cp link training failed\n",
-                        socket_id, aid_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_USR_DP_LINK_TRAINING))
-               dev_info(adev->dev, "socket: %d, aid: %d, usr dp link training failed\n",
-                        socket_id, aid_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_HBM_MEM_TEST))
-               dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm memory test failed\n",
-                        socket_id, aid_id, hbm_id);
-
-       if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_HBM_BIST_TEST))
-               dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm bist test failed\n",
-                        socket_id, aid_id, hbm_id);
-}
-
-static int psp_v13_0_query_boot_status(struct psp_context *psp)
-{
-       struct amdgpu_device *adev = psp->adev;
-       int inst_mask = adev->aid_mask;
-       uint32_t reg_data;
-       uint32_t i;
-       int ret = 0;
-
-       if (amdgpu_ip_version(adev, MP0_HWIP, 0) != IP_VERSION(13, 0, 6))
-               return 0;
-
-       if (RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_59) < 0x00a10109)
-               return 0;
-
-       for_each_inst(i, inst_mask) {
-               reg_data = RREG32_SOC15(MP0, i, regMP0_SMN_C2PMSG_126);
-               if (!REG_GET_FIELD(reg_data, MP0_SMN_C2PMSG_126, BOOT_STATUS)) {
-                       psp_v13_0_boot_error_reporting(adev, i, reg_data);
-                       ret = -EINVAL;
-                       break;
-               }
-       }
-
-       return ret;
-}
-
 static const struct psp_funcs psp_v13_0_funcs = {
        .init_microcode = psp_v13_0_init_microcode,
        .wait_for_bootloader = psp_v13_0_wait_for_bootloader_steady_state,
@@ -862,7 +785,6 @@ static const struct psp_funcs psp_v13_0_funcs = {
        .update_spirom = psp_v13_0_update_spirom,
        .vbflash_stat = psp_v13_0_vbflash_status,
        .fatal_error_recovery_quirk = psp_v13_0_fatal_error_recovery_quirk,
-       .query_boot_status = psp_v13_0_query_boot_status,
 };
 
 void psp_v13_0_set_psp_funcs(struct psp_context *psp)