summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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