[Feature][ZXW-88]merge P50 version

Only Configure: No
Affected branch: master
Affected module: unknown
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I34667719d9e0e7e29e8e4368848601cde0a48408
diff --git a/boot/common/src/loader/drivers/bbt.c b/boot/common/src/loader/drivers/bbt.c
index bf46266..471a86f 100755
--- a/boot/common/src/loader/drivers/bbt.c
+++ b/boot/common/src/loader/drivers/bbt.c
@@ -56,7 +56,7 @@
 	uint32_t block_size = flash.block_size;
 	uint8_t oob[256];   /* ÕâÀﶨÒå×î´óµÄOOB SIZE */
 //#ifdef CONFIG_ZX297520V3E_MDL_AB
-#if defined(CONFIG_ZX297520V3E_MDL_AB) || defined(CONFIG_ZX297520V3E_VEHICLE_DC)
+#if defined(CONFIG_ZX297520V3E_MDL_AB) || defined(CONFIG_ZX297520V3E_VEHICLE_DC) || defined(CONFIG_ZX297520V3E_VEHICLE_DC_REF)
 	uint32_t block_nums = 72;
 #else
 	uint32_t block_nums = 17;
diff --git a/boot/common/src/loader/drivers/image.c b/boot/common/src/loader/drivers/image.c
index 8903e14..09c296a 100755
--- a/boot/common/src/loader/drivers/image.c
+++ b/boot/common/src/loader/drivers/image.c
@@ -11,7 +11,7 @@
 
 #include "flash.h"
 #include <bbt.h>
-
+#include "pub_flags.h"
 
 /*
  ******************************************************************************
@@ -112,10 +112,10 @@
 }
 
 //#ifdef CONFIG_ZX297520V3E_MDL_AB
-#if defined(CONFIG_ZX297520V3E_MDL_AB) || defined(CONFIG_ZX297520V3E_VEHICLE_DC)
+#if defined(CONFIG_ZX297520V3E_MDL_AB) || defined(CONFIG_ZX297520V3E_VEHICLE_DC) || defined(CONFIG_ZX297520V3E_VEHICLE_DC_REF)
 int read_flags_image(uint8_t *name)
 {
-    T_BOOT_FOTA_FLAG *fotaFlag;
+    T_FLAGS_INFO *fotaFlag;
 	uint32_t uiPageSize = 0;
     uint32_t flags_offset = 0;
 	uint32_t off = 0;
@@ -125,7 +125,7 @@
 	uint32_t work_area_offset = 0;
 	uint32_t backup_area_offset = 0;
 	int32_t ret = 0;
-	int32_t fota_size = sizeof(T_BOOT_FOTA_FLAG);
+	int32_t fota_size = sizeof(T_FLAGS_INFO);
 	int32_t block_size = flash.block_size;
 
 	fota_size = page_align(fota_size);
@@ -173,9 +173,9 @@
 		return -1;
 	}
 
-	fotaFlag = (T_BOOT_FOTA_FLAG *)(CFG_TEMP_ADDR);
+	fotaFlag = (T_FLAGS_INFO *)(CFG_TEMP_ADDR);
 	
-	if(fotaFlag->magic != FLAGS_MAGIC)
+	if(fotaFlag->magic_start != FLAGS_MAGIC || fotaFlag->magic_end != FLAGS_MAGIC)
 	{
         ret = flash.read(backup_area_offset, fota_size, CFG_TEMP_ADDR);
 		if(ret != 0)
@@ -184,8 +184,8 @@
 			
 			return -1;
 		}
-		fotaFlag = (T_BOOT_FOTA_FLAG *)(CFG_TEMP_ADDR);
-		if(fotaFlag->magic != FLAGS_MAGIC)
+		fotaFlag = (T_FLAGS_INFO *)(CFG_TEMP_ADDR);
+		if(fotaFlag->magic_start != FLAGS_MAGIC || fotaFlag->magic_end != FLAGS_MAGIC)
 		{
             printf("flags magic err.\n");
 		    return -1;