Skip to content

Commit

Permalink
PRD: incorrect CFAM register addresses used in Hostboot
Browse files Browse the repository at this point in the history
Change-Id: I1b340112b8b82e6833e7d30b4eb8c122290700e9
CQ: SW436672
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/62257
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/62376
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/62649
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
zane131 committed Jul 19, 2018
1 parent 7be4362 commit 0eda42c
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 46 deletions.
80 changes: 47 additions & 33 deletions src/usr/diag/prdf/common/plat/p9/prdfFsiCapUtil.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,48 +40,62 @@ using namespace PlatServices;
namespace PLL
{

void captureFsiStatusReg( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
void __captureFsiReg( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc,
uint16_t i_wordAddr, const char * i_regStr )
{
// In hostboot runtime, PRD does not have access to drivers that read
// CFAM registers
#ifndef __HOSTBOOT_RUNTIME
uint32_t data = 0;

#define PRDF_FUNC "[PLL::captureFsiStatusReg] "
if ( SUCCESS == getCfam(i_chip, i_wordAddr, data) )
{
BitString bs { 32, (CPU_WORD *) &data };

uint32_t u32Data = 0;
uint16_t id = Util::hashString(i_regStr) ^ i_chip->getSignatureOffset();

int32_t rc = getCfam( i_chip, 0x00001007, u32Data );
io_sc.service_data->GetCaptureData().Add( i_chip->getTrgt(), id, bs );
}
}

if ( SUCCESS == rc )
{
BitString bs (32, (CPU_WORD *) &u32Data);
template<>
void captureFsiStatusReg<TYPE_PROC>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( TYPE_PROC == i_chip->getType() );

io_sc.service_data->GetCaptureData().Add(
i_chip->getTrgt(),
( Util::hashString("CFAM_FSI_STATUS") ^
i_chip->getSignatureOffset() ),
bs);
}
#if defined(__HOSTBOOT_RUNTIME)

// Do nothing. HBRT does not have any FSI access.

#elif defined(__HOSTBOOT_MODULE)

if( TYPE_PROC == i_chip->getType() )
// Hostboot does not have FSI access to the master processor.
if ( getMasterProc() != i_chip->getTrgt() )
{
uint32_t fsiGp7 = 0;
rc = getCfam( i_chip, 0x2816, fsiGp7 );
if ( SUCCESS == rc )
{
BitString bs (32, (CPU_WORD *) &fsiGp7);

io_sc.service_data->GetCaptureData().Add(
i_chip->getTrgt(),
( Util::hashString("CFAM_FSI_GP7") ^
i_chip->getSignatureOffset() ),
bs);
}
__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );
__captureFsiReg( i_chip, io_sc, 0x2816, "CFAM_FSI_GP7" );
}

#undef PRDF_FUNC
#endif // not hostboot runtime
#else

// FSP has full FSI access.
__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );
__captureFsiReg( i_chip, io_sc, 0x2816, "CFAM_FSI_GP7" );

#endif
}

template<>
void captureFsiStatusReg<TYPE_MEMBUF>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( TYPE_MEMBUF == i_chip->getType() );

#ifndef __HOSTBOOT_RUNTIME

__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );

#endif
}

} // end namespace PLL
Expand Down
6 changes: 5 additions & 1 deletion src/usr/diag/prdf/common/plat/p9/prdfFsiCapUtil.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -31,6 +31,9 @@
* @brief Captures FSI status register for FFDC.
*/

// Platform includes
#include <prdfTargetServices.H>

namespace PRDF
{

Expand All @@ -44,6 +47,7 @@ namespace PLL
* @param i_chip Extensible chip
* @param i_sc service data collector
*/
template<TARGETING::TYPE T>
void captureFsiStatusReg( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );

Expand Down
4 changes: 2 additions & 2 deletions src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -509,7 +509,7 @@ int32_t capturePllFfdc( ExtensibleChip * i_chip,
#define PRDF_FUNC "[Proc::capturePllFfdc] "

// Add FSI status reg
PLL::captureFsiStatusReg( i_chip, io_sc );
PLL::captureFsiStatusReg<TYPE_PROC>( i_chip, io_sc );

// Add EX scom data
TargetHandleList exList = getConnected(i_chip->getTrgt(), TYPE_CORE);
Expand Down
6 changes: 4 additions & 2 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -32,6 +32,8 @@
#include <prdfPluginMap.H>
#include <prdfFsiCapUtil.H>

using namespace TARGETING;

namespace PRDF
{

Expand Down Expand Up @@ -177,7 +179,7 @@ int32_t capturePllFfdc( ExtensibleChip * i_chip,
#define PRDF_FUNC "[Membuf::capturePllFfdc] "

// Add FSI status reg
captureFsiStatusReg( i_chip, io_sc );
captureFsiStatusReg<TYPE_MEMBUF>( i_chip, io_sc );

return SUCCESS;

Expand Down
9 changes: 5 additions & 4 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.H
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,14 @@ mss_MaintCmdWrapper * createIncAddrMssCmd( TARGETING::TargetHandle_t i_mba );

/**
* @brief get cfam data
* @param i_chip Extensible chip
* @param i_addr address
* @param o_data returned data
* @param i_chip Extensible chip
* @param i_wordAddr FSI word address. Note that Hostboot implementation will
* convert this to a byte address.
* @param o_data returned data
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
int32_t getCfam( ExtensibleChip * i_chip,
const uint32_t i_addr,
const uint16_t i_wordAddr,
uint32_t & o_data);

/**
Expand Down
10 changes: 6 additions & 4 deletions src/usr/diag/prdf/plat/prdfPlatServices.C
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,15 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget)
//##############################################################################

int32_t getCfam( ExtensibleChip * i_chip,
const uint32_t i_addr,
const uint16_t i_wordAddr,
uint32_t & o_data)
{
#define PRDF_FUNC "[PlatServices::getCfam] "

int32_t rc = SUCCESS;

uint16_t byteAddr = (i_wordAddr & 0xfe00) | ((i_wordAddr & 0x01ff) * 4);

do
{
// HB doesn't allow cfam access on master proc
Expand All @@ -239,12 +241,12 @@ int32_t getCfam( ExtensibleChip * i_chip,
errlHndl_t errH = NULL;
size_t l_size = sizeof(uint32_t);
errH = deviceRead(l_procTgt, &o_data, l_size,
DEVICE_FSI_ADDRESS((uint64_t) i_addr));
DEVICE_FSI_ADDRESS((uint64_t) byteAddr));
if (errH)
{
rc = FAIL;
PRDF_ERR( PRDF_FUNC "chip: 0x%.8X, failed to get cfam address: "
"0x%X", i_chip->GetId(), i_addr );
PRDF_ERR( PRDF_FUNC "chip: 0x%.8X, failed to get cfam byte addr: "
"0x%X", i_chip->GetId(), byteAddr );
PRDF_COMMIT_ERRL(errH, ERRL_ACTION_SA|ERRL_ACTION_REPORT);
break;
}
Expand Down

0 comments on commit 0eda42c

Please sign in to comment.