diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2014-11-12 09:55:32 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-11-12 10:41:54 -0600 |
commit | 5dccc9bcd198b69cb33fc824a6a721ab1e88ff36 (patch) | |
tree | 67a9a963355213da3ba2d7fe8fa1922dd7edc3c3 | |
parent | e92561c3352a4af3b1b8506fae61652cde4ee3d5 (diff) | |
download | talos-hostboot-5dccc9bcd198b69cb33fc824a6a721ab1e88ff36.tar.gz talos-hostboot-5dccc9bcd198b69cb33fc824a6a721ab1e88ff36.zip |
Fix bad loop in PNOR write path
Change-Id: I2326fde348f944b4f50dc51f3a32040220a77481
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14447
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/usr/pnor/sfc_ast2400.C | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usr/pnor/sfc_ast2400.C b/src/usr/pnor/sfc_ast2400.C index 5384e7b62..71420fbd0 100644 --- a/src/usr/pnor/sfc_ast2400.C +++ b/src/usr/pnor/sfc_ast2400.C @@ -138,6 +138,7 @@ errlHndl_t SfcAST2400::writeFlash( uint32_t i_addr, size_t l_bytes_left = i_size; size_t l_bytes_to_write = 0; uint32_t l_addr_to_write = i_addr; + uint8_t* l_dataptr = reinterpret_cast<uint8_t*>(i_data); do { // Enable write mode @@ -160,12 +161,13 @@ errlHndl_t SfcAST2400::writeFlash( uint32_t i_addr, uint8_t opcode = PNOR::SPI_JEDEC_PAGE_PROGRAM; l_err = sendSpiCmd( opcode, l_addr_to_write, l_bytes_to_write, - reinterpret_cast<uint8_t*>(i_data), + l_dataptr, 0, NULL ); if( l_err ) { break; } // Move to the next chunk l_addr_to_write += l_bytes_to_write; + l_dataptr += l_bytes_to_write; // Wait for idle l_err = pollOpComplete(); |