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/46718
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
  • Loading branch information
stillgs authored and dcrowell77 committed Oct 3, 2017
1 parent e20d02c commit e26a4e0
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 49 deletions.
3 changes: 2 additions & 1 deletion src/import/chips/p9/procedures/hwp/pm/p9_pm_cme_firinit.mk
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016
# Contributors Listed Below - COPYRIGHT 2016,2017
# [+] International Business Machines Corp.
#
#
Expand All @@ -23,4 +23,5 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_pm_cme_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_query_cache_access_state
$(call BUILD_PROCEDURE)
7 changes: 5 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.mk
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2016
# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
Expand All @@ -23,5 +23,8 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_pm_firinit
#libp9_pm_firinit_DEPLIBS += p9_pm_occ_firinit p9_pm_pba_firinit p9_pm_ppm_firinit p9_pm_cme_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pba_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ppm_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_cme_firinit
$(call BUILD_PROCEDURE)
18 changes: 12 additions & 6 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_init.C
Expand Up @@ -207,10 +207,10 @@ fapi2::ReturnCode pm_init(
// ************************************************************************
// Switch off OCC initiated special wakeup on EX to allowSTOP functionality
// ************************************************************************
FAPI_DBG("Clear off the wakeup");
FAPI_DBG("Clearing OCC special wake-up to be sure");
FAPI_TRY(clear_occ_special_wakeups(i_target),
"ERROR: Failed to clear off the wakeup");
FAPI_TRY(p9_pm_glob_fir_trace(i_target, "EX targets off special wakeup"));
FAPI_TRY(p9_pm_glob_fir_trace(i_target, "EX targets OCC clear special wakeup"));

// ************************************************************************
// Take all EX chiplets out of special wakeup
Expand Down Expand Up @@ -242,7 +242,7 @@ fapi_try_exit:
fapi2::ReturnCode clear_occ_special_wakeups(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target)
{
FAPI_INF("Entering clear_occ_special_wakeups...");
FAPI_DBG(">> clear_occ_special_wakeups...");
fapi2::buffer<uint64_t> l_data64;

auto l_exChiplets = i_target.getChildren<fapi2::TARGET_TYPE_EX>
Expand All @@ -253,15 +253,21 @@ fapi2::ReturnCode clear_occ_special_wakeups(
// Iterate through the EX chiplets
for (auto l_ex_chplt : l_exChiplets)
{
FAPI_DBG("Clear OCC 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("Clear OCC special wakeup on ex chiplet 0x%08X", l_ex_num);
FAPI_TRY(fapi2::getScom(i_target, EX_PPM_SPWKUP_OCC, l_data64),
"ERROR: Failed to read OCC Spl wkup on EX 0x%08X", l_ex_chplt);
"ERROR: Failed to read OCC Spl wkup on EX 0x%08X", l_ex_num);
l_data64.clearBit<0>();
FAPI_TRY(fapi2::putScom(i_target, EX_PPM_SPWKUP_OCC, l_data64),
"ERROR: Failed to clear OCC Spl wkup on EX 0x%08X", l_ex_chplt);
"ERROR: Failed to clear OCC Spl wkup on EX 0x%08X", l_ex_num);
}

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

13 changes: 10 additions & 3 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_init.mk
Expand Up @@ -23,9 +23,16 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_pm_init
libp9_pm_init_DEPLIBS += p9_pm_utils p9_pm_corequad_init p9_pm_ocb_init p9_pm_pss_init
libp9_pm_init_DEPLIBS += p9_pm_pba_init p9_pm_firinit p9_pm_stop_gpe_init p9_pm_pstate_gpe_init
libp9_pm_init_DEPLIBS += p9_pm_occ_control p9_pm_reset p9_check_proc_config
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_reset
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_corequad_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ocb_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pss_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_stop_gpe_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pstate_gpe_init
lib$(PROCEDURE)_EXTRALIBS+=p9_check_proc_config
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_control
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib)
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/common/pmlib/include/registers)
$(call BUILD_PROCEDURE)
15 changes: 11 additions & 4 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.mk
Expand Up @@ -22,11 +22,18 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG

PROCEDURE=p9_pm_reset
libp9_pm_reset_DEPLIBS += p9_pm_utils p9_pm_occ_firinit p9_pm_firinit p9_pm_occ_control
libp9_pm_reset_DEPLIBS += p9_pm_pstate_gpe_init p9_pm_stop_gpe_init p9_pm_occ_gpe_init
libp9_pm_reset_DEPLIBS += p9_pm_corequad_init p9_pm_occ_sram_init p9_pm_ocb_init p9_pm_pss_init
lib$(PROCEDURE)_DEPLIBS+=p9_pm_utils
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_firinit
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_control
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_gpe_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pstate_gpe_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_stop_gpe_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_corequad_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_sram_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ocb_init
lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pss_init
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib)
$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/common/pmlib/include/registers)
$(call BUILD_PROCEDURE)
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 e26a4e0

Please sign in to comment.