From 838ccab480029ccc0d16eeff828abba0f4405d68 Mon Sep 17 00:00:00 2001 From: Adam Madsen Date: Wed, 18 Nov 2020 17:44:50 -0600 Subject: [PATCH] [amd] firmware: fix IOREG access --- src/amd/firmware.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/amd/firmware.c b/src/amd/firmware.c index b0049a4..7701238 100644 --- a/src/amd/firmware.c +++ b/src/amd/firmware.c @@ -40,11 +40,11 @@ Place, Suite 330, Boston, MA 02111-1307 USA u32 amdgpu_io_rreg(struct amd_fake_dev *adev, u32 reg) { if ((reg * 4) < adev_to_amd_private(adev)->rio_mem_size) - return ioread32(adev_to_amd_private(adev)->rio_mem + (reg * 4)); + return ioread32(adev_to_amd_private(adev)->rio_mem + reg); else { - iowrite32((reg * 4), adev_to_amd_private(adev)->rio_mem + (mmMM_INDEX * 4)); - return ioread32(adev_to_amd_private(adev)->rio_mem + (mmMM_DATA * 4)); + iowrite32((reg * 4), adev_to_amd_private(adev)->rio_mem + mmMM_INDEX); + return ioread32(adev_to_amd_private(adev)->rio_mem + mmMM_DATA); } } @@ -60,11 +60,11 @@ u32 amdgpu_io_rreg(struct amd_fake_dev *adev, u32 reg) void amdgpu_io_wreg(struct amd_fake_dev *adev, u32 reg, u32 v) { if ((reg * 4) < adev_to_amd_private(adev)->rio_mem_size) - iowrite32(v, adev_to_amd_private(adev)->rio_mem + (reg * 4)); + iowrite32(v, adev_to_amd_private(adev)->rio_mem + reg); else { - iowrite32((reg * 4), adev_to_amd_private(adev)->rio_mem + (mmMM_INDEX * 4)); - iowrite32(v, adev_to_amd_private(adev)->rio_mem + (mmMM_DATA * 4)); + iowrite32((reg * 4), adev_to_amd_private(adev)->rio_mem + mmMM_INDEX); + iowrite32(v, adev_to_amd_private(adev)->rio_mem + mmMM_DATA); } }