Skip to content

Commit

Permalink
PM: p9_pm_init, p9_pm_utils clean-up
Browse files Browse the repository at this point in the history
- Clarify OCC special wake-up clearing
- Use unit_pos for traces vs target addresses
- Add ATTR_PM_GLOBAL_FIR_TRACE_EN as an override attribute to control tracing
- Enable p9_pm_glob_fir_trace unit above attribute control
- Use EXTRALIBS to ensure .so is built

Change-Id: I1ea4764ca15862e82acb0751fe867d281cf00c12
RTC: 174349
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46715
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46717
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
stillgs authored and sgupta2m committed Oct 2, 2017
1 parent a92029a commit de2de6b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
51 changes: 21 additions & 30 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C
Expand Up @@ -40,6 +40,7 @@
#include <p9_pm.H>
#include <p9_pm_utils.H>
#include <p9_const_common.H>
#include <p9_perv_scom_addresses.H>

/// Byte-reverse a 16-bit integer if on a little-endian machine

Expand Down Expand Up @@ -114,32 +115,26 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
const char* i_msg)
{
FAPI_INF("p9_pm_glob_fir_trace Enter");

#if 0 // The CONST_UINT64_T definition in P9 const_common.H takes 4 arguments -
// CONST_UINT64_T(name, expr, unit, meth). Need to figure out the values
// for "unit" and "meth" for the below declarations.
CONST_UINT64_T( GLOB_XSTOP_FIR_0x01040000, ULL(0x01040000) );
CONST_UINT64_T( GLOB_RECOV_FIR_0x01040001, ULL(0x01040001) );
CONST_UINT64_T( TP_LFIR_0x0104000A, ULL(0x0104000A) );
#endif
FAPI_DBG(">> p9_pm_glob_fir_trace");

// Multicast read addresses
const uint64_t READ_GLOB_XSTOP_FIR_MC = RULL(0x570F001C);
const uint64_t READ_GLOB_RECOV_FIR_MC = RULL(0x570F001B);

// Note: i_msg is put on on each record to allow for trace "greps"
// so as to see the "big picture" across when

uint8_t l_traceEnFlag = false;
const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
fapi2::buffer<uint64_t> l_data64;

#if 0 // Uncomment when attribute ATTR_PM_GLOBAL_FIR_TRACE_EN is ready

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PM_GLOBAL_FIR_TRACE_EN,
FAPI_SYSTEM,
l_traceEnFlag),
"FAPI_ATTR_GET for attribute ATTR_PM_GLOBAL_FIR_TRACE_EN");
#endif

// Continue if trace is enabled.
if (false == l_traceEnFlag)
if (!l_traceEnFlag)
{
goto fapi_try_exit;
}
Expand All @@ -148,11 +143,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
// Check for xstops and recoverables and put in the trace
// ******************************************************************
{
#if 0 // Uncomment when the scom address is defined
FAPI_TRY(fapi2::getScom(i_target,
READ_GLOBAL_XSTOP_FIR_0x570F001B,
READ_GLOB_XSTOP_FIR_MC,
l_data64));
#endif

if(l_data64)
{
Expand All @@ -161,11 +154,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
}

{
#if 0 // Uncomment when the scom address is defined
FAPI_TRY(fapi2::getScom(i_target,
READ_GLOBAL_RECOV_FIR_0x570F001C,
READ_GLOB_RECOV_FIR_MC,
l_data64));
#endif

if(l_data64)
{
Expand All @@ -174,11 +165,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
}

{
#if 0 // Uncomment when the scom address is defined
FAPI_TRY(fapi2::getScom(i_target,
GLOB_XSTOP_FIR_0x01040000,
PERV_TP_XFIR,
l_data64));
#endif

if(l_data64)
{
Expand All @@ -187,11 +176,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
}

{
#if 0 // Uncomment when the scom address is defined
FAPI_TRY(fapi2::getScom(i_target,
GLOB_RECOV_FIR_0x01040001,
PERV_TP_RFIR,
l_data64));
#endif

if(l_data64)
{
Expand All @@ -200,11 +187,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
}

{
#if 0 // Uncomment when the scom address is defined
FAPI_TRY(fapi2::getScom(i_target,
TP_LFIR_0x0104000A,
PERV_TP_LOCAL_FIR,
l_data64));
#endif

if(l_data64)
{
Expand All @@ -213,14 +198,15 @@ fapi2::ReturnCode p9_pm_glob_fir_trace(
}

fapi_try_exit:
FAPI_DBG("<< p9_pm_glob_fir_trace");
return fapi2::current_err;
}

fapi2::ReturnCode special_wakeup_all(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
const bool i_enable)
{
FAPI_INF("special_wakeup_all Enter");
FAPI_DBG(">> special_wakeup_all");

fapi2::ReturnCode l_rc;
auto l_exChiplets = i_target.getChildren<fapi2::TARGET_TYPE_EX>
Expand All @@ -229,11 +215,16 @@ fapi2::ReturnCode special_wakeup_all(
// For each EX target
for (auto l_ex_chplt : l_exChiplets)
{
FAPI_DBG("Running special wakeup on ex chiplet 0x%08X ", l_ex_chplt);
fapi2::ATTR_CHIP_UNIT_POS_Type l_ex_num;
FAPI_TRY(FAPI_ATTR_GET( fapi2::ATTR_CHIP_UNIT_POS,
l_ex_chplt,
l_ex_num));
FAPI_DBG("Running special wakeup on ex chiplet 0x%08X ", l_ex_num);

FAPI_TRY( fapi2::specialWakeup( l_ex_chplt, i_enable ) );
}

fapi_try_exit:
FAPI_DBG("<< special_wakeup_all");
return fapi2::current_err;
}
Expand Up @@ -158,16 +158,14 @@
<writeable/>
<overrideOnly/>
</attribute>


<!-- ********************************************************************* -->
<attribute>
<id>ATTR_SAFE_MODE_VOLTAGE_MV</id>

<targetType>TARGET_TYPE_PROC_CHIP</targetType>
<description>
Safe mode voltage in mv
This attribute is used within the hwp to update the
This attribute is used within the hwp to update the
VDM config register.
Consumer: p9_setup_evid.C

Expand Down Expand Up @@ -2180,4 +2178,17 @@
<overrideOnly/>
</attribute>
<!-- ********************************************************************* -->
<attribute>
<id>ATTR_PM_GLOBAL_FIR_TRACE_EN</id>
<targetType>TARGET_TYPE_SYSTEM</targetType>
<description>
Enable Global FIR tracing through PM Complex Reset/Initialization
</description>
<valueType>uint8</valueType>
<platInit/>
<initToZero/>
<writeable/>
<overrideOnly/>
</attribute>
<!-- ********************************************************************* -->
</attributes>

0 comments on commit de2de6b

Please sign in to comment.