<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Monday, March 4, 2019 1:36 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH] drm/amdgpu: also reroute VMC and UMD to IH ring 1 on Vega 20</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Same patch we alredy did for Vega10. Just re-route page faults to a separate<br>
ring to avoid drowning in interrupts.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 36 ++++++++++++++++++++++++++<br>
 1 file changed, 36 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c<br>
index 3f59a4477a7b..2b3429d90690 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c<br>
@@ -33,6 +33,9 @@<br>
 #include "sdma0/sdma0_4_0_offset.h"<br>
 #include "nbio/nbio_7_4_offset.h"<br>
 <br>
+#include "oss/osssys_4_0_offset.h"<br>
+#include "oss/osssys_4_0_sh_mask.h"<br>
+<br>
 MODULE_FIRMWARE("amdgpu/vega20_sos.bin");<br>
 MODULE_FIRMWARE("amdgpu/vega20_asd.bin");<br>
 MODULE_FIRMWARE("amdgpu/vega20_ta.bin");<br>
@@ -224,6 +227,37 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)<br>
         return ret;<br>
 }<br>
 <br>
+static void psp_v11_0_reroute_ih(struct psp_context *psp)<br>
+{<br>
+       struct amdgpu_device *adev = psp->adev;<br>
+       uint32_t tmp;<br>
+<br>
+       /* Change IH ring for VMC */<br>
+       tmp = REG_SET_FIELD(0, IH_CLIENT_CFG_DATA, CREDIT_RETURN_ADDR, 0x1244b);<br>
+       tmp = REG_SET_FIELD(tmp, IH_CLIENT_CFG_DATA, CLIENT_TYPE, 1);<br>
+       tmp = REG_SET_FIELD(tmp, IH_CLIENT_CFG_DATA, RING_ID, 1);<br>
+<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_69, 3);<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_70, tmp);<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_64, GFX_CTRL_CMD_ID_GBR_IH_SET);<br>
+<br>
+       mdelay(20);<br>
+       psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),<br>
+                    0x80000000, 0x8000FFFF, false);<br>
+<br>
+       /* Change IH ring for UMC */<br>
+       tmp = REG_SET_FIELD(0, IH_CLIENT_CFG_DATA, CREDIT_RETURN_ADDR, 0x1216b);<br>
+       tmp = REG_SET_FIELD(tmp, IH_CLIENT_CFG_DATA, RING_ID, 1);<br>
+<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_69, 4);<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_70, tmp);<br>
+       WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_64, GFX_CTRL_CMD_ID_GBR_IH_SET);<br>
+<br>
+       mdelay(20);<br>
+       psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),<br>
+                    0x80000000, 0x8000FFFF, false);<br>
+}<br>
+<br>
 static int psp_v11_0_ring_init(struct psp_context *psp,<br>
                               enum psp_ring_type ring_type)<br>
 {<br>
@@ -231,6 +265,8 @@ static int psp_v11_0_ring_init(struct psp_context *psp,<br>
         struct psp_ring *ring;<br>
         struct amdgpu_device *adev = psp->adev;<br>
 <br>
+       psp_v11_0_reroute_ih(psp);<br>
+<br>
         ring = &psp->km_ring;<br>
 <br>
         ring->ring_type = ring_type;<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>