summaryrefslogtreecommitdiffstats
path: root/src/usr/sbe
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2015-08-24 21:38:11 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-09-04 18:50:27 -0500
commit27565cd9a200c54e2fafb56a4776a233950e6a10 (patch)
tree61e4994c601c3b25798b4c43909fdfc9c082f404 /src/usr/sbe
parentaaf724e9f06ac6013f97bb967aae6c4510b0a1da (diff)
downloadtalos-hostboot-27565cd9a200c54e2fafb56a4776a233950e6a10.tar.gz
talos-hostboot-27565cd9a200c54e2fafb56a4776a233950e6a10.zip
IPL: SEL cleanup: BCFF220F SBE_READ_SBE_IMAGE - SBE_ECC_FAIL
Change-Id: I3b2b13d3e9f8e121adbb287ae35a1d4d4b5d157d CQ:SW306829 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20067 Tested-by: Jenkins Server Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/sbe')
-rw-r--r--src/usr/sbe/sbe_resolve_sides.C10
-rw-r--r--src/usr/sbe/sbe_resolve_sides.H4
2 files changed, 9 insertions, 5 deletions
diff --git a/src/usr/sbe/sbe_resolve_sides.C b/src/usr/sbe/sbe_resolve_sides.C
index 11d500734..393fdf7aa 100644
--- a/src/usr/sbe/sbe_resolve_sides.C
+++ b/src/usr/sbe/sbe_resolve_sides.C
@@ -723,11 +723,13 @@ errlHndl_t readSbeImage(TARGETING::Target* i_target,
break;
}
+ // make sure returned size is 8 byte aligned
+ o_image_size = ALIGN_8(o_image_size);
/*****************************************/
/* Do Actual Read */
/*****************************************/
- image_size_ECC = ALIGN_8((o_image_size*9)/8);
+ image_size_ECC = (o_image_size*9)/8;
assert(image_size_ECC <= SBE_ECC_IMG_MAX_SIZE,
"getSetSbeImage() SBE Image with ECC too large");
@@ -768,7 +770,7 @@ errlHndl_t readSbeImage(TARGETING::Target* i_target,
(SBE_ECC_IMG_VADDR),
reinterpret_cast<uint8_t*>
(o_imgPtr),
- image_size_ECC);
+ o_image_size);
// Fail if uncorrectable ECC
if ( eccStatus == PNOR::ECC::UNCORRECTABLE )
@@ -936,14 +938,14 @@ errlHndl_t writeSbeImage(TARGETING::Target* i_target,
// Inject ECC
PNOR::ECC::injectECC(reinterpret_cast<uint8_t*>(i_imgPtr),
- ALIGN_8(i_image_size),
+ i_image_size,
reinterpret_cast<uint8_t*>
(SBE_ECC_IMG_VADDR));
/*****************************************/
/* Do Actual Write of Image */
/*****************************************/
- image_size_ECC = ALIGN_8((i_image_size*9)/8);
+ image_size_ECC = (i_image_size*9)/8;
assert(image_size_ECC <= SBE_ECC_IMG_MAX_SIZE,
"writeSbeImage() SBE Image with ECC too large");
diff --git a/src/usr/sbe/sbe_resolve_sides.H b/src/usr/sbe/sbe_resolve_sides.H
index 9e116e001..25d442ec3 100644
--- a/src/usr/sbe/sbe_resolve_sides.H
+++ b/src/usr/sbe/sbe_resolve_sides.H
@@ -159,6 +159,7 @@ namespace SBE
* @param[in] i_side Seeprom Side to access
*
* @param[in] o_image_size The size of the image (non-ECC)
+ * NOTE: o_image_size will be 8 byte aligned.
*
* @param[in] o_version SBE Version struct from seeprom (non-ECC)
*
@@ -178,12 +179,13 @@ namespace SBE
* @param[in] i_imgPtr Pointer to SBE image in memory
* Memory for this pointer is expected to be
* pre-alloacted
- * NOTE: ECC is handled internally in this function
+ * NOTE: ECC is handled internally in this function,
* i_imgPtr points to non-ECC image
*
* @param[in] i_side Seeprom Side to access
*
* @param[in] i_image_size Size of image to write (non-ECC)
+ * NOTE: must be 8 byte aligned
*
* @param[in] io_version SBE Version struct to write (non-ECC)
* NOTE: data_crc updated in this function
OpenPOWER on IntegriCloud