Skip to content

Commit

Permalink
PRD: Restart EC/EQ/EX trace arrays
Browse files Browse the repository at this point in the history
Change-Id: Ibc05f8d3a018875e10d98a3581c54a628f7b0618
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42498
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43054
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
bweisenb authored and zane131 committed Jul 13, 2017
1 parent d80986c commit 27f03d2
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 1 deletion.
65 changes: 65 additions & 0 deletions src/usr/diag/prdf/common/plat/p9/prdfP9Ec.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Ec.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
// Framework includes
#include <prdfPluginDef.H>
#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
#include <prdfPluginMap.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

namespace p9_ec
{

/**
* @brief Plugin function called after analysis is complete but before PRD
* exits.
* @param i_chip EC chip.
* @param io_sc The step code data struct.
* @note This is especially useful for any analysis that still needs to be
* done after the framework clears the FIR bits that were at attention.
* @return SUCCESS.
*/
int32_t PostAnalysis( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
#ifdef __HOSTBOOT_MODULE
int32_t l_rc = restartTraceArray(i_chip->GetChipHandle());
if (SUCCESS != l_rc)
{
PRDF_ERR( "[EC PostAnalysis HUID: 0x%08x RestartTraceArray failed",
i_chip->GetId());
}
#endif
return SUCCESS;
} PRDF_PLUGIN_DEFINE(p9_ec, PostAnalysis);

}
}
65 changes: 65 additions & 0 deletions src/usr/diag/prdf/common/plat/p9/prdfP9Eq.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Eq.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
// Framework includes
#include <prdfPluginDef.H>
#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
#include <prdfPluginMap.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

namespace p9_eq
{

/**
* @brief Plugin function called after analysis is complete but before PRD
* exits.
* @param i_chip EQ chip.
* @param io_sc The step code data struct.
* @note This is especially useful for any analysis that still needs to be
* done after the framework clears the FIR bits that were at attention.
* @return SUCCESS.
*/
int32_t PostAnalysis( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
#ifdef __HOSTBOOT_MODULE
int32_t l_rc = restartTraceArray(i_chip->GetChipHandle());
if (SUCCESS != l_rc)
{
PRDF_ERR( "[EQ PostAnalysis HUID: 0x%08x RestartTraceArray failed",
i_chip->GetId());
}
#endif
return SUCCESS;
} PRDF_PLUGIN_DEFINE(p9_eq, PostAnalysis);

}
}
3 changes: 2 additions & 1 deletion src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ prd_rule_plugin += prdfP9Pll.o
prd_rule_plugin += prdfCommonPlugins.o
prd_rule_plugin += prdfP9Ex.o
prd_rule_plugin += prdfP9Xbus.o

prd_rule_plugin += prdfP9Ec.o
prd_rule_plugin += prdfP9Eq.o
61 changes: 61 additions & 0 deletions src/usr/diag/prdf/plat/prdfPlatServices.C
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <devicefw/userif.H>
#include <iipMopRegisterAccess.h>
#include <ibscomreasoncodes.H>
#include <p9_proc_gettracearray.H>

using namespace TARGETING;

Expand Down Expand Up @@ -590,6 +591,66 @@ uint32_t startTpsPhase2<TYPE_MBA>( ExtensibleChip * i_mbaChip,
return SUCCESS;
}

int32_t restartTraceArray(TargetHandle_t i_tgt)
{
int32_t o_rc = SUCCESS;
errlHndl_t err = nullptr;
TYPE tgtType = getTargetType(i_tgt);
proc_gettracearray_args taArgs;
TargetHandle_t l_tgt = nullptr;

if (TYPE_CORE == tgtType)
{
taArgs.trace_bus = PROC_TB_CORE0;
l_tgt = i_tgt;
}
else if (TYPE_EQ == tgtType)
{
taArgs.trace_bus = PROC_TB_L20;
// HWP requires an EX tgt here, all the traces within EQ/EX start/stop
// so it doesn't matter which one, just use the first
TargetHandleList lst = getConnected(i_tgt, TYPE_EX);
if (lst.size() > 0)
{
l_tgt = lst[0];
}
else
{
PRDF_ERR( "restartTraceArray: no functional EX for EQ 0x%08x",
getHuid(i_tgt) );
return FAIL;
}
}
else
{
PRDF_ASSERT(false); // should only call this on EC/EQ/EX
}

taArgs.stop_pre_dump = false;
taArgs.ignore_mux_setting = true;
taArgs.collect_dump = false;
taArgs.reset_post_dump = true;
taArgs.restart_post_dump = true; //Restart all chiplet trace arrays

fapi2::variable_buffer taData;

fapi2::Target<PROC_GETTRACEARRAY_TARGET_TYPES> fapiTrgt (l_tgt);
FAPI_INVOKE_HWP( err,
p9_proc_gettracearray,
fapiTrgt,
taArgs,
taData);

if(NULL != err)
{
PRDF_ERR( "[PlatServices::RestartTraceArray] HUID: 0x%08x"
"RestartTraceArray failed", getHuid(i_tgt));
PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT );
o_rc = FAIL;
}
return o_rc;
}

//------------------------------------------------------------------------------

} // end namespace PlatServices
Expand Down
7 changes: 7 additions & 0 deletions src/usr/diag/prdf/plat/prdfPlatServices.H
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ uint32_t startTpsPhase1( ExtensibleChip * i_chip, const MemRank & i_rank );
template<TARGETING::TYPE T>
uint32_t startTpsPhase2( ExtensibleChip * i_chip, const MemRank & i_rank );

/**
* @brief Restarts Trace arrays after having stopped on error
* @param i_tgt EC/EQ target
* @return non-SUCCESS for failure, SUCCESS otherwise
*/
int32_t restartTraceArray(TARGETING::TargetHandle_t i_tgt);

} // end namespace PlatServices

} // end namespace PRDF
Expand Down
4 changes: 4 additions & 0 deletions src/usr/diag/prdf/prdf_hb_only.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/utils/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/io/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include
prd_incpath += ${ROOTPATH}/src/import/
Expand Down Expand Up @@ -148,6 +149,9 @@ CLEAN_TARGETS += ${MFG_THRES_PATH}
################################################################################
prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/io/
prd_obj_no_sim += p9_io_xbus_read_erepair.o
prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/
prd_obj_no_sim += p9_proc_gettracearray.o
prd_obj_no_sim += p9_sbe_tracearray.o

################################################################################
# The following are hardware procedure utilities that we are pulling into the
Expand Down

0 comments on commit 27f03d2

Please sign in to comment.