Skip to content

Commit 4cc9f86

Browse files
Tom St Denisalexdeucher
authored andcommitted
drm/amd/amdgpu: Add pcie indirect support to amdgpu_mm_wreg_mmio_rlc()
The function amdgpu_mm_wreg_mmio_rlc() is used by debugfs to write to MMIO registers. It didn't support registers beyond the BAR mapped MMIO space. This adds pcie indirect write support. Signed-off-by: Tom St Denis <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 575e55e commit 4cc9f86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ void amdgpu_device_wreg(struct amdgpu_device *adev,
552552
}
553553

554554
/**
555-
* amdgpu_mm_wreg_mmio_rlc - write register either with mmio or with RLC path if in range
555+
* amdgpu_mm_wreg_mmio_rlc - write register either with direct/indirect mmio or with RLC path if in range
556556
*
557557
* this function is invoked only the debugfs register access
558558
*/
@@ -567,6 +567,8 @@ void amdgpu_mm_wreg_mmio_rlc(struct amdgpu_device *adev,
567567
adev->gfx.rlc.funcs->is_rlcg_access_range) {
568568
if (adev->gfx.rlc.funcs->is_rlcg_access_range(adev, reg))
569569
return adev->gfx.rlc.funcs->sriov_wreg(adev, reg, v, 0, 0);
570+
} else if ((reg * 4) >= adev->rmmio_size) {
571+
adev->pcie_wreg(adev, reg * 4, v);
570572
} else {
571573
writel(v, ((void __iomem *)adev->rmmio) + (reg * 4));
572574
}

0 commit comments

Comments
 (0)