<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Sorry, Please ignore this patch.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<br>
<p style="margin-top:0;margin-bottom:0">Best Regards</p>
<p style="margin-top:0;margin-bottom:0">Rex<br>
</p>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Thursday, September 27, 2018 9:55 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH v2] drm/amd/pp: Export load_firmware interface</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Export this interface for the AMDGPU_FW_LOAD_SMU type.<br>
gfx/sdma can request smu to load firmware.<br>
<br>
Split the smu7/8_start_smu function into two functions<br>
1. start_smu, used for load smu firmware in smu7/8 and<br>
   check smu firmware version.<br>
2. request_smu_load_fw, used for load other ip's firmware<br>
   on smu7/8 and add firmware loading staus check.<br>
<br>
v2: default fw loading type is via smu for VI, driver call smu<br>
    to load all fw at the begin of hw init.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/vi.c                    | 16 ++++++<br>
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c      | 20 ++++----<br>
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c |  4 +-<br>
 .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c  | 25 ++++-----<br>
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c    |  4 +-<br>
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 59 +++++-----------------<br>
 drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h |  3 +-<br>
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 46 ++++++++---------<br>
 .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c    | 12 ++++-<br>
 .../gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c    |  4 +-<br>
 10 files changed, 86 insertions(+), 107 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
index 88b57a5..3384a15 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vi.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
@@ -1222,6 +1222,16 @@ static int vi_common_hw_init(void *handle)<br>
         /* enable the doorbell aperture */<br>
         vi_enable_doorbell_aperture(adev, true);<br>
 <br>
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) {<br>
+               if (adev->powerplay.pp_funcs->load_firmware) {<br>
+                       amdgpu_ucode_init_bo(adev);<br>
+                       if (adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle)) {<br>
+                               adev->firmware.load_type = AMDGPU_FW_LOAD_DIRECT;<br>
+                               amdgpu_ucode_fini_bo(adev);<br>
+                       }<br>
+               }<br>
+       }<br>
+<br>
         return 0;<br>
 }<br>
 <br>
@@ -1235,6 +1245,12 @@ static int vi_common_hw_fini(void *handle)<br>
         if (amdgpu_sriov_vf(adev))<br>
                 xgpu_vi_mailbox_put_irq(adev);<br>
 <br>
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) {<br>
+               release_firmware(adev->pm.fw);<br>
+               adev->pm.fw = NULL;<br>
+               amdgpu_ucode_fini_bo(adev);<br>
+       }<br>
+<br>
         return 0;<br>
 }<br>
 <br>
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
index aff7c14..5dc8fb9 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
@@ -109,12 +109,6 @@ static int pp_sw_fini(void *handle)<br>
 <br>
         hwmgr_sw_fini(hwmgr);<br>
 <br>
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) {<br>
-               release_firmware(adev->pm.fw);<br>
-               adev->pm.fw = NULL;<br>
-               amdgpu_ucode_fini_bo(adev);<br>
-       }<br>
-<br>
         return 0;<br>
 }<br>
 <br>
@@ -124,9 +118,6 @@ static int pp_hw_init(void *handle)<br>
         struct amdgpu_device *adev = handle;<br>
         struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;<br>
 <br>
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)<br>
-               amdgpu_ucode_init_bo(adev);<br>
-<br>
         ret = hwmgr_hw_init(hwmgr);<br>
 <br>
         if (ret)<br>
@@ -275,7 +266,16 @@ static int pp_set_clockgating_state(void *handle,<br>
 <br>
 static int pp_dpm_load_fw(void *handle)<br>
 {<br>
-       return 0;<br>
+       struct pp_hwmgr *hwmgr = handle;<br>
+       int ret = 0;<br>
+<br>
+       if (!hwmgr || !hwmgr->smumgr_funcs)<br>
+               return -EINVAL;<br>
+<br>
+       if (hwmgr->smumgr_funcs->request_smu_load_fw)<br>
+               ret = hwmgr->smumgr_funcs->request_smu_load_fw(hwmgr);<br>
+<br>
+       return ret;<br>
 }<br>
 <br>
 static int pp_dpm_fw_loading_complete(void *handle)<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
index b6b62a7..ffd7d78 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
@@ -310,8 +310,6 @@ static int fiji_start_smu(struct pp_hwmgr *hwmgr)<br>
                         offsetof(SMU73_Firmware_Header, SoftRegisters),<br>
                         &(priv->smu7_data.soft_regs_start), 0x40000);<br>
 <br>
-       result = smu7_request_smu_load_fw(hwmgr);<br>
-<br>
         return result;<br>
 }<br>
 <br>
@@ -2643,7 +2641,7 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,<br>
         .smu_fini = &smu7_smu_fini,<br>
         .start_smu = &fiji_start_smu,<br>
         .check_fw_load_finish = &smu7_check_fw_load_finish,<br>
-       .request_smu_load_fw = &smu7_reload_firmware,<br>
+       .request_smu_load_fw = &smu7_request_smu_load_fw,<br>
         .request_smu_load_specific_fw = NULL,<br>
         .send_msg_to_smc = &smu7_send_msg_to_smc,<br>
         .send_msg_to_smc_with_parameter = &smu7_send_msg_to_smc_with_parameter,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
index 73aa368..68a4836 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
@@ -232,27 +232,24 @@ static int iceland_request_smu_load_specific_fw(struct pp_hwmgr *hwmgr,<br>
 <br>
 static int iceland_start_smu(struct pp_hwmgr *hwmgr)<br>
 {<br>
-       int result;<br>
-<br>
-       result = iceland_smu_upload_firmware_image(hwmgr);<br>
-       if (result)<br>
-               return result;<br>
-       result = iceland_smu_start_smc(hwmgr);<br>
-       if (result)<br>
-               return result;<br>
+       struct iceland_smumgr *priv = hwmgr->smu_backend;<br>
+       int result = 0;<br>
 <br>
         if (!smu7_is_smc_ram_running(hwmgr)) {<br>
-               pr_info("smu not running, upload firmware again \n");<br>
                 result = iceland_smu_upload_firmware_image(hwmgr);<br>
                 if (result)<br>
                         return result;<br>
 <br>
-               result = iceland_smu_start_smc(hwmgr);<br>
-               if (result)<br>
-                       return result;<br>
+               iceland_smu_start_smc(hwmgr);<br>
         }<br>
+       /* Setup SoftRegsStart here for register lookup in case<br>
+        * DummyBackEnd is used and ProcessFirmwareHeader is not executed<br>
+        */<br>
 <br>
-       result = smu7_request_smu_load_fw(hwmgr);<br>
+       smu7_read_smc_sram_dword(hwmgr,<br>
+                       SMU71_FIRMWARE_HEADER_LOCATION +<br>
+                       offsetof(SMU71_Firmware_Header, SoftRegisters),<br>
+                       &(priv->smu7_data.soft_regs_start), 0x40000);<br>
 <br>
         return result;<br>
 }<br>
@@ -2662,7 +2659,7 @@ static bool iceland_is_dpm_running(struct pp_hwmgr *hwmgr)<br>
         .smu_fini = &smu7_smu_fini,<br>
         .start_smu = &iceland_start_smu,<br>
         .check_fw_load_finish = &smu7_check_fw_load_finish,<br>
-       .request_smu_load_fw = &smu7_reload_firmware,<br>
+       .request_smu_load_fw = &smu7_request_smu_load_fw,<br>
         .request_smu_load_specific_fw = &iceland_request_smu_load_specific_fw,<br>
         .send_msg_to_smc = &smu7_send_msg_to_smc,<br>
         .send_msg_to_smc_with_parameter = &smu7_send_msg_to_smc_with_parameter,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
index 872d382..2ad6ad9 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
@@ -313,8 +313,6 @@ static int polaris10_start_smu(struct pp_hwmgr *hwmgr)<br>
         smu7_read_smc_sram_dword(hwmgr, SMU7_FIRMWARE_HEADER_LOCATION + offsetof(SMU74_Firmware_Header, SoftRegisters),<br>
                                         &(smu_data->smu7_data.soft_regs_start), 0x40000);<br>
 <br>
-       result = smu7_request_smu_load_fw(hwmgr);<br>
-<br>
         return result;<br>
 }<br>
 <br>
@@ -2478,7 +2476,7 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,<br>
         .smu_fini = smu7_smu_fini,<br>
         .start_smu = polaris10_start_smu,<br>
         .check_fw_load_finish = smu7_check_fw_load_finish,<br>
-       .request_smu_load_fw = smu7_reload_firmware,<br>
+       .request_smu_load_fw = smu7_request_smu_load_fw,<br>
         .request_smu_load_specific_fw = NULL,<br>
         .send_msg_to_smc = smu7_send_msg_to_smc,<br>
         .send_msg_to_smc_with_parameter = smu7_send_msg_to_smc_with_parameter,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
index 10eb967..edfb061 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c<br>
@@ -302,44 +302,6 @@ int smu7_write_smc_sram_dword(struct pp_hwmgr *hwmgr, uint32_t smc_addr, uint32_<br>
         return 0;<br>
 }<br>
 <br>
-/* Convert the firmware type to SMU type mask. For MEC, we need to check all MEC related type */<br>
-<br>
-static uint32_t smu7_get_mask_for_firmware_type(uint32_t fw_type)<br>
-{<br>
-       uint32_t result = 0;<br>
-<br>
-       switch (fw_type) {<br>
-       case UCODE_ID_SDMA0:<br>
-               result = UCODE_ID_SDMA0_MASK;<br>
-               break;<br>
-       case UCODE_ID_SDMA1:<br>
-               result = UCODE_ID_SDMA1_MASK;<br>
-               break;<br>
-       case UCODE_ID_CP_CE:<br>
-               result = UCODE_ID_CP_CE_MASK;<br>
-               break;<br>
-       case UCODE_ID_CP_PFP:<br>
-               result = UCODE_ID_CP_PFP_MASK;<br>
-               break;<br>
-       case UCODE_ID_CP_ME:<br>
-               result = UCODE_ID_CP_ME_MASK;<br>
-               break;<br>
-       case UCODE_ID_CP_MEC:<br>
-       case UCODE_ID_CP_MEC_JT1:<br>
-       case UCODE_ID_CP_MEC_JT2:<br>
-               result = UCODE_ID_CP_MEC_MASK;<br>
-               break;<br>
-       case UCODE_ID_RLC_G:<br>
-               result = UCODE_ID_RLC_G_MASK;<br>
-               break;<br>
-       default:<br>
-               pr_info("UCode type is out of range! \n");<br>
-               result = 0;<br>
-       }<br>
-<br>
-       return result;<br>
-}<br>
-<br>
 static int smu7_populate_single_firmware_entry(struct pp_hwmgr *hwmgr,<br>
                                                 uint32_t fw_type,<br>
                                                 struct SMU_Entry *entry)<br>
@@ -381,6 +343,11 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
         uint32_t fw_to_load;<br>
         int r = 0;<br>
 <br>
+       if (hwmgr->smumgr_funcs->start_smu(hwmgr)) {<br>
+               pr_err("smu not running \n");<br>
+               return -EINVAL;<br>
+       }<br>
+<br>
         if (smu_data->soft_regs_start)<br>
                 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,<br>
                                         smu_data->soft_regs_start + smum_get_offsetof(hwmgr,<br>
@@ -462,10 +429,13 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
         smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_HI, upper_32_bits(smu_data->header_buffer.mc_addr));<br>
         smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_LO, lower_32_bits(smu_data->header_buffer.mc_addr));<br>
 <br>
-       if (smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load))<br>
-               pr_err("Fail to Request SMU Load uCode");<br>
+       smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load);<br>
 <br>
-       return r;<br>
+       r = smu7_check_fw_load_finish(hwmgr, fw_to_load);<br>
+       if (!r)<br>
+               return 0;<br>
+<br>
+       pr_err("SMU load firmware failed\n");<br>
 <br>
 failed:<br>
         kfree(smu_data->toc);<br>
@@ -477,20 +447,15 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
 int smu7_check_fw_load_finish(struct pp_hwmgr *hwmgr, uint32_t fw_type)<br>
 {<br>
         struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);<br>
-       uint32_t fw_mask = smu7_get_mask_for_firmware_type(fw_type);<br>
         uint32_t ret;<br>
 <br>
         ret = phm_wait_on_indirect_register(hwmgr, mmSMC_IND_INDEX_11,<br>
                                         smu_data->soft_regs_start + smum_get_offsetof(hwmgr,<br>
                                         SMU_SoftRegisters, UcodeLoadStatus),<br>
-                                       fw_mask, fw_mask);<br>
+                                       fw_type, fw_type);<br>
         return ret;<br>
 }<br>
 <br>
-int smu7_reload_firmware(struct pp_hwmgr *hwmgr)<br>
-{<br>
-       return hwmgr->smumgr_funcs->start_smu(hwmgr);<br>
-}<br>
 <br>
 static int smu7_upload_smc_firmware_data(struct pp_hwmgr *hwmgr, uint32_t length, uint32_t *src, uint32_t limit)<br>
 {<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h<br>
index 01f0538f..10c8ceb 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h<br>
@@ -73,9 +73,8 @@ int smu7_read_smc_sram_dword(struct pp_hwmgr *hwmgr, uint32_t smc_addr,<br>
 int smu7_write_smc_sram_dword(struct pp_hwmgr *hwmgr, uint32_t smc_addr,<br>
                                                 uint32_t value, uint32_t limit);<br>
 <br>
-int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr);<br>
 int smu7_check_fw_load_finish(struct pp_hwmgr *hwmgr, uint32_t fw_type);<br>
-int smu7_reload_firmware(struct pp_hwmgr *hwmgr);<br>
+int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr);<br>
 int smu7_upload_smu_firmware_image(struct pp_hwmgr *hwmgr);<br>
 int smu7_init(struct pp_hwmgr *hwmgr);<br>
 int smu7_smu_fini(struct pp_hwmgr *hwmgr);<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
index 7a4c425..90f5f30 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c<br>
@@ -658,6 +658,8 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
 {<br>
         struct smu8_smumgr *smu8_smu = hwmgr->smu_backend;<br>
         uint32_t smc_address;<br>
+       uint32_t fw_to_check = 0;<br>
+       int ret;<br>
 <br>
         smu8_smu_populate_firmware_entries(hwmgr);<br>
 <br>
@@ -684,28 +686,9 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)<br>
         smu8_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,<br>
                                 smu8_smu->toc_entry_power_profiling_index);<br>
 <br>
-       return smu8_send_msg_to_smc_with_parameter(hwmgr,<br>
+       smu8_send_msg_to_smc_with_parameter(hwmgr,<br>
                                         PPSMC_MSG_ExecuteJob,<br>
                                         smu8_smu->toc_entry_initialize_index);<br>
-}<br>
-<br>
-static int smu8_start_smu(struct pp_hwmgr *hwmgr)<br>
-{<br>
-       int ret = 0;<br>
-       uint32_t fw_to_check = 0;<br>
-       struct amdgpu_device *adev = hwmgr->adev;<br>
-<br>
-       uint32_t index = SMN_MP1_SRAM_START_ADDR +<br>
-                        SMU8_FIRMWARE_HEADER_LOCATION +<br>
-                        offsetof(struct SMU8_Firmware_Header, Version);<br>
-<br>
-<br>
-       if (hwmgr == NULL || hwmgr->device == NULL)<br>
-               return -EINVAL;<br>
-<br>
-       cgs_write_register(hwmgr->device, mmMP0PUB_IND_INDEX, index);<br>
-       hwmgr->smu_version = cgs_read_register(hwmgr->device, mmMP0PUB_IND_DATA);<br>
-       adev->pm.fw_version = hwmgr->smu_version >> 8;<br>
 <br>
         fw_to_check = UCODE_ID_RLC_G_MASK |<br>
                         UCODE_ID_SDMA0_MASK |<br>
@@ -719,8 +702,6 @@ static int smu8_start_smu(struct pp_hwmgr *hwmgr)<br>
         if (hwmgr->chip_id == CHIP_STONEY)<br>
                 fw_to_check &= ~(UCODE_ID_SDMA1_MASK | UCODE_ID_CP_MEC_JT2_MASK);<br>
 <br>
-       smu8_request_smu_load_fw(hwmgr);<br>
-<br>
         ret = smu8_check_fw_load_finish(hwmgr, fw_to_check);<br>
         if (ret) {<br>
                 pr_err("SMU firmware load failed\n");<br>
@@ -734,6 +715,25 @@ static int smu8_start_smu(struct pp_hwmgr *hwmgr)<br>
         return ret;<br>
 }<br>
 <br>
+static int smu8_start_smu(struct pp_hwmgr *hwmgr)<br>
+{<br>
+       struct amdgpu_device *adev = hwmgr->adev;<br>
+<br>
+       uint32_t index = SMN_MP1_SRAM_START_ADDR +<br>
+                        SMU8_FIRMWARE_HEADER_LOCATION +<br>
+                        offsetof(struct SMU8_Firmware_Header, Version);<br>
+<br>
+<br>
+       if (hwmgr == NULL || hwmgr->device == NULL)<br>
+               return -EINVAL;<br>
+<br>
+       cgs_write_register(hwmgr->device, mmMP0PUB_IND_INDEX, index);<br>
+       hwmgr->smu_version = cgs_read_register(hwmgr->device, mmMP0PUB_IND_DATA);<br>
+       adev->pm.fw_version = hwmgr->smu_version >> 8;<br>
+<br>
+       return 0;<br>
+}<br>
+<br>
 static int smu8_smu_init(struct pp_hwmgr *hwmgr)<br>
 {<br>
         int ret = 0;<br>
@@ -876,7 +876,7 @@ static bool smu8_is_dpm_running(struct pp_hwmgr *hwmgr)<br>
         .smu_fini = smu8_smu_fini,<br>
         .start_smu = smu8_start_smu,<br>
         .check_fw_load_finish = smu8_check_fw_load_finish,<br>
-       .request_smu_load_fw = NULL,<br>
+       .request_smu_load_fw = smu8_request_smu_load_fw,<br>
         .request_smu_load_specific_fw = NULL,<br>
         .get_argument = smu8_get_argument,<br>
         .send_msg_to_smc = smu8_send_msg_to_smc,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
index ae8378e..d8f1ca2 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
@@ -192,7 +192,8 @@ static int tonga_start_in_non_protection_mode(struct pp_hwmgr *hwmgr)<br>
 <br>
 static int tonga_start_smu(struct pp_hwmgr *hwmgr)<br>
 {<br>
-       int result;<br>
+       struct tonga_smumgr *priv = hwmgr->smu_backend;<br>
+       int result = 0;<br>
 <br>
         /* Only start SMC if SMC RAM is not running */<br>
         if (!smu7_is_smc_ram_running(hwmgr) && hwmgr->not_vf) {<br>
@@ -209,7 +210,14 @@ static int tonga_start_smu(struct pp_hwmgr *hwmgr)<br>
                 }<br>
         }<br>
 <br>
-       result = smu7_request_smu_load_fw(hwmgr);<br>
+       /* Setup SoftRegsStart here for register lookup in case<br>
+        * DummyBackEnd is used and ProcessFirmwareHeader is not executed<br>
+        */<br>
+<br>
+       smu7_read_smc_sram_dword(hwmgr,<br>
+                       SMU72_FIRMWARE_HEADER_LOCATION +<br>
+                       offsetof(SMU72_Firmware_Header, SoftRegisters),<br>
+                       &(priv->smu7_data.soft_regs_start), 0x40000);<br>
 <br>
         return result;<br>
 }<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
index 3d415fa..71e376f 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
@@ -218,8 +218,6 @@ static int vegam_start_smu(struct pp_hwmgr *hwmgr)<br>
                         &(smu_data->smu7_data.soft_regs_start),<br>
                         0x40000);<br>
 <br>
-       result = smu7_request_smu_load_fw(hwmgr);<br>
-<br>
         return result;<br>
 }<br>
 <br>
@@ -2280,7 +2278,7 @@ static int vegam_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)<br>
         .smu_fini = smu7_smu_fini,<br>
         .start_smu = vegam_start_smu,<br>
         .check_fw_load_finish = smu7_check_fw_load_finish,<br>
-       .request_smu_load_fw = smu7_reload_firmware,<br>
+       .request_smu_load_fw = smu7_request_smu_load_fw,<br>
         .request_smu_load_specific_fw = NULL,<br>
         .send_msg_to_smc = smu7_send_msg_to_smc,<br>
         .send_msg_to_smc_with_parameter = smu7_send_msg_to_smc_with_parameter,<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk765884" class="OWAAutoLink" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
<div id="LPBorder_GT_15380573002800.7746271423568079" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15380573002620.6615257615661329" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15380573002800.8729728302113203" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15380573002800.6596419293200704"></div>
<div id="LPTitle_15380573002800.6685421005742361" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15380573002800.5659310772379927" style="text-decoration: none;" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank">amd-gfx Info Page - freedesktop.org</a></div>
<div id="LPMetadata_15380573002800.27986444667919286" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.freedesktop.org</div>
<div id="LPDescription_15380573002800.6911916717608517" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to amd-gfx@lists.freedesktop.org. You can subscribe to the list, or change your existing subscription, in
 the sections below.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>