[Feature][ZXW-285]merge P56U05 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: Ied657102425a179a89ef41847170152e8a5d437c
diff --git a/boot/common/src/uboot/drivers/power/zx234290.c b/boot/common/src/uboot/drivers/power/zx234290.c
index e8f083f..6e82f81 100755
--- a/boot/common/src/uboot/drivers/power/zx234290.c
+++ b/boot/common/src/uboot/drivers/power/zx234290.c
@@ -36,6 +36,7 @@
 #define GPIO_PSHOLD_FUNC_SEL    GPIO24_GPIO24
 
 static boot_reason_t s_boot_reason = UNKNOWN_BOOT_REASON;
+unsigned int g_pmu_type = PMU_TYPE_MAX;
 
 /*******************************************************************************
  * Function:    zx234290_i2c_read_reg
@@ -394,6 +395,7 @@
 {
     int ret = 0;
 	uchar reg_val = 0;
+	uchar reg_val1 = 0;
     struct pmu_opt pmu = {NULL};
 
     /* GPIO init */
@@ -420,6 +422,7 @@
 
 	ret = zx234290_get_boot_reason_prev();
 	ret +=zx234290_i2c_read_reg(ZX234297_REG_ADDR_SINK_CONTROL,&reg_val);
+	ret +=zx234290_i2c_read_reg(ZX234290_REG_ADDR_TYPE,&reg_val1);
 	if(reg_val==0x7f){//means 296G C
 		reg_val = 0xff;//define to 296
 		ret+=zx234290_i2c_write_reg(ZX234297_REG_ADDR_SINK_CONTROL,&reg_val);
@@ -428,8 +431,23 @@
 	if (ret != SUCCESS)
 	{
 		printf( "[%s]set 0x29 error ret=0x%x!\n", __FUNCTION__,ret);
+		return ret;
 	}
 	
+	if(0xff == reg_val)//296&296G
+	{
+		if(0==reg_val1)
+			g_pmu_type = PMU_TYPE_296G;
+		else
+			g_pmu_type = PMU_TYPE_296;			
+	}
+	else//297
+	{
+		if(0==reg_val1)
+			g_pmu_type = PMU_TYPE_296H;
+		else
+			g_pmu_type = PMU_TYPE_297;			
+	}
     return ret;
 }