summaryrefslogtreecommitdiffstats
path: root/writer
diff options
context:
space:
mode:
authorHao Zhang2015-09-11 14:27:05 -0500
committerHao Zhang2015-09-11 14:27:05 -0500
commit8eae8951378ae971ba3df050646e35dc9342db9d (patch)
treeb8e08f4565b9377804300c7cfa654d89b1c5b39a /writer
parentc614d27099edee62d1e100a070701854cbee34a7 (diff)
downloadmcsdk-tools-8eae8951378ae971ba3df050646e35dc9342db9d.tar.gz
mcsdk-tools-8eae8951378ae971ba3df050646e35dc9342db9d.tar.xz
mcsdk-tools-8eae8951378ae971ba3df050646e35dc9342db9d.zip
tools: nand writer: fix read verify bug
Nand writer uses DDR memory to store the read buffer (for verification) and the write buffer of the written file. The maximum buffer size is the size of the NAND device. If the NAND device size is 2GB (e.g. K2L EVM), it will exceed the DDR size (2GB) and report an error. The fix will only allow maximum size of 1GB for the buffer size. Signed-off-by: Hao Zhang <hzhang@ti.com>
Diffstat (limited to 'writer')
-rwxr-xr-xwriter/nand/src/nandwriter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/writer/nand/src/nandwriter.c b/writer/nand/src/nandwriter.c
index 458796b..d520410 100755
--- a/writer/nand/src/nandwriter.c
+++ b/writer/nand/src/nandwriter.c
@@ -626,6 +626,8 @@ void main ()
626 return; 626 return;
627 } 627 }
628 nandWriterInfo.deviceTotalBytes = p_device->block_count * p_device->page_count * p_device->page_size; 628 nandWriterInfo.deviceTotalBytes = p_device->block_count * p_device->page_count * p_device->page_size;
629 if (nandWriterInfo.deviceTotalBytes > 0x40000000)
630 nandWriterInfo.deviceTotalBytes = 0x40000000; /* Max write size 1 GB */
629 nandWriterInfo.blockSizeBytes = p_device->page_count * p_device->page_size; 631 nandWriterInfo.blockSizeBytes = p_device->page_count * p_device->page_size;
630 632
631 if ((nandWriterInfo.startAddr % nandWriterInfo.blockSizeBytes) != 0) 633 if ((nandWriterInfo.startAddr % nandWriterInfo.blockSizeBytes) != 0)