summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2019-02-14 19:08:22 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-06-20 21:46:50 -0500
commit1316956284ac44b4714510186eb9091ed7829421 (patch)
tree4417d072d4f0c5f12262c9758782dcf46b8ad2c1
parentbb67469e29f30462582fbf55690f1a41249fc1a5 (diff)
drm/amdgpu: load smc ucode at first with psp while rlc auto load is supported
This patch loades smc ucode at first with psp while rlc auto load is supported on navi10. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index d6009772ad8d..bbc3b0488982 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -919,19 +919,45 @@ static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,
return ret;
}
+static int psp_execute_np_fw_load(struct psp_context *psp,
+ struct amdgpu_firmware_info *ucode)
+{
+ int ret = 0;
+
+ ret = psp_prep_load_ip_fw_cmd_buf(ucode, psp->cmd);
+ if (ret)
+ return ret;
+
+ ret = psp_cmd_submit_buf(psp, ucode, psp->cmd,
+ psp->fence_buf_mc_addr);
+
+ return ret;
+}
+
static int psp_np_fw_load(struct psp_context *psp)
{
int i, ret;
struct amdgpu_firmware_info *ucode;
struct amdgpu_device* adev = psp->adev;
+ if (psp->autoload_supported) {
+ ucode = &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
+ if (!ucode->fw)
+ goto out;
+
+ ret = psp_execute_np_fw_load(psp, ucode);
+ if (ret)
+ return ret;
+ }
+
+out:
for (i = 0; i < adev->firmware.max_ucodes; i++) {
ucode = &adev->firmware.ucode[i];
if (!ucode->fw)
continue;
if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC &&
- psp_smu_reload_quirk(psp))
+ (psp_smu_reload_quirk(psp) || psp->autoload_supported))
continue;
if (amdgpu_sriov_vf(adev) &&
(ucode->ucode_id == AMDGPU_UCODE_ID_SDMA0
@@ -945,12 +971,7 @@ static int psp_np_fw_load(struct psp_context *psp)
/* skip mec JT when autoload is enabled */
continue;
- ret = psp_prep_load_ip_fw_cmd_buf(ucode, psp->cmd);
- if (ret)
- return ret;
-
- ret = psp_cmd_submit_buf(psp, ucode, psp->cmd,
- psp->fence_buf_mc_addr);
+ ret = psp_execute_np_fw_load(psp, ucode);
if (ret)
return ret;