Commit 744a5227 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Allocate ucode bo in request_smu_load_fw

ucode bo is needed by request_smu_load_fw,
the request_smu_load_fw maybe called by gfx/sdma
before smu hw init.
so move amdgpu_ucode_bo_init to request_smu_lowd_fw
from smu hw init.
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 07da6aa4
...@@ -124,9 +124,6 @@ static int pp_hw_init(void *handle) ...@@ -124,9 +124,6 @@ static int pp_hw_init(void *handle)
struct amdgpu_device *adev = handle; struct amdgpu_device *adev = handle;
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle; struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
amdgpu_ucode_init_bo(adev);
ret = hwmgr_hw_init(hwmgr); ret = hwmgr_hw_init(hwmgr);
if (ret) if (ret)
......
...@@ -346,6 +346,8 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) ...@@ -346,6 +346,8 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
if (!hwmgr->reload_fw) if (!hwmgr->reload_fw)
return 0; return 0;
amdgpu_ucode_init_bo(hwmgr->adev);
if (smu_data->soft_regs_start) if (smu_data->soft_regs_start)
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
smu_data->soft_regs_start + smum_get_offsetof(hwmgr, smu_data->soft_regs_start + smum_get_offsetof(hwmgr,
......
...@@ -664,6 +664,8 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr) ...@@ -664,6 +664,8 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)
if (!hwmgr->reload_fw) if (!hwmgr->reload_fw)
return 0; return 0;
amdgpu_ucode_init_bo(hwmgr->adev);
smu8_smu_populate_firmware_entries(hwmgr); smu8_smu_populate_firmware_entries(hwmgr);
smu8_smu_construct_toc(hwmgr); smu8_smu_construct_toc(hwmgr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment