drm/amdgpu: Add C2PMSG_109/126 reg field shift/masks
Subsystems (2)
PATCH 1/3 drm/amdgpu: Add C2PMSG_109/126 reg field shift/masks
Add MP0_C2PMSG_109/126 register field shift/masks that are used to identify boot status by driver.
Signed-off-by Hawking Zhang <[email protected]>
Reviewed-by Tao Zhou <[email protected]>
Reviewed-by Yang Wang <[email protected]>
Reviewed-by Le Ma <[email protected]>
--- .../include/asic_reg/mp/mp_13_0_2_sh_mask.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/mp/mp_13_0_2_sh_mask.h +28 -0
@@ -242,6 +242,34 @@//MP0_SMN_C2PMSG_103 #define MP0_SMN_C2PMSG_103__CONTENT__SHIFT 0x0#define MP0_SMN_C2PMSG_103__CONTENT_MASK 0xFFFFFFFFL +//MP0_SMN_C2PMSG_109 +#define MP0_SMN_C2PMSG_109__CONTENT__SHIFT 0x0 +#define MP0_SMN_C2PMSG_109__CONTENT_MASK 0xFFFFFFFFL +//MP0_SMN_C2PMSG_126 +#define MP0_SMN_C2PMSG_126__GPU_ERR_MEM_TRAINING__SHIFT 0x0 +#define MP0_SMN_C2PMSG_126__GPU_ERR_FW_LOAD__SHIFT 0x1 +#define MP0_SMN_C2PMSG_126__GPU_ERR_WAFL_LINK_TRAINING__SHIFT 0x2 +#define MP0_SMN_C2PMSG_126__GPU_ERR_XGMI_LINK_TRAINING__SHIFT 0x3 +#define MP0_SMN_C2PMSG_126__GPU_ERR_USR_CP_LINK_TRAINING__SHIFT 0x4 +#define MP0_SMN_C2PMSG_126__GPU_ERR_USR_DP_LINK_TRAINING__SHIFT 0x5 +#define MP0_SMN_C2PMSG_126__GPU_ERR_HBM_MEM_TEST__SHIFT 0x6 +#define MP0_SMN_C2PMSG_126__GPU_ERR_HBM_BIST_TEST__SHIFT 0x7 +#define MP0_SMN_C2PMSG_126__SOCKET_ID__SHIFT 0x8 +#define MP0_SMN_C2PMSG_126__AID_ID__SHIFT 0xb +#define MP0_SMN_C2PMSG_126__HBM_ID__SHIFT 0xd +#define MP0_SMN_C2PMSG_126__BOOT_STATUS__SHIFT 0x1f +#define MP0_SMN_C2PMSG_126__GPU_ERR_MEM_TRAINING_MASK 0x00000001L +#define MP0_SMN_C2PMSG_126__GPU_ERR_FW_LOAD_MASK 0x00000002L +#define MP0_SMN_C2PMSG_126__GPU_ERR_WAFL_LINK_TRAINING_MASK 0x00000004L +#define MP0_SMN_C2PMSG_126__GPU_ERR_XGMI_LINK_TRAINING_MASK 0x00000008L +#define MP0_SMN_C2PMSG_126__GPU_ERR_USR_CP_LINK_TRAINING_MASK 0x00000010L +#define MP0_SMN_C2PMSG_126__GPU_ERR_USR_DP_LINK_TRAINING_MASK 0x00000020L +#define MP0_SMN_C2PMSG_126__GPU_ERR_HBM_MEM_TEST_MASK 0x00000040L +#define MP0_SMN_C2PMSG_126__GPU_ERR_HBM_BIST_TEST_MASK 0x00000080L +#define MP0_SMN_C2PMSG_126__SOCKET_ID_MASK 0x00000700L +#define MP0_SMN_C2PMSG_126__AID_ID_MASK 0x00001800L +#define MP0_SMN_C2PMSG_126__HBM_ID_MASK 0x00002000L +#define MP0_SMN_C2PMSG_126__BOOT_STATUS_MASK 0x80000000L//MP0_SMN_IH_CREDIT #define MP0_SMN_IH_CREDIT__CREDIT_VALUE__SHIFT 0x0#define MP0_SMN_IH_CREDIT__CLIENT_ID__SHIFT 0x10
Signature · 1 line
2.17.1
PATCH 2/3 drm/amdgpu: Add psp v13 function to query boot status
Add psp v13 function to query boot status.
v2: limit the use case to dGPU only (Lijo)
Signed-off-by Hawking Zhang <[email protected]>
Reviewed-by Tao Zhou <[email protected]>
Reviewed-by Yang Wang <[email protected]>
Reviewed-by Le Ma <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 15 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 3 + drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 78 +++++++++++++++++++++++++ 3 files changed, 96 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +15 -0
@@ -2120,6 +2120,21 @@ 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; + +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;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +3 -0
@@ -134,6 +134,7 @@ 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 {
@@ -537,4 +538,6 @@ 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
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +78 -0
90 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 3/3 drm/amdgpu: Query and report boot status
In reply to Hawking ZhangQuery boot status and report boot errors. A follow up change is needed to stop GPU initialization if boot fails.
v2: only invoke the call for dGPU (Le/Lijo)
Signed-off-by Hawking Zhang <[email protected]>
Reviewed-by Tao Zhou <[email protected]>
Reviewed-by Yang Wang <[email protected]>
Reviewed-by Le Ma <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -1070,6 +1070,8 @@ 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);
Signature · 1 line
2.17.1