[Feature][ZXW-130]merge P50U02 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I4f29ec5bb7c59385f23738d2b7ca84e67c100f69
diff --git a/boot/common/src/uboot/downloader/downloader_nand.c b/boot/common/src/uboot/downloader/downloader_nand.c
old mode 100644
new mode 100755
index d28cfbc..fe24aaa
--- a/boot/common/src/uboot/downloader/downloader_nand.c
+++ b/boot/common/src/uboot/downloader/downloader_nand.c
@@ -476,7 +476,7 @@
*
* Others:
********************************************************************************/
-int downloader_nand_write(partition_entry_t * part, uint offset, uint size, unchar * buffer)
+int downloader_nand_write(partition_entry_t * part, uint offset, uint size, unchar * buffer)
{
nand_info_t * pNandInfo = NULL;
uint nandPhyBase = 0;
@@ -502,24 +502,40 @@
/* רÃÅдZ-LOADʱʹÓ㬲»Ê¹ÓÃECC*/
if( strcmp((const char *)part->part_name , "zloader") == 0 )
- {
- if( size != 12*1024 )
- {
- printf("downloader_nand_write z-load size != 12k...\n");
- return -1;
- }
- int times = 12*1024/pNandInfo->writesize;
- int i = 0;
+ {
+ if(g_nor_flag == 1)
+ {
+ int times = 0x9000/pNandInfo->writesize;
+ int i = 0;
- for(; i<times; i++)
- {
-
- ret += nand_write_page_with_ecc(pNandInfo,
- ((loff_t)i*(pNandInfo->writesize)),
- buf );
- buf += pNandInfo->writesize;
- }
-
+ for(; i<times; i++)
+ {
+
+ ret += nand_write_page_with_ecc(pNandInfo,
+ ((loff_t)i*(pNandInfo->writesize)),
+ buf );
+ buf += pNandInfo->writesize;
+ }
+ }
+ else
+ {
+ if( size != 12*1024 )
+ {
+ printf("downloader_nand_write z-load size != 12k...\n");
+ return -1;
+ }
+ int times = 12*1024/pNandInfo->writesize;
+ int i = 0;
+
+ for(; i<times; i++)
+ {
+
+ ret += nand_write_page_with_ecc(pNandInfo,
+ ((loff_t)i*(pNandInfo->writesize)),
+ buf );
+ buf += pNandInfo->writesize;
+ }
+ }
}
else