aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch
new file mode 100644
index 00000000..605292be
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3030-drm-amd-pp-Get-and-save-CZ-ST-smu-version.patch
@@ -0,0 +1,57 @@
+From cc818d6fff59c00bb11326d2e0d06480639ea6a0 Mon Sep 17 00:00:00 2001
+From: Rex Zhu <Rex.Zhu@amd.com>
+Date: Thu, 21 Dec 2017 18:38:47 +0800
+Subject: [PATCH 3030/4131] drm/amd/pp: Get and save CZ/ST smu version
+
+The smu firmware is loaded by the sbios on APUs, so query it
+from the smu and save the smu fw version info that is reported
+to userspace.
+
+Change-Id: I5de5aff3eaa9a7f0c273fa31bd252c52211f4247
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 2 ++
+ drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 13 +++++++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+index 13607e2..4466f35 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+@@ -801,6 +801,8 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
+ else
+ strcpy(fw_name, "amdgpu/vega10_smc.bin");
+ break;
++ case CHIP_CARRIZO:
++ case CHIP_STONEY:
+ case CHIP_RAVEN:
+ adev->pm.fw_version = info->version;
+ return 0;
+diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
+index 78ab055..4d3aff3 100644
+--- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
++++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
+@@ -709,6 +709,19 @@ static int cz_start_smu(struct pp_hwmgr *hwmgr)
+ {
+ int ret = 0;
+ uint32_t fw_to_check = 0;
++ struct cgs_firmware_info info = {0};
++ uint32_t index = SMN_MP1_SRAM_START_ADDR +
++ SMU8_FIRMWARE_HEADER_LOCATION +
++ offsetof(struct SMU8_Firmware_Header, Version);
++
++
++ if (hwmgr == NULL || hwmgr->device == NULL)
++ return -EINVAL;
++
++ cgs_write_register(hwmgr->device, mmMP0PUB_IND_INDEX, index);
++ hwmgr->smu_version = cgs_read_register(hwmgr->device, mmMP0PUB_IND_DATA);
++ info.version = hwmgr->smu_version >> 8;
++ cgs_get_firmware_info(hwmgr->device, CGS_UCODE_ID_SMU, &info);
+
+ fw_to_check = UCODE_ID_RLC_G_MASK |
+ UCODE_ID_SDMA0_MASK |
+--
+2.7.4
+