Skip to content

Commit

Permalink
PRD: MBA command resume not incrementing address
Browse files Browse the repository at this point in the history
Change-Id: Id16fe92c063c926ae7d061b257aafc5a7f44a864
CQ: SW433786
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60717
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60927
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Jun 20, 2018
1 parent f59ac34 commit b2c2ca9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
14 changes: 7 additions & 7 deletions src/usr/diag/prdf/common/plat/mem/prdfMemAddress.C
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ MemAddr MemAddr::fromMaintAddr<TYPE_MBA>( uint64_t i_addr )
uint64_t srnk = (i_addr >> 57) & 0x7; // 4: 6
uint64_t bnk = (i_addr >> 53) & 0xf; // 7:10
uint64_t r16_r0 = (i_addr >> 36) & 0x1ffff; // 11:27
uint64_t col = (i_addr >> 27) & 0x1ff; // 28:36
uint64_t col = (i_addr >> 27) & 0x1ff; // 28:36 (37:39 tied to 0)
uint64_t r17 = (i_addr >> 4) & 0x1; // 59

uint64_t row = (r17 << 17) | r16_r0;
Expand All @@ -106,12 +106,12 @@ MemAddr MemAddr::fromMaintAddr<TYPE_MBA>( uint64_t i_addr )
template<>
uint64_t MemAddr::toMaintAddr<TYPE_MBA>() const
{
return ( ((uint64_t) iv_rnk.getMaster() << 60) |
((uint64_t) iv_rnk.getSlave() << 57) |
((uint64_t) iv_bnk << 53) |
((uint64_t)(iv_row & 0x1ffff) << 36) | // r16-r0
((uint64_t) iv_col << 24) |
((uint64_t)(iv_row & 0x20000) << 13) ); // r17
return ( ((uint64_t) iv_rnk.getMaster() << 60) | // 1: 3
((uint64_t) iv_rnk.getSlave() << 57) | // 4: 6
((uint64_t) iv_bnk << 53) | // 7:10
((uint64_t)(iv_row & 0x1ffff) << 36) | // 11:27
((uint64_t) iv_col << 27) | // 28:36 (37:39 tied to 0)
((uint64_t)(iv_row & 0x20000) >> 13) ); // 59
}

//------------------------------------------------------------------------------
Expand Down
28 changes: 15 additions & 13 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDynMemDealloc_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void getRankBank( uint64_t i_ds, uint64_t i_mrnk, uint64_t i_srnk,
* @param i_numLowerRnkBnk Number of configured lower rank/bank bits.
* @param i_row Row (R18-R0)
* @param i_numRow Number of configured row bits.
* @param i_col Column (C13,C11,C9-C3,C2-C0)
* @param i_col Column (C13,C11,C9-C3)
* @param i_numCol Number of configured column bits.
* @param i_ddrVer DDR version (DDR3 or DDR4).
* @param i_mbaIlMode MBA interleave mode. (from MBAXCR[12])
Expand Down Expand Up @@ -177,12 +177,11 @@ uint64_t combineComponents( uint64_t i_upperRnkBnk, uint64_t i_numUpperRnkBnk,
if ( 18 == i_numRow ) numUpperRow -= 1; // r17 is not in numUpperRow
}

// Get the column components. Note c2-c1 will be added later. Also c0 is
// tied to 0 and not used at all.
uint64_t upperCol = (i_col & 0x00ff0) >> 4;
uint64_t c3 = (i_col & 0x00008) >> 3;
// Get the column components.
uint64_t upperCol = i_col & 0x1fe;
uint64_t c3 = i_col & 0x001;

uint64_t numUpperCol = i_numCol - 4;
uint64_t numUpperCol = i_numCol - 1;
uint64_t numC3 = 1;

// Start building the address.
Expand Down Expand Up @@ -221,7 +220,7 @@ uint64_t combineComponents( uint64_t i_upperRnkBnk, uint64_t i_numUpperRnkBnk,
* @param i_numSrnk Number of configured slave rank bits.
* @param i_row Row (R18-R0)
* @param i_numRow Number of configured row bits.
* @param i_col Column (C13,C11,C9-C3,C2-C0)
* @param i_col Column (C13,C11,C9-C3)
* @param i_numCol Number of configured column bits.
* @param i_bnk Bank (DDR3: B2-B0, DDR4: BG1-BG0,B1-B0).
* @param i_mba MBA position (0 or 1)
Expand Down Expand Up @@ -274,11 +273,8 @@ uint64_t transPhysToCenAddr( uint64_t i_ds, uint64_t i_mrnk, uint64_t i_srnk,
addr = (addr & mask) << 1 | i_mba << shift | (addr & ~mask);
}

// Add c2-c1 to the end (bits 33:34).
addr <<= 2; addr |= (i_col & 0x00006) >> 1;

// Bits 35:39 are zero.
addr <<= 5;
// Bits 33:39 are zero.
addr <<= 7;

return addr;
}
Expand Down Expand Up @@ -319,7 +315,7 @@ int32_t getCenPhyAddr( ExtensibleChip * i_mbaChip, ExtensibleChip * i_mbChip,
uint64_t srnk = i_addr.getRank().getSlave(); // S0-S2

uint64_t row = i_addr.getRow(); // R18-R0
uint64_t col = i_addr.getCol(); // C13,C11,C9-C3,C2-C0
uint64_t col = i_addr.getCol(); // C13,C11,C9-C3
uint64_t bnk = i_addr.getBank(); // DDR3: B2-B0, DDR4: BG1-BG0,B1-B0

do
Expand Down Expand Up @@ -355,6 +351,12 @@ int32_t getCenPhyAddr( ExtensibleChip * i_mbaChip, ExtensibleChip * i_mbChip,
break;
}

// The attribute used in getDimmRowCol() returns a value for colBits
// which includes c2-c0. Those bits are tied to zero and are not
// included in col. Therefore, we need to subtract 3 to get the real
// value.
colBits = colBits - 3;

// Get the DDR verion of the DIMM (DDR3, DDR4, etc...)
uint8_t ddrVer = getDramGen<TYPE_MBA>( mba );

Expand Down
7 changes: 4 additions & 3 deletions src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,10 @@ uint32_t TpsEvent<TYPE_MBA>::analyzeEccErrors( const uint32_t & i_eccAttns,
break;
}

// Do not abort the procedure. UEs are expected. Since the command
// has to stop on error due to the hardware bugs, we need to resume
// the command and ensure it gets to the end of the rank.
// An error was found, but don't abort. We want to see if any UEs
// or MPEs exist on the rest of the rank. Also, since there was an
// error, clear the false alarm flag.
iv_tpsFalseAlarm = false;
}

// If there was an MPE.
Expand Down

0 comments on commit b2c2ca9

Please sign in to comment.