aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch
new file mode 100644
index 00000000..730f9e41
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1484-drm-amd-powerplay-get-eclk-vclk-dclk-for-smu11.patch
@@ -0,0 +1,85 @@
+From 8d48afcb6e9886fc5b7318fb9295fed6d0b9ca67 Mon Sep 17 00:00:00 2001
+From: Likun Gao <Likun.Gao@amd.com>
+Date: Mon, 28 Jan 2019 12:04:46 +0800
+Subject: [PATCH 1484/2940] drm/amd/powerplay: get eclk/vclk/dclk for smu11
+
+Get eclk, vclk and dclk info from vbios when hw init for smu11.
+
+Signed-off-by: Likun Gao <Likun.Gao@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 3 ++
+ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 42 +++++++++++++++++++
+ 2 files changed, 45 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+index 8464fdb3c337..00ef6f1c9d30 100644
+--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
++++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+@@ -282,6 +282,9 @@ struct smu_bios_boot_up_values
+ uint32_t uclk;
+ uint32_t socclk;
+ uint32_t dcefclk;
++ uint32_t eclk;
++ uint32_t vclk;
++ uint32_t dclk;
+ uint16_t vddc;
+ uint16_t vddci;
+ uint16_t mvddc;
+diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+index 8acfeed1f774..21490867f40f 100644
+--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
++++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+@@ -462,6 +462,48 @@ static int smu_v11_0_get_clk_info_from_vbios(struct smu_context *smu)
+ output = (struct atom_get_smu_clock_info_output_parameters_v3_1 *)&input;
+ smu->smu_table.boot_values.dcefclk = le32_to_cpu(output->atom_smu_outputclkfreq.smu_clock_freq_hz) / 10000;
+
++ memset(&input, 0, sizeof(input));
++ input.clk_id = SMU11_SYSPLL0_ECLK_ID;
++ input.command = GET_SMU_CLOCK_INFO_V3_1_GET_CLOCK_FREQ;
++ index = get_index_into_master_table(atom_master_list_of_command_functions_v2_1,
++ getsmuclockinfo);
++
++ ret = amdgpu_atom_execute_table(adev->mode_info.atom_context, index,
++ (uint32_t *)&input);
++ if (ret)
++ return -EINVAL;
++
++ output = (struct atom_get_smu_clock_info_output_parameters_v3_1 *)&input;
++ smu->smu_table.boot_values.eclk = le32_to_cpu(output->atom_smu_outputclkfreq.smu_clock_freq_hz) / 10000;
++
++ memset(&input, 0, sizeof(input));
++ input.clk_id = SMU11_SYSPLL0_VCLK_ID;
++ input.command = GET_SMU_CLOCK_INFO_V3_1_GET_CLOCK_FREQ;
++ index = get_index_into_master_table(atom_master_list_of_command_functions_v2_1,
++ getsmuclockinfo);
++
++ ret = amdgpu_atom_execute_table(adev->mode_info.atom_context, index,
++ (uint32_t *)&input);
++ if (ret)
++ return -EINVAL;
++
++ output = (struct atom_get_smu_clock_info_output_parameters_v3_1 *)&input;
++ smu->smu_table.boot_values.vclk = le32_to_cpu(output->atom_smu_outputclkfreq.smu_clock_freq_hz) / 10000;
++
++ memset(&input, 0, sizeof(input));
++ input.clk_id = SMU11_SYSPLL0_DCLK_ID;
++ input.command = GET_SMU_CLOCK_INFO_V3_1_GET_CLOCK_FREQ;
++ index = get_index_into_master_table(atom_master_list_of_command_functions_v2_1,
++ getsmuclockinfo);
++
++ ret = amdgpu_atom_execute_table(adev->mode_info.atom_context, index,
++ (uint32_t *)&input);
++ if (ret)
++ return -EINVAL;
++
++ output = (struct atom_get_smu_clock_info_output_parameters_v3_1 *)&input;
++ smu->smu_table.boot_values.dclk = le32_to_cpu(output->atom_smu_outputclkfreq.smu_clock_freq_hz) / 10000;
++
+ return 0;
+ }
+
+--
+2.17.1
+