aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch
new file mode 100644
index 00000000..b5f35ad6
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4499-drm-amdgpu-Add-SOC15_WAIT_ON_RREG-macro-define.patch
@@ -0,0 +1,41 @@
+From 3552ed5de7c5230aece29c49a3ab7c8063268dee Mon Sep 17 00:00:00 2001
+From: Rex Zhu <Rex.Zhu@amd.com>
+Date: Thu, 17 May 2018 15:58:53 +0800
+Subject: [PATCH 4499/5725] drm/amdgpu: Add SOC15_WAIT_ON_RREG macro define
+
+Change-Id: Ic44aa31a34e24b07d9f18a17301b8969c01de321
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/soc15_common.h | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/soc15_common.h b/drivers/gpu/drm/amd/amdgpu/soc15_common.h
+index def8650..0942f49 100644
+--- a/drivers/gpu/drm/amd/amdgpu/soc15_common.h
++++ b/drivers/gpu/drm/amd/amdgpu/soc15_common.h
+@@ -47,6 +47,21 @@
+ #define WREG32_SOC15_OFFSET(ip, inst, reg, offset, value) \
+ WREG32((adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg) + offset, value)
+
++#define SOC15_WAIT_ON_RREG(ip, inst, reg, expected_value, mask, ret) \
++ do { \
++ uint32_t tmp_ = RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg); \
++ uint32_t loop = adev->usec_timeout; \
++ while ((tmp_ & (mask)) != (expected_value)) { \
++ udelay(2); \
++ tmp_ = RREG32(adev->reg_offset[ip##_HWIP][inst][reg##_BASE_IDX] + reg); \
++ loop--; \
++ if (!loop) { \
++ ret = -ETIMEDOUT; \
++ break; \
++ } \
++ } \
++ } while (0)
++
+ #endif
+
+
+--
+2.7.4
+