Skip to content

Commit

Permalink
PM: Delete deprecated attributes
Browse files Browse the repository at this point in the history
- Complete the move to platform SYSTEM_*_DISABLED and HWP *_ENABLED attributes
- Added VDM DPLL response attribute to CME header mapping
- Updated review comments

Change-Id: If8f8e42fd94825623315e8a7c28105cca8c8c8b2
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42918
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42920
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Tested-by: Dean Sanner <dsanner@us.ibm.com>
  • Loading branch information
stillgs authored and sannerd committed Jul 14, 2017
1 parent b3535c2 commit c0cb66e
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ p9_hcd_cache_stopclocks(
uint32_t l_loops1ms = 0;
uint32_t l_scom_addr = 0;
uint8_t l_attr_chip_unit_pos = 0;
uint8_t l_attr_vdm_enable = 0;
uint8_t l_attr_vdm_enabled = 0;
uint8_t l_is_mpipl = 0;
const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> l_sys;
auto l_perv = i_target.getParent<fapi2::TARGET_TYPE_PERV>();
Expand Down Expand Up @@ -135,8 +135,8 @@ p9_hcd_cache_stopclocks(
FAPI_TRY(fapi2::putScom(i_target, EQ_QPPM_QCCR_SCOM1, l_data64));
}

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLE, l_sys,
l_attr_vdm_enable));
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLED, l_chip,
l_attr_vdm_enabled));
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, l_perv,
l_attr_chip_unit_pos));
// l_attr_chip_unit_pos = l_attr_chip_unit_pos - p9hcd::PERV_TO_QUAD_POS_OFFSET;
Expand Down Expand Up @@ -263,7 +263,7 @@ p9_hcd_cache_stopclocks(
// Disable VDM
// -------------------------------

if (l_attr_vdm_enable == fapi2::ENUM_ATTR_VDM_ENABLE_ON)
if (l_attr_vdm_enabled == fapi2::ENUM_ATTR_VDM_ENABLED_TRUE)
{
FAPI_DBG("Clear Jump Protect Enable via DPLL_CTRL[1] (no need to poll DPLL_STAT)");
FAPI_TRY(putScom(i_target, EQ_QPPM_DPLL_CTRL_CLEAR, MASK_SET(1)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ p9_hcd_core_stopclocks(
fapi2::buffer<uint64_t> l_temp64;
uint32_t l_loops1ms;
uint8_t l_attr_chip_unit_pos;
uint8_t l_attr_vdm_enable;
uint8_t l_attr_vdm_enabled;
uint8_t l_attr_sdisn_setup;
const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> l_sys;
auto l_quad = i_target.getParent<fapi2::TARGET_TYPE_EQ>();
Expand All @@ -84,8 +84,8 @@ p9_hcd_core_stopclocks(
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_SDISN_SETUP, l_chip,
l_attr_sdisn_setup));

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLE, l_sys,
l_attr_vdm_enable));
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLED, l_chip,
l_attr_vdm_enabled));
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, l_perv,
l_attr_chip_unit_pos));
l_attr_chip_unit_pos = (l_attr_chip_unit_pos -
Expand Down Expand Up @@ -240,7 +240,7 @@ p9_hcd_core_stopclocks(
// Disable VDM
// -------------------------------

if (l_attr_vdm_enable == fapi2::ENUM_ATTR_VDM_ENABLE_ON)
if (l_attr_vdm_enabled == fapi2::ENUM_ATTR_VDM_ENABLED_TRUE)
{
FAPI_DBG("Set VDM Disable via CPPM_VDMCR[1]");
FAPI_TRY(putScom(i_target, C_PPM_VDMCR_OR, MASK_SET(1)));
Expand Down
3 changes: 3 additions & 0 deletions src/import/chips/p9/procedures/hwp/lib/p9_hcd_memmap_base.H
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ HCD_CONST(CME_QM_FLAG_RESCLK_ENABLE, 0x8000)
HCD_CONST(CME_QM_FLAG_SYS_IVRM_ENABLE, 0x4000)
HCD_CONST(CME_QM_FLAG_SYS_VDM_ENABLE, 0x2000)
HCD_CONST(CME_QM_FLAG_SYS_WOF_ENABLE, 0x1000)
HCD_CONST(CME_QM_FLAG_SYS_DYN_FMIN_ENABLE, 0x0800)
HCD_CONST(CME_QM_FLAG_SYS_DYN_FMAX_ENABLE, 0x0400)
HCD_CONST(CME_QM_FLAG_SYS_JUMP_PROTECT, 0x0200)

/// CME Hcode

Expand Down
6 changes: 4 additions & 2 deletions src/import/chips/p9/procedures/hwp/lib/p9_pstates_cmeqm.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ typedef union
#ifdef _BIG_ENDIAN
uint16_t resclk_enable : 1;
uint16_t ivrm_enable : 1;
uint16_t vdm_enable : 1;
uint16_t wof_enable : 1;
uint16_t dpll_dynamic_fmax_enable : 1;
uint16_t dpll_dynamic_fmin_enable : 1;
uint16_t dpll_droop_protect_enable : 1;
uint16_t reserved : 10;
uint16_t reserved : 9;
#else
uint16_t reserved : 10;
uint16_t reserved : 9;
uint16_t dpll_droop_protect_enable : 1;
uint16_t dpll_dynamic_fmin_enable : 1;
uint16_t dpll_dynamic_fmax_enable : 1;
uint16_t wof_enable : 1;
uint16_t vdm_enable : 1;
uint16_t ivrm_enable : 1;
uint16_t resclk_enable : 1;
#endif // _BIG_ENDIAN
Expand Down
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
Original file line number Diff line number Diff line change
Expand Up @@ -856,10 +856,10 @@ fapi2::ReturnCode updateImageFlags( Homerlayout_t* i_pChipHomer, CONST_FAPI2_PRO

FAPI_DBG("Resonant Clock Enabled : %s", attrVal ? "TRUE" : "FALSE" );

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IVRMS_ENABLED,
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IVRM_ENABLED,
i_procTgt,
attrVal),
"Error from FAPI_ATTR_GET for attribute ATTR_IVRMS_ENABLED" );
"Error from FAPI_ATTR_GET for attribute ATTR_IVRM_ENABLED" );

if( attrVal )
{
Expand Down
21 changes: 10 additions & 11 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_stop_gpe_init.C
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,20 @@ fapi2::ReturnCode p9_pm_stop_gpe_init(
"ERROR: Failed to assert DPLL in mode 1 and set slew rate to 1");
}

uint8_t l_ivrms_attrval = 0;
uint8_t l_ivrm_attrval = 0;
uint8_t l_vdm_attrval = 0;

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SYSTEM_IVRMS_ENABLED,
FAPI_SYSTEM,
l_ivrms_attrval),
"Error from FAPI_ATTR_GET for attribute ATTR_SYSTEM_IVRMS_ENABLED" );

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IVRM_ENABLED,
i_target,
l_ivrm_attrval),
"Error from FAPI_ATTR_GET for attribute ATTR_IVRM_ENABLED" );

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLE,
FAPI_SYSTEM,
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLED,
i_target,
l_vdm_attrval),
"Error from FAPI_ATTR_GET for attribute ATTR_VDM_ENABLE" );
"Error from FAPI_ATTR_GET for attribute ATTR_VDM_ENABLED" );

if((l_vdm_attrval || l_ivrms_attrval))
if((l_vdm_attrval || l_ivrm_attrval))
{
//check vref calibration bit set or not
//PERV_TP_KVREF_AND_VMEAS_MODE_STATUS_REG
Expand All @@ -276,7 +275,7 @@ fapi2::ReturnCode p9_pm_stop_gpe_init(
.set_CHIP(i_target)
.set_VREF_CALIBRATION_ADDRESS(0x01020007)
.set_IS_VDM_ENABLED(l_vdm_attrval)
.set_IS_IVRM_ENABLED(l_ivrms_attrval),
.set_IS_IVRM_ENABLED(l_ivrm_attrval),
"ERROR; VREF calibration bit is not set %x",
(uint32_t)l_data64);
}
Expand Down
55 changes: 42 additions & 13 deletions src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// ----------------------------------------------------------------------
#include <fapi2.H>
#include <p9_pstate_parameter_block.H>
#include <p9_hcd_memmap_base.H>
#include "p9_pm_get_poundw_bucket.H"
#include "p9_resclk_defines.H"
#include <attribute_ids.H>
Expand Down Expand Up @@ -915,9 +916,7 @@ FAPI_INF("%-60s = 0x%08x %u", #attr_name, io_attr->attr_assign, io_attr->attr_as
DATABLOCK_GET_ATTR(ATTR_SYSTEM_IVRM_DISABLE, FAPI_SYSTEM, attr_system_ivrm_disable);
DATABLOCK_GET_ATTR(ATTR_SYSTEM_WOF_DISABLE, FAPI_SYSTEM, attr_system_wof_disable);
DATABLOCK_GET_ATTR(ATTR_SYSTEM_VDM_DISABLE, FAPI_SYSTEM, attr_system_vdm_disable);
DATABLOCK_GET_ATTR(ATTR_DPLL_DYNAMIC_FMAX_ENABLE, FAPI_SYSTEM, attr_dpll_dynamic_fmax_enable);
DATABLOCK_GET_ATTR(ATTR_DPLL_DYNAMIC_FMIN_ENABLE, FAPI_SYSTEM, attr_dpll_dynamic_fmin_enable);
DATABLOCK_GET_ATTR(ATTR_DPLL_DROOP_PROTECT_ENABLE, FAPI_SYSTEM, attr_dpll_droop_protect_enable);
DATABLOCK_GET_ATTR(ATTR_DPLL_VDM_RESPONSE, FAPI_SYSTEM, attr_dpll_vdm_response);
DATABLOCK_GET_ATTR(ATTR_SYSTEM_RESCLK_DISABLE, FAPI_SYSTEM, attr_resclk_disable);
DATABLOCK_GET_ATTR(ATTR_CHIP_EC_FEATURE_WOF_NOT_SUPPORTED, i_target, attr_dd_wof_not_supported);
DATABLOCK_GET_ATTR(ATTR_CHIP_EC_FEATURE_VDM_NOT_SUPPORTED, i_target, attr_dd_vdm_not_supported);
Expand Down Expand Up @@ -1914,9 +1913,9 @@ proc_get_ivrm_parms ( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_targe
// Indicate that IVRM is good to be enabled (or not)
FAPI_INF(" NOTE: This level of code is forcing the iVRM to OFF");
{
fapi2::ATTR_IVRMS_ENABLED_Type l_ivrm_enabled =
(fapi2::ATTR_IVRMS_ENABLED_Type)fapi2::ENUM_ATTR_IVRMS_ENABLED_FALSE;
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_IVRMS_ENABLED, i_target, l_ivrm_enabled));
fapi2::ATTR_IVRM_ENABLED_Type l_ivrm_enabled =
(fapi2::ATTR_IVRM_ENABLED_Type)fapi2::ENUM_ATTR_IVRM_ENABLED_FALSE;
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_IVRM_ENABLED, i_target, l_ivrm_enabled));
}
}
else
Expand Down Expand Up @@ -3591,7 +3590,7 @@ p9_pstate_set_global_feature_attributes(const fapi2::Target<fapi2::TARGET_TYPE_P
(fapi2::ATTR_VDM_ENABLED_Type)fapi2::ENUM_ATTR_VDM_ENABLED_FALSE;

fapi2::ATTR_IVRM_ENABLED_Type l_ivrm_enabled =
(fapi2::ATTR_IVRMS_ENABLED_Type)fapi2::ENUM_ATTR_IVRMS_ENABLED_FALSE;
(fapi2::ATTR_IVRM_ENABLED_Type)fapi2::ENUM_ATTR_IVRM_ENABLED_FALSE;

fapi2::ATTR_WOF_ENABLED_Type l_wof_enabled =
(fapi2::ATTR_WOF_ENABLED_Type)fapi2::ENUM_ATTR_WOF_ENABLED_FALSE;
Expand All @@ -3613,7 +3612,7 @@ p9_pstate_set_global_feature_attributes(const fapi2::Target<fapi2::TARGET_TYPE_P

if (i_state.iv_ivrm_enabled)
{
l_ivrm_enabled = (fapi2::ATTR_IVRMS_ENABLED_Type)fapi2::ENUM_ATTR_IVRMS_ENABLED_TRUE;
l_ivrm_enabled = (fapi2::ATTR_IVRM_ENABLED_Type)fapi2::ENUM_ATTR_IVRM_ENABLED_TRUE;
}

if (i_state.iv_wof_enabled)
Expand All @@ -3624,7 +3623,7 @@ p9_pstate_set_global_feature_attributes(const fapi2::Target<fapi2::TARGET_TYPE_P
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_PSTATES_ENABLED, i_target, l_ps_enabled));
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_RESCLK_ENABLED, i_target, l_resclk_enabled));
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_VDM_ENABLED, i_target, l_vdm_enabled));
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_IVRMS_ENABLED, i_target, l_ivrm_enabled));
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_IVRM_ENABLED, i_target, l_ivrm_enabled));
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_WOF_ENABLED, i_target, l_wof_enabled));


Expand All @@ -3635,11 +3634,41 @@ p9_pstate_set_global_feature_attributes(const fapi2::Target<fapi2::TARGET_TYPE_P

l_data16.insertFromRight<0, 1>(l_resclk_enabled);
l_data16.insertFromRight<1, 1>(l_ivrm_enabled);
l_data16.insertFromRight<2, 1>(l_wof_enabled);
l_data16.insertFromRight<2, 1>(l_vdm_enabled);
l_data16.insertFromRight<3, 1>(l_wof_enabled);

l_data16.insertFromRight<3, 1>(attr.attr_dpll_dynamic_fmax_enable);
l_data16.insertFromRight<4, 1>(attr.attr_dpll_dynamic_fmin_enable);
l_data16.insertFromRight<5, 1>(attr.attr_dpll_droop_protect_enable);

// DROOP_PROTECT -> DPLL Mode 3
// DROOP_PROTECT_OVERVOLT -> DPLL Mode 3.5
// DYNAMIC -> DPLL Mode 4
// DYNAMIC_PROTECT -> DPLL Mode 5

// enable_fmin enable_fmax enable_jump
// DPLL Mode 2 0 0 0
// DPLL Mode 3 0 0 1
// DPLL Mode 4 X 1 0
// DPLL Mode 4 1 X 0
// DPLL Mode 3.5 0 1 1
// DPLL Mode 5 1 X 1

switch (attr.attr_dpll_vdm_response)
{
case fapi2::ENUM_ATTR_DPLL_VDM_RESPONSE_DROOP_PROTECT:
l_data16 |= CME_QM_FLAG_SYS_JUMP_PROTECT;
break;
case fapi2::ENUM_ATTR_DPLL_VDM_RESPONSE_DROOP_PROTECT_OVERVOLT:
l_data16 |= CME_QM_FLAG_SYS_DYN_FMAX_ENABLE;
l_data16 |= CME_QM_FLAG_SYS_JUMP_PROTECT;
break;
case fapi2::ENUM_ATTR_DPLL_VDM_RESPONSE_DYNAMIC:
l_data16 |= CME_QM_FLAG_SYS_DYN_FMIN_ENABLE;
l_data16 |= CME_QM_FLAG_SYS_DYN_FMAX_ENABLE;
break;
case fapi2::ENUM_ATTR_DPLL_VDM_RESPONSE_DYNAMIC_PROTECT:
l_data16 |= CME_QM_FLAG_SYS_DYN_FMIN_ENABLE;
l_data16 |= CME_QM_FLAG_SYS_JUMP_PROTECT;
break;
}

o_qm_flags->value = revle16(l_data16);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,7 @@ typedef struct
uint32_t attr_tdp_rdp_current_factor;

uint8_t attr_resclk_disable;
uint8_t attr_dpll_dynamic_fmax_enable;
uint8_t attr_dpll_dynamic_fmin_enable;
uint8_t attr_dpll_droop_protect_enable;

uint8_t attr_dpll_vdm_response;
uint8_t attr_nest_leakage_percent;

// Control attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,20 +381,6 @@
<initToZero/>
</attribute>
<!-- ********************************************************************* -->
<attribute>
<id>ATTR_IVRMS_ENABLED</id>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
<description>
<!-- @todo RTC 173736 -->
!!!!! Deprecated for ATTR_IVRM_ENABLED
!!!!! Will be removed in the future
</description>
<valueType>uint8</valueType>
<enum>FALSE=0, TRUE=1</enum>
<writeable/>
<initToZero/>
</attribute>
<!-- ********************************************************************* -->
<attribute>
<id>ATTR_IVRM_ENABLED</id>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
Expand Down

0 comments on commit c0cb66e

Please sign in to comment.