Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add set_reg_remap callback for NBIF 6.3.1

This will be used to consolidate the register remap offset
configuration and fix HDP flushes on systems non-4K pages.

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+16
+16
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c
··· 424 424 #endif 425 425 } 426 426 427 + #define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) 428 + 429 + static void nbif_v6_3_1_set_reg_remap(struct amdgpu_device *adev) 430 + { 431 + if (!amdgpu_sriov_vf(adev) && (PAGE_SIZE <= 4096)) { 432 + adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET; 433 + adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET; 434 + } else { 435 + adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0, 436 + regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2; 437 + adev->rmmio_remap.bus_addr = 0; 438 + } 439 + } 440 + 427 441 const struct amdgpu_nbio_funcs nbif_v6_3_1_funcs = { 428 442 .get_hdp_flush_req_offset = nbif_v6_3_1_get_hdp_flush_req_offset, 429 443 .get_hdp_flush_done_offset = nbif_v6_3_1_get_hdp_flush_done_offset, ··· 460 446 .remap_hdp_registers = nbif_v6_3_1_remap_hdp_registers, 461 447 .get_rom_offset = nbif_v6_3_1_get_rom_offset, 462 448 .program_aspm = nbif_v6_3_1_program_aspm, 449 + .set_reg_remap = nbif_v6_3_1_set_reg_remap, 463 450 }; 464 451 465 452 ··· 507 492 .init_registers = nbif_v6_3_1_init_registers, 508 493 .remap_hdp_registers = nbif_v6_3_1_remap_hdp_registers, 509 494 .get_rom_offset = nbif_v6_3_1_get_rom_offset, 495 + .set_reg_remap = nbif_v6_3_1_set_reg_remap, 510 496 };