[Feature][ZXW-136]merge P50U04 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: I7b6a8e22777591bc7a9ede91d6695d9415116f81
diff --git a/boot/common/src/uboot/drivers/efuse/efuse.c b/boot/common/src/uboot/drivers/efuse/efuse.c
index 96e4901..9d0937e 100755
--- a/boot/common/src/uboot/drivers/efuse/efuse.c
+++ b/boot/common/src/uboot/drivers/efuse/efuse.c
@@ -193,7 +193,7 @@
 	guiOtpStatus = 0;	   //Enable.

 }

 

-static void efuse_get_data(void)

+void efuse_get_data(void)

 {

 	efuse_struct *psEfuseInfo = NULL;

 	u32 uiLen = 0;

@@ -401,6 +401,8 @@
 		u32 puiArrPubKey[64] = {0};

 		T_Rsa_Paramter sRSAInput;

 		u32 *puiRsaResAddr = NULL;

+		

+		if(NULL == addr)

 		{

 			BOOT_PRINTF(UBOOT_ERR, "Bad Parameter(Empty Pointer)!\n");

 			return -1;

diff --git a/boot/common/src/uboot/drivers/mtd/nand/nand.c b/boot/common/src/uboot/drivers/mtd/nand/nand.c
index 7abfca0..92aa855 100755
--- a/boot/common/src/uboot/drivers/mtd/nand/nand.c
+++ b/boot/common/src/uboot/drivers/mtd/nand/nand.c
@@ -49,6 +49,7 @@
 struct flash_ops flash;
 
 unsigned char g_nor_flag = 0;
+int one_flag = 0;
 /*******************************************************************************
  * Function:    
  * Description: 
@@ -163,12 +164,16 @@
 	int i;
 	unsigned int size = 0;
 
-	/*¶ÁȡоƬid*/
-	if((reg32(0x0121b040)>>8) == ZX297520V3ECOGG_GW_NYC_NOR_2G_DDR
-	||(reg32(0x0121b040)>>8) == ZX297520V3ECOSC_GW_NYC_NOR_2G_DDR)
-	{
-        g_nor_flag = 1;
-		printf("g_nor_flag is %d.\n",g_nor_flag);
+	if(one_flag == 0){		
+		/*¶ÁȡоƬid*/
+		if((reg32(0x0121b040)>>8) == ZX297520V3ECOGG_GW_NYC_NOR_2G_DDR
+		||(reg32(0x0121b040)>>8) == ZX297520V3ECOSC_GW_NYC_NOR_2G_DDR)
+		{
+	        g_nor_flag = 1;
+			efuse_get_data();
+			//printf("chip id is 0x%x.\n",reg32(0x0121b040));
+			//printf("g_nor_flag is %d.\n",g_nor_flag);
+		}
 	}
 	
 	for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) 
@@ -190,5 +195,11 @@
 #endif
 
 	set_flash_opt();
-	jffs2_lzma_init();
+
+    if(one_flag == 0){
+		
+		jffs2_lzma_init();		
+		one_flag = 1;
+	}
+	
 }