Skip to content

Commit

Permalink
PRD: sync common FIRDATA files from OCC
Browse files Browse the repository at this point in the history
Change-Id: I0506240b55d3a292e2fd990bbacf6434a5f7419c
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38431
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
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: Zane C. Shelley <zshelle@us.ibm.com>
  • Loading branch information
zane131 committed Mar 28, 2017
1 parent 9fd94df commit 490d1c4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 40 deletions.
17 changes: 9 additions & 8 deletions src/usr/diag/prdf/occ_firdata/firDataConst_common.h
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -35,7 +35,7 @@
/** Target types for all supported targets. */
typedef enum
{
// NOTE: These will be used as array indexes.
/* NOTE: These will be used as array indexes. */
FIRST_TRGT = 0,
PROC = FIRST_TRGT,
EX,
Expand All @@ -62,7 +62,7 @@ typedef enum
/** All register types. */
typedef enum
{
// NOTE: These will be used as array indexes.
/* NOTE: These will be used as array indexes. */
FIRST_REG = 0,
GLBL = FIRST_REG,
FIR,
Expand All @@ -73,11 +73,12 @@ typedef enum

} RegType_t;

/** IPL or Runtime flag in HOMER data */
/** Indicates the state of the machine when the checkstop occurred. */
typedef enum
{
HOMER_RUNTIME_STATE = 0,
HOMER_IPL_STATE = 1
} Homer_IplRuntime_t;
FIRDATA_STATE_RUNTIME = 0,
FIRDATA_STATE_IPL = 1,

#endif // __firDataConst_common_h
} IplState_t;

#endif /* __firDataConst_common_h */
20 changes: 10 additions & 10 deletions src/usr/diag/prdf/occ_firdata/homerData_common.h
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -77,30 +77,30 @@

typedef enum
{
HOMER_FIR1 = 0x46495231, ///< FIR data version 1 ("FIR1" in ascii)
HOMER_FIR1 = 0x46495231, /** FIR data version 1 ("FIR1" in ascii) */

} HOMER_Version_t;

/** PNOR information contained within the HOMER data. */
typedef struct __attribute__((packed))
{
uint32_t pnorOffset; ///< Physical offset of FIRDATA in PNOR
uint32_t pnorSize; ///< Maximum size of FIRDATA (includes ECC)
uint32_t mmioOffset; ///< Address of MMIO access
uint32_t norWorkarounds; ///< NOR flash vendor
uint32_t pnorOffset; /** Physical offset of FIRDATA in PNOR */
uint32_t pnorSize; /** Maximum size of FIRDATA (includes ECC) */
uint32_t mmioOffset; /** Address of MMIO access */
uint32_t norWorkarounds; /** NOR flash vendor */

} HOMER_PnorInfo_t;

/** HOMER data header information containing hardware configurations and
* register counts. */
typedef struct __attribute__((packed))
{
uint32_t header; ///< Magic number to indicate valid data and version
uint32_t header; /** Magic number to indicate valid data and version */

uint16_t iplState : 1; // Uses enum Homer_iplRuntime_t
uint16_t iplState : 1; /** See enum IplState_t */
uint16_t reserved : 15;

uint8_t masterProc; ///< The position of the master PROC
uint8_t masterProc; /** The position of the master PROC */

/** Bitwise mask to indicate which PROCs are configured (max 8). The mask
* bit position is consistant with PROC ATTR_POSITION attribute. */
Expand Down Expand Up @@ -170,4 +170,4 @@ static inline HOMER_Data_t HOMER_getData()
return d;
}

#endif // __homerData_common_h
#endif /* __homerData_common_h */
38 changes: 19 additions & 19 deletions src/usr/diag/prdf/occ_firdata/pnorData_common.h
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -66,18 +66,18 @@

typedef enum
{
PNOR_FIR1 = 0x46495231, ///< FIR data version 1 ("FIR1" in ascii)
PNOR_FIR1 = 0x46495231, /** FIR data version 1 ("FIR1" in ascii) */

} PNOR_Version_t;

/** PNOR data header information. */
typedef struct __attribute__((packed))
{
uint32_t header; ///< Magic number to indicate valid data and version
uint32_t header; /** Magic number to indicate valid data and version */

uint32_t trgts : 8; ///< Number of targets with register data
uint32_t full : 1; ///< 1 if PNOR data is full and data may be missing
uint32_t iplState : 1; ///< Uses enum Homer_iplRuntime_t
uint32_t trgts : 8; /** Number of targets with register data */
uint32_t full : 1; /** 1 if PNOR data is full and data may be missing*/
uint32_t iplState : 1; /** See enum IplState_t */
uint32_t reserved : 22;

} PNOR_Data_t;
Expand All @@ -97,21 +97,21 @@ static inline PNOR_Data_t PNOR_getData()
/** These values will match the corresponding bit fields in PNOR_Trgt_t. */
typedef enum
{
PNOR_Trgt_MAX_REGS_PER_TRGT = 511, // Currently expect 266 on the PROC
PNOR_Trgt_MAX_ID_REGS_PER_TRGT = 15, // Currently expect 9 on the MBA
PNOR_Trgt_MAX_SCOM_ERRORS = 511, // Should be plenty
PNOR_Trgt_MAX_REGS_PER_TRGT = 511, /* Currently expect 266 on the PROC */
PNOR_Trgt_MAX_ID_REGS_PER_TRGT = 15, /* Currently expect 9 on the MBA */
PNOR_Trgt_MAX_SCOM_ERRORS = 511, /* Should be plenty */

} PNOR_Trgt_RegLimits_t;

/** Information for each target with SCOM data. */
typedef struct __attribute__((packed))
{
uint32_t type : 3; ///< Target type. See enum TrgtType_t
uint32_t procPos : 3; ///< The processor position (0-7)
uint32_t unitPos : 4; ///< Unit position relative to the processor (0-15)
uint32_t regs : 9; ///< Number of normal registers
uint32_t idRegs : 4; ///< Number of indirect-SCOM registers
uint32_t scomErrs : 9; ///< Number of SCOM errors detected
uint32_t type : 3; /** Target type. See enum TrgtType_t */
uint32_t procPos : 3; /** The processor position (0-7) */
uint32_t unitPos : 4; /** Unit position relative to the processor (0-15) */
uint32_t regs : 9; /** Number of normal registers */
uint32_t idRegs : 4; /** Number of indirect-SCOM registers */
uint32_t scomErrs : 9; /** Number of SCOM errors detected */

} PNOR_Trgt_t;

Expand All @@ -137,16 +137,16 @@ static inline PNOR_Trgt_t PNOR_getTrgt( uint32_t i_type, uint32_t i_procPos,
/** Information for a normal register. */
typedef struct __attribute__((packed))
{
uint32_t addr; ///< 32-bit address
uint64_t val; ///< 64-bit value
uint32_t addr; /** 32-bit address */
uint64_t val; /** 64-bit value */

} PNOR_Reg_t;

/** Information for an indirect-SCOM register. */
typedef struct __attribute__((packed))
{
uint64_t addr; ///< 64-bit address
uint32_t val; ///< 32-bit value
uint64_t addr; /** 64-bit address */
uint32_t val; /** 32-bit value */

} PNOR_IdReg_t;

Expand Down
4 changes: 2 additions & 2 deletions src/usr/diag/prdf/occ_firdata/prdfReadPnorFirData.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -203,7 +203,7 @@ errlHndl_t readPnorFirData( bool & o_validData, PnorTrgtMap & o_trgtMap,
// Gather FFDC from header data.
o_ffdc.trgts = data->trgts;
o_ffdc.full = (0 == data->full) ? false : true;
o_ffdc.iplStateActive = (HOMER_IPL_STATE == data->iplState)
o_ffdc.iplStateActive = (FIRDATA_STATE_IPL == data->iplState)
? true:false;

// Iterate each target and get the register data.
Expand Down
2 changes: 1 addition & 1 deletion src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C
Expand Up @@ -811,7 +811,7 @@ errlHndl_t writeHomerFirData( uint8_t * i_hBuf, size_t i_hBufSize,

// Set flag indicating if IPL or runtime situation.
data.iplState = (ALL_HARDWARE == i_curHw)
? HOMER_RUNTIME_STATE : HOMER_IPL_STATE;
? FIRDATA_STATE_RUNTIME : FIRDATA_STATE_IPL;

// Get the PNOR information
errl = getPnorInfo( data );
Expand Down

0 comments on commit 490d1c4

Please sign in to comment.