<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<p class="x_MsoNormal">Series is: </p>
<p class="x_MsoNormal">Reviewed-by: <span>Rex Zhu <Rex.Zhu@amd.com></span></p>
<p class="x_MsoNormal"><br>
</p>
<p class="x_MsoNormal">Best Regards</p>
<p class="x_MsoNormal">Rex<br>
</p>
<br>
<p></p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Evan Quan <evan.quan@amd.com><br>
<b>Sent:</b> Tuesday, April 10, 2018 12:40 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex; Quan, Evan<br>
<b>Subject:</b> [PATCH 2/2] drm/amd/powerplay: use soc15 common macros instead of vega10 specific</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">pp_soc15.h is vega10 specific. Update powerplay code to use soc15 common<br>
macros defined in soc15_common.h.<br>
<br>
Change-Id: I43c9a89e1a1f5d9a031465e2c2ba1525486aba9a<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 7 +-<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 16 +--<br>
.../gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 50 ++++------<br>
.../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 107 ++++++++-------------<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 1 -<br>
.../gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c | 37 +++----<br>
drivers/gpu/drm/amd/powerplay/inc/pp_soc15.h | 52 ----------<br>
.../gpu/drm/amd/powerplay/smumgr/smu10_smumgr.c | 37 +++----<br>
.../gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c | 50 ++++------<br>
.../gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c | 56 ++++-------<br>
10 files changed, 133 insertions(+), 280 deletions(-)<br>
delete mode 100644 drivers/gpu/drm/amd/powerplay/inc/pp_soc15.h<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
index 055358b..6ba3b1f 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
@@ -34,7 +34,7 @@<br>
#include "rv_ppsmc.h"<br>
#include "smu10_hwmgr.h"<br>
#include "power_state.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
<br>
#define SMU10_MAX_DEEPSLEEP_DIVIDER_ID 5<br>
#define SMU10_MINIMUM_ENGINE_CLOCK 800 /* 8Mhz, the low boundary of engine clock allowed on this chip */<br>
@@ -947,9 +947,8 @@ static int smu10_get_max_high_clocks(struct pp_hwmgr *hwmgr, struct amd_pp_simpl<br>
<br>
static int smu10_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg_offset = soc15_get_register_offset(THM_HWID, 0,<br>
- mmTHM_TCON_CUR_TMP_BASE_IDX, mmTHM_TCON_CUR_TMP);<br>
- uint32_t reg_value = cgs_read_register(hwmgr->device, reg_offset);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
+ uint32_t reg_value = RREG32_SOC15(THM, 0, mmTHM_TCON_CUR_TMP);<br>
int cur_temp =<br>
(reg_value & THM_TCON_CUR_TMP__CUR_TEMP_MASK) >> THM_TCON_CUR_TMP__CUR_TEMP__SHIFT;<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
index c9fb4b2..5fc2f20 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
@@ -36,7 +36,7 @@<br>
#include "smu9.h"<br>
#include "smu9_driver_if.h"<br>
#include "vega10_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "pppcielanes.h"<br>
#include "vega10_hwmgr.h"<br>
#include "vega10_processpptables.h"<br>
@@ -754,7 +754,6 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)<br>
uint32_t config_telemetry = 0;<br>
struct pp_atomfwctrl_voltage_table vol_table;<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
- uint32_t reg;<br>
<br>
data = kzalloc(sizeof(struct vega10_hwmgr), GFP_KERNEL);<br>
if (data == NULL)<br>
@@ -860,10 +859,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)<br>
advanceFanControlParameters.usFanPWMMinLimit *<br>
hwmgr->thermal_controller.fanInfo.ulMaxRPM / 100;<br>
<br>
- reg = soc15_get_register_offset(DF_HWID, 0,<br>
- mmDF_CS_AON0_DramBaseAddress0_BASE_IDX,<br>
- mmDF_CS_AON0_DramBaseAddress0);<br>
- data->mem_channels = (cgs_read_register(hwmgr->device, reg) &<br>
+ data->mem_channels = (RREG32_SOC15(DF, 0, mmDF_CS_AON0_DramBaseAddress0) &<br>
DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK) >><br>
DF_CS_AON0_DramBaseAddress0__IntLvNumChan__SHIFT;<br>
PP_ASSERT_WITH_CODE(data->mem_channels < ARRAY_SIZE(channel_number),<br>
@@ -3802,11 +3798,12 @@ static int vega10_get_gpu_power(struct pp_hwmgr *hwmgr,<br>
static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,<br>
void *value, int *size)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t sclk_idx, mclk_idx, activity_percent = 0;<br>
struct vega10_hwmgr *data = hwmgr->backend;<br>
struct vega10_dpm_table *dpm_table = &data->dpm_table;<br>
int ret = 0;<br>
- uint32_t reg, val_vid;<br>
+ uint32_t val_vid;<br>
<br>
switch (idx) {<br>
case AMDGPU_PP_SENSOR_GFX_SCLK:<br>
@@ -3856,10 +3853,7 @@ static int vega10_read_sensor(struct pp_hwmgr *hwmgr, int idx,<br>
}<br>
break;<br>
case AMDGPU_PP_SENSOR_VDDGFX:<br>
- reg = soc15_get_register_offset(SMUIO_HWID, 0,<br>
- mmSMUSVI0_PLANE0_CURRENTVID_BASE_IDX,<br>
- mmSMUSVI0_PLANE0_CURRENTVID);<br>
- val_vid = (cgs_read_register(hwmgr->device, reg) &<br>
+ val_vid = (RREG32_SOC15(SMUIO, 0, mmSMUSVI0_PLANE0_CURRENTVID) &<br>
SMUSVI0_PLANE0_CURRENTVID__CURRENT_SVI0_PLANE0_VID_MASK) >><br>
SMUSVI0_PLANE0_CURRENTVID__CURRENT_SVI0_PLANE0_VID__SHIFT;<br>
*((uint32_t *)value) = (uint32_t)convert_to_vddc((uint8_t)val_vid);<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c<br>
index 203a691..a9efd855 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c<br>
@@ -27,7 +27,7 @@<br>
#include "vega10_ppsmc.h"<br>
#include "vega10_inc.h"<br>
#include "pp_debug.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
<br>
static const struct vega10_didt_config_reg SEDiDtTuningCtrlConfig_Vega10[] =<br>
{<br>
@@ -888,36 +888,36 @@ static void vega10_didt_set_mask(struct pp_hwmgr *hwmgr, const bool enable)<br>
if (PP_CAP(PHM_PlatformCaps_DiDtEDCEnable)) {<br>
if (PP_CAP(PHM_PlatformCaps_SQRamping)) {<br>
data = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_SQ_EDC_CTRL);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_SQ_EDC_CTRL, EDC_EN, en);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_SQ_EDC_CTRL, EDC_SW_RST, ~en);<br>
+ data = REG_SET_FIELD(data, DIDT_SQ_EDC_CTRL, EDC_EN, en);<br>
+ data = REG_SET_FIELD(data, DIDT_SQ_EDC_CTRL, EDC_SW_RST, ~en);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_SQ_EDC_CTRL, data);<br>
}<br>
<br>
if (PP_CAP(PHM_PlatformCaps_DBRamping)) {<br>
data = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_DB_EDC_CTRL);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_DB_EDC_CTRL, EDC_EN, en);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_DB_EDC_CTRL, EDC_SW_RST, ~en);<br>
+ data = REG_SET_FIELD(data, DIDT_DB_EDC_CTRL, EDC_EN, en);<br>
+ data = REG_SET_FIELD(data, DIDT_DB_EDC_CTRL, EDC_SW_RST, ~en);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_DB_EDC_CTRL, data);<br>
}<br>
<br>
if (PP_CAP(PHM_PlatformCaps_TDRamping)) {<br>
data = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_TD_EDC_CTRL);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_TD_EDC_CTRL, EDC_EN, en);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_TD_EDC_CTRL, EDC_SW_RST, ~en);<br>
+ data = REG_SET_FIELD(data, DIDT_TD_EDC_CTRL, EDC_EN, en);<br>
+ data = REG_SET_FIELD(data, DIDT_TD_EDC_CTRL, EDC_SW_RST, ~en);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_TD_EDC_CTRL, data);<br>
}<br>
<br>
if (PP_CAP(PHM_PlatformCaps_TCPRamping)) {<br>
data = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_TCP_EDC_CTRL);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_TCP_EDC_CTRL, EDC_EN, en);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_TCP_EDC_CTRL, EDC_SW_RST, ~en);<br>
+ data = REG_SET_FIELD(data, DIDT_TCP_EDC_CTRL, EDC_EN, en);<br>
+ data = REG_SET_FIELD(data, DIDT_TCP_EDC_CTRL, EDC_SW_RST, ~en);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_TCP_EDC_CTRL, data);<br>
}<br>
<br>
if (PP_CAP(PHM_PlatformCaps_DBRRamping)) {<br>
data = cgs_read_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_DBR_EDC_CTRL);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_DBR_EDC_CTRL, EDC_EN, en);<br>
- data = CGS_REG_SET_FIELD(data, DIDT_DBR_EDC_CTRL, EDC_SW_RST, ~en);<br>
+ data = REG_SET_FIELD(data, DIDT_DBR_EDC_CTRL, EDC_EN, en);<br>
+ data = REG_SET_FIELD(data, DIDT_DBR_EDC_CTRL, EDC_SW_RST, ~en);<br>
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__DIDT, ixDIDT_DBR_EDC_CTRL, data);<br>
}<br>
}<br>
@@ -933,17 +933,15 @@ static int vega10_enable_cac_driving_se_didt_config(struct pp_hwmgr *hwmgr)<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
int result;<br>
uint32_t num_se = 0, count, data;<br>
- uint32_t reg;<br>
<br>
num_se = adev->gfx.config.max_shader_engines;<br>
<br>
adev->gfx.rlc.funcs->enter_safe_mode(adev);<br>
<br>
mutex_lock(&adev->grbm_idx_mutex);<br>
- reg = soc15_get_register_offset(GC_HWID, 0, mmGRBM_GFX_INDEX_BASE_IDX, mmGRBM_GFX_INDEX);<br>
for (count = 0; count < num_se; count++) {<br>
data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK | GRBM_GFX_INDEX__SH_BROADCAST_WRITES_MASK | ( count << GRBM_GFX_INDEX__SE_INDEX__SHIFT);<br>
- cgs_write_register(hwmgr->device, reg, data);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);<br>
<br>
result = vega10_program_didt_config_registers(hwmgr, SEDiDtStallCtrlConfig_vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, SEDiDtStallPatternConfig_vega10, VEGA10_CONFIGREG_DIDT);<br>
@@ -958,7 +956,7 @@ static int vega10_enable_cac_driving_se_didt_config(struct pp_hwmgr *hwmgr)<br>
if (0 != result)<br>
break;<br>
}<br>
- cgs_write_register(hwmgr->device, reg, 0xE0000000);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, 0xE0000000);<br>
mutex_unlock(&adev->grbm_idx_mutex);<br>
<br>
vega10_didt_set_mask(hwmgr, true);<br>
@@ -986,17 +984,15 @@ static int vega10_enable_psm_gc_didt_config(struct pp_hwmgr *hwmgr)<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
int result;<br>
uint32_t num_se = 0, count, data;<br>
- uint32_t reg;<br>
<br>
num_se = adev->gfx.config.max_shader_engines;<br>
<br>
adev->gfx.rlc.funcs->enter_safe_mode(adev);<br>
<br>
mutex_lock(&adev->grbm_idx_mutex);<br>
- reg = soc15_get_register_offset(GC_HWID, 0, mmGRBM_GFX_INDEX_BASE_IDX, mmGRBM_GFX_INDEX);<br>
for (count = 0; count < num_se; count++) {<br>
data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK | GRBM_GFX_INDEX__SH_BROADCAST_WRITES_MASK | ( count << GRBM_GFX_INDEX__SE_INDEX__SHIFT);<br>
- cgs_write_register(hwmgr->device, reg, data);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);<br>
<br>
result = vega10_program_didt_config_registers(hwmgr, SEDiDtStallCtrlConfig_vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, SEDiDtStallPatternConfig_vega10, VEGA10_CONFIGREG_DIDT);<br>
@@ -1005,7 +1001,7 @@ static int vega10_enable_psm_gc_didt_config(struct pp_hwmgr *hwmgr)<br>
if (0 != result)<br>
break;<br>
}<br>
- cgs_write_register(hwmgr->device, reg, 0xE0000000);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, 0xE0000000);<br>
mutex_unlock(&adev->grbm_idx_mutex);<br>
<br>
vega10_didt_set_mask(hwmgr, true);<br>
@@ -1049,17 +1045,15 @@ static int vega10_enable_se_edc_config(struct pp_hwmgr *hwmgr)<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
int result;<br>
uint32_t num_se = 0, count, data;<br>
- uint32_t reg;<br>
<br>
num_se = adev->gfx.config.max_shader_engines;<br>
<br>
adev->gfx.rlc.funcs->enter_safe_mode(adev);<br>
<br>
mutex_lock(&adev->grbm_idx_mutex);<br>
- reg = soc15_get_register_offset(GC_HWID, 0, mmGRBM_GFX_INDEX_BASE_IDX, mmGRBM_GFX_INDEX);<br>
for (count = 0; count < num_se; count++) {<br>
data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK | GRBM_GFX_INDEX__SH_BROADCAST_WRITES_MASK | ( count << GRBM_GFX_INDEX__SE_INDEX__SHIFT);<br>
- cgs_write_register(hwmgr->device, reg, data);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);<br>
result = vega10_program_didt_config_registers(hwmgr, SEDiDtWeightConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, SEEDCStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, SEEDCStallDelayConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
@@ -1070,7 +1064,7 @@ static int vega10_enable_se_edc_config(struct pp_hwmgr *hwmgr)<br>
if (0 != result)<br>
break;<br>
}<br>
- cgs_write_register(hwmgr->device, reg, 0xE0000000);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, 0xE0000000);<br>
mutex_unlock(&adev->grbm_idx_mutex);<br>
<br>
vega10_didt_set_mask(hwmgr, true);<br>
@@ -1099,7 +1093,6 @@ static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)<br>
int result;<br>
uint32_t num_se = 0;<br>
uint32_t count, data;<br>
- uint32_t reg;<br>
<br>
num_se = adev->gfx.config.max_shader_engines;<br>
<br>
@@ -1108,10 +1101,9 @@ static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)<br>
vega10_program_gc_didt_config_registers(hwmgr, AvfsPSMResetConfig_vega10);<br>
<br>
mutex_lock(&adev->grbm_idx_mutex);<br>
- reg = soc15_get_register_offset(GC_HWID, 0, mmGRBM_GFX_INDEX_BASE_IDX, mmGRBM_GFX_INDEX);<br>
for (count = 0; count < num_se; count++) {<br>
data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK | GRBM_GFX_INDEX__SH_BROADCAST_WRITES_MASK | ( count << GRBM_GFX_INDEX__SE_INDEX__SHIFT);<br>
- cgs_write_register(hwmgr->device, reg, data);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);<br>
result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCStallDelayConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCCtrlResetConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
@@ -1120,7 +1112,7 @@ static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)<br>
if (0 != result)<br>
break;<br>
}<br>
- cgs_write_register(hwmgr->device, reg, 0xE0000000);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, 0xE0000000);<br>
mutex_unlock(&adev->grbm_idx_mutex);<br>
<br>
vega10_didt_set_mask(hwmgr, true);<br>
@@ -1165,14 +1157,12 @@ static int vega10_disable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)<br>
static int vega10_enable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)<br>
{<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
- uint32_t reg;<br>
int result;<br>
<br>
adev->gfx.rlc.funcs->enter_safe_mode(adev);<br>
<br>
mutex_lock(&adev->grbm_idx_mutex);<br>
- reg = soc15_get_register_offset(GC_HWID, 0, mmGRBM_GFX_INDEX_BASE_IDX, mmGRBM_GFX_INDEX);<br>
- cgs_write_register(hwmgr->device, reg, 0xE0000000);<br>
+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, 0xE0000000);<br>
mutex_unlock(&adev->grbm_idx_mutex);<br>
<br>
result = vega10_program_didt_config_registers(hwmgr, SEEDCForceStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c<br>
index 9f18226..aa044c1 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c<br>
@@ -25,7 +25,7 @@<br>
#include "vega10_hwmgr.h"<br>
#include "vega10_ppsmc.h"<br>
#include "vega10_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "pp_debug.h"<br>
<br>
static int vega10_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)<br>
@@ -89,6 +89,7 @@ int vega10_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr *hwmgr,<br>
<br>
int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
struct vega10_hwmgr *data = hwmgr->backend;<br>
uint32_t tach_period;<br>
uint32_t crystal_clock_freq;<br>
@@ -100,10 +101,8 @@ int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed)<br>
if (data->smu_features[GNLD_FAN_CONTROL].supported) {<br>
result = vega10_get_current_rpm(hwmgr, speed);<br>
} else {<br>
- uint32_t reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_TACH_STATUS_BASE_IDX, mmCG_TACH_STATUS);<br>
tach_period =<br>
- CGS_REG_GET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_STATUS),<br>
CG_TACH_STATUS,<br>
TACH_PERIOD);<br>
<br>
@@ -127,26 +126,23 @@ int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed)<br>
*/<br>
int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)<br>
{<br>
- uint32_t reg;<br>
-<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_FDO_CTRL2_BASE_IDX, mmCG_FDO_CTRL2);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
if (hwmgr->fan_ctrl_is_in_default_mode) {<br>
hwmgr->fan_ctrl_default_mode =<br>
- CGS_REG_GET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, FDO_PWM_MODE);<br>
hwmgr->tmin =<br>
- CGS_REG_GET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, TMIN);<br>
hwmgr->fan_ctrl_is_in_default_mode = false;<br>
}<br>
<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL2,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, TMIN, 0));<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL2,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, FDO_PWM_MODE, mode));<br>
<br>
return 0;<br>
@@ -159,18 +155,15 @@ int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)<br>
*/<br>
int vega10_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg;<br>
-<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_FDO_CTRL2_BASE_IDX, mmCG_FDO_CTRL2);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
if (!hwmgr->fan_ctrl_is_in_default_mode) {<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL2,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, FDO_PWM_MODE,<br>
hwmgr->fan_ctrl_default_mode));<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL2,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, TMIN,<br>
hwmgr->tmin << CG_FDO_CTRL2__TMIN__SHIFT));<br>
hwmgr->fan_ctrl_is_in_default_mode = true;<br>
@@ -257,10 +250,10 @@ int vega10_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr)<br>
int vega10_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,<br>
uint32_t speed)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t duty100;<br>
uint32_t duty;<br>
uint64_t tmp64;<br>
- uint32_t reg;<br>
<br>
if (hwmgr->thermal_controller.fanInfo.bNoFan)<br>
return 0;<br>
@@ -271,10 +264,7 @@ int vega10_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,<br>
if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl))<br>
vega10_fan_ctrl_stop_smc_fan_control(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_FDO_CTRL1_BASE_IDX, mmCG_FDO_CTRL1);<br>
-<br>
- duty100 = CGS_REG_GET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1),<br>
CG_FDO_CTRL1, FMAX_DUTY100);<br>
<br>
if (duty100 == 0)<br>
@@ -284,10 +274,8 @@ int vega10_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,<br>
do_div(tmp64, 100);<br>
duty = (uint32_t)tmp64;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_FDO_CTRL0_BASE_IDX, mmCG_FDO_CTRL0);<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL0,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL0),<br>
CG_FDO_CTRL0, FDO_STATIC_DUTY, duty));<br>
<br>
return vega10_fan_ctrl_set_static_mode(hwmgr, FDO_PWM_MODE_STATIC);<br>
@@ -317,10 +305,10 @@ int vega10_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr)<br>
*/<br>
int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t tach_period;<br>
uint32_t crystal_clock_freq;<br>
int result = 0;<br>
- uint32_t reg;<br>
<br>
if (hwmgr->thermal_controller.fanInfo.bNoFan ||<br>
(speed < hwmgr->thermal_controller.fanInfo.ulMinRPM) ||<br>
@@ -333,10 +321,8 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)<br>
if (!result) {<br>
crystal_clock_freq = amdgpu_asic_get_xclk((struct amdgpu_device *)hwmgr->adev);<br>
tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed);<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_TACH_STATUS_BASE_IDX, mmCG_TACH_STATUS);<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_TACH_STATUS,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_STATUS),<br>
CG_TACH_STATUS, TACH_PERIOD,<br>
tach_period));<br>
}<br>
@@ -350,13 +336,10 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)<br>
*/<br>
int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
int temp;<br>
- uint32_t reg;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_MULT_THERMAL_STATUS_BASE_IDX, mmCG_MULT_THERMAL_STATUS);<br>
-<br>
- temp = cgs_read_register(hwmgr->device, reg);<br>
+ temp = RREG32_SOC15(THM, 0, mmCG_MULT_THERMAL_STATUS);<br>
<br>
temp = (temp & CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK) >><br>
CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT;<br>
@@ -379,11 +362,12 @@ int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
struct PP_TemperatureRange *range)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
int low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP *<br>
PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
int high = VEGA10_THERMAL_MAXIMUM_ALERT_TEMP *<br>
PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
- uint32_t val, reg;<br>
+ uint32_t val;<br>
<br>
if (low < range->min)<br>
low = range->min;<br>
@@ -393,20 +377,17 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
if (low > high)<br>
return -EINVAL;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmTHM_THERMAL_INT_CTRL_BASE_IDX, mmTHM_THERMAL_INT_CTRL);<br>
-<br>
- val = cgs_read_register(hwmgr->device, reg);<br>
+ val = RREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL);<br>
<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, MAX_IH_CREDIT, 5);<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, MAX_IH_CREDIT, 5);<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
val &= (~THM_THERMAL_INT_CTRL__THERM_TRIGGER_MASK_MASK) &<br>
(~THM_THERMAL_INT_CTRL__THERM_INTH_MASK_MASK) &<br>
(~THM_THERMAL_INT_CTRL__THERM_INTL_MASK_MASK);<br>
<br>
- cgs_write_register(hwmgr->device, reg, val);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL, val);<br>
<br>
return 0;<br>
}<br>
@@ -418,21 +399,17 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
*/<br>
static int vega10_thermal_initialize(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
if (hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution) {<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_TACH_CTRL_BASE_IDX, mmCG_TACH_CTRL);<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_TACH_CTRL,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_CTRL),<br>
CG_TACH_CTRL, EDGE_PER_REV,<br>
hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution - 1));<br>
}<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_FDO_CTRL2_BASE_IDX, mmCG_FDO_CTRL2);<br>
- cgs_write_register(hwmgr->device, reg,<br>
- CGS_REG_SET_FIELD(cgs_read_register(hwmgr->device, reg),<br>
+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL2,<br>
+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL2),<br>
CG_FDO_CTRL2, TACH_PWM_RESP_RATE, 0x28));<br>
<br>
return 0;<br>
@@ -445,9 +422,9 @@ static int vega10_thermal_initialize(struct pp_hwmgr *hwmgr)<br>
*/<br>
static int vega10_thermal_enable_alert(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
struct vega10_hwmgr *data = hwmgr->backend;<br>
uint32_t val = 0;<br>
- uint32_t reg;<br>
<br>
if (data->smu_features[GNLD_FW_CTF].supported) {<br>
if (data->smu_features[GNLD_FW_CTF].enabled)<br>
@@ -465,8 +442,7 @@ static int vega10_thermal_enable_alert(struct pp_hwmgr *hwmgr)<br>
val |= (1 << THM_THERMAL_INT_ENA__THERM_INTL_CLR__SHIFT);<br>
val |= (1 << THM_THERMAL_INT_ENA__THERM_TRIGGER_CLR__SHIFT);<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0, mmTHM_THERMAL_INT_ENA_BASE_IDX, mmTHM_THERMAL_INT_ENA);<br>
- cgs_write_register(hwmgr->device, reg, val);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_ENA, val);<br>
<br>
return 0;<br>
}<br>
@@ -477,8 +453,8 @@ static int vega10_thermal_enable_alert(struct pp_hwmgr *hwmgr)<br>
*/<br>
int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
struct vega10_hwmgr *data = hwmgr->backend;<br>
- uint32_t reg;<br>
<br>
if (data->smu_features[GNLD_FW_CTF].supported) {<br>
if (!data->smu_features[GNLD_FW_CTF].enabled)<br>
@@ -493,8 +469,7 @@ int vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr)<br>
data->smu_features[GNLD_FW_CTF].enabled = false;<br>
}<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0, mmTHM_THERMAL_INT_ENA_BASE_IDX, mmTHM_THERMAL_INT_ENA);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_ENA, 0);<br>
<br>
return 0;<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c<br>
index 6a85238..7dca75c 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c<br>
@@ -34,7 +34,6 @@<br>
#include "atomfirmware.h"<br>
#include "cgs_common.h"<br>
#include "vega12_inc.h"<br>
-#include "pp_soc15.h"<br>
#include "pppcielanes.h"<br>
#include "vega12_hwmgr.h"<br>
#include "vega12_processpptables.h"<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c<br>
index df0fa81..cfd9e6c 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c<br>
@@ -26,7 +26,7 @@<br>
#include "vega12_smumgr.h"<br>
#include "vega12_ppsmc.h"<br>
#include "vega12_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "pp_debug.h"<br>
<br>
static int vega12_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)<br>
@@ -147,13 +147,10 @@ int vega12_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr)<br>
*/<br>
int vega12_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
int temp = 0;<br>
- uint32_t reg;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmCG_MULT_THERMAL_STATUS_BASE_IDX, mmCG_MULT_THERMAL_STATUS);<br>
-<br>
- temp = cgs_read_register(hwmgr->device, reg);<br>
+ temp = RREG32_SOC15(THM, 0, mmCG_MULT_THERMAL_STATUS);<br>
<br>
temp = (temp & CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK) >><br>
CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT;<br>
@@ -175,11 +172,12 @@ int vega12_thermal_get_temperature(struct pp_hwmgr *hwmgr)<br>
static int vega12_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
struct PP_TemperatureRange *range)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
int low = VEGA12_THERMAL_MINIMUM_ALERT_TEMP *<br>
PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
int high = VEGA12_THERMAL_MAXIMUM_ALERT_TEMP *<br>
PP_TEMPERATURE_UNITS_PER_CENTIGRADES;<br>
- uint32_t val, reg;<br>
+ uint32_t val;<br>
<br>
if (low < range->min)<br>
low = range->min;<br>
@@ -189,18 +187,15 @@ static int vega12_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
if (low > high)<br>
return -EINVAL;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0,<br>
- mmTHM_THERMAL_INT_CTRL_BASE_IDX, mmTHM_THERMAL_INT_CTRL);<br>
-<br>
- val = cgs_read_register(hwmgr->device, reg);<br>
+ val = RREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL);<br>
<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, MAX_IH_CREDIT, 5);<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
- val = CGS_REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, MAX_IH_CREDIT, 5);<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / PP_TEMPERATURE_UNITS_PER_CENTIGRADES));<br>
val = val & (~THM_THERMAL_INT_CTRL__THERM_TRIGGER_MASK_MASK);<br>
<br>
- cgs_write_register(hwmgr->device, reg, val);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL, val);<br>
<br>
return 0;<br>
}<br>
@@ -212,15 +207,14 @@ static int vega12_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,<br>
*/<br>
static int vega12_thermal_enable_alert(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t val = 0;<br>
- uint32_t reg;<br>
<br>
val |= (1 << THM_THERMAL_INT_ENA__THERM_INTH_CLR__SHIFT);<br>
val |= (1 << THM_THERMAL_INT_ENA__THERM_INTL_CLR__SHIFT);<br>
val |= (1 << THM_THERMAL_INT_ENA__THERM_TRIGGER_CLR__SHIFT);<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0, mmTHM_THERMAL_INT_ENA_BASE_IDX, mmTHM_THERMAL_INT_ENA);<br>
- cgs_write_register(hwmgr->device, reg, val);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_ENA, val);<br>
<br>
return 0;<br>
}<br>
@@ -231,10 +225,9 @@ static int vega12_thermal_enable_alert(struct pp_hwmgr *hwmgr)<br>
*/<br>
int vega12_thermal_disable_alert(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- reg = soc15_get_register_offset(THM_HWID, 0, mmTHM_THERMAL_INT_ENA_BASE_IDX, mmTHM_THERMAL_INT_ENA);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_ENA, 0);<br>
<br>
return 0;<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_soc15.h b/drivers/gpu/drm/amd/powerplay/inc/pp_soc15.h<br>
deleted file mode 100644<br>
index 214f370..0000000<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/pp_soc15.h<br>
+++ /dev/null<br>
@@ -1,52 +0,0 @@<br>
-/*<br>
- * Copyright 2016 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 in<br>
- * all copies or substantial portions of the Software.<br>
- *<br>
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
- * 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) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
- * OTHER DEALINGS IN THE SOFTWARE.<br>
- *<br>
- */<br>
-#ifndef PP_SOC15_H<br>
-#define PP_SOC15_H<br>
-<br>
-#include "soc15_hw_ip.h"<br>
-#include "vega10_ip_offset.h"<br>
-<br>
-inline static uint32_t soc15_get_register_offset(<br>
- uint32_t hw_id,<br>
- uint32_t inst,<br>
- uint32_t segment,<br>
- uint32_t offset)<br>
-{<br>
- uint32_t reg = 0;<br>
-<br>
- if (hw_id == THM_HWID)<br>
- reg = THM_BASE.instance[inst].segment[segment] + offset;<br>
- else if (hw_id == NBIF_HWID)<br>
- reg = NBIF_BASE.instance[inst].segment[segment] + offset;<br>
- else if (hw_id == MP1_HWID)<br>
- reg = MP1_BASE.instance[inst].segment[segment] + offset;<br>
- else if (hw_id == DF_HWID)<br>
- reg = DF_BASE.instance[inst].segment[segment] + offset;<br>
- else if (hw_id == GC_HWID)<br>
- reg = GC_BASE.instance[inst].segment[segment] + offset;<br>
- else if (hw_id == SMUIO_HWID)<br>
- reg = SMUIO_BASE.instance[inst].segment[segment] + offset;<br>
- return reg;<br>
-}<br>
-<br>
-#endif<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu10_smumgr.c<br>
index bc53f2b..9adea72 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu10_smumgr.c<br>
@@ -23,7 +23,7 @@<br>
<br>
#include "smumgr.h"<br>
#include "smu10_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "smu10_smumgr.h"<br>
#include "ppatomctrl.h"<br>
#include "rv_ppsmc.h"<br>
@@ -49,48 +49,41 @@<br>
<br>
static uint32_t smu10_wait_for_response(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t reg;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
+ reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
<br>
phm_wait_for_register_unequal(hwmgr, reg,<br>
0, MP1_C2PMSG_90__CONTENT_MASK);<br>
<br>
- return cgs_read_register(hwmgr->device, reg);<br>
+ return RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
}<br>
<br>
static int smu10_send_msg_to_smc_without_waiting(struct pp_hwmgr *hwmgr,<br>
uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_66_BASE_IDX, mmMP1_SMN_C2PMSG_66);<br>
- cgs_write_register(hwmgr->device, reg, msg);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66, msg);<br>
<br>
return 0;<br>
}<br>
<br>
static int smu10_read_arg_from_smc(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg;<br>
-<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- return cgs_read_register(hwmgr->device, reg);<br>
+ return RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);<br>
}<br>
<br>
static int smu10_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
smu10_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
smu10_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
@@ -104,17 +97,13 @@ static int smu10_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
static int smu10_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,<br>
uint16_t msg, uint32_t parameter)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
smu10_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
- cgs_write_register(hwmgr->device, reg, parameter);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, parameter);<br>
<br>
smu10_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c<br>
index 4aafb04..14ac6d1 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vega10_smumgr.c<br>
@@ -23,7 +23,7 @@<br>
<br>
#include "smumgr.h"<br>
#include "vega10_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "vega10_smumgr.h"<br>
#include "vega10_hwmgr.h"<br>
#include "vega10_ppsmc.h"<br>
@@ -54,18 +54,13 @@<br>
<br>
static bool vega10_is_smc_ram_running(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t mp1_fw_flags, reg;<br>
-<br>
- reg = soc15_get_register_offset(NBIF_HWID, 0,<br>
- mmPCIE_INDEX2_BASE_IDX, mmPCIE_INDEX2);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
+ uint32_t mp1_fw_flags;<br>
<br>
- cgs_write_register(hwmgr->device, reg,<br>
+ WREG32_SOC15(NBIF, 0, mmPCIE_INDEX2,<br>
(MP1_Public | (smnMP1_FIRMWARE_FLAGS & 0xffffffff)));<br>
<br>
- reg = soc15_get_register_offset(NBIF_HWID, 0,<br>
- mmPCIE_DATA2_BASE_IDX, mmPCIE_DATA2);<br>
-<br>
- mp1_fw_flags = cgs_read_register(hwmgr->device, reg);<br>
+ mp1_fw_flags = RREG32_SOC15(NBIF, 0, mmPCIE_DATA2);<br>
<br>
if (mp1_fw_flags & MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED_MASK)<br>
return true;<br>
@@ -81,11 +76,11 @@ static bool vega10_is_smc_ram_running(struct pp_hwmgr *hwmgr)<br>
*/<br>
static uint32_t vega10_wait_for_response(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t reg;<br>
uint32_t ret;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
+ reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
<br>
ret = phm_wait_for_register_unequal(hwmgr, reg,<br>
0, MP1_C2PMSG_90__CONTENT_MASK);<br>
@@ -93,7 +88,7 @@ static uint32_t vega10_wait_for_response(struct pp_hwmgr *hwmgr)<br>
if (ret)<br>
pr_err("No response from smu\n");<br>
<br>
- return cgs_read_register(hwmgr->device, reg);<br>
+ return RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
}<br>
<br>
/*<br>
@@ -105,11 +100,9 @@ static uint32_t vega10_wait_for_response(struct pp_hwmgr *hwmgr)<br>
static int vega10_send_msg_to_smc_without_waiting(struct pp_hwmgr *hwmgr,<br>
uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_66_BASE_IDX, mmMP1_SMN_C2PMSG_66);<br>
- cgs_write_register(hwmgr->device, reg, msg);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66, msg);<br>
<br>
return 0;<br>
}<br>
@@ -122,14 +115,12 @@ static int vega10_send_msg_to_smc_without_waiting(struct pp_hwmgr *hwmgr,<br>
*/<br>
static int vega10_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t ret;<br>
<br>
vega10_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
vega10_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
@@ -150,18 +141,14 @@ static int vega10_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
static int vega10_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,<br>
uint16_t msg, uint32_t parameter)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t ret;<br>
<br>
vega10_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
- cgs_write_register(hwmgr->device, reg, parameter);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, parameter);<br>
<br>
vega10_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
@@ -174,12 +161,9 @@ static int vega10_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,<br>
<br>
static int vega10_get_argument(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t reg;<br>
-<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- return cgs_read_register(hwmgr->device, reg);<br>
+ return RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);<br>
}<br>
<br>
static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c<br>
index 651a3f2..7d9b40e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vega12_smumgr.c<br>
@@ -23,7 +23,7 @@<br>
<br>
#include "smumgr.h"<br>
#include "vega12_inc.h"<br>
-#include "pp_soc15.h"<br>
+#include "soc15_common.h"<br>
#include "vega12_smumgr.h"<br>
#include "vega12_ppsmc.h"<br>
#include "vega12/smu9_driver_if.h"<br>
@@ -44,18 +44,13 @@<br>
<br>
static bool vega12_is_smc_ram_running(struct pp_hwmgr *hwmgr)<br>
{<br>
- uint32_t mp1_fw_flags, reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
+ uint32_t mp1_fw_flags;<br>
<br>
- reg = soc15_get_register_offset(NBIF_HWID, 0,<br>
- mmPCIE_INDEX2_BASE_IDX, mmPCIE_INDEX2);<br>
-<br>
- cgs_write_register(hwmgr->device, reg,<br>
+ WREG32_SOC15(NBIF, 0, mmPCIE_INDEX2,<br>
(MP1_Public | (smnMP1_FIRMWARE_FLAGS & 0xffffffff)));<br>
<br>
- reg = soc15_get_register_offset(NBIF_HWID, 0,<br>
- mmPCIE_DATA2_BASE_IDX, mmPCIE_DATA2);<br>
-<br>
- mp1_fw_flags = cgs_read_register(hwmgr->device, reg);<br>
+ mp1_fw_flags = RREG32_SOC15(NBIF, 0, mmPCIE_DATA2);<br>
<br>
if ((mp1_fw_flags & MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED_MASK) >><br>
MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED__SHIFT)<br>
@@ -72,15 +67,15 @@ static bool vega12_is_smc_ram_running(struct pp_hwmgr *hwmgr)<br>
*/<br>
static uint32_t vega12_wait_for_response(struct pp_hwmgr *hwmgr)<br>
{<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
uint32_t reg;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
+ reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
<br>
phm_wait_for_register_unequal(hwmgr, reg,<br>
0, MP1_C2PMSG_90__CONTENT_MASK);<br>
<br>
- return cgs_read_register(hwmgr->device, reg);<br>
+ return RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90);<br>
}<br>
<br>
/*<br>
@@ -92,11 +87,9 @@ static uint32_t vega12_wait_for_response(struct pp_hwmgr *hwmgr)<br>
int vega12_send_msg_to_smc_without_waiting(struct pp_hwmgr *hwmgr,<br>
uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_66_BASE_IDX, mmMP1_SMN_C2PMSG_66);<br>
- cgs_write_register(hwmgr->device, reg, msg);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66, msg);<br>
<br>
return 0;<br>
}<br>
@@ -109,13 +102,11 @@ int vega12_send_msg_to_smc_without_waiting(struct pp_hwmgr *hwmgr,<br>
*/<br>
int vega12_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
vega12_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
vega12_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
@@ -135,17 +126,13 @@ int vega12_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)<br>
int vega12_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,<br>
uint16_t msg, uint32_t parameter)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
vega12_wait_for_response(hwmgr);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_90_BASE_IDX, mmMP1_SMN_C2PMSG_90);<br>
- cgs_write_register(hwmgr->device, reg, 0);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
- cgs_write_register(hwmgr->device, reg, parameter);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, parameter);<br>
<br>
vega12_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
<br>
@@ -166,11 +153,9 @@ int vega12_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,<br>
int vega12_send_msg_to_smc_with_parameter_without_waiting(<br>
struct pp_hwmgr *hwmgr, uint16_t msg, uint32_t parameter)<br>
{<br>
- uint32_t reg;<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_66_BASE_IDX, mmMP1_SMN_C2PMSG_66);<br>
- cgs_write_register(hwmgr->device, reg, parameter);<br>
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66, parameter);<br>
<br>
return vega12_send_msg_to_smc_without_waiting(hwmgr, msg);<br>
}<br>
@@ -183,12 +168,9 @@ int vega12_send_msg_to_smc_with_parameter_without_waiting(<br>
*/<br>
int vega12_read_arg_from_smc(struct pp_hwmgr *hwmgr, uint32_t *arg)<br>
{<br>
- uint32_t reg;<br>
-<br>
- reg = soc15_get_register_offset(MP1_HWID, 0,<br>
- mmMP1_SMN_C2PMSG_82_BASE_IDX, mmMP1_SMN_C2PMSG_82);<br>
+ struct amdgpu_device *adev = hwmgr->adev;<br>
<br>
- *arg = cgs_read_register(hwmgr->device, reg);<br>
+ *arg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);<br>
<br>
return 0;<br>
}<br>
-- <br>
2.7.4<br>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>