Skip to content

Commit dadf272

Browse files
zane131wilbryan
authored andcommitted
FIRDATA: updates to FIRDATA constants
Change-Id: I4207cf6d9ac85ecbb16f04263ca57a8c61d6d1f5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41279 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
1 parent 64aa591 commit dadf272

File tree

11 files changed

+186
-115
lines changed

11 files changed

+186
-115
lines changed

src/occ_405/firdata/firData.c

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/occ/firdata/firData.C $ */
4+
/* $Source: src/occ_405/firdata/firData.c $ */
55
/* */
66
/* OpenPOWER OnChipController Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -55,7 +55,7 @@ typedef struct
5555
PNOR_Data_t * pData; /*/< Pointer to the PNOR header data */
5656
uint32_t pBufSize; /*/< Current size of the PNOR data buffer */
5757

58-
FirData_ListPointers_t hPtrs[MAX_TRGTS]; /*/< Pointers to the register lists */
58+
FirData_ListPointers_t hPtrs[TRGT_MAX]; /*/< Pointers to the register lists */
5959

6060
} FirData_t;
6161

@@ -204,7 +204,7 @@ bool FirData_addGlblsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
204204
bool full = false;
205205

206206
uint8_t t = i_sTrgt.type;
207-
uint8_t cnt = io_fd->hData->counts[t][GLBL];
207+
uint8_t cnt = io_fd->hData->counts[t][REG_GLBL];
208208

209209
uint32_t i = 0;
210210

@@ -246,7 +246,7 @@ bool FirData_addFirsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
246246
bool full = false;
247247

248248
uint8_t t = i_sTrgt.type;
249-
uint8_t cnt = io_fd->hData->counts[t][FIR];
249+
uint8_t cnt = io_fd->hData->counts[t][REG_FIR];
250250

251251
uint32_t i = 0;
252252

@@ -298,7 +298,7 @@ bool FirData_addRegsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
298298
bool full = false;
299299

300300
uint8_t t = i_sTrgt.type;
301-
uint8_t cnt = io_fd->hData->counts[t][REG];
301+
uint8_t cnt = io_fd->hData->counts[t][REG_REG];
302302

303303
uint32_t i = 0;
304304

@@ -330,7 +330,7 @@ bool FirData_addIdFirsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
330330
bool full = false;
331331

332332
uint8_t t = i_sTrgt.type;
333-
uint8_t cnt = io_fd->hData->counts[t][IDFIR];
333+
uint8_t cnt = io_fd->hData->counts[t][REG_IDFIR];
334334

335335
uint32_t i = 0;
336336

@@ -384,7 +384,7 @@ bool FirData_addIdRegsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
384384
bool full = false;
385385

386386
uint8_t t = i_sTrgt.type;
387-
uint8_t cnt = io_fd->hData->counts[t][IDREG];
387+
uint8_t cnt = io_fd->hData->counts[t][REG_IDREG];
388388

389389
uint32_t i = 0;
390390

@@ -436,9 +436,10 @@ bool FirData_addTrgtToPnor( FirData_t * io_fd, SCOM_Trgt_t i_sTrgt,
436436
/* Update the number of targets in the PNOR data. */
437437
io_fd->pData->trgts++;
438438

439-
/* NOTE: Must add all regular registers (GLBL, FIR, REG) before all */
440-
/* indirect-SCOM registers. Also, must check GLBL registers first */
441-
/* to determine whether it is necessary to do the other registers. */
439+
/* NOTE: Must add all regular registers (REG_GLBL, REG_FIR, REG_REG)
440+
* before all indirect-SCOM registers. Also, must check REG_GLBL
441+
* registers first to determine whether it is necessary to do the
442+
* other registers. */
442443

443444
/* Add the GLBLs. */
444445
full = FirData_addGlblsToPnor( io_fd, pTrgt, i_sTrgt, o_noAttn );
@@ -499,7 +500,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
499500
fsi = io_fd->hData->procFsiBaseAddr[p];
500501

501502
/* Add this PROC to the PNOR. */
502-
sTrgt = SCOM_Trgt_getTrgt(PROC, p, 0, fsi, isM);
503+
sTrgt = SCOM_Trgt_getTrgt(TRGT_PROC, p, 0, fsi, isM);
503504
full = FirData_addTrgtToPnor( io_fd, sTrgt, &noAttn );
504505
if ( full ) break;
505506
if ( noAttn ) continue; /* Skip the PROC, EXs, and MCSs */
@@ -510,7 +511,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
510511
if ( 0 == (io_fd->hData->exMasks[p] & (0x8000 >> u)) ) continue;
511512

512513
/* Add this EX to the PNOR. */
513-
sTrgt = SCOM_Trgt_getTrgt(EX, p, u, fsi, isM);
514+
sTrgt = SCOM_Trgt_getTrgt(TRGT_EX, p, u, fsi, isM);
514515
full = FirData_addTrgtToPnor( io_fd, sTrgt, &noAttn );
515516
if ( full ) break;
516517
if ( noAttn ) continue; /* Skip the EX */
@@ -523,7 +524,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
523524
if ( 0 == (io_fd->hData->mcsMasks[p] & (0x80 >> u)) ) continue;
524525

525526
/* Add this MCS to the PNOR. */
526-
sTrgt = SCOM_Trgt_getTrgt(MCS, p, u, fsi, isM);
527+
sTrgt = SCOM_Trgt_getTrgt(TRGT_MCS, p, u, fsi, isM);
527528
full = FirData_addTrgtToPnor( io_fd, sTrgt, &noAttn );
528529
if ( full ) break;
529530
if ( noAttn ) continue; /* Skip the MCS */
@@ -533,38 +534,38 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
533534
if ( full ) break;
534535

535536
/* Iterate all MEMBs. Must do this separate of from the PROCs because */
536-
/* it is possible a MEMB could be reporting an attention but the */
537+
/* it is possible a MEMBUF could be reporting an attention but the */
537538
/* connected PROC is not. */
538-
for ( i = 0; i < MAX_MEMB_PER_NODE; i++ )
539+
for ( i = 0; i < MAX_MEMBUF_PER_NODE; i++ )
539540
{
540-
p = i / MAX_MEMB_PER_PROC;
541-
u = i % MAX_MEMB_PER_PROC;
541+
p = i / MAX_MEMBUF_PER_PROC;
542+
u = i % MAX_MEMBUF_PER_PROC;
542543

543-
/* Check if the MEMB is configured. */
544+
/* Check if the MEMBUF is configured. */
544545
if ( 0 == (io_fd->hData->membMasks[p] & (0x80 >> u)) ) continue;
545546

546547
/* Get the FSI base address. */
547548
fsi = io_fd->hData->membFsiBaseAddr[p][u];
548549

549-
/* Add this MEMB to the PNOR. */
550-
sTrgt = SCOM_Trgt_getTrgt(MEMB, p, u, fsi, false);
550+
/* Add this MEMBUF to the PNOR. */
551+
sTrgt = SCOM_Trgt_getTrgt(TRGT_MEMBUF, p, u, fsi, false);
551552
full = FirData_addTrgtToPnor( io_fd, sTrgt, &noAttn );
552553
if ( full ) break;
553-
if ( noAttn ) continue; /* Skip the MEMB and MBAs */
554+
if ( noAttn ) continue; /* Skip the MEMBUF and MBAs */
554555

555-
for ( j = 0; j < MAX_MBA_PER_MEMB; j++ )
556+
for ( j = 0; j < MAX_MBA_PER_MEMBUF; j++ )
556557
{
557-
mu = u * MAX_MBA_PER_MEMB + j;
558+
mu = u * MAX_MBA_PER_MEMBUF + j;
558559

559560
/* Check if the MBA is configured. */
560561
if ( 0 == (io_fd->hData->mbaMasks[p] & (0x8000 >> mu)) )
561562
continue;
562563

563564
/* Add this MBA to the PNOR. */
564-
sTrgt = SCOM_Trgt_getTrgt(MBA, p, mu, fsi, false);
565+
sTrgt = SCOM_Trgt_getTrgt(TRGT_MBA, p, mu, fsi, false);
565566
full = FirData_addTrgtToPnor( io_fd, sTrgt, &noAttn );
566567
if ( full ) break;
567-
if ( noAttn ) continue; /* Skip the MEMB */
568+
if ( noAttn ) continue; /* Skip the MEMBUF */
568569
}
569570
if ( full ) break;
570571
}
@@ -607,10 +608,10 @@ int32_t FirData_init( FirData_t * io_fd,
607608

608609
bool full = false;
609610

610-
uint32_t x[MAX_TRGTS][MAX_REGS];
611+
uint32_t x[TRGT_MAX][REG_MAX];
611612
size_t curIdx = 0;
612613

613-
uint32_t t = FIRST_TRGT;
614+
uint32_t t = TRGT_FIRST;
614615

615616
uint8_t * reglist = NULL;
616617

@@ -665,14 +666,14 @@ int32_t FirData_init( FirData_t * io_fd,
665666

666667
/* Get the register list byte indexes in HOMER data buffer */
667668
memset( x, 0x00, sizeof(x) );
668-
for ( t = FIRST_TRGT; t < MAX_TRGTS; t++ )
669+
for ( t = TRGT_FIRST; t < TRGT_MAX; t++ )
669670
{
670-
x[t][GLBL] = curIdx;
671-
x[t][FIR] = x[t][GLBL] + sz_u32 * io_fd->hData->counts[t][GLBL];
672-
x[t][REG] = x[t][FIR] + sz_u32 * io_fd->hData->counts[t][FIR];
673-
x[t][IDFIR] = x[t][REG] + sz_u32 * io_fd->hData->counts[t][REG];
674-
x[t][IDREG] = x[t][IDFIR] + sz_u64 * io_fd->hData->counts[t][IDFIR];
675-
curIdx = x[t][IDREG] + sz_u64 * io_fd->hData->counts[t][IDREG];
671+
x[t][REG_GLBL] = curIdx;
672+
x[t][REG_FIR] = x[t][REG_GLBL] + sz_u32 * io_fd->hData->counts[t][REG_GLBL];
673+
x[t][REG_REG] = x[t][REG_FIR] + sz_u32 * io_fd->hData->counts[t][REG_FIR];
674+
x[t][REG_IDFIR] = x[t][REG_REG] + sz_u32 * io_fd->hData->counts[t][REG_REG];
675+
x[t][REG_IDREG] = x[t][REG_IDFIR] + sz_u64 * io_fd->hData->counts[t][REG_IDFIR];
676+
curIdx = x[t][REG_IDREG] + sz_u64 * io_fd->hData->counts[t][REG_IDREG];
676677
}
677678

678679
/* Check to make sure the list data is not larger than the available */
@@ -687,13 +688,13 @@ int32_t FirData_init( FirData_t * io_fd,
687688

688689
/* Now, get the pointers for each list. */
689690
reglist = io_fd->hBuf + sz_hData;
690-
for ( t = FIRST_TRGT; t < MAX_TRGTS; t++ )
691+
for ( t = TRGT_FIRST; t < TRGT_MAX; t++ )
691692
{
692-
(io_fd->hPtrs[t]).glbl = (uint32_t *)(reglist + x[t][GLBL] );
693-
(io_fd->hPtrs[t]).fir = (uint32_t *)(reglist + x[t][FIR] );
694-
(io_fd->hPtrs[t]).reg = (uint32_t *)(reglist + x[t][REG] );
695-
(io_fd->hPtrs[t]).idFir = (uint64_t *)(reglist + x[t][IDFIR]);
696-
(io_fd->hPtrs[t]).idReg = (uint64_t *)(reglist + x[t][IDREG]);
693+
(io_fd->hPtrs[t]).glbl = (uint32_t *)(reglist + x[t][REG_GLBL] );
694+
(io_fd->hPtrs[t]).fir = (uint32_t *)(reglist + x[t][REG_FIR] );
695+
(io_fd->hPtrs[t]).reg = (uint32_t *)(reglist + x[t][REG_REG] );
696+
(io_fd->hPtrs[t]).idFir = (uint64_t *)(reglist + x[t][REG_IDFIR]);
697+
(io_fd->hPtrs[t]).idReg = (uint64_t *)(reglist + x[t][REG_IDREG]);
697698
}
698699

699700
} while (0);
@@ -737,12 +738,14 @@ int32_t FirData_captureCsFirData( uint8_t * i_hBuf, uint32_t i_hBufSize,
737738
FirData_addTrgtsToPnor( &fd );
738739

739740
/* Write the buffer to PNOR. */
741+
/* TODO: 175241
740742
rc = PNOR_writeFirData( fd.hData->pnorInfo, fd.pBuf, fd.pBufSize );
741743
if ( SUCCESS != rc )
742744
{
743745
TRAC_ERR( FUNC"Failed to process FIR data" );
744746
break;
745747
}
748+
*/
746749

747750
} while (0);
748751

src/occ_405/firdata/firDataConst_common.h

Lines changed: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/occ/firdata/occ_const.H $ */
4+
/* $Source: src/occ_405/firdata/firDataConst_common.h $ */
55
/* */
66
/* OpenPOWER OnChipController Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -36,40 +36,85 @@
3636
typedef enum
3737
{
3838
/* NOTE: These will be used as array indexes. */
39-
FIRST_TRGT = 0,
40-
PROC = FIRST_TRGT,
41-
EX,
42-
MCS,
43-
MEMB,
44-
MBA,
45-
MAX_TRGTS,
39+
40+
TRGT_FIRST = 0,
41+
42+
/** Common Nimbus/Cumulus types */
43+
TRGT_PROC = TRGT_FIRST,
44+
TRGT_CAPP,
45+
TRGT_XBUS,
46+
TRGT_OBUS,
47+
TRGT_PEC,
48+
TRGT_PHB,
49+
TRGT_EQ,
50+
TRGT_EX,
51+
TRGT_EC,
52+
53+
/* Nimbus only */
54+
TRGT_MCBIST,
55+
TRGT_MCS,
56+
TRGT_MCA,
57+
58+
/* Cumulus only */
59+
/* NOTE: Nimbus and Cumulus cannot be used at the same time. So we can have
60+
* These array indexes overlap to save space. */
61+
TRGT_MC = TRGT_MCBIST,
62+
TRGT_MI,
63+
TRGT_DMI,
64+
65+
/* Centaur only */
66+
TRGT_MEMBUF,
67+
TRGT_MBA,
68+
69+
TRGT_MAX,
4670

4771
} TrgtType_t;
4872

4973
/** Boundary/position ranges for each target type. */
5074
typedef enum
5175
{
52-
MAX_PROC_PER_NODE = 8,
53-
MAX_EX_PER_PROC = 16,
54-
MAX_MCS_PER_PROC = 8,
55-
MAX_MEMB_PER_PROC = MAX_MCS_PER_PROC,
56-
MAX_MEMB_PER_NODE = MAX_MEMB_PER_PROC * MAX_PROC_PER_NODE,
57-
MAX_MBA_PER_MEMB = 2,
58-
MAX_MBA_PER_PROC = MAX_MEMB_PER_PROC * MAX_MBA_PER_MEMB,
76+
/* Common Nimbus/Cumulus */
77+
MAX_PROC_PER_NODE = 8,
78+
MAX_CAPP_PER_PROC = 2,
79+
MAX_XBUS_PER_PROC = 3, /* Nimbus 1 and 2, Cumulus 0, 1, and 2 */
80+
MAX_OBUS_PER_PROC = 4, /* Nimbus 0 and 3, Cumulus 0, 1, 2, and 3 */
81+
MAX_PEC_PER_PROC = 3,
82+
MAX_PHB_PER_PROC = 6,
83+
MAX_EQ_PER_PROC = 6,
84+
MAX_EX_PER_PROC = 12,
85+
MAX_EC_PER_PROC = 24,
86+
87+
/** Nimbus only */
88+
MAX_MCBIST_PER_PROC = 2,
89+
MAX_MCS_PER_PROC = 4,
90+
MAX_MCA_PER_PROC = 8,
91+
92+
/** Cumulus only */
93+
MAX_MC_PER_PROC = 2,
94+
MAX_MI_PER_PROC = 4,
95+
MAX_DMI_PER_PROC = 8,
96+
97+
/** Centaur only */
98+
MAX_MEMBUF_PER_PROC = 8,
99+
MAX_MEMBUF_PER_NODE = MAX_MEMBUF_PER_PROC * MAX_PROC_PER_NODE,
100+
MAX_MBA_PER_MEMBUF = 2,
101+
MAX_MBA_PER_PROC = MAX_MEMBUF_PER_PROC * MAX_MBA_PER_MEMBUF,
59102

60103
} TrgtPos_t;
61104

62105
/** All register types. */
63106
typedef enum
64107
{
65108
/* NOTE: These will be used as array indexes. */
66-
FIRST_REG = 0,
67-
GLBL = FIRST_REG,
68-
FIR,
69-
REG,
70-
IDFIR,
71-
IDREG,
72-
MAX_REGS,
109+
REG_FIRST = 0,
110+
111+
REG_GLBL = REG_FIRST, /* 32-bit addresses, 64-bit value */
112+
REG_FIR, /* 32-bit addresses, 64-bit value */
113+
REG_REG, /* 32-bit addresses, 64-bit value */
114+
REG_IDFIR, /* 64-bit addresses, 32-bit value */
115+
REG_IDREG, /* 64-bit addresses, 32-bit value */
116+
117+
REG_MAX,
73118

74119
} RegType_t;
75120

@@ -82,3 +127,4 @@ typedef enum
82127
} IplState_t;
83128

84129
#endif /* __firDataConst_common_h */
130+

src/occ_405/firdata/homerData_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/occ/firdata/homerData.H $ */
4+
/* $Source: src/occ_405/firdata/homerData_common.h $ */
55
/* */
66
/* OpenPOWER OnChipController Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2015 */
8+
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -129,13 +129,13 @@ typedef struct __attribute__((packed))
129129
uint16_t mbaMasks[MAX_PROC_PER_NODE];
130130

131131
/** Contains number of registers per type for each target type. */
132-
uint8_t counts[MAX_TRGTS][MAX_REGS];
132+
uint8_t counts[TRGT_MAX][REG_MAX];
133133

134134
/** FSI base address for each PROC chip. */
135135
uint32_t procFsiBaseAddr[MAX_PROC_PER_NODE];
136136

137137
/** FSI base address for each MEMB chip. */
138-
uint32_t membFsiBaseAddr[MAX_PROC_PER_NODE][MAX_MEMB_PER_PROC];
138+
uint32_t membFsiBaseAddr[MAX_PROC_PER_NODE][MAX_MEMBUF_PER_PROC];
139139

140140
/** Information regarding the PNOR location and size. */
141141
HOMER_PnorInfo_t pnorInfo;

0 commit comments

Comments
 (0)