Commit f8f70c13 authored by John Clements's avatar John Clements Committed by Alex Deucher
Browse files

drm/amdgpu: disable mec2 fw bin loading



disable mec2 fw bin loading and reference on unsupported ASIC

Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarJohn Clements <john.clements@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 211fe484
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
@@ -107,14 +107,12 @@ MODULE_FIRMWARE("amdgpu/raven2_rlc.bin");
MODULE_FIRMWARE("amdgpu/raven_kicker_rlc.bin");

MODULE_FIRMWARE("amdgpu/arcturus_mec.bin");
MODULE_FIRMWARE("amdgpu/arcturus_mec2.bin");
MODULE_FIRMWARE("amdgpu/arcturus_rlc.bin");

MODULE_FIRMWARE("amdgpu/renoir_ce.bin");
MODULE_FIRMWARE("amdgpu/renoir_pfp.bin");
MODULE_FIRMWARE("amdgpu/renoir_me.bin");
MODULE_FIRMWARE("amdgpu/renoir_mec.bin");
MODULE_FIRMWARE("amdgpu/renoir_mec2.bin");
MODULE_FIRMWARE("amdgpu/renoir_rlc.bin");

MODULE_FIRMWARE("amdgpu/green_sardine_ce.bin");
@@ -1517,6 +1515,15 @@ static int gfx_v9_0_init_rlc_microcode(struct amdgpu_device *adev,
	return err;
}

static bool gfx_v9_0_load_mec2_fw_bin_support(struct amdgpu_device *adev)
{
	if (adev->asic_type == CHIP_ARCTURUS  ||
	    adev->asic_type == CHIP_RENOIR)
	    return false;

	return true;
}

static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
					  const char *chip_name)
{
@@ -1538,6 +1545,7 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
	adev->gfx.mec_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);


	if (gfx_v9_0_load_mec2_fw_bin_support(adev)) {
		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name);
		err = request_firmware(&adev->gfx.mec2_fw, fw_name, adev->dev);
		if (!err) {
@@ -1554,6 +1562,7 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,
			err = 0;
			adev->gfx.mec2_fw = NULL;
		}
	}

	if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
		info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1];
@@ -1581,8 +1590,7 @@ static int gfx_v9_0_init_cp_compute_microcode(struct amdgpu_device *adev,

			/* TODO: Determine if MEC2 JT FW loading can be removed
				 for all GFX V9 asic and above */
			if (adev->asic_type != CHIP_ARCTURUS &&
			    adev->asic_type != CHIP_RENOIR) {
			if (gfx_v9_0_load_mec2_fw_bin_support(adev)) {
				info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC2_JT];
				info->ucode_id = AMDGPU_UCODE_ID_CP_MEC2_JT;
				info->fw = adev->gfx.mec2_fw;