aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch
new file mode 100644
index 00000000..368e5ca5
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0469-drm-amd-pp-Setup-SoftRegsStart-before-request-smu-lo.patch
@@ -0,0 +1,82 @@
+From 10e3b21a63d922f97eed1e165b4760c860bfb288 Mon Sep 17 00:00:00 2001
+From: Rex Zhu <Rex.Zhu@amd.com>
+Date: Sat, 29 Sep 2018 14:32:47 +0800
+Subject: [PATCH 0469/2940] 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>
+---
+ drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 11 ++++++++++-
+ drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 9 +++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
+index 2287ad6928d4..375ccf6ff5f2 100644
+--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
++++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
+@@ -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)
+ {
++ struct iceland_smumgr *priv = hwmgr->smu_backend;
+ int result;
+
+ 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);
+ }
+
++ /* 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);
+
+ return result;
+@@ -2654,7 +2663,7 @@ const struct pp_smumgr_func iceland_smu_funcs = {
+ .smu_fini = &smu7_smu_fini,
+ .start_smu = &iceland_start_smu,
+ .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,
+ .send_msg_to_smc = &smu7_send_msg_to_smc,
+ .send_msg_to_smc_with_parameter = &smu7_send_msg_to_smc_with_parameter,
+diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+index a2ba5b012866..3ed6c5f1e5cf 100644
+--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
++++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+@@ -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)
+ {
++ struct tonga_smumgr *priv = hwmgr->smu_backend;
+ int result;
+
+ /* 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);
+
+ return result;
+--
+2.17.1
+