RLC and PSP TOC firmwares are different, rest all firmwares are
same for GC 11.7.0 and GC 11.7.1. Reuse VCN,VPE,SDMA,DMU,MES,PFP,
ME,MEC,IMU and PSP TA firmwares for GC 11.7.1 from GC 11.7.0

Signed-off-by: Kanala Ramalingeswara Reddy <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c |  6 ++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c    | 11 ++++++++---
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c    |  1 -
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c    |  2 --
 drivers/gpu/drm/amd/amdgpu/psp_v15_0.c    |  7 ++++++-
 5 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 4f1c711df5bd..ee0b785b4a39 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -1458,6 +1458,12 @@ void amdgpu_ucode_ip_version_decode(struct amdgpu_device 
*adev, int block_type,
        switch (block_type) {
        case GC_HWIP:
                ip_name = "gc";
+               /*
+                *RLC fw is different and rest all fw are same for GC 11.7.0
+                *and GC 11.7.1
+                */
+               if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 7, 1))
+                       version = IP_VERSION(11, 7, 0);
                break;
        case SDMA0_HWIP:
                ip_name = "sdma";
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 0cbbdc3694f4..710bd195c4b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -137,9 +137,6 @@ MODULE_FIRMWARE("amdgpu/gc_11_7_0_pfp.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_me.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_rlc.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_pfp.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_me.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_mec.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_1_rlc.bin");
 
 static const struct amdgpu_hwip_reg_entry gc_reg_list_11_0[] = {
@@ -745,6 +742,7 @@ static int gfx_v11_0_init_microcode(struct amdgpu_device 
*adev)
        DRM_DEBUG("\n");
 
        amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, 
sizeof(ucode_prefix));
+
        err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
                                   AMDGPU_UCODE_REQUIRED,
                                   "amdgpu/%s_pfp.bin", ucode_prefix);
@@ -786,6 +784,13 @@ static int gfx_v11_0_init_microcode(struct amdgpu_device 
*adev)
                        err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
                                                   AMDGPU_UCODE_REQUIRED,
                                                   "amdgpu/%s_rlc_kicker.bin", 
ucode_prefix);
+               /*
+                *RLC fw is different for GC 11.7.0 and GC 11.7.1
+                */
+               else if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 
7, 1))
+                       err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
+                                                  AMDGPU_UCODE_REQUIRED,
+                                                  "amdgpu/gc_11_7_1_rlc.bin");
                else
                        err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
                                                   AMDGPU_UCODE_REQUIRED,
diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
index 09dc01a425d1..2fc2a8e4be98 100644
--- a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
@@ -44,7 +44,6 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_3_imu.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_5_4_imu.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_5_6_imu.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_imu.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_imu.bin");
 
 static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index b72da75dd851..988afc0631b2 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -62,8 +62,6 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_6_mes_2.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_5_6_mes1.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_mes_2.bin");
 MODULE_FIRMWARE("amdgpu/gc_11_7_0_mes1.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_mes_2.bin");
-MODULE_FIRMWARE("amdgpu/gc_11_7_1_mes1.bin");
 
 static int mes_v11_0_hw_init(struct amdgpu_ip_block *ip_block);
 static int mes_v11_0_hw_fini(struct amdgpu_ip_block *ip_block);
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v15_0.c 
b/drivers/gpu/drm/amd/amdgpu/psp_v15_0.c
index 2a4d91368ac6..c78a8f1e8c8a 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v15_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v15_0.c
@@ -34,7 +34,6 @@
 MODULE_FIRMWARE("amdgpu/psp_15_0_0_toc.bin");
 MODULE_FIRMWARE("amdgpu/psp_15_0_0_ta.bin");
 MODULE_FIRMWARE("amdgpu/psp_15_0_9_toc.bin");
-MODULE_FIRMWARE("amdgpu/psp_15_0_9_ta.bin");
 
 static int psp_v15_0_0_init_microcode(struct psp_context *psp)
 {
@@ -48,6 +47,12 @@ static int psp_v15_0_0_init_microcode(struct psp_context 
*psp)
        if (err)
                return err;
 
+       /*
+        *PSP ta FW is same for PSP v15_0_9 and PSP v15_0_0
+        */
+       if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(15, 0, 9))
+               snprintf(ucode_prefix, sizeof(ucode_prefix), "%s", 
"psp_15_0_0");
+
        err = psp_init_ta_microcode(psp, ucode_prefix);
        if (err)
                return err;
-- 
2.53.0

Reply via email to