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 NBIO 4.3

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/nbio_v4_3.c
··· 475 475 #endif 476 476 } 477 477 478 + #define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) 479 + 480 + static void nbio_v4_3_set_reg_remap(struct amdgpu_device *adev) 481 + { 482 + if (!amdgpu_sriov_vf(adev) && (PAGE_SIZE <= 4096)) { 483 + adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET; 484 + adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET; 485 + } else { 486 + adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0, 487 + regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2; 488 + adev->rmmio_remap.bus_addr = 0; 489 + } 490 + } 491 + 478 492 const struct amdgpu_nbio_funcs nbio_v4_3_funcs = { 479 493 .get_hdp_flush_req_offset = nbio_v4_3_get_hdp_flush_req_offset, 480 494 .get_hdp_flush_done_offset = nbio_v4_3_get_hdp_flush_done_offset, ··· 511 497 .remap_hdp_registers = nbio_v4_3_remap_hdp_registers, 512 498 .get_rom_offset = nbio_v4_3_get_rom_offset, 513 499 .program_aspm = nbio_v4_3_program_aspm, 500 + .set_reg_remap = nbio_v4_3_set_reg_remap, 514 501 }; 515 502 516 503 ··· 556 541 .init_registers = nbio_v4_3_init_registers, 557 542 .remap_hdp_registers = nbio_v4_3_remap_hdp_registers, 558 543 .get_rom_offset = nbio_v4_3_get_rom_offset, 544 + .set_reg_remap = nbio_v4_3_set_reg_remap, 559 545 }; 560 546 561 547 static int nbio_v4_3_set_ras_err_event_athub_irq_state(struct amdgpu_device *adev,