Skip to content

Commit 0eda42c

Browse files
committed
PRD: incorrect CFAM register addresses used in Hostboot
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>
1 parent 7be4362 commit 0eda42c

File tree

6 files changed

+69
-46
lines changed

6 files changed

+69
-46
lines changed

src/usr/diag/prdf/common/plat/p9/prdfFsiCapUtil.C

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -40,48 +40,62 @@ using namespace PlatServices;
4040
namespace PLL
4141
{
4242

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

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

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

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

56-
if ( SUCCESS == rc )
57-
{
58-
BitString bs (32, (CPU_WORD *) &u32Data);
58+
template<>
59+
void captureFsiStatusReg<TYPE_PROC>( ExtensibleChip * i_chip,
60+
STEP_CODE_DATA_STRUCT & io_sc )
61+
{
62+
PRDF_ASSERT( nullptr != i_chip );
63+
PRDF_ASSERT( TYPE_PROC == i_chip->getType() );
5964

60-
io_sc.service_data->GetCaptureData().Add(
61-
i_chip->getTrgt(),
62-
( Util::hashString("CFAM_FSI_STATUS") ^
63-
i_chip->getSignatureOffset() ),
64-
bs);
65-
}
65+
#if defined(__HOSTBOOT_RUNTIME)
66+
67+
// Do nothing. HBRT does not have any FSI access.
68+
69+
#elif defined(__HOSTBOOT_MODULE)
6670

67-
if( TYPE_PROC == i_chip->getType() )
71+
// Hostboot does not have FSI access to the master processor.
72+
if ( getMasterProc() != i_chip->getTrgt() )
6873
{
69-
uint32_t fsiGp7 = 0;
70-
rc = getCfam( i_chip, 0x2816, fsiGp7 );
71-
if ( SUCCESS == rc )
72-
{
73-
BitString bs (32, (CPU_WORD *) &fsiGp7);
74-
75-
io_sc.service_data->GetCaptureData().Add(
76-
i_chip->getTrgt(),
77-
( Util::hashString("CFAM_FSI_GP7") ^
78-
i_chip->getSignatureOffset() ),
79-
bs);
80-
}
74+
__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );
75+
__captureFsiReg( i_chip, io_sc, 0x2816, "CFAM_FSI_GP7" );
8176
}
8277

83-
#undef PRDF_FUNC
84-
#endif // not hostboot runtime
78+
#else
79+
80+
// FSP has full FSI access.
81+
__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );
82+
__captureFsiReg( i_chip, io_sc, 0x2816, "CFAM_FSI_GP7" );
83+
84+
#endif
85+
}
86+
87+
template<>
88+
void captureFsiStatusReg<TYPE_MEMBUF>( ExtensibleChip * i_chip,
89+
STEP_CODE_DATA_STRUCT & io_sc )
90+
{
91+
PRDF_ASSERT( nullptr != i_chip );
92+
PRDF_ASSERT( TYPE_MEMBUF == i_chip->getType() );
93+
94+
#ifndef __HOSTBOOT_RUNTIME
95+
96+
__captureFsiReg( i_chip, io_sc, 0x1007, "CFAM_FSI_STATUS" );
97+
98+
#endif
8599
}
86100

87101
} // end namespace PLL

src/usr/diag/prdf/common/plat/p9/prdfFsiCapUtil.H

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -31,6 +31,9 @@
3131
* @brief Captures FSI status register for FFDC.
3232
*/
3333

34+
// Platform includes
35+
#include <prdfTargetServices.H>
36+
3437
namespace PRDF
3538
{
3639

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

src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -509,7 +509,7 @@ int32_t capturePllFfdc( ExtensibleChip * i_chip,
509509
#define PRDF_FUNC "[Proc::capturePllFfdc] "
510510

511511
// Add FSI status reg
512-
PLL::captureFsiStatusReg( i_chip, io_sc );
512+
PLL::captureFsiStatusReg<TYPE_PROC>( i_chip, io_sc );
513513

514514
// Add EX scom data
515515
TargetHandleList exList = getConnected(i_chip->getTrgt(), TYPE_CORE);

src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2015 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -32,6 +32,8 @@
3232
#include <prdfPluginMap.H>
3333
#include <prdfFsiCapUtil.H>
3434

35+
using namespace TARGETING;
36+
3537
namespace PRDF
3638
{
3739

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

179181
// Add FSI status reg
180-
captureFsiStatusReg( i_chip, io_sc );
182+
captureFsiStatusReg<TYPE_MEMBUF>( i_chip, io_sc );
181183

182184
return SUCCESS;
183185

src/usr/diag/prdf/common/plat/prdfPlatServices_common.H

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,14 @@ mss_MaintCmdWrapper * createIncAddrMssCmd( TARGETING::TargetHandle_t i_mba );
458458

459459
/**
460460
* @brief get cfam data
461-
* @param i_chip Extensible chip
462-
* @param i_addr address
463-
* @param o_data returned data
461+
* @param i_chip Extensible chip
462+
* @param i_wordAddr FSI word address. Note that Hostboot implementation will
463+
* convert this to a byte address.
464+
* @param o_data returned data
464465
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
465466
*/
466467
int32_t getCfam( ExtensibleChip * i_chip,
467-
const uint32_t i_addr,
468+
const uint16_t i_wordAddr,
468469
uint32_t & o_data);
469470

470471
/**

src/usr/diag/prdf/plat/prdfPlatServices.C

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,15 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget)
210210
//##############################################################################
211211

212212
int32_t getCfam( ExtensibleChip * i_chip,
213-
const uint32_t i_addr,
213+
const uint16_t i_wordAddr,
214214
uint32_t & o_data)
215215
{
216216
#define PRDF_FUNC "[PlatServices::getCfam] "
217217

218218
int32_t rc = SUCCESS;
219219

220+
uint16_t byteAddr = (i_wordAddr & 0xfe00) | ((i_wordAddr & 0x01ff) * 4);
221+
220222
do
221223
{
222224
// HB doesn't allow cfam access on master proc
@@ -239,12 +241,12 @@ int32_t getCfam( ExtensibleChip * i_chip,
239241
errlHndl_t errH = NULL;
240242
size_t l_size = sizeof(uint32_t);
241243
errH = deviceRead(l_procTgt, &o_data, l_size,
242-
DEVICE_FSI_ADDRESS((uint64_t) i_addr));
244+
DEVICE_FSI_ADDRESS((uint64_t) byteAddr));
243245
if (errH)
244246
{
245247
rc = FAIL;
246-
PRDF_ERR( PRDF_FUNC "chip: 0x%.8X, failed to get cfam address: "
247-
"0x%X", i_chip->GetId(), i_addr );
248+
PRDF_ERR( PRDF_FUNC "chip: 0x%.8X, failed to get cfam byte addr: "
249+
"0x%X", i_chip->GetId(), byteAddr );
248250
PRDF_COMMIT_ERRL(errH, ERRL_ACTION_SA|ERRL_ACTION_REPORT);
249251
break;
250252
}

0 commit comments

Comments
 (0)