summaryrefslogtreecommitdiffstats
path: root/src/usr/pnor
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2014-12-10 11:20:45 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-10 15:44:05 -0600
commit32fb8195f4531dd9e44d62ddab3505664a5455d7 (patch)
treef6bc90e45107deb075710d8322570d81b613dd35 /src/usr/pnor
parentbf042716b8ad3adde8fe8f263a6b630ee1fd260c (diff)
downloadtalos-hostboot-32fb8195f4531dd9e44d62ddab3505664a5455d7.tar.gz
talos-hostboot-32fb8195f4531dd9e44d62ddab3505664a5455d7.zip
Fix readFlash size calculation bug
- Allows Micron extended chip ID to be read correctly - Fixed bytes to words calculation in IBM + AST readFlash routines Change-Id: I26feec40bf111d9bfbb1c791f2b113fcdd270a78 CQ: SW289339 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14835 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/pnor')
-rw-r--r--src/usr/pnor/sfc_ast2400.C2
-rw-r--r--src/usr/pnor/sfc_ibm.C2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/pnor/sfc_ast2400.C b/src/usr/pnor/sfc_ast2400.C
index 71420fbd0..abb4e61da 100644
--- a/src/usr/pnor/sfc_ast2400.C
+++ b/src/usr/pnor/sfc_ast2400.C
@@ -101,7 +101,7 @@ errlHndl_t SfcAST2400::readFlash( uint32_t i_addr,
do{
uint32_t* word_ptr = static_cast<uint32_t*>(o_data);
- uint32_t word_size = i_size/4;
+ uint32_t word_size = (ALIGN_4(i_size))/4;
for( uint32_t words_read = 0;
words_read < word_size;
words_read ++ )
diff --git a/src/usr/pnor/sfc_ibm.C b/src/usr/pnor/sfc_ibm.C
index 7574923b6..acdcfffac 100644
--- a/src/usr/pnor/sfc_ibm.C
+++ b/src/usr/pnor/sfc_ibm.C
@@ -348,7 +348,7 @@ errlHndl_t SfcIBM::readFlash( uint32_t i_addr,
do{
//Read directly from MMIO space
uint32_t* word_ptr = static_cast<uint32_t*>(o_data);
- uint32_t word_size = i_size/4;
+ uint32_t word_size = (ALIGN_4(i_size))/4;
for( uint32_t words_read = 0;
words_read < word_size;
words_read ++ )
OpenPOWER on IntegriCloud