<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks Feifei!<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Xu, Feifei <Feifei.Xu@amd.com><br>
<b>Sent:</b> Thursday, September 19, 2019 14:05<br>
<b>To:</b> Yin, Tianci (Rico) <Tianci.Yin@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Yin, Tianci (Rico) <Tianci.Yin@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu/gfx10: add support for wks firmware loading</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com><br>
<br>
-----Original Message-----<br>
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Tianci Yin<br>
Sent: Thursday, September 19, 2019 1:33 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Yin, Tianci (Rico) <Tianci.Yin@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
Subject: [PATCH] drm/amdgpu/gfx10: add support for wks firmware loading<br>
<br>
From: "Tianci.Yin" <tianci.yin@amd.com><br>
<br>
load different cp firmware according to the DID and RID<br>
<br>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 ++++++++++++++++------<br>
 1 file changed, 16 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
index 082a0b3298a9..65caf404e7d1 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
@@ -66,6 +66,11 @@ MODULE_FIRMWARE("amdgpu/navi10_mec.bin");<br>
 MODULE_FIRMWARE("amdgpu/navi10_mec2.bin");<br>
 MODULE_FIRMWARE("amdgpu/navi10_rlc.bin");<br>
 <br>
+MODULE_FIRMWARE("amdgpu/navi14_ce_wks.bin");<br>
+MODULE_FIRMWARE("amdgpu/navi14_pfp_wks.bin");<br>
+MODULE_FIRMWARE("amdgpu/navi14_me_wks.bin");<br>
+MODULE_FIRMWARE("amdgpu/navi14_mec_wks.bin");<br>
+MODULE_FIRMWARE("amdgpu/navi14_mec2_wks.bin");<br>
 MODULE_FIRMWARE("amdgpu/navi14_ce.bin");<br>
 MODULE_FIRMWARE("amdgpu/navi14_pfp.bin");<br>
 MODULE_FIRMWARE("amdgpu/navi14_me.bin");<br>
@@ -591,7 +596,8 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev)  static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)  {<br>
         const char *chip_name;<br>
-       char fw_name[30];<br>
+       char fw_name[40];<br>
+       char wks[10];<br>
         int err;<br>
         struct amdgpu_firmware_info *info = NULL;<br>
         const struct common_firmware_header *header = NULL; @@ -604,12 +610,16 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
 <br>
         DRM_DEBUG("\n");<br>
 <br>
+       memset(wks, 0, sizeof(wks));<br>
         switch (adev->asic_type) {<br>
         case CHIP_NAVI10:<br>
                 chip_name = "navi10";<br>
                 break;<br>
         case CHIP_NAVI14:<br>
                 chip_name = "navi14";<br>
+               if (!(adev->pdev->device == 0x7340 &&<br>
+                     adev->pdev->revision != 0x00))<br>
+                       snprintf(wks, sizeof(wks), "_wks");<br>
                 break;<br>
         case CHIP_NAVI12:<br>
                 chip_name = "navi12";<br>
@@ -618,7 +628,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
                 BUG();<br>
         }<br>
 <br>
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name);<br>
+       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp%s.bin", chip_name, <br>
+wks);<br>
         err = request_firmware(&adev->gfx.pfp_fw, fw_name, adev->dev);<br>
         if (err)<br>
                 goto out;<br>
@@ -629,7 +639,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
         adev->gfx.pfp_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);<br>
         adev->gfx.pfp_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);<br>
 <br>
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name);<br>
+       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me%s.bin", chip_name, <br>
+wks);<br>
         err = request_firmware(&adev->gfx.me_fw, fw_name, adev->dev);<br>
         if (err)<br>
                 goto out;<br>
@@ -640,7 +650,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
         adev->gfx.me_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);<br>
         adev->gfx.me_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);<br>
 <br>
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name);<br>
+       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce%s.bin", chip_name, <br>
+wks);<br>
         err = request_firmware(&adev->gfx.ce_fw, fw_name, adev->dev);<br>
         if (err)<br>
                 goto out;<br>
@@ -705,7 +715,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
         if (adev->gfx.rlc.is_rlc_v2_1)<br>
                 gfx_v10_0_init_rlc_ext_microcode(adev);<br>
 <br>
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);<br>
+       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec%s.bin", chip_name, <br>
+wks);<br>
         err = request_firmware(&adev->gfx.mec_fw, fw_name, adev->dev);<br>
         if (err)<br>
                 goto out;<br>
@@ -716,7 +726,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)<br>
         adev->gfx.mec_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);<br>
         adev->gfx.mec_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);<br>
 <br>
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);<br>
+       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2%s.bin", chip_name, <br>
+wks);<br>
         err = request_firmware(&adev->gfx.mec2_fw, fw_name, adev->dev);<br>
         if (!err) {<br>
                 err = amdgpu_ucode_validate(adev->gfx.mec2_fw);<br>
--<br>
2.17.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">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>