Skip to contentSkip to conversation

drm/amdgpu: add sriov microcode init for MP0 15.0.8

PATCH In review YuBiao Wang 2 participants 3 messages Sep 24 – Sep 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: add sriov microcode init for MP0 15.0.8

psp_init_sriov_microcode() returns -EINVAL for an MP0 version it does not know about, so PSP init fails on a VF before any firmware is loaded.

Add the MP0 15.0.8 case. It needs neither cap nor ta microcode, only the autoload trigger: on a VF psp_load_non_psp_fw() starts RLC autoload once it has handed virt.autoload_ucode_id to PSP, and on this generation IMU comes from the IFWI and is skipped, which leaves MES1 DATA as the last firmware PSP receives.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
index 66eb2f34cc0d..453aef42556d 100644
@@ -173,6 +173,9 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
 	case IP_VERSION(13, 0, 12):
 		ret = psp_init_ta_microcode(psp, ucode_prefix);
 		break;
+	case IP_VERSION(15, 0, 8):
+		adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MES1_DATA;
+		break;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.34.1
#1 lore raw

Ping.

Quoted 29 lines · YuBiao Wang

psp_init_sriov_microcode() returns -EINVAL for an MP0 version it does not know about, so PSP init fails on a VF before any firmware is loaded.

Add the MP0 15.0.8 case. It needs neither cap nor ta microcode, only the autoload trigger: on a VF psp_load_non_psp_fw() starts RLC autoload once it has handed virt.autoload_ucode_id to PSP, and on this generation IMU comes from the IFWI and is skipped, which leaves MES1 DATA as the last firmware PSP receives.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
index 66eb2f34cc0d..453aef42556d 100644
@@ -173,6 +173,9 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
 	case IP_VERSION(13, 0, 12):
 		ret = psp_init_ta_microcode(psp, ucode_prefix);
 		break;
+	case IP_VERSION(15, 0, 8):
+		adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MES1_DATA;
+		break;
 	default:
 		return -EINVAL;
 	}
Reviewed-by on v1 1/1
#2 lore raw
In reply to YuBiao Wang
Quoted 10 lines · YuBiao Wang

psp_init_sriov_microcode() returns -EINVAL for an MP0 version it does not know about, so PSP init fails on a VF before any firmware is loaded.

Add the MP0 15.0.8 case. It needs neither cap nor ta microcode, only the autoload trigger: on a VF psp_load_non_psp_fw() starts RLC autoload once it has handed virt.autoload_ucode_id to PSP, and on this generation IMU comes from the IFWI and is skipped, which leaves MES1 DATA as the last firmware PSP receives.

Thanks,
Lijo

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -0
index 66eb2f34cc0d..453aef42556d 100644
@@ -173,6 +173,9 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
  	case IP_VERSION(13, 0, 12):
  		ret = psp_init_ta_microcode(psp, ucode_prefix);
  		break;
+	case IP_VERSION(15, 0, 8):
+		adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MES1_DATA;
+		break;
  	default:
  		return -EINVAL;
  	}