mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-03 12:24:45 +08:00
drm/amdgpu/psp11: TA firmware is optional (v3)
Don't warn or fail if it's missing. v2: handle xgmi case more gracefully. v3: handle older kernels properly Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Tested-by: James Zhu <James.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
727962f030
commit
1d69511e49
@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle)
|
|||||||
adev->psp.sos_fw = NULL;
|
adev->psp.sos_fw = NULL;
|
||||||
release_firmware(adev->psp.asd_fw);
|
release_firmware(adev->psp.asd_fw);
|
||||||
adev->psp.asd_fw = NULL;
|
adev->psp.asd_fw = NULL;
|
||||||
release_firmware(adev->psp.ta_fw);
|
if (adev->psp.ta_fw) {
|
||||||
adev->psp.ta_fw = NULL;
|
release_firmware(adev->psp.ta_fw);
|
||||||
|
adev->psp.ta_fw = NULL;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)
|
|||||||
struct ta_xgmi_shared_memory *xgmi_cmd;
|
struct ta_xgmi_shared_memory *xgmi_cmd;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!psp->adev->psp.ta_fw)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
if (!psp->xgmi_context.initialized) {
|
if (!psp->xgmi_context.initialized) {
|
||||||
ret = psp_xgmi_init_shared_buf(psp);
|
ret = psp_xgmi_init_shared_buf(psp);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
|
|||||||
|
|
||||||
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
|
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
|
||||||
err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
|
err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
|
||||||
if (err)
|
if (err) {
|
||||||
goto out2;
|
release_firmware(adev->psp.ta_fw);
|
||||||
|
adev->psp.ta_fw = NULL;
|
||||||
|
dev_info(adev->dev,
|
||||||
|
"psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
|
||||||
|
} else {
|
||||||
|
err = amdgpu_ucode_validate(adev->psp.ta_fw);
|
||||||
|
if (err)
|
||||||
|
goto out2;
|
||||||
|
|
||||||
err = amdgpu_ucode_validate(adev->psp.ta_fw);
|
ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
|
||||||
if (err)
|
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
|
||||||
goto out2;
|
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
|
||||||
|
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
|
||||||
ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
|
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
|
||||||
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
|
}
|
||||||
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
|
|
||||||
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
|
|
||||||
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user