Skip to contentSkip to conversation

drm/amdgpu: Hardcode reg access using L1 security

PATCH In review Trigger Huang 2 participants 2 messages Jun 3, 2019 – Jun 4, 2019 1 message not in the archive

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

PATCH 1/1 drm/amdgpu: Hardcode reg access using L1 security

Under Vega10 SR-IOV VF, L1 register access mode should be enabled by default as the non-security VF will no longer be supported.

---
 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +6 -9
index 31030f8..235548c 100644
@@ -451,19 +451,16 @@ void xgpu_ai_mailbox_put_irq(struct amdgpu_device *adev)
 
 static void xgpu_ai_init_reg_access_mode(struct amdgpu_device *adev)
 {
-	uint32_t rlc_fw_ver = RREG32_SOC15(GC, 0, mmRLC_GPM_GENERAL_6);
-	uint32_t sos_fw_ver = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
-
 	adev->virt.reg_access_mode = AMDGPU_VIRT_REG_ACCESS_LEGACY;
 
-	if (rlc_fw_ver >= 0x5d)
-		adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_ACCESS_RLC;
+	/* Enable L1 security reg access mode by defaul,  as non-security VF
+	 * will no longer be supported.
+	 */
+	adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_ACCESS_RLC;
 
-	if (sos_fw_ver >= 0x80455)
-		adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_ACCESS_PSP_PRG_IH;
+	adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_ACCESS_PSP_PRG_IH;
 
-	if (sos_fw_ver >= 0x8045b)
-		adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_SKIP_SEETING;
+	adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_SKIP_SEETING;
 }
 
 const struct amdgpu_virt_ops xgpu_ai_virt_ops = {
Signature · 6 lines
2.7.4

_______________________________________________
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): 1559562183-29241-1-git-send-email-Trigger.Huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by Emily Deng
#2 lore raw
Quoted 53 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Trigger Huang
Sent: Monday, June 3, 2019 7:43 PM
To: [email protected]
Cc: Huang, Trigger <[email protected]>
Subject: [PATCH] drm/amdgpu: Hardcode reg access using L1 security

Under Vega10 SR-IOV VF, L1 register access mode should be enabled by default as the non-security VF will no longer be supported.

---
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 15 ++++++---------

1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +5 -7
index 31030f8..235548c 100644
@@ -451,19 +451,16 @@ void xgpu_ai_mailbox_put_irq(struct
 amdgpu_device *adev)
 
 static void xgpu_ai_init_reg_access_mode(struct amdgpu_device *adev)  {
-	uint32_t rlc_fw_ver = RREG32_SOC15(GC, 0,
 mmRLC_GPM_GENERAL_6);
-	uint32_t sos_fw_ver = RREG32_SOC15(MP0, 0,
 mmMP0_SMN_C2PMSG_58);
-
 	adev->virt.reg_access_mode =
 AMDGPU_VIRT_REG_ACCESS_LEGACY;
 
-	if (rlc_fw_ver >= 0x5d)
-		adev->virt.reg_access_mode |=
 AMDGPU_VIRT_REG_ACCESS_RLC;
+	/* Enable L1 security reg access mode by defaul,  as non-security VF
+	 * will no longer be supported.
+	 */
+	adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_ACCESS_RLC;
 
-	if (sos_fw_ver >= 0x80455)
-		adev->virt.reg_access_mode |=
 AMDGPU_VIRT_REG_ACCESS_PSP_PRG_IH;
+	adev->virt.reg_access_mode |=

AMDGPU_VIRT_REG_ACCESS_PSP_PRG_IH;

drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +0 -2
-	if (sos_fw_ver >= 0x8045b)
-		adev->virt.reg_access_mode |=

AMDGPU_VIRT_REG_SKIP_SEETING;

drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +1 -0
+	adev->virt.reg_access_mode |= AMDGPU_VIRT_REG_SKIP_SEETING;

}

Quoted 8 lines

const struct amdgpu_virt_ops xgpu_ai_virt_ops = {
--
2.7.4

_______________________________________________
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