Skip to content

Commit

Permalink
drm/amdgpu: rename psp_execute_non_psp_fw_load and make it global
Browse files Browse the repository at this point in the history
This will make this function more general, and then serve other IPs.

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Lang Yu authored and Alex Deucher committed Jul 12, 2023
1 parent 41b8a08 commit 45b51ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2448,8 +2448,8 @@ static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,
return ret;
}

static int psp_execute_non_psp_fw_load(struct psp_context *psp,
struct amdgpu_firmware_info *ucode)
int psp_execute_ip_fw_load(struct psp_context *psp,
struct amdgpu_firmware_info *ucode)
{
int ret = 0;
struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);
Expand Down Expand Up @@ -2492,7 +2492,7 @@ static int psp_load_smu_fw(struct psp_context *psp)
DRM_WARN("Failed to set MP1 state prepare for reload\n");
}

ret = psp_execute_non_psp_fw_load(psp, ucode);
ret = psp_execute_ip_fw_load(psp, ucode);

if (ret)
DRM_ERROR("PSP load smu failed!\n");
Expand Down Expand Up @@ -2534,7 +2534,7 @@ int psp_load_fw_list(struct psp_context *psp,
for (i = 0; i < ucode_count; ++i) {
ucode = ucode_list[i];
psp_print_fw_hdr(psp, ucode);
ret = psp_execute_non_psp_fw_load(psp, ucode);
ret = psp_execute_ip_fw_load(psp, ucode);
if (ret)
return ret;
}
Expand Down Expand Up @@ -2581,7 +2581,7 @@ static int psp_load_non_psp_fw(struct psp_context *psp)

psp_print_fw_hdr(psp, ucode);

ret = psp_execute_non_psp_fw_load(psp, ucode);
ret = psp_execute_ip_fw_load(psp, ucode);
if (ret)
return ret;

Expand Down Expand Up @@ -2930,7 +2930,7 @@ int psp_update_vcn_sram(struct amdgpu_device *adev, int inst_idx,
ucode.mc_addr = cmd_gpu_addr;
ucode.ucode_size = cmd_size;

return psp_execute_non_psp_fw_load(&adev->psp, &ucode);
return psp_execute_ip_fw_load(&adev->psp, &ucode);
}

int psp_ring_cmd_submit(struct psp_context *psp,
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ extern int psp_wait_for(struct psp_context *psp, uint32_t reg_index,
extern int psp_wait_for_spirom_update(struct psp_context *psp, uint32_t reg_index,
uint32_t field_val, uint32_t mask, uint32_t msec_timeout);

int psp_execute_ip_fw_load(struct psp_context *psp,
struct amdgpu_firmware_info *ucode);

int psp_gpu_reset(struct amdgpu_device *adev);
int psp_update_vcn_sram(struct amdgpu_device *adev, int inst_idx,
uint64_t cmd_gpu_addr, int cmd_size);
Expand Down

0 comments on commit 45b51ac

Please sign in to comment.