<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Chen, Guchun <Guchun.Chen@amd.com><br>
<b>Sent:</b> Tuesday, December 17, 2019 4:08 AM<br>
<b>To:</b> Clements, John <John.Clements@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Chen, Guchun <Guchun.Chen@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: move umc offset to one new header file for Arcturus</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Fixes: 9686563c4c42 drm/amdgpu: Added RAS UMC error query support for Arcturus<br>
<br>
Code refactor and no functional change.<br>
<br>
Signed-off-by: Guchun Chen <guchun.chen@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/umc_v6_1.c | 17 +---------<br>
.../include/asic_reg/umc/umc_6_1_2_offset.h | 32 +++++++++++++++++++<br>
2 files changed, 33 insertions(+), 16 deletions(-)<br>
create mode 100644 drivers/gpu/drm/amd/include/asic_reg/umc/umc_6_1_2_offset.h<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v6_1.c b/drivers/gpu/drm/amd/amdgpu/umc_v6_1.c<br>
index 515eb50cd0f8..5093965dbc24 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/umc_v6_1.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/umc_v6_1.c<br>
@@ -28,17 +28,10 @@<br>
#include "rsmu/rsmu_0_0_2_sh_mask.h"<br>
#include "umc/umc_6_1_1_offset.h"<br>
#include "umc/umc_6_1_1_sh_mask.h"<br>
+#include "umc/umc_6_1_2_offset.h"<br>
<br>
#define smnMCA_UMC0_MCUMC_ADDRT0 0x50f10<br>
<br>
-/* UMC 6_1_2 register offsets */<br>
-#define mmUMCCH0_0_EccErrCntSel_ARCT 0x0360<br>
-#define mmUMCCH0_0_EccErrCntSel_ARCT_BASE_IDX 1<br>
-#define mmUMCCH0_0_EccErrCnt_ARCT 0x0361<br>
-#define mmUMCCH0_0_EccErrCnt_ARCT_BASE_IDX 1<br>
-#define mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT 0x03c2<br>
-#define mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT_BASE_IDX 1<br>
-<br>
/*<br>
* (addr / 256) * 8192, the higher 26 bits in ErrorAddr<br>
* is the index of 8KB block<br>
@@ -105,7 +98,6 @@ static void umc_v6_1_query_correctable_error_count(struct amdgpu_device *adev,<br>
<br>
if (adev->asic_type == CHIP_ARCTURUS) {<br>
/* UMC 6_1_2 registers */<br>
-<br>
ecc_err_cnt_sel_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCntSel_ARCT);<br>
ecc_err_cnt_addr =<br>
@@ -114,7 +106,6 @@ static void umc_v6_1_query_correctable_error_count(struct amdgpu_device *adev,<br>
SOC15_REG_OFFSET(UMC, 0, mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT);<br>
} else {<br>
/* UMC 6_1_1 registers */<br>
-<br>
ecc_err_cnt_sel_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCntSel);<br>
ecc_err_cnt_addr =<br>
@@ -164,12 +155,10 @@ static void umc_v6_1_querry_uncorrectable_error_count(struct amdgpu_device *adev<br>
<br>
if (adev->asic_type == CHIP_ARCTURUS) {<br>
/* UMC 6_1_2 registers */<br>
-<br>
mc_umc_status_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT);<br>
} else {<br>
/* UMC 6_1_1 registers */<br>
-<br>
mc_umc_status_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmMCA_UMC_UMC0_MCUMC_STATUST0);<br>
}<br>
@@ -211,12 +200,10 @@ static void umc_v6_1_query_error_address(struct amdgpu_device *adev,<br>
<br>
if (adev->asic_type == CHIP_ARCTURUS) {<br>
/* UMC 6_1_2 registers */<br>
-<br>
mc_umc_status_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT);<br>
} else {<br>
/* UMC 6_1_1 registers */<br>
-<br>
mc_umc_status_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmMCA_UMC_UMC0_MCUMC_STATUST0);<br>
}<br>
@@ -282,14 +269,12 @@ static void umc_v6_1_err_cnt_init_per_channel(struct amdgpu_device *adev,<br>
<br>
if (adev->asic_type == CHIP_ARCTURUS) {<br>
/* UMC 6_1_2 registers */<br>
-<br>
ecc_err_cnt_sel_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCntSel_ARCT);<br>
ecc_err_cnt_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCnt_ARCT);<br>
} else {<br>
/* UMC 6_1_1 registers */<br>
-<br>
ecc_err_cnt_sel_addr =<br>
SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCntSel);<br>
ecc_err_cnt_addr =<br>
diff --git a/drivers/gpu/drm/amd/include/asic_reg/umc/umc_6_1_2_offset.h b/drivers/gpu/drm/amd/include/asic_reg/umc/umc_6_1_2_offset.h<br>
new file mode 100644<br>
index 000000000000..3e79a8056556<br>
--- /dev/null<br>
+++ b/drivers/gpu/drm/amd/include/asic_reg/umc/umc_6_1_2_offset.h<br>
@@ -0,0 +1,32 @@<br>
+/*<br>
+ * Copyright (C) 2019 Advanced Micro Devices, Inc.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included<br>
+ * in all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS<br>
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+ * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN<br>
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br>
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+#ifndef _umc_6_1_2_OFFSET_HEADER<br>
+#define _umc_6_1_2_OFFSET_HEADER<br>
+<br>
+#define mmUMCCH0_0_EccErrCntSel_ARCT 0x0360<br>
+#define mmUMCCH0_0_EccErrCntSel_ARCT_BASE_IDX 1<br>
+#define mmUMCCH0_0_EccErrCnt_ARCT 0x0361<br>
+#define mmUMCCH0_0_EccErrCnt_ARCT_BASE_IDX 1<br>
+#define mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT 0x03c2<br>
+#define mmMCA_UMC_UMC0_MCUMC_STATUST0_ARCT_BASE_IDX 1<br>
+<br>
+#endif<br>
+<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>