drm/amdgpu: add nbio set_reg_remap helper
Subsystems (2)
Alex Deucher
maintainerPATCH 1/14 drm/amdgpu: add nbio set_reg_remap helper
Will be used to consolidate reg remap settings and fix HDP flushes on systems with non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h +1 -0
@@ -102,6 +102,7 @@ struct amdgpu_nbio_funcs {u32 (*get_memory_partition_mode)(struct amdgpu_device *adev,u32 *supp_modes);u64 (*get_pcie_replay_count)(struct amdgpu_device *adev); +void (*set_reg_remap)(struct amdgpu_device *adev); };struct amdgpu_nbio {
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 2/14 drm/amdgpu: add set_reg_remap callback for NBIO 6.1
This will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +17 -1
@@ -394,6 +394,21 @@ static void nbio_v6_1_program_aspm(struct amdgpu_device *adev)#endif } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v6_1_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , + mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v6_1_funcs = { .get_hdp_flush_req_offset = nbio_v6_1_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v6_1_get_hdp_flush_done_offset,
@@ -412,5 +427,6 @@ const struct amdgpu_nbio_funcs nbio_v6_1_funcs = { .ih_control = nbio_v6_1_ih_control, .init_registers = nbio_v6_1_init_registers, .remap_hdp_registers = nbio_v6_1_remap_hdp_registers, - .program_aspm = nbio_v6_1_program_aspm, + .program_aspm = nbio_v6_1_program_aspm, + .set_reg_remap = nbio_v6_1_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 3/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.0
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +15 -0
@@ -278,6 +278,20 @@ static void nbio_v7_0_init_registers(struct amdgpu_device *adev)SOC15_REG_OFFSET (NBIO ,0 , mmHDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v7_0_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , mmHDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_0_funcs = { .get_hdp_flush_req_offset = nbio_v7_0_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_0_get_hdp_flush_done_offset,
@@ -297,4 +311,5 @@ const struct amdgpu_nbio_funcs nbio_v7_0_funcs = { .ih_control = nbio_v7_0_ih_control, .init_registers = nbio_v7_0_init_registers, .remap_hdp_registers = nbio_v7_0_remap_hdp_registers, + .set_reg_remap = nbio_v7_0_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 4/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.4
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +16 -0
@@ -792,6 +792,21 @@ static void nbio_v7_4_program_aspm(struct amdgpu_device *adev)#endif } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v7_4_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , + mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_4_funcs = { .get_hdp_flush_req_offset = nbio_v7_4_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_4_get_hdp_flush_done_offset,
@@ -813,4 +828,5 @@ const struct amdgpu_nbio_funcs nbio_v7_4_funcs = { .init_registers = nbio_v7_4_init_registers, .remap_hdp_registers = nbio_v7_4_remap_hdp_registers, .program_aspm = nbio_v7_4_program_aspm, + .set_reg_remap = nbio_v7_4_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 5/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.9
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +18 -0
@@ -475,6 +475,23 @@ static u64 nbio_v7_9_get_pcie_replay_count(struct amdgpu_device *adev)return (nak_r + nak_g); } +#define MMIO_REG_HOLE_OFFSET 0x1A000 + +static void nbio_v7_9_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET ( +NBIO ,0 , + regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) + <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_9_funcs = { .get_hdp_flush_req_offset = nbio_v7_9_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_9_get_hdp_flush_done_offset,
@@ -499,6 +516,7 @@ const struct amdgpu_nbio_funcs nbio_v7_9_funcs = { .get_memory_partition_mode = nbio_v7_9_get_memory_partition_mode, .init_registers = nbio_v7_9_init_registers, .get_pcie_replay_count = nbio_v7_9_get_pcie_replay_count, + .set_reg_remap = nbio_v7_9_set_reg_remap, }; static void nbio_v7_9_query_ras_error_count(struct amdgpu_device *adev,
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 6/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.11
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c +15 -0
@@ -352,6 +352,20 @@ static void nbio_v7_11_get_clockgating_state(struct amdgpu_device *adev, *flags |=AMD_CG_SUPPORT_BIF_LS ; } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v7_11_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , regBIF_BX_PF1_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_11_funcs = { .get_hdp_flush_req_offset = nbio_v7_11_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_11_get_hdp_flush_done_offset,
@@ -374,4 +388,5 @@ const struct amdgpu_nbio_funcs nbio_v7_11_funcs = { .ih_control = nbio_v7_11_ih_control, .init_registers = nbio_v7_11_init_registers, .remap_hdp_registers = nbio_v7_11_remap_hdp_registers, + .set_reg_remap = nbio_v7_11_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 7/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.2
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +16 -0
@@ -408,6 +408,21 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev) regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2; } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v7_2_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , + regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_2_funcs = { .get_hdp_flush_req_offset = nbio_v7_2_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_2_get_hdp_flush_done_offset,
@@ -429,4 +444,5 @@ const struct amdgpu_nbio_funcs nbio_v7_2_funcs = { .ih_control = nbio_v7_2_ih_control, .init_registers = nbio_v7_2_init_registers, .remap_hdp_registers = nbio_v7_2_remap_hdp_registers, + .set_reg_remap = nbio_v7_2_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 8/14 drm/amdgpu: add set_reg_remap callback for NBIO 2.3
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +15 -0
@@ -553,6 +553,20 @@ static void nbio_v2_3_clear_doorbell_interrupt(struct amdgpu_device *adev) } } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v2_3_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , + mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v2_3_funcs = { .get_hdp_flush_req_offset = nbio_v2_3_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v2_3_get_hdp_flush_done_offset,
@@ -577,4 +591,5 @@ const struct amdgpu_nbio_funcs nbio_v2_3_funcs = { .apply_lc_spc_mode_wa = nbio_v2_3_apply_lc_spc_mode_wa, .apply_l1_link_width_reconfig_wa = nbio_v2_3_apply_l1_link_width_reconfig_wa, .clear_doorbell_interrupt = nbio_v2_3_clear_doorbell_interrupt, + .set_reg_remap = nbio_v2_3_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 9/14 drm/amdgpu: add set_reg_remap callback for NBIO 4.3
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +16 -0
@@ -475,6 +475,20 @@ static void nbio_v4_3_program_aspm(struct amdgpu_device *adev)#endif } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v4_3_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , + regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v4_3_funcs = { .get_hdp_flush_req_offset = nbio_v4_3_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v4_3_get_hdp_flush_done_offset,
@@ -497,6 +511,7 @@ const struct amdgpu_nbio_funcs nbio_v4_3_funcs = { .remap_hdp_registers = nbio_v4_3_remap_hdp_registers, .get_rom_offset = nbio_v4_3_get_rom_offset, .program_aspm = nbio_v4_3_program_aspm, + .set_reg_remap = nbio_v4_3_set_reg_remap, };
@@ -541,6 +556,7 @@ const struct amdgpu_nbio_funcs nbio_v4_3_sriov_funcs = { .init_registers = nbio_v4_3_init_registers, .remap_hdp_registers = nbio_v4_3_remap_hdp_registers, .get_rom_offset = nbio_v4_3_get_rom_offset, + .set_reg_remap = nbio_v4_3_set_reg_remap, }; static int nbio_v4_3_set_ras_err_event_athub_irq_state(struct amdgpu_device *adev,
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 10/14 drm/amdgpu: add set_reg_remap callback for NBIO 7.7
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c +16 -0
@@ -324,6 +324,21 @@ static void nbio_v7_7_get_clockgating_state(struct amdgpu_device *adev, *flags |=AMD_CG_SUPPORT_BIF_LS ; } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbio_v7_7_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset = +SOC15_REG_OFFSET (NBIO ,0 , + regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbio_v7_7_funcs = { .get_hdp_flush_req_offset = nbio_v7_7_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbio_v7_7_get_hdp_flush_done_offset,
@@ -345,4 +360,5 @@ const struct amdgpu_nbio_funcs nbio_v7_7_funcs = { .ih_control = nbio_v7_7_ih_control, .init_registers = nbio_v7_7_init_registers, .remap_hdp_registers = nbio_v7_7_remap_hdp_registers, + .set_reg_remap = nbio_v7_7_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 11/14 drm/amdgpu: add set_reg_remap callback for NBIF 6.3.1
In reply to Alex DeucherThis will be used to consolidate the register remap offset configuration and fix HDP flushes on systems non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c +16 -0
@@ -424,6 +424,20 @@ static void nbif_v6_3_1_program_aspm(struct amdgpu_device *adev)#endif } +#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) + +static void nbif_v6_3_1_set_reg_remap (struct amdgpu_device *adev) +{ +if (!amdgpu_sriov_vf (adev) && (PAGE_SIZE <=4096 )) { + adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; + adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + }else { + adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , + regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; + adev->rmmio_remap.bus_addr =0 ; + } +} +const struct amdgpu_nbio_funcs nbif_v6_3_1_funcs = { .get_hdp_flush_req_offset = nbif_v6_3_1_get_hdp_flush_req_offset, .get_hdp_flush_done_offset = nbif_v6_3_1_get_hdp_flush_done_offset,
@@ -446,6 +460,7 @@ const struct amdgpu_nbio_funcs nbif_v6_3_1_funcs = { .remap_hdp_registers = nbif_v6_3_1_remap_hdp_registers, .get_rom_offset = nbif_v6_3_1_get_rom_offset, .program_aspm = nbif_v6_3_1_program_aspm, + .set_reg_remap = nbif_v6_3_1_set_reg_remap, };
@@ -492,4 +507,5 @@ const struct amdgpu_nbio_funcs nbif_v6_3_1_sriov_funcs = { .init_registers = nbif_v6_3_1_init_registers, .remap_hdp_registers = nbif_v6_3_1_remap_hdp_registers, .get_rom_offset = nbif_v6_3_1_get_rom_offset, + .set_reg_remap = nbif_v6_3_1_set_reg_remap, };
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 12/14 drm/amdgpu/soc15: use common nbio callback to set remap offset
In reply to Alex DeucherThis fixes HDP flushes on systems with non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 4 ---- drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c | 3 --- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 4 ---- drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 6 ------ drivers/gpu/drm/amd/amdgpu/soc15.c | 11 +---------- 5 files changed, 1 insertion(+), 27 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +0 -4
@@ -276,10 +276,6 @@ static void nbio_v6_1_init_registers(struct amdgpu_device *adev)if (def != data)WREG32_PCIE (smnPCIE_CI_CNTL, data); - -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , - mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; }#ifdef CONFIG_PCIEASPM
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +0 -3
@@ -273,9 +273,6 @@ const struct nbio_hdp_flush_reg nbio_v7_0_hdp_flush_reg = {static void nbio_v7_0_init_registers (struct amdgpu_device *adev) { -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset = -SOC15_REG_OFFSET (NBIO ,0 , mmHDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; }#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +0 -4
@@ -343,10 +343,6 @@ static void nbio_v7_4_init_registers(struct amdgpu_device *adev) {uint32_t baco_cntl; -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , - mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; -if (amdgpu_ip_version (adev,NBIO_HWIP ,0 ) ==IP_VERSION (7 ,4 ,4 ) && !amdgpu_sriov_vf (adev)) { baco_cntl =RREG32_SOC15 (NBIO ,0 , mmBACO_CNTL);
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +0 -6
@@ -422,12 +422,6 @@ static void nbio_v7_9_init_registers(struct amdgpu_device *adev)u32 inst_mask;int i; -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset = -SOC15_REG_OFFSET ( -NBIO ,0 , - regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) - <<2 ;WREG32_SOC15 (NBIO ,0 , regXCC_DOORBELL_FENCE,0xff & ~(adev->gfx.xcc_mask));
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -10
@@ -931,13 +931,9 @@ static const struct amdgpu_asic_funcs aqua_vanjaram_asic_funcs =static int soc15_common_early_init (void *handle) { -#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_sriov_vf (adev)) { - adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; - adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; - } + adev->nbio.funcs->set_reg_remap (adev); adev->smc_rreg =NULL ; adev->smc_wreg =NULL ; adev->pcie_rreg = &amdgpu_device_indirect_rreg;
@@ -1188,11 +1184,6 @@ static int soc15_common_early_init(void *handle)AMD_PG_SUPPORT_JPEG ;/*TODO: need a new external_rev_id for GC 9.4.4? */ adev->external_rev_id = adev->rev_id +0x46 ; -/* GC 9.4.3 uses MMIO register region hole at a different offset */ -if (!amdgpu_sriov_vf (adev)) { - adev->rmmio_remap.reg_offset =0x1A000 ; - adev->rmmio_remap.bus_addr = adev->rmmio_base +0x1A000 ; - }break ;default :/* FIXME: not supported yet */
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 13/14 drm/amdgpu/nv: use common nbio callback to set remap offset
In reply to Alex DeucherThis fixes HDP flushes on systems with non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c | 4 ---- drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c | 4 ---- drivers/gpu/drm/amd/amdgpu/nv.c | 6 +----- 3 files changed, 1 insertion(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +0 -4
@@ -339,10 +339,6 @@ static void nbio_v2_3_init_registers(struct amdgpu_device *adev)if (def != data)WREG32_PCIE (smnPCIE_CONFIG_CNTL, data); - -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , - mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; }#define NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT 0x00000000 // off by default, no gains over L1
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +0 -4
@@ -402,10 +402,6 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev)WREG32_SOC15 (NBIO ,0 , regRCC_DEV2_EPF0_STRAP2, data);break ; } - -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , - regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; }#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
drivers/gpu/drm/amd/amdgpu/nv.c +1 -5
@@ -637,13 +637,9 @@ static const struct amdgpu_asic_funcs nv_asic_funcs = {static int nv_common_early_init (void *handle) { -#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (!amdgpu_sriov_vf (adev)) { - adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; - adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; - } + adev->nbio.funcs->set_reg_remap (adev); adev->smc_rreg =NULL ; adev->smc_wreg =NULL ; adev->pcie_rreg = &amdgpu_device_indirect_rreg;
Signature · 1 line
2.44.0
Alex Deucher
maintainerPATCH 14/14 drm/amdgpu/soc21: use common nbio callback to set remap offset
In reply to Alex DeucherThis fixes HDP flushes on systems with non-4K pages.
--- drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c | 3 --- drivers/gpu/drm/amd/amdgpu/soc21.c | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +0 -3
@@ -345,9 +345,6 @@ static void nbio_v4_3_init_registers(struct amdgpu_device *adev) data &= ~RCC_DEV0_EPF2_STRAP2__STRAP_NO_SOFT_RESET_DEV0_F2_MASK ;WREG32_SOC15 (NBIO ,0 , regRCC_DEV0_EPF2_STRAP2, data); } -if (amdgpu_sriov_vf (adev)) - adev->rmmio_remap.reg_offset =SOC15_REG_OFFSET (NBIO ,0 , - regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) <<2 ; }static u32 nbio_v4_3_get_rom_offset (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/soc21.c +1 -3
@@ -557,11 +557,9 @@ static const struct amdgpu_asic_funcs soc21_asic_funcs = {static int soc21_common_early_init (void *handle) { -#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)struct amdgpu_device *adev = (struct amdgpu_device *)handle; - adev->rmmio_remap.reg_offset =MMIO_REG_HOLE_OFFSET ; - adev->rmmio_remap.bus_addr = adev->rmmio_base +MMIO_REG_HOLE_OFFSET ; + adev->nbio.funcs->set_reg_remap (adev); adev->smc_rreg =NULL ; adev->smc_wreg =NULL ; adev->pcie_rreg = &amdgpu_device_indirect_rreg;
Signature · 1 line
2.44.0
Am 06.05.24 um 20:45 schrieb Alex Deucher:
Quoted 21 lines
Will be used to consolidate reg remap settings and fix HDP flushes on systems with non-4K pages.
Reviewed-by Felix Kuehling <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h +1
-0@@ -102,6 +102,7 @@ struct amdgpu_nbio_funcs {u32 (*get_memory_partition_mode)(struct amdgpu_device *adev,u32 *supp_modes);u64 (*get_pcie_replay_count)(struct amdgpu_device *adev); +void (*set_reg_remap)(struct amdgpu_device *adev); };struct amdgpu_nbio {