Skip to contentSkip to conversation

drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

PATCH Superseded Suresh Guttula 2 participants 5 messages Nov 18

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c  | 14 +++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -2
index 7a8cc043df5e..9d6c192db348 100644
@@ -4091,8 +4091,13 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
 			continue;
 		}
 
-		if (fw_load_skip_check(psp, ucode))
-			continue;
+		if (fw_load_skip_check(psp, ucode)) {
+			if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I ||
+			    ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D))
+				dev_dbg(psp->adev->dev, "don't skip IMU fw load!\n");
+			else
+				continue;
+		}
 
 		if (psp->autoload_supported &&
 		    (amdgpu_ip_version(adev, MP0_HWIP, 0) ==
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +13 -1
index b6c4ae35ca03..3aef68c9891a 100644
@@ -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;
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 15 lines · Suresh Guttula

For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
  drivers/gpu/drm/amd/amdgpu/imu_v11_0.c  | 14 +++++++++++++-
  2 files changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 7a8cc043df5e..9d6c192db348 100644
@@ -4091,8 +4091,13 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
  			continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_non_psp_fw(struct psp_context *psp) · line 4099

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -2
  		}
 
-		if (fw_load_skip_check(psp, ucode))
-			continue;
+		if (fw_load_skip_check(psp, ucode)) {
+			if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I ||
+			    ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D))
+				dev_dbg(psp->adev->dev, "don't skip IMU fw load!\n");
+			else
+				continue;

Keeping this in common code causes side effect on other SOCs. Better add a check inside fw_load_skip_check() such that it returns false for the particular GC IP version.

Thanks,
Lijo

Quoted 37 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+		}
 
  		if (psp->autoload_supported &&
  		    (amdgpu_ip_version(adev, MP0_HWIP, 0) ==
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +13 -1
index b6c4ae35ca03..3aef68c9891a 100644
@@ -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 lore raw

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: 18 November 2026 19:14
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

Quoted 16 lines · Suresh Guttula

For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
  drivers/gpu/drm/amd/amdgpu/imu_v11_0.c  | 14 +++++++++++++-
  2 files changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 7a8cc043df5e..9d6c192db348 100644
@@ -4091,8 +4091,13 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
                      continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_non_psp_fw(struct psp_context *psp) · line 4099

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -2
              }
 
-             if (fw_load_skip_check(psp, ucode))
-                     continue;
+             if (fw_load_skip_check(psp, ucode)) {
+                     if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I ||
+                         ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D))
+                             dev_dbg(psp->adev->dev, "don't skip IMU fw load!\n");
+                     else
+                             continue;

Keeping this in common code causes side effect on other SOCs. Better add a check inside fw_load_skip_check() such that it returns false for the particular GC IP version.

Thanks,
Lijo

This is specific to APUs, Let me add APU check also.. Like added in imuv11_init_microcode(), that will differentiate. Thanks.

Quoted 38 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+             }
 
              if (psp->autoload_supported &&
                  (amdgpu_ip_version(adev, MP0_HWIP, 0) == 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

drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +13 -1
@@ -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;
 
#3 lore raw
Quoted 40 lines · Suresh

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: 18 November 2026 19:14
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

Quoted 16 lines · Suresh Guttula

For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
   drivers/gpu/drm/amd/amdgpu/imu_v11_0.c  | 14 +++++++++++++-
   2 files changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 7a8cc043df5e..9d6c192db348 100644
@@ -4091,8 +4091,13 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
                       continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_non_psp_fw(struct psp_context *psp) · line 4099

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -2
               }
 
-             if (fw_load_skip_check(psp, ucode))
-                     continue;
+             if (fw_load_skip_check(psp, ucode)) {
+                     if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I ||
+                         ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D))
+                             dev_dbg(psp->adev->dev, "don't skip IMU fw load!\n");
+                     else
+                             continue;

Keeping this in common code causes side effect on other SOCs. Better add a check inside fw_load_skip_check() such that it returns false for the particular GC IP version.

Quoted 4 lines

Thanks,
Lijo

This is specific to APUs, Let me add APU check also.. Like added in imuv11_init_microcode(), that will differentiate.

If it's applicable for all APUs including any upcoming ones, then the commit message shouldn't specify "For GC v11".

Thanks,
Lijo

Quoted 41 lines

Thanks.

Quoted 38 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+             }
 
               if (psp->autoload_supported &&
                   (amdgpu_ip_version(adev, MP0_HWIP, 0) == 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

drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +13 -1
@@ -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;
 
#4 lore raw

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: 18 November 2026 19:26
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

Quoted 41 lines · Suresh

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: 18 November 2026 19:14
To: Guttula, Suresh <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: Enable IMU_I/DRAM FW_LOAD CMD

Quoted 16 lines · Suresh Guttula

For GC 11, Eventhough IMU ucode load from BIOS/IFWI, PSP exepct Load command from GFX to load IMU ucode.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
   drivers/gpu/drm/amd/amdgpu/imu_v11_0.c  | 14 +++++++++++++-
   2 files changed, 20 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 7a8cc043df5e..9d6c192db348 100644
@@ -4091,8 +4091,13 @@ static int psp_load_non_psp_fw(struct psp_context *psp)
                       continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c static int psp_load_non_psp_fw(struct psp_context *psp) · line 4099

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -2
               }
 
-             if (fw_load_skip_check(psp, ucode))
-                     continue;
+             if (fw_load_skip_check(psp, ucode)) {
+                     if (!ucode->fw && (ucode->ucode_id == AMDGPU_UCODE_ID_IMU_I ||
+                         ucode->ucode_id == AMDGPU_UCODE_ID_IMU_D))
+                             dev_dbg(psp->adev->dev, "don't skip IMU fw load!\n");
+                     else
+                             continue;

Keeping this in common code causes side effect on other SOCs. Better add a check inside fw_load_skip_check() such that it returns false for the particular GC IP version.

Quoted 4 lines

Thanks,
Lijo

This is specific to APUs, Let me add APU check also.. Like added in imuv11_init_microcode(), that will differentiate.

If it's applicable for all APUs including any upcoming ones, then the commit message shouldn't specify "For GC v11".

Thanks,
Lijo

As of now, this is specific to GC11 only.. I will update.

Quoted 41 lines

Thanks.

Quoted 38 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
+             }
 
               if (psp->autoload_supported &&
                   (amdgpu_ip_version(adev, MP0_HWIP, 0) == 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

drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +13 -1
@@ -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;