1
1
/* IBM_PROLOG_BEGIN_TAG */
2
2
/* This is an automatically generated prolog. */
3
3
/* */
4
- /* $Source: src/occ /firdata/firData.C $ */
4
+ /* $Source: src/occ_405 /firdata/firData.c $ */
5
5
/* */
6
6
/* OpenPOWER OnChipController Project */
7
7
/* */
8
- /* Contributors Listed Below - COPYRIGHT 2015 */
8
+ /* Contributors Listed Below - COPYRIGHT 2015,2017 */
9
9
/* [+] International Business Machines Corp. */
10
10
/* */
11
11
/* */
@@ -55,7 +55,7 @@ typedef struct
55
55
PNOR_Data_t * pData ; /*/< Pointer to the PNOR header data */
56
56
uint32_t pBufSize ; /*/< Current size of the PNOR data buffer */
57
57
58
- FirData_ListPointers_t hPtrs [MAX_TRGTS ]; /*/< Pointers to the register lists */
58
+ FirData_ListPointers_t hPtrs [TRGT_MAX ]; /*/< Pointers to the register lists */
59
59
60
60
} FirData_t ;
61
61
@@ -204,7 +204,7 @@ bool FirData_addGlblsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
204
204
bool full = false;
205
205
206
206
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 ];
208
208
209
209
uint32_t i = 0 ;
210
210
@@ -246,7 +246,7 @@ bool FirData_addFirsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
246
246
bool full = false;
247
247
248
248
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 ];
250
250
251
251
uint32_t i = 0 ;
252
252
@@ -298,7 +298,7 @@ bool FirData_addRegsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
298
298
bool full = false;
299
299
300
300
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 ];
302
302
303
303
uint32_t i = 0 ;
304
304
@@ -330,7 +330,7 @@ bool FirData_addIdFirsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
330
330
bool full = false;
331
331
332
332
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 ];
334
334
335
335
uint32_t i = 0 ;
336
336
@@ -384,7 +384,7 @@ bool FirData_addIdRegsToPnor( FirData_t * io_fd, PNOR_Trgt_t * io_pTrgt,
384
384
bool full = false;
385
385
386
386
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 ];
388
388
389
389
uint32_t i = 0 ;
390
390
@@ -436,9 +436,10 @@ bool FirData_addTrgtToPnor( FirData_t * io_fd, SCOM_Trgt_t i_sTrgt,
436
436
/* Update the number of targets in the PNOR data. */
437
437
io_fd -> pData -> trgts ++ ;
438
438
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. */
442
443
443
444
/* Add the GLBLs. */
444
445
full = FirData_addGlblsToPnor ( io_fd , pTrgt , i_sTrgt , o_noAttn );
@@ -499,7 +500,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
499
500
fsi = io_fd -> hData -> procFsiBaseAddr [p ];
500
501
501
502
/* 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 );
503
504
full = FirData_addTrgtToPnor ( io_fd , sTrgt , & noAttn );
504
505
if ( full ) break ;
505
506
if ( noAttn ) continue ; /* Skip the PROC, EXs, and MCSs */
@@ -510,7 +511,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
510
511
if ( 0 == (io_fd -> hData -> exMasks [p ] & (0x8000 >> u )) ) continue ;
511
512
512
513
/* 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 );
514
515
full = FirData_addTrgtToPnor ( io_fd , sTrgt , & noAttn );
515
516
if ( full ) break ;
516
517
if ( noAttn ) continue ; /* Skip the EX */
@@ -523,7 +524,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
523
524
if ( 0 == (io_fd -> hData -> mcsMasks [p ] & (0x80 >> u )) ) continue ;
524
525
525
526
/* 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 );
527
528
full = FirData_addTrgtToPnor ( io_fd , sTrgt , & noAttn );
528
529
if ( full ) break ;
529
530
if ( noAttn ) continue ; /* Skip the MCS */
@@ -533,38 +534,38 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
533
534
if ( full ) break ;
534
535
535
536
/* 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 */
537
538
/* connected PROC is not. */
538
- for ( i = 0 ; i < MAX_MEMB_PER_NODE ; i ++ )
539
+ for ( i = 0 ; i < MAX_MEMBUF_PER_NODE ; i ++ )
539
540
{
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 ;
542
543
543
- /* Check if the MEMB is configured. */
544
+ /* Check if the MEMBUF is configured. */
544
545
if ( 0 == (io_fd -> hData -> membMasks [p ] & (0x80 >> u )) ) continue ;
545
546
546
547
/* Get the FSI base address. */
547
548
fsi = io_fd -> hData -> membFsiBaseAddr [p ][u ];
548
549
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);
551
552
full = FirData_addTrgtToPnor ( io_fd , sTrgt , & noAttn );
552
553
if ( full ) break ;
553
- if ( noAttn ) continue ; /* Skip the MEMB and MBAs */
554
+ if ( noAttn ) continue ; /* Skip the MEMBUF and MBAs */
554
555
555
- for ( j = 0 ; j < MAX_MBA_PER_MEMB ; j ++ )
556
+ for ( j = 0 ; j < MAX_MBA_PER_MEMBUF ; j ++ )
556
557
{
557
- mu = u * MAX_MBA_PER_MEMB + j ;
558
+ mu = u * MAX_MBA_PER_MEMBUF + j ;
558
559
559
560
/* Check if the MBA is configured. */
560
561
if ( 0 == (io_fd -> hData -> mbaMasks [p ] & (0x8000 >> mu )) )
561
562
continue ;
562
563
563
564
/* 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);
565
566
full = FirData_addTrgtToPnor ( io_fd , sTrgt , & noAttn );
566
567
if ( full ) break ;
567
- if ( noAttn ) continue ; /* Skip the MEMB */
568
+ if ( noAttn ) continue ; /* Skip the MEMBUF */
568
569
}
569
570
if ( full ) break ;
570
571
}
@@ -607,10 +608,10 @@ int32_t FirData_init( FirData_t * io_fd,
607
608
608
609
bool full = false;
609
610
610
- uint32_t x [MAX_TRGTS ][ MAX_REGS ];
611
+ uint32_t x [TRGT_MAX ][ REG_MAX ];
611
612
size_t curIdx = 0 ;
612
613
613
- uint32_t t = FIRST_TRGT ;
614
+ uint32_t t = TRGT_FIRST ;
614
615
615
616
uint8_t * reglist = NULL ;
616
617
@@ -665,14 +666,14 @@ int32_t FirData_init( FirData_t * io_fd,
665
666
666
667
/* Get the register list byte indexes in HOMER data buffer */
667
668
memset ( x , 0x00 , sizeof (x ) );
668
- for ( t = FIRST_TRGT ; t < MAX_TRGTS ; t ++ )
669
+ for ( t = TRGT_FIRST ; t < TRGT_MAX ; t ++ )
669
670
{
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 ];
676
677
}
677
678
678
679
/* 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,
687
688
688
689
/* Now, get the pointers for each list. */
689
690
reglist = io_fd -> hBuf + sz_hData ;
690
- for ( t = FIRST_TRGT ; t < MAX_TRGTS ; t ++ )
691
+ for ( t = TRGT_FIRST ; t < TRGT_MAX ; t ++ )
691
692
{
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 ]);
697
698
}
698
699
699
700
} while (0 );
@@ -737,12 +738,14 @@ int32_t FirData_captureCsFirData( uint8_t * i_hBuf, uint32_t i_hBufSize,
737
738
FirData_addTrgtsToPnor ( & fd );
738
739
739
740
/* Write the buffer to PNOR. */
741
+ /* TODO: 175241
740
742
rc = PNOR_writeFirData( fd.hData->pnorInfo, fd.pBuf, fd.pBufSize );
741
743
if ( SUCCESS != rc )
742
744
{
743
745
TRAC_ERR( FUNC"Failed to process FIR data" );
744
746
break;
745
747
}
748
+ */
746
749
747
750
} while (0 );
748
751
0 commit comments