Re: [PATCH] drm/amdgpu: disable gpa mode for direct loading

2020-10-14 Thread Alex Deucher
On Wed, Oct 14, 2020 at 7:59 PM Huang Rui  wrote:
>
> This patch fixes the gfx hang while use firmware direct loading mode.
>
> Signed-off-by: Huang Rui 

Acked-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 20 
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 042ad5e4292b..8fc69c208adb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -129,6 +129,13 @@
>  #define mmCP_HYP_ME_UCODE_DATA 0x5817
>  #define mmCP_HYP_ME_UCODE_DATA_BASE_IDX1
>
> +#define mmCPG_PSP_DEBUG0x5c10
> +#define mmCPG_PSP_DEBUG_BASE_IDX   1
> +#define mmCPC_PSP_DEBUG0x5c11
> +#define mmCPC_PSP_DEBUG_BASE_IDX   1
> +#define CPC_PSP_DEBUG__GPA_OVERRIDE_MASK   0x0008L
> +#define CPG_PSP_DEBUG__GPA_OVERRIDE_MASK   0x0008L
> +
>  MODULE_FIRMWARE("amdgpu/navi10_ce.bin");
>  MODULE_FIRMWARE("amdgpu/navi10_pfp.bin");
>  MODULE_FIRMWARE("amdgpu/navi10_me.bin");
> @@ -7035,6 +7042,18 @@ static void gfx_v10_0_setup_grbm_cam_remapping(struct 
> amdgpu_device *adev)
> WREG32_SOC15(GC, 0, mmGRBM_CAM_DATA, data);
>  }
>
> +static void gfx_v10_0_disable_gpa_mode(struct amdgpu_device *adev)
> +{
> +   uint32_t data;
> +   data = RREG32_SOC15(GC, 0, mmCPC_PSP_DEBUG);
> +   data |= CPC_PSP_DEBUG__GPA_OVERRIDE_MASK;
> +   WREG32_SOC15(GC, 0, mmCPC_PSP_DEBUG, data);
> +
> +   data = RREG32_SOC15(GC, 0, mmCPG_PSP_DEBUG);
> +   data |= CPG_PSP_DEBUG__GPA_OVERRIDE_MASK;
> +   WREG32_SOC15(GC, 0, mmCPG_PSP_DEBUG, data);
> +}
> +
>  static int gfx_v10_0_hw_init(void *handle)
>  {
> int r;
> @@ -7060,6 +7079,7 @@ static int gfx_v10_0_hw_init(void *handle)
> return r;
> }
> }
> +   gfx_v10_0_disable_gpa_mode(adev);
> }
>
> /* if GRBM CAM not remapped, set up the remapping */
> --
> 2.25.1
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] drm/amdgpu: disable gpa mode for direct loading

2020-10-14 Thread Huang Rui
This patch fixes the gfx hang while use firmware direct loading mode.

Signed-off-by: Huang Rui 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 042ad5e4292b..8fc69c208adb 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -129,6 +129,13 @@
 #define mmCP_HYP_ME_UCODE_DATA 0x5817
 #define mmCP_HYP_ME_UCODE_DATA_BASE_IDX1
 
+#define mmCPG_PSP_DEBUG0x5c10
+#define mmCPG_PSP_DEBUG_BASE_IDX   1
+#define mmCPC_PSP_DEBUG0x5c11
+#define mmCPC_PSP_DEBUG_BASE_IDX   1
+#define CPC_PSP_DEBUG__GPA_OVERRIDE_MASK   0x0008L
+#define CPG_PSP_DEBUG__GPA_OVERRIDE_MASK   0x0008L
+
 MODULE_FIRMWARE("amdgpu/navi10_ce.bin");
 MODULE_FIRMWARE("amdgpu/navi10_pfp.bin");
 MODULE_FIRMWARE("amdgpu/navi10_me.bin");
@@ -7035,6 +7042,18 @@ static void gfx_v10_0_setup_grbm_cam_remapping(struct 
amdgpu_device *adev)
WREG32_SOC15(GC, 0, mmGRBM_CAM_DATA, data);
 }
 
+static void gfx_v10_0_disable_gpa_mode(struct amdgpu_device *adev)
+{
+   uint32_t data;
+   data = RREG32_SOC15(GC, 0, mmCPC_PSP_DEBUG);
+   data |= CPC_PSP_DEBUG__GPA_OVERRIDE_MASK;
+   WREG32_SOC15(GC, 0, mmCPC_PSP_DEBUG, data);
+
+   data = RREG32_SOC15(GC, 0, mmCPG_PSP_DEBUG);
+   data |= CPG_PSP_DEBUG__GPA_OVERRIDE_MASK;
+   WREG32_SOC15(GC, 0, mmCPG_PSP_DEBUG, data);
+}
+
 static int gfx_v10_0_hw_init(void *handle)
 {
int r;
@@ -7060,6 +7079,7 @@ static int gfx_v10_0_hw_init(void *handle)
return r;
}
}
+   gfx_v10_0_disable_gpa_mode(adev);
}
 
/* if GRBM CAM not remapped, set up the remapping */
-- 
2.25.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx