drm/amdgpu/gfx10: add support for wks firmware loading
Subsystems (2)
PATCH 1/1 drm/amdgpu/gfx10: add support for wks firmware loading
From: "Tianci.Yin" <[email protected]>
load different cp firmware according to the DID and RID
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +16 -6
@@ -66,6 +66,11 @@ MODULE_FIRMWARE("amdgpu/navi10_mec.bin");MODULE_FIRMWARE ("amdgpu/navi10_mec2.bin" );MODULE_FIRMWARE ("amdgpu/navi10_rlc.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_ce_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_pfp_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_me_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec2_wks.bin" );MODULE_FIRMWARE ("amdgpu/navi14_ce.bin" );MODULE_FIRMWARE ("amdgpu/navi14_pfp.bin" );MODULE_FIRMWARE ("amdgpu/navi14_me.bin" );
@@ -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) {const char *chip_name; -char fw_name[30 ]; +char fw_name[40 ]; +char wks[10 ];int err;struct amdgpu_firmware_info *info =NULL ;const struct common_firmware_header *header =NULL ;
@@ -604,12 +610,16 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)DRM_DEBUG ("\n" ); +memset (wks,0 ,sizeof (wks));switch (adev->asic_type) {case CHIP_NAVI10 : chip_name ="navi10" ;break ;case CHIP_NAVI14 : chip_name ="navi14" ; +if (!(adev->pdev->device ==0x7340 && + adev->pdev->revision !=0x00 )) +snprintf (wks,sizeof (wks),"_wks" );break ;case CHIP_NAVI12 : chip_name ="navi12" ;
@@ -618,7 +628,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)BUG (); } -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_pfp.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_pfp%s.bin" , chip_name, wks); err =request_firmware (&adev->gfx.pfp_fw, fw_name, adev->dev);if (err) goto out;
@@ -629,7 +639,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) adev->gfx.pfp_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); adev->gfx.pfp_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version); -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_me.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_me%s.bin" , chip_name, wks); err =request_firmware (&adev->gfx.me_fw, fw_name, adev->dev);if (err) goto out;
@@ -640,7 +650,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) adev->gfx.me_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); adev->gfx.me_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version); -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ce.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_ce%s.bin" , chip_name, wks); err =request_firmware (&adev->gfx.ce_fw, fw_name, adev->dev);if (err) goto out;
@@ -705,7 +715,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)if (adev->gfx.rlc.is_rlc_v2_1)gfx_v10_0_init_rlc_ext_microcode (adev); -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_mec.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_mec%s.bin" , chip_name, wks); err =request_firmware (&adev->gfx.mec_fw, fw_name, adev->dev);if (err) goto out;
@@ -716,7 +726,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) adev->gfx.mec_fw_version =le32_to_cpu (cp_hdr->header.ucode_version); adev->gfx.mec_feature_version =le32_to_cpu (cp_hdr->ucode_feature_version); -snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_mec2.bin" , chip_name); +snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_mec2%s.bin" , chip_name, wks); err =request_firmware (&adev->gfx.mec2_fw, fw_name, adev->dev);if (!err) { err =amdgpu_ucode_validate (adev->gfx.mec2_fw);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Xu, Feifei
Reviewed-by Feifei Xu-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tianci Yin
Sent: Thursday, September 19, 2019 1:33 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu/gfx10: add support for wks firmware loading
From: "Tianci.Yin" <[email protected]>
load different cp firmware according to the DID and RID
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +7 -1
@@ -66,6 +66,11 @@ MODULE_FIRMWARE("amdgpu/navi10_mec.bin");MODULE_FIRMWARE ("amdgpu/navi10_mec2.bin" );MODULE_FIRMWARE ("amdgpu/navi10_rlc.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_ce_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_pfp_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_me_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec2_wks.bin" );MODULE_FIRMWARE ("amdgpu/navi14_ce.bin" );MODULE_FIRMWARE ("amdgpu/navi14_pfp.bin" );MODULE_FIRMWARE ("amdgpu/navi14_me.bin" );
@@ -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) {const char *chip_name; -char fw_name[30 ]; +char fw_name[40 ]; +char wks[10 ];int err;struct amdgpu_firmware_info *info =NULL ; const struct common_firmware_header *header = NULL; @@ -604,12 +610,16 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) DRM_DEBUG("\n");
+ memset(wks, 0, sizeof(wks));
switch (adev->asic_type) {
case CHIP_NAVI10:
chip_name = "navi10";
break;
case CHIP_NAVI14:
chip_name = "navi14";
+ if (!(adev->pdev->device == 0x7340 &&
+ adev->pdev->revision != 0x00))
+ snprintf(wks, sizeof(wks), "_wks");
break;
case CHIP_NAVI12:
chip_name = "navi12";
@@ -618,7 +628,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
BUG();
}
- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.pfp_fw, fw_name, adev->dev); if (err)
goto out;
@@ -629,7 +639,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.pfp_fw_version = le32_to_cpu(cp_hdr->header.ucode_version); adev->gfx.pfp_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.me_fw, fw_name, adev->dev); if (err)
goto out;
@@ -640,7 +650,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.me_fw_version = le32_to_cpu(cp_hdr->header.ucode_version); adev->gfx.me_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.ce_fw, fw_name, adev->dev); if (err)
goto out;
@@ -705,7 +715,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
if (adev->gfx.rlc.is_rlc_v2_1)
gfx_v10_0_init_rlc_ext_microcode(adev);
- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.mec_fw, fw_name, adev->dev); if (err)
goto out;
@@ -716,7 +726,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.mec_fw_version = le32_to_cpu(cp_hdr->header.ucode_version); adev->gfx.mec_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.mec2_fw, fw_name, adev->dev); if (!err) {
err = amdgpu_ucode_validate(adev->gfx.mec2_fw);
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CH2PR12MB37670D6362ADEBD444190252FE890-rV3HgkLYx2Vb0rI3ZRjBIAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Yin, Tianci (Rico)
Reviewed-by Feifei XuThanks Feifei!
________________________________
From: Xu, Feifei <[email protected]>
Sent: Thursday, September 19, 2019 14:05
To: Yin, Tianci (Rico) <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/gfx10: add support for wks firmware loading
-----Original Message-----
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of Tianci Yin
Sent: Thursday, September 19, 2019 1:33 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu/gfx10: add support for wks firmware loading
From: "Tianci.Yin" <[email protected]>
load different cp firmware according to the DID and RID
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +7 -1
@@ -66,6 +66,11 @@ MODULE_FIRMWARE("amdgpu/navi10_mec.bin");MODULE_FIRMWARE ("amdgpu/navi10_mec2.bin" );MODULE_FIRMWARE ("amdgpu/navi10_rlc.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_ce_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_pfp_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_me_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec_wks.bin" ); +MODULE_FIRMWARE ("amdgpu/navi14_mec2_wks.bin" );MODULE_FIRMWARE ("amdgpu/navi14_ce.bin" );MODULE_FIRMWARE ("amdgpu/navi14_pfp.bin" );MODULE_FIRMWARE ("amdgpu/navi14_me.bin" );
@@ -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) {const char *chip_name; -char fw_name[30 ]; +char fw_name[40 ]; +char wks[10 ];int err;struct amdgpu_firmware_info *info =NULL ; const struct common_firmware_header *header = NULL; @@ -604,12 +610,16 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) DRM_DEBUG("\n");
+ memset(wks, 0, sizeof(wks));
switch (adev->asic_type) {
case CHIP_NAVI10:
chip_name = "navi10";
break;
case CHIP_NAVI14:
chip_name = "navi14";
+ if (!(adev->pdev->device == 0x7340 &&
+ adev->pdev->revision != 0x00))
+ snprintf(wks, sizeof(wks), "_wks");
break;
case CHIP_NAVI12:
chip_name = "navi12";
@@ -618,7 +628,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
BUG();
}- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.pfp_fw, fw_name, adev->dev);
if (err)
goto out;
@@ -629,7 +639,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.pfp_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.pfp_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.me_fw, fw_name, adev->dev);
if (err)
goto out;
@@ -640,7 +650,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.me_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.me_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.ce_fw, fw_name, adev->dev);
if (err)
goto out;
@@ -705,7 +715,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
if (adev->gfx.rlc.is_rlc_v2_1)
gfx_v10_0_init_rlc_ext_microcode(adev);- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.mec_fw, fw_name, adev->dev);
if (err)
goto out;
@@ -716,7 +726,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
adev->gfx.mec_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.mec_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);- snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);
+ snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2%s.bin", chip_name,
+wks);
err = request_firmware(&adev->gfx.mec2_fw, fw_name, adev->dev);
if (!err) {
err = amdgpu_ucode_validate(adev->gfx.mec2_fw);--
2.17.1
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx