[Feature][ZXW-65]merged P49 base code

Change-Id: I3e09c0c3d47483bc645f02310380ecb7fc6f4041
diff --git a/boot/common/src/uboot/arch/arm/include/asm/arch-zx297520v3/efuse.h b/boot/common/src/uboot/arch/arm/include/asm/arch-zx297520v3/efuse.h
index 61f8991..dce9dbd 100644
--- a/boot/common/src/uboot/arch/arm/include/asm/arch-zx297520v3/efuse.h
+++ b/boot/common/src/uboot/arch/arm/include/asm/arch-zx297520v3/efuse.h
@@ -22,6 +22,7 @@
 #define CHIP_DDR_IS_64M			1
 #define CHIP_DDR_IS_128M		2
 #define CHIP_DDR_IS_256M		3
+#define CHIP_DDR_IS_512M		4
 
 
 #define ZX297520V3_GW_NYB_1G_DDR			0xF86302
@@ -40,6 +41,11 @@
 #define ZX297520V3ECOSC_GW_NYC_1G_DDR		0xF8630f
 #define ZX297520V3ECOSC_GW_UNILC_1G_DDR		0xF86310
 #define ZX297520V3ECOSC_GW_NYC_2G_DDR		0xF86311
+#define ZX297520V3ECOSCC_GW_NYB_4G_DDR		0xF86313
+#define ZX297520V3ECOGG_GW_NYC_2G_DDR		0xF86314
+#define ZX297520V3ECOGG_GW_NYB_4G_DDR		0xF86315
+
+
 
 #define ZX297520V3_ZW_NYB_1G_DDR			0x1E871E
 #define ZX297520V3_ZW_NYC_1G_DDR			0x1E871F
diff --git a/boot/common/src/uboot/board/zte/zx297520v3/zx297520v3_vehicle_dc.c b/boot/common/src/uboot/board/zte/zx297520v3/zx297520v3_vehicle_dc.c
index 3cae467..08b530f 100755
--- a/boot/common/src/uboot/board/zte/zx297520v3/zx297520v3_vehicle_dc.c
+++ b/boot/common/src/uboot/board/zte/zx297520v3/zx297520v3_vehicle_dc.c
@@ -371,9 +371,7 @@
 	}
 */
 #if 1
-	//xf.li@20230526 add for ZXW-36 start
 	//zx234290_set_softon(1);
-	//xf.li@20230526 add for ZXW-36 end
 #else
 	zx234290_set_softon(0);
 	pmu_pull_off_ps_hold();
diff --git a/boot/common/src/uboot/downloader/cmd_efuse_program.c b/boot/common/src/uboot/downloader/cmd_efuse_program.c
index abe9532..3f931ba 100644
--- a/boot/common/src/uboot/downloader/cmd_efuse_program.c
+++ b/boot/common/src/uboot/downloader/cmd_efuse_program.c
@@ -242,7 +242,8 @@
 		printf("chip_flag=0x%x board_type is V3E.\n", chip_flag);
 		board_type = BOARD_TYPE_ZX297520V3E64M;
 	}
-	else if(chip_flag == ZX297520V3ECOSC_GW_NYC_2G_DDR)
+	else if((chip_flag == ZX297520V3ECOSC_GW_NYC_2G_DDR)
+			||(chip_flag == ZX297520V3ECOGG_GW_NYC_2G_DDR))
 	{
 		printf("chip_flag=0x%x board_type is V3E.\n", chip_flag);
 		board_type = BOARD_TYPE_ZX297520V3E256M;
diff --git a/boot/common/src/uboot/drivers/efuse/efuse.c b/boot/common/src/uboot/drivers/efuse/efuse.c
index becc890..46bc303 100644
--- a/boot/common/src/uboot/drivers/efuse/efuse.c
+++ b/boot/common/src/uboot/drivers/efuse/efuse.c
@@ -167,7 +167,8 @@
 		g_ddr_size_flag = CHIP_DDR_IS_64M;

 		BOOT_PRINTF(UBOOT_NOTICE, "secure_flag=0x%x.\n", psEfuseInfo->secure_flag);

 	}

-	else if((psEfuseInfo->secure_flag >> 8) == ZX297520V3ECOSC_GW_NYC_2G_DDR)

+	else if(((psEfuseInfo->secure_flag >> 8) == ZX297520V3ECOSC_GW_NYC_2G_DDR)

+		||((psEfuseInfo->secure_flag >> 8) == ZX297520V3ECOGG_GW_NYC_2G_DDR))

 	{

 		g_ddr_size_flag = CHIP_DDR_IS_256M;

 		BOOT_PRINTF(UBOOT_NOTICE, "secure_flag=0x%x.\n", psEfuseInfo->secure_flag);

diff --git a/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c b/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c
index f437b83..ae834a8 100755
--- a/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c
+++ b/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c
@@ -90,6 +90,8 @@
 	{0x2C,0x35,0x00,0,4096,256,0,0,0x40000,64,2048,1,1,0,{2,1,1,9,0,0,0,0,0,0},{8,512}},
 	/*GD5F4GQ6REY2G    512MB SPI-NAND*/
 	{0xC8,0x45,0x00,0,2048,128,0,0,0x20000,64,4096,1,1,0,{2,1,1,9,0,0,0,0,0,0},{0,0}},
+	/*XTX XT26Q04D-B 512M SPI-NAND*/
+	{0x0B,0x53,0x00,0,4096,256,0,0,0x40000,64,2048,1,1,0,{2,1,1,9,0,0,0,0,0,0},{0,0}},
 	{0,}
 }; 
 /*
@@ -130,6 +132,7 @@
 	{"SPI-NAND 256MiB 1,8V",	0x25, 2048, 256, 0x20000, 0},	//MT29F2G01ABAGDWB
 	{"SPI-NAND 512MiB 1,8V",	0x35, 4096, 512, 0x40000, 0},	//F50D44G41XB (2X)
 	{"SPI-NAND 512MiB 1,8V",	0x45, 2048, 512, 0x20000, 0},	//GD5F4GQ6REY2G
+	{"SPI-NAND 512MiB 1,8V",	0x53, 4096, 512, 0x40000, 0},	//XT26Q04D-B
 	{NULL,}
 };
 
@@ -156,6 +159,7 @@
 	{NAND_MFR_HOSIN, "hosin"},
 	{NAND_MFR_EMST, "emst"},
 	{NAND_MFR_FORESEE, "foresee"},
+	{NAND_MFR_XTX, "xtx"},
 	{0x0, "Unknown"}
 };
 
diff --git a/boot/common/src/uboot/drivers/mtd/nand/spi_nand_devices.c b/boot/common/src/uboot/drivers/mtd/nand/spi_nand_devices.c
index 3247543..09556f6 100755
--- a/boot/common/src/uboot/drivers/mtd/nand/spi_nand_devices.c
+++ b/boot/common/src/uboot/drivers/mtd/nand/spi_nand_devices.c
@@ -111,6 +111,11 @@
 	.oobfree = {{64,64}}
  };
 
+ static struct nand_ecclayout nand_xtx_oob_256= {
+	 .eccbytes = 192,
+	 .oobfree = {{2,62}}
+  };
+
 static void	spi_nand_winbond_init(struct spi_nand_info *spi_nand)
 {
 	uint8_t dev_id = spi_nand->para->device_id;	
@@ -197,6 +202,7 @@
 			|| (g_maf_id == NAND_MFR_HOSIN)
 			||((g_maf_id == NAND_MFR_EMST) && (g_dev_id == NAND_DEVID_EMST_F50D1G41LB_1G))
 			|| (g_maf_id == NAND_MFR_FORESEE)
+			|| (g_maf_id == NAND_MFR_XTX)
 			|| (g_maf_id == NAND_MFR_MICRON))
 			return RDX4_MODE;
 		else
@@ -322,6 +328,12 @@
 			}
 		}
 		break;
+	case NAND_MFR_XTX:
+		if(mtd->oobsize==256 && mtd->writesize==4096)
+		{
+			chip->ecc.layout =&nand_xtx_oob_256;
+		}
+		break;
 	default:
 		break;
 	}
diff --git a/boot/common/src/uboot/drivers/mtd/partition/partition.c b/boot/common/src/uboot/drivers/mtd/partition/partition.c
index 264dfb4..80b0362 100755
--- a/boot/common/src/uboot/drivers/mtd/partition/partition.c
+++ b/boot/common/src/uboot/drivers/mtd/partition/partition.c
@@ -79,7 +79,7 @@
 
 	/* console=ttyS1,115200 no_console_suspend */
 	sprintf((char *)bootargs_cmd, "console=ttyS1,921600 no_console_suspend");
-    sprintf((char *)bootargs_cmd_cap, "console=ttyS0,921600n8 earlycon");
+    sprintf((char *)bootargs_cmd_cap, "console=ttyS1,921600n8 earlycon no_console_suspend");
 	/* denali-nand: */
 	if(read_boot_flashtype() == IF_TYPE_NAND)
 	{
diff --git a/boot/common/src/uboot/include/linux/mtd/nand.h b/boot/common/src/uboot/include/linux/mtd/nand.h
index d46ee20..efdfb54 100755
--- a/boot/common/src/uboot/include/linux/mtd/nand.h
+++ b/boot/common/src/uboot/include/linux/mtd/nand.h
@@ -522,6 +522,8 @@
 #define NAND_MFR_HOSIN	   0xD6
 #define NAND_MFR_EMST			0xC8
 #define NAND_MFR_FORESEE		0xCD
+#define NAND_MFR_XTX		0x0B
+
 
 #define NAND_DEVID_GD5F1GQ5R_1G 0x41