For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.
v2: Updated fw_load_skip_check specific to GC11 Signed-off-by: Suresh Guttula <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/imu_v11_0.c | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 7a8cc043df5e..e50796f530a9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -4023,6 +4023,16 @@ static int psp_load_smu_fw(struct psp_context *psp) static bool fw_load_skip_check(struct psp_context *psp, struct amdgpu_firmware_info *ucode) { + struct amdgpu_device *adev = psp->adev; + /* Keep IMU firmware loading enabled for APUs with GC IP 11.0.0-11.7.1. */ + if ((adev->flags & AMD_IS_APU) && + (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0) + && amdgpu_ip_version(adev, GC_HWIP, 0) <= IP_VERSION(11, 7, 1))) { + if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I || + ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D)) + return false; + } + if (!ucode->fw || !ucode->ucode_size) return true; diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c index b6c4ae35ca03..3aef68c9891a 100644 --- a/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/imu_v11_0.c @@ -31,6 +31,8 @@ #include "gc/gc_11_0_0_offset.h" #include "gc/gc_11_0_0_sh_mask.h" +#define IMU_DATA_SIZE_BYTES 66304 + MODULE_FIRMWARE("amdgpu/gc_11_0_0_imu.bin"); MODULE_FIRMWARE("amdgpu/gc_11_0_0_imu_kicker.bin"); MODULE_FIRMWARE("amdgpu/gc_11_0_1_imu.bin"); @@ -73,8 +75,18 @@ static int imu_v11_0_init_microcode(struct amdgpu_device *adev) else err = amdgpu_ucode_request(adev, &adev->gfx.imu_fw, required, "amdgpu/%s_imu.bin", ucode_prefix); - if (err == -ENODEV && imu_in_ifwi) + if (err == -ENODEV && imu_in_ifwi) { + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_IMU_I]; + info->ucode_id = AMDGPU_UCODE_ID_IMU_I; + info->fw = adev->gfx.imu_fw; + info->ucode_size = IMU_DATA_SIZE_BYTES; + + info = &adev->firmware.ucode[AMDGPU_UCODE_ID_IMU_D]; + info->ucode_id = AMDGPU_UCODE_ID_IMU_D; + info->fw = adev->gfx.imu_fw; + info->ucode_size = IMU_DATA_SIZE_BYTES; return 0; + } if (err) goto out; -- 2.43.0
