drm/amdgpu: init SAW registers for mmhub v3.3
Subsystems (2)
PATCH 1/3 drm/amdgpu: init SAW registers for mmhub v3.3
This patch to configure mmhub3.3 SAW registers
Signed-off-by Yifan Zhang <[email protected]>
Reviewed-by Mario Limonciello <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c +40 -0
@@ -359,6 +359,43 @@ static void mmhub_v3_3_program_invalidation(struct amdgpu_device *adev) } } +static void mmhub_v3_3_init_saw_regs (struct amdgpu_device *adev) +{ +uint64_t pt_base =amdgpu_gmc_pd_addr (adev->gart.bo); +uint32_t tmp; + +/* Program page table base, gart start, gart end */ +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32, +lower_32_bits (pt_base >>12 )); +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32, +upper_32_bits (pt_base >>12 )); + +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_START_ADDR_LO32, + (u32)(adev->gmc.gart_start >>12 )); +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_START_ADDR_HI32, + (u32)(adev->gmc.gart_start >>44 )); + +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_END_ADDR_LO32, + (u32)(adev->gmc.gart_end >>12 )); +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_PAGE_TABLE_END_ADDR_HI32, + (u32)(adev->gmc.gart_end >>44 )); + + tmp =RREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_CNTL); + tmp =REG_SET_FIELD (tmp,MMVM_L2_SAW_CONTEXT0_CNTL ,ENABLE_CONTEXT ,1 ); + tmp =REG_SET_FIELD (tmp,MMVM_L2_SAW_CONTEXT0_CNTL ,PAGE_TABLE_DEPTH ,0 ); +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXT0_CNTL, tmp); + +/* Disable all contexts except context 0 */ + tmp =0xfffe ; +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CONTEXTS_DISABLE, tmp); + +/* Program saw cntl4 */ + tmp =RREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CNTL4); + tmp =REG_SET_FIELD (tmp,MMVM_L2_SAW_CNTL4 ,VMC_TAP_CONTEXT0_PDE_REQUEST_SNOOP ,1 ); + tmp =REG_SET_FIELD (tmp,MMVM_L2_SAW_CNTL4 ,VMC_TAP_CONTEXT0_PTE_REQUEST_SNOOP ,1 ); +WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CNTL4, tmp); +} +static int mmhub_v3_3_gart_enable (struct amdgpu_device *adev) {/* GART Enable. */
@@ -372,6 +409,9 @@ static int mmhub_v3_3_gart_enable(struct amdgpu_device *adev)mmhub_v3_3_setup_vmid_config (adev);mmhub_v3_3_program_invalidation (adev); +/* standalone alone walker init */ +mmhub_v3_3_init_saw_regs (adev); +return 0 ; }
Signature · 1 line
2.37.3
PATCH 2/3 drm/amdgpu: disable lane0 L1TLB and enable lane1 L1TLB
This patch to disable lane0 L1TLB and enable lane1 L1TLB.
Signed-off-by Yifan Zhang <[email protected]>
Reviewed-by Mario Limonciello <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c +13 -0
@@ -33,6 +33,10 @@#define regMMVM_L2_CNTL3_DEFAULT 0x80100007#define regMMVM_L2_CNTL4_DEFAULT 0x000000c1#define regMMVM_L2_CNTL5_DEFAULT 0x00003fe0 +#define regDAGB0_L1TLB_REG_RW_3_3 0x00a4 +#define regDAGB0_L1TLB_REG_RW_3_3_BASE_IDX 1 +#define regDAGB1_L1TLB_REG_RW_3_3 0x0163 +#define regDAGB1_L1TLB_REG_RW_3_3_BASE_IDX 1static const char *mmhub_client_ids_v3_3[][2 ] = { [0 ][0 ] ="VMC" ,
@@ -396,6 +400,12 @@ static void mmhub_v3_3_init_saw_regs(struct amdgpu_device *adev)WREG32_SOC15 (MMHUB ,0 , regMMVM_L2_SAW_CNTL4, tmp); } +static void mmhub_v3_3_enable_tls (struct amdgpu_device *adev) +{ +WREG32_SOC15 (MMHUB ,0 , regDAGB0_L1TLB_REG_RW_3_3,0 ); +WREG32_SOC15 (MMHUB ,0 , regDAGB1_L1TLB_REG_RW_3_3,3 ); +} +static int mmhub_v3_3_gart_enable (struct amdgpu_device *adev) {/* GART Enable. */
@@ -412,6 +422,9 @@ static int mmhub_v3_3_gart_enable(struct amdgpu_device *adev)/* standalone alone walker init */ mmhub_v3_3_init_saw_regs (adev); +/* enable mmhub tls */ +mmhub_v3_3_enable_tls (adev); +return 0 ; }
Signature · 1 line
2.37.3
PATCH 3/3 drm/amd/amdgpu: Enable MMHUB prefetch for ISP v4.1.0 and 4.1.1
In reply to Yifan ZhangFrom: Pratap Nirujogi <[email protected]>
Remove temporary WA to disable ISP prefetch as MMHUB SAW is initialized to support ISP HW access GART memory using the TLSi path with prefetch enabled.
Signed-off-by Pratap Nirujogi <[email protected]>
Reviewed-by Mario Limonciello <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c | 12 ------------ drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h | 7 ------- drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c | 12 ------------ drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h | 7 ------- 4 files changed, 38 deletions(-)
drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c +0 -12
@@ -104,18 +104,6 @@ static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp) goto failure; } -/* -* Temporary WA added to disable MMHUB TLSi until the GART initialization -* is ready to support MMHUB TLSi and SAW for ISP HW to access GART memory -* using the TLSi path -*/ -WREG32 (mmDAGB0_WRCLI5_V4_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB0_WRCLI9_V4_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB0_WRCLI10_V4_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB0_WRCLI14_V4_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB0_WRCLI19_V4_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB0_WRCLI20_V4_1 >>2 ,0xFE5FEAA8 ); -return 0 ; failure:
drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.h +0 -7
@@ -32,13 +32,6 @@#include "ivsrcid/isp/irqsrcs_isp_4_1.h" -#define mmDAGB0_WRCLI5_V4_1 0x6811C -#define mmDAGB0_WRCLI9_V4_1 0x6812C -#define mmDAGB0_WRCLI10_V4_1 0x68130 -#define mmDAGB0_WRCLI14_V4_1 0x68140 -#define mmDAGB0_WRCLI19_V4_1 0x68154 -#define mmDAGB0_WRCLI20_V4_1 0x68158 -#define MAX_ISP410_INT_SRC 8void isp_v4_1_0_set_isp_funcs (struct amdgpu_isp *isp);
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c +0 -12
@@ -104,18 +104,6 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp) goto failure; } -/* -* Temporary WA added to disable MMHUB TLSi until the GART initialization -* is ready to support MMHUB TLSi and SAW for ISP HW to access GART memory -* using the TLSi path -*/ -WREG32 (mmDAGB1_WRCLI5_V4_1_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB1_WRCLI9_V4_1_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB1_WRCLI10_V4_1_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB1_WRCLI14_V4_1_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB1_WRCLI19_V4_1_1 >>2 ,0xFE5FEAA8 ); -WREG32 (mmDAGB1_WRCLI20_V4_1_1 >>2 ,0xFE5FEAA8 ); -return 0 ; failure:
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.h +0 -7
@@ -32,13 +32,6 @@#include "ivsrcid/isp/irqsrcs_isp_4_1.h" -#define mmDAGB1_WRCLI5_V4_1_1 0x68420 -#define mmDAGB1_WRCLI9_V4_1_1 0x68430 -#define mmDAGB1_WRCLI10_V4_1_1 0x68434 -#define mmDAGB1_WRCLI14_V4_1_1 0x68444 -#define mmDAGB1_WRCLI19_V4_1_1 0x68458 -#define mmDAGB1_WRCLI20_V4_1_1 0x6845C -#define MAX_ISP411_INT_SRC 8void isp_v4_1_1_set_isp_funcs (struct amdgpu_isp *isp);
Signature · 1 line
2.37.3