drm/amd/pp: Setup SoftRegsStart before request smu load fw

need to know SoftRegsStart value to visit the register
UcodeLoadStatus to check fw loading state.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Rex Zhu 2018-09-29 14:32:47 +08:00 committed by Alex Deucher
parent bcb7c4e8b4
commit 0a821579a2
2 changed files with 19 additions and 1 deletions

View File

@ -232,6 +232,7 @@ static int iceland_request_smu_load_specific_fw(struct pp_hwmgr *hwmgr,
static int iceland_start_smu(struct pp_hwmgr *hwmgr) static int iceland_start_smu(struct pp_hwmgr *hwmgr)
{ {
struct iceland_smumgr *priv = hwmgr->smu_backend;
int result; int result;
if (!smu7_is_smc_ram_running(hwmgr)) { if (!smu7_is_smc_ram_running(hwmgr)) {
@ -242,6 +243,14 @@ static int iceland_start_smu(struct pp_hwmgr *hwmgr)
iceland_smu_start_smc(hwmgr); iceland_smu_start_smc(hwmgr);
} }
/* Setup SoftRegsStart here to visit the register UcodeLoadStatus
* to check fw loading state
*/
smu7_read_smc_sram_dword(hwmgr,
SMU71_FIRMWARE_HEADER_LOCATION +
offsetof(SMU71_Firmware_Header, SoftRegisters),
&(priv->smu7_data.soft_regs_start), 0x40000);
result = smu7_request_smu_load_fw(hwmgr); result = smu7_request_smu_load_fw(hwmgr);
return result; return result;
@ -2652,7 +2661,7 @@ const struct pp_smumgr_func iceland_smu_funcs = {
.smu_fini = &smu7_smu_fini, .smu_fini = &smu7_smu_fini,
.start_smu = &iceland_start_smu, .start_smu = &iceland_start_smu,
.check_fw_load_finish = &smu7_check_fw_load_finish, .check_fw_load_finish = &smu7_check_fw_load_finish,
.request_smu_load_fw = &smu7_reload_firmware, .request_smu_load_fw = &smu7_request_smu_load_fw,
.request_smu_load_specific_fw = &iceland_request_smu_load_specific_fw, .request_smu_load_specific_fw = &iceland_request_smu_load_specific_fw,
.send_msg_to_smc = &smu7_send_msg_to_smc, .send_msg_to_smc = &smu7_send_msg_to_smc,
.send_msg_to_smc_with_parameter = &smu7_send_msg_to_smc_with_parameter, .send_msg_to_smc_with_parameter = &smu7_send_msg_to_smc_with_parameter,

View File

@ -192,6 +192,7 @@ static int tonga_start_in_non_protection_mode(struct pp_hwmgr *hwmgr)
static int tonga_start_smu(struct pp_hwmgr *hwmgr) static int tonga_start_smu(struct pp_hwmgr *hwmgr)
{ {
struct tonga_smumgr *priv = hwmgr->smu_backend;
int result; int result;
/* Only start SMC if SMC RAM is not running */ /* Only start SMC if SMC RAM is not running */
@ -209,6 +210,14 @@ static int tonga_start_smu(struct pp_hwmgr *hwmgr)
} }
} }
/* Setup SoftRegsStart here to visit the register UcodeLoadStatus
* to check fw loading state
*/
smu7_read_smc_sram_dword(hwmgr,
SMU72_FIRMWARE_HEADER_LOCATION +
offsetof(SMU72_Firmware_Header, SoftRegisters),
&(priv->smu7_data.soft_regs_start), 0x40000);
result = smu7_request_smu_load_fw(hwmgr); result = smu7_request_smu_load_fw(hwmgr);
return result; return result;