summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
diff options
context:
space:
mode:
authorTao Zhou <tao.zhou1@amd.com>2019-08-09 10:57:50 +0300
committerAlex Deucher <alexander.deucher@amd.com>2019-08-09 19:17:10 +0300
commitdd21a572c9068e9a59b46dea67e8a65a44aee90b (patch)
treeecc621a5c087c510fe50b4aade94866c24647aad /drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
parentc6dddf45402caeadc49dc859fa497cfb98841af4 (diff)
downloadlinux-dd21a572c9068e9a59b46dea67e8a65a44aee90b.tar.xz
drm/amdgpu: implement UMC 64 bits REG operations
implement 64 bits operations via 32 bits interface v2: make use of lower_32_bits() and upper_32_bits() macros Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
index 9efdd66279e5..975afa04df09 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
@@ -21,6 +21,15 @@
#ifndef __AMDGPU_UMC_H__
#define __AMDGPU_UMC_H__
+/* implement 64 bits REG operations via 32 bits interface */
+#define RREG64_UMC(reg) (RREG32(reg) | \
+ ((uint64_t)RREG32((reg) + 1) << 32))
+#define WREG64_UMC(reg, v) \
+ do { \
+ WREG32((reg), lower_32_bits(v)); \
+ WREG32((reg) + 1, upper_32_bits(v)); \
+ } while (0)
+
/*
* void (*func)(struct amdgpu_device *adev, struct ras_err_data *err_data,
* uint32_t umc_reg_offset, uint32_t channel_index)