summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2018-12-07 10:11:07 -0600
committerMartha Broyles <mbroyles@us.ibm.com>2019-01-02 12:54:03 -0600
commit6220fb3d8d7a96d79e7b06c2c387c204a28928db (patch)
tree01a289a5b2f97f42c83bf1c928e2c08407fe581b
parentb673f22459cae0494ac7c9e01a5c0215590168c4 (diff)
downloadtalos-occ-6220fb3d8d7a96d79e7b06c2c387c204a28928db.zip
talos-occ-6220fb3d8d7a96d79e7b06c2c387c204a28928db.tar.gz
FIRDATA: Simplified adding subunit targets to PNOR in firData.c
Change-Id: I8b6c3cd0081237bb9d4912becbfecd4d437fb7c1 RTC: 201994 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69558 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
-rw-r--r--src/occ_gpe0/firdata/firData.c55
1 files changed, 23 insertions, 32 deletions
diff --git a/src/occ_gpe0/firdata/firData.c b/src/occ_gpe0/firdata/firData.c
index 72eefa9..ea1fa26 100644
--- a/src/occ_gpe0/firdata/firData.c
+++ b/src/occ_gpe0/firdata/firData.c
@@ -863,6 +863,18 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
} \
if ( full ) break;
+#define ADD_UNITS_TO_PNOR( MASK, TYPE ) \
+ START_UNIT_LOOP( u1, PROC_MAX(TYPE) ) \
+ ADD_UNIT_TO_PNOR( MASK, TYPE, u1 ) \
+ END_UNIT_LOOP
+
+#define ADD_SUBUNITS_TO_PNOR( MASK, P_TYPE, C_TYPE ) \
+ subUnitMax = PROC_MAX(C_TYPE) / PROC_MAX(P_TYPE); \
+ START_UNIT_LOOP( u2, subUnitMax ) \
+ u3 = (subUnitMax * u1) + u2; \
+ ADD_UNIT_TO_PNOR( MASK, C_TYPE, u3 ) \
+ END_UNIT_LOOP
+
if ( HOMER_CHIP_NIMBUS == chipHdr->chipType )
{
// Keep a pointer of the current chip data.
@@ -873,17 +885,11 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
ADD_TO_PNOR( PROC, 0 )
- START_UNIT_LOOP( u1, PROC_MAX(XBUS) )
- ADD_UNIT_TO_PNOR( xbusMask, XBUS, u1 )
- END_UNIT_LOOP
+ ADD_UNITS_TO_PNOR( xbusMask, XBUS )
- START_UNIT_LOOP( u1, PROC_MAX(OBUS) )
- ADD_UNIT_TO_PNOR( obusMask, OBUS, u1 )
- END_UNIT_LOOP
+ ADD_UNITS_TO_PNOR( obusMask, OBUS )
- START_UNIT_LOOP( u1, PROC_MAX(CAPP) )
- ADD_UNIT_TO_PNOR( cappMask, CAPP, u1 )
- END_UNIT_LOOP
+ ADD_UNITS_TO_PNOR( cappMask, CAPP )
START_UNIT_LOOP( u1, PROC_MAX(PEC) )
@@ -906,36 +912,19 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
END_UNIT_LOOP
- START_UNIT_LOOP( u1, PROC_MAX(EC) )
- ADD_UNIT_TO_PNOR( ecMask, EC, u1 )
- END_UNIT_LOOP
+ ADD_UNITS_TO_PNOR( ecMask, EC )
START_UNIT_LOOP( u1, PROC_MAX(EQ) )
- ADD_UNIT_TO_PNOR( eqMask, EQ, u1 )
-
- subUnitMax = PROC_MAX(EX) / PROC_MAX(EQ);
- START_UNIT_LOOP( u2, subUnitMax )
- u3 = (subUnitMax * u1) + u2;
- ADD_UNIT_TO_PNOR( exMask, EX, u3 )
- END_UNIT_LOOP
-
+ ADD_UNIT_TO_PNOR( eqMask, EQ, u1 )
+ ADD_SUBUNITS_TO_PNOR( exMask, EQ, EX )
END_UNIT_LOOP
START_UNIT_LOOP( u1, PROC_MAX(MCBIST) )
- ADD_UNIT_TO_PNOR( mcbistMask, MCBIST, u1 )
-
- subUnitMax = PROC_MAX(MCA) / PROC_MAX(MCBIST);
- START_UNIT_LOOP( u2, subUnitMax )
- u3 = (subUnitMax * u1) + u2;
- ADD_UNIT_TO_PNOR( mcaMask, MCA, u3 )
- END_UNIT_LOOP
-
- END_UNIT_LOOP
-
- START_UNIT_LOOP( u1, PROC_MAX(MCS) )
- ADD_UNIT_TO_PNOR( mcsMask, MCS, u1 )
+ ADD_UNIT_TO_PNOR( mcbistMask, MCBIST, u1 )
+ ADD_SUBUNITS_TO_PNOR( mcaMask, MCBIST, MCA )
END_UNIT_LOOP
+ ADD_UNITS_TO_PNOR( mcsMask, MCS )
}
else
{
@@ -949,6 +938,8 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
#undef ADD_UNIT_TO_PNOR
#undef START_UNIT_LOOP
#undef END_UNIT_LOOP
+#undef ADD_UNITS_TO_PNOR
+#undef ADD_SUBUNITS_TO_PNOR
}
}
OpenPOWER on IntegriCloud