[Feature][task-view-1126]merge ZXW nand flash patch

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

Change-Id: Iaeb60fdc93b8ccc6ebd3f150fa047ddbee6c0d8c
diff --git a/ap/os/linux/linux-3.4.x/drivers/mtd/nand/nand_ids.c b/ap/os/linux/linux-3.4.x/drivers/mtd/nand/nand_ids.c
index e15a472..2334345 100755
--- a/ap/os/linux/linux-3.4.x/drivers/mtd/nand/nand_ids.c
+++ b/ap/os/linux/linux-3.4.x/drivers/mtd/nand/nand_ids.c
@@ -90,6 +90,8 @@
 	{"SPI-NAND 512MiB 1,8V",	0x45, 2048, 512, 0x20000, 0},	//GD5F4GQ6REY2G
 	{"SPI-NAND 512MiB 1,8V",	0x53, 4096, 512, 0x40000, 0},	//XT26Q04D-B
 	{"SPI-NAND 128MiB 1,8V",	0x15, 2048, 128, 0x20000, 0},	//UM19A0LISW
+	{"SPI-NAND 512MiB 1,8V",	0x85, 2048, 512, 0x20000, 0},	//GD5F4GM8XEXXG
+
 	/*
 	 * These are the new chips with large page size. The pagesize and the
 	 * erasesize is determined from the extended id bytes
diff --git a/ap/os/linux/linux-3.4.x/drivers/mtd/nand/spi_nand_devices.c b/ap/os/linux/linux-3.4.x/drivers/mtd/nand/spi_nand_devices.c
index 6f4db46..767b38f 100755
--- a/ap/os/linux/linux-3.4.x/drivers/mtd/nand/spi_nand_devices.c
+++ b/ap/os/linux/linux-3.4.x/drivers/mtd/nand/spi_nand_devices.c
@@ -71,6 +71,10 @@
 	case 0x45:
 		main_size = 2048;
 		spare_size = 128;
+		break;
+	case 0x85:
+		main_size = 2048;
+		spare_size = 128;
 		break;	
 	default:
 		printk(
@@ -361,6 +365,12 @@
 	.eccbytes = 64,
 	.oobfree = {{4,12},{20,12},{36,12},{52,12}}
 };
+	
+static struct nand_ecclayout nand_gd5f4gm8_oob_128 = {
+	.eccbytes = 64,
+	.oobfree = {{2,62}}
+};
+
 static struct nand_ecclayout nand_gd_oob_256 = {
 	.eccbytes = 128,
 	.oobfree = {{2,2},{16,4},{32,4},{48,4},{64,4},{80,4},{96,4},{112,4}}
@@ -608,6 +618,10 @@
 				chip->ecc.layout =&nand_emst_oob_64;
 			}
 		}
+		else if(dev_id == NAND_DEVID_GD5F4GM8)
+		{
+			chip->ecc.layout =&nand_gd5f4gm8_oob_128;
+		}
 		else
 		{
 			if(mtd->oobsize==64 && mtd->writesize==2048)
diff --git a/ap/os/linux/linux-3.4.x/include/linux/mtd/nand.h b/ap/os/linux/linux-3.4.x/include/linux/mtd/nand.h
index 057c896..2be8a65 100755
--- a/ap/os/linux/linux-3.4.x/include/linux/mtd/nand.h
+++ b/ap/os/linux/linux-3.4.x/include/linux/mtd/nand.h
@@ -574,6 +574,7 @@
 #define NAND_MFR_UNIM		0xB0
 
 #define NAND_DEVID_EMST_F50D1G41LB_1G 0x11
+#define NAND_DEVID_GD5F4GM8  0x85
 
 #define NAND_DEVID_GD5F1GQ4R_1G	0xC1
 #define NAND_DEVID_GD5F1GQ5R_1G	0x41
diff --git a/boot/common/src/loader/drivers/spifc.c b/boot/common/src/loader/drivers/spifc.c
index b41effc..a05604e 100755
--- a/boot/common/src/loader/drivers/spifc.c
+++ b/boot/common/src/loader/drivers/spifc.c
@@ -79,6 +79,8 @@
 	{0x0B, 0x53, 0x77, 4096, 12, 256, 18, 2048, 0x40000, 1},
 	/*UNIM UM19A0LISW 128M SPI-NAND*/
 	{0xB0, 0x15, 0x77, 2048, 11, 64, 17, 1024, 0x20000, 1},
+	/* GD5F4GM8RExxG  512MB SPI-NAND */
+	{0xC8, 0x85, 0x77, 2048, 11, 64, 17, 4096, 0x20000, 1},
 	{0}
 };
 
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 6d54c1e..a992337 100755
--- a/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c
+++ b/boot/common/src/uboot/drivers/mtd/nand/nand_ids.c
@@ -94,6 +94,9 @@
 	{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}},
 	/*UNIM UM19A0LISW 128M SPI-NAND*/
 	{0xB0,0x15,0x00,0,2048,64,0,0,0x20000,64,1024,1,1,0,{2,1,1,9,0,0,0,0,0,0},{0,0}},
+	/*GD5F4GM8XEXXG 512M SPI-NAND*/
+	{0xC8,0x85,0x00,0,2048,128,0,0,0x20000,64,4096,1,1,0,{2,1,1,9,0,0,0,0,0,0},{0,0}},
+
 	{0,}
 }; 
 /*
@@ -136,6 +139,7 @@
 	{"SPI-NAND 512MiB 1,8V",	0x45, 2048, 512, 0x20000, 0},	//GD5F4GQ6REY2G
 	{"SPI-NAND 512MiB 1,8V",	0x53, 4096, 512, 0x40000, 0},	//XT26Q04D-B
 	{"SPI-NAND 128MiB 1,8V",	0x15, 2048, 128, 0x20000, 0},	//UM19A0LISW
+	{"SPI-NAND 512MiB 1,8V",	0x85, 2048, 512, 0x20000, 0},   //GD5F4GM8XEXXG
 	{NULL,}
 };
 
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 4062428..ad98144 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
@@ -43,6 +43,12 @@
 	.eccbytes = 64,
 	.oobfree = {{4,12},{20,12},{36,12},{52,12}}
 };
+
+static struct nand_ecclayout nand_gd5f4gm8_oob_128 = {
+	.eccbytes = 64,
+	.oobfree = {{2,62}}
+};
+
 static struct nand_ecclayout nand_gd_oob_256 = {
 	.eccbytes = 128,
 	.oobfree = {{2,2},{16,4},{32,4},{48,4},{64,4},{80,4},{96,4},{112,4}}
@@ -273,6 +279,10 @@
 				chip->ecc.layout =&nand_emst_oob_64;
 			}
 		}
+		else if(dev_id == NAND_DEVID_GD5F4GM8)
+		{
+			chip->ecc.layout =&nand_gd5f4gm8_oob_128;
+		}
 		else
 		{
 			if(mtd->oobsize==64 && mtd->writesize==2048)
diff --git a/boot/common/src/uboot/include/linux/mtd/nand.h b/boot/common/src/uboot/include/linux/mtd/nand.h
index f1c4aa1..a3c0a30 100755
--- a/boot/common/src/uboot/include/linux/mtd/nand.h
+++ b/boot/common/src/uboot/include/linux/mtd/nand.h
@@ -529,6 +529,7 @@
 #define NAND_DEVID_GD5F1GQ5R_1G 0x41
 
 #define NAND_DEVID_EMST_F50D1G41LB_1G 0x11
+#define NAND_DEVID_GD5F4GM8  0x85
 
 #define NAND_DEVID_PARAGON_1G 0xC1
 #define NAND_DEVID_PARAGON_2G 0xC2
diff --git a/boot/prj/zx297520v3/bootrom/dl_off/loader2.bin b/boot/prj/zx297520v3/bootrom/dl_off/loader2.bin
index 9f59920..ad2b9b9 100755
--- a/boot/prj/zx297520v3/bootrom/dl_off/loader2.bin
+++ b/boot/prj/zx297520v3/bootrom/dl_off/loader2.bin
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom/dl_off/z-load2 b/boot/prj/zx297520v3/bootrom/dl_off/z-load2
index be71fcd..1dc1546 100755
--- a/boot/prj/zx297520v3/bootrom/dl_off/z-load2
+++ b/boot/prj/zx297520v3/bootrom/dl_off/z-load2
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom/dl_off/z-load2.map b/boot/prj/zx297520v3/bootrom/dl_off/z-load2.map
index c906aa5..c01b65c 100755
--- a/boot/prj/zx297520v3/bootrom/dl_off/z-load2.map
+++ b/boot/prj/zx297520v3/bootrom/dl_off/z-load2.map
@@ -161,95 +161,95 @@
  .iplt          0x0000000000000000        0x0 cpu/m0/start.o
                 0x0000000020304ea4                . = ALIGN (0x4)
 
-.rodata         0x0000000020304ea4      0x3f0
+.rodata         0x0000000020304ea4      0x408
  *(.rodata)
- .rodata        0x0000000020304ea4      0x270 drivers/libdrivers.a(spifc_loader2.o)
- .rodata        0x0000000020305114       0x13 drivers/libdrivers.a(sha256.o)
-                0x0000000020305114                sha256_der_prefix
- *fill*         0x0000000020305127        0x1 
- .rodata        0x0000000020305128      0x16c drivers/libdrivers.a(nor.o)
+ .rodata        0x0000000020304ea4      0x288 drivers/libdrivers.a(spifc_loader2.o)
+ .rodata        0x000000002030512c       0x13 drivers/libdrivers.a(sha256.o)
+                0x000000002030512c                sha256_der_prefix
+ *fill*         0x000000002030513f        0x1 
+ .rodata        0x0000000020305140      0x16c drivers/libdrivers.a(nor.o)
 
-.rodata.str1.1  0x0000000020305294      0x516
+.rodata.str1.1  0x00000000203052ac      0x516
  .rodata.str1.1
-                0x0000000020305294      0x213 lib/libarm.a(board.o)
+                0x00000000203052ac      0x213 lib/libarm.a(board.o)
                                         0x24e (松开之前的大小)
  .rodata.str1.1
-                0x00000000203054a7       0xef drivers/libdrivers.a(image.o)
+                0x00000000203054bf       0xef drivers/libdrivers.a(image.o)
                                         0x115 (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305596       0x5b drivers/libdrivers.a(secure_verify.o)
+                0x00000000203055ae       0x5b drivers/libdrivers.a(secure_verify.o)
                                          0x5d (松开之前的大小)
  .rodata.str1.1
-                0x00000000203055f1       0x3d drivers/libdrivers.a(spifc_loader2.o)
+                0x0000000020305609       0x3d drivers/libdrivers.a(spifc_loader2.o)
                                          0x4a (松开之前的大小)
  .rodata.str1.1
-                0x000000002030562e        0x9 drivers/libdrivers.a(bbt.o)
+                0x0000000020305646        0x9 drivers/libdrivers.a(bbt.o)
  .rodata.str1.1
-                0x0000000020305637      0x15c drivers/libdrivers.a(nor.o)
+                0x000000002030564f      0x15c drivers/libdrivers.a(nor.o)
  .rodata.str1.1
-                0x0000000020305793       0x17 drivers/libdrivers.a(efuse.o)
+                0x00000000203057ab       0x17 drivers/libdrivers.a(efuse.o)
 
-.rel.dyn        0x00000000203057ac        0x0
+.rel.dyn        0x00000000203057c4        0x0
  .rel.iplt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x00000000203057ac                . = ALIGN (0x4)
+                0x00000000203057c4                . = ALIGN (0x4)
 
-.data           0x00000000203057ac       0xd0
+.data           0x00000000203057c4       0xd0
  *(.data)
- .data          0x00000000203057ac        0x0 cpu/m0/start.o
- .data          0x00000000203057ac        0x0 lib/libarm.a(board.o)
- .data          0x00000000203057ac        0x0 lib/libarm.a(string.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(ddr.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(uart.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(image.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(secure_verify.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(spifc_loader2.o)
- .data          0x00000000203057ac       0x40 drivers/libdrivers.a(bbt.o)
- .data          0x00000000203057ec       0x40 drivers/libdrivers.a(sha256.o)
- .data          0x000000002030582c       0x50 drivers/libdrivers.a(nor.o)
-                0x000000002030582c                nor_cmd_table
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(drv_hash.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(drv_rsa.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(flash.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(efuse.o)
- .data          0x000000002030587c        0x0 cpu/m0/libm0.a(cpu.o)
+ .data          0x00000000203057c4        0x0 cpu/m0/start.o
+ .data          0x00000000203057c4        0x0 lib/libarm.a(board.o)
+ .data          0x00000000203057c4        0x0 lib/libarm.a(string.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(ddr.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(uart.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(image.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(secure_verify.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(spifc_loader2.o)
+ .data          0x00000000203057c4       0x40 drivers/libdrivers.a(bbt.o)
+ .data          0x0000000020305804       0x40 drivers/libdrivers.a(sha256.o)
+ .data          0x0000000020305844       0x50 drivers/libdrivers.a(nor.o)
+                0x0000000020305844                nor_cmd_table
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(drv_hash.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(flash.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(efuse.o)
+ .data          0x0000000020305894        0x0 cpu/m0/libm0.a(cpu.o)
 
-.igot.plt       0x000000002030587c        0x0
+.igot.plt       0x0000000020305894        0x0
  .igot.plt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x000000002030587c                . = ALIGN (0x4)
+                0x0000000020305894                . = ALIGN (0x4)
 
 .got
  *(.got)
-                0x000000002030587c                . = ALIGN (0x4)
-                0x000000002030587c                __bss_start = .
+                0x0000000020305894                . = ALIGN (0x4)
+                0x0000000020305894                __bss_start = .
 
-.bss            0x000000002030587c      0x1e8
+.bss            0x0000000020305894      0x1e8
  *(.bss)
- .bss           0x000000002030587c        0x0 cpu/m0/start.o
- .bss           0x000000002030587c        0x4 lib/libarm.a(board.o)
-                0x000000002030587c                zloader_entry_point
- .bss           0x0000000020305880        0x0 lib/libarm.a(string.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(ddr.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(uart.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(image.o)
- .bss           0x0000000020305880      0x104 drivers/libdrivers.a(secure_verify.o)
-                0x0000000020305880                result
- .bss           0x0000000020305984        0x4 drivers/libdrivers.a(spifc_loader2.o)
- .bss           0x0000000020305988       0x80 drivers/libdrivers.a(bbt.o)
- .bss           0x0000000020305a08        0x0 drivers/libdrivers.a(sha256.o)
- .bss           0x0000000020305a08       0x28 drivers/libdrivers.a(nor.o)
-                0x0000000020305a08                spi_nor_flash
-                0x0000000020305a0c                otp_data
- .bss           0x0000000020305a30        0x0 drivers/libdrivers.a(drv_hash.o)
- .bss           0x0000000020305a30        0x0 drivers/libdrivers.a(drv_rsa.o)
- .bss           0x0000000020305a30       0x24 drivers/libdrivers.a(flash.o)
-                0x0000000020305a30                flash
- .bss           0x0000000020305a54        0x0 drivers/libdrivers.a(efuse.o)
- .bss           0x0000000020305a54       0x10 cpu/m0/libm0.a(cpu.o)
-                0x0000000020305a54                g_tick
-                0x0000000020305a64                __bss_end = .
-                0x0000000020305a64                . = ALIGN (0x4)
+ .bss           0x0000000020305894        0x0 cpu/m0/start.o
+ .bss           0x0000000020305894        0x4 lib/libarm.a(board.o)
+                0x0000000020305894                zloader_entry_point
+ .bss           0x0000000020305898        0x0 lib/libarm.a(string.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(ddr.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(uart.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(image.o)
+ .bss           0x0000000020305898      0x104 drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305898                result
+ .bss           0x000000002030599c        0x4 drivers/libdrivers.a(spifc_loader2.o)
+ .bss           0x00000000203059a0       0x80 drivers/libdrivers.a(bbt.o)
+ .bss           0x0000000020305a20        0x0 drivers/libdrivers.a(sha256.o)
+ .bss           0x0000000020305a20       0x28 drivers/libdrivers.a(nor.o)
+                0x0000000020305a20                spi_nor_flash
+                0x0000000020305a24                otp_data
+ .bss           0x0000000020305a48        0x0 drivers/libdrivers.a(drv_hash.o)
+ .bss           0x0000000020305a48        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .bss           0x0000000020305a48       0x24 drivers/libdrivers.a(flash.o)
+                0x0000000020305a48                flash
+ .bss           0x0000000020305a6c        0x0 drivers/libdrivers.a(efuse.o)
+ .bss           0x0000000020305a6c       0x10 cpu/m0/libm0.a(cpu.o)
+                0x0000000020305a6c                g_tick
+                0x0000000020305a7c                __bss_end = .
+                0x0000000020305a7c                . = ALIGN (0x4)
 
-.para           0x0000000082000000        0x0 加载地址 0x0000000020305a64
+.para           0x0000000082000000        0x0 加载地址 0x0000000020305a7c
                 0x0000000082000000                __para_start = .
  *(.para)
                 0x0000000082000000                __para_end = .
diff --git a/boot/prj/zx297520v3/bootrom/dl_on/loader2.bin b/boot/prj/zx297520v3/bootrom/dl_on/loader2.bin
index 6cf279f..81fe5ed 100755
--- a/boot/prj/zx297520v3/bootrom/dl_on/loader2.bin
+++ b/boot/prj/zx297520v3/bootrom/dl_on/loader2.bin
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom/dl_on/z-load2 b/boot/prj/zx297520v3/bootrom/dl_on/z-load2
index 88a41ea..881486d 100755
--- a/boot/prj/zx297520v3/bootrom/dl_on/z-load2
+++ b/boot/prj/zx297520v3/bootrom/dl_on/z-load2
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom/dl_on/z-load2.map b/boot/prj/zx297520v3/bootrom/dl_on/z-load2.map
index c906aa5..c01b65c 100755
--- a/boot/prj/zx297520v3/bootrom/dl_on/z-load2.map
+++ b/boot/prj/zx297520v3/bootrom/dl_on/z-load2.map
@@ -161,95 +161,95 @@
  .iplt          0x0000000000000000        0x0 cpu/m0/start.o
                 0x0000000020304ea4                . = ALIGN (0x4)
 
-.rodata         0x0000000020304ea4      0x3f0
+.rodata         0x0000000020304ea4      0x408
  *(.rodata)
- .rodata        0x0000000020304ea4      0x270 drivers/libdrivers.a(spifc_loader2.o)
- .rodata        0x0000000020305114       0x13 drivers/libdrivers.a(sha256.o)
-                0x0000000020305114                sha256_der_prefix
- *fill*         0x0000000020305127        0x1 
- .rodata        0x0000000020305128      0x16c drivers/libdrivers.a(nor.o)
+ .rodata        0x0000000020304ea4      0x288 drivers/libdrivers.a(spifc_loader2.o)
+ .rodata        0x000000002030512c       0x13 drivers/libdrivers.a(sha256.o)
+                0x000000002030512c                sha256_der_prefix
+ *fill*         0x000000002030513f        0x1 
+ .rodata        0x0000000020305140      0x16c drivers/libdrivers.a(nor.o)
 
-.rodata.str1.1  0x0000000020305294      0x516
+.rodata.str1.1  0x00000000203052ac      0x516
  .rodata.str1.1
-                0x0000000020305294      0x213 lib/libarm.a(board.o)
+                0x00000000203052ac      0x213 lib/libarm.a(board.o)
                                         0x24e (松开之前的大小)
  .rodata.str1.1
-                0x00000000203054a7       0xef drivers/libdrivers.a(image.o)
+                0x00000000203054bf       0xef drivers/libdrivers.a(image.o)
                                         0x115 (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305596       0x5b drivers/libdrivers.a(secure_verify.o)
+                0x00000000203055ae       0x5b drivers/libdrivers.a(secure_verify.o)
                                          0x5d (松开之前的大小)
  .rodata.str1.1
-                0x00000000203055f1       0x3d drivers/libdrivers.a(spifc_loader2.o)
+                0x0000000020305609       0x3d drivers/libdrivers.a(spifc_loader2.o)
                                          0x4a (松开之前的大小)
  .rodata.str1.1
-                0x000000002030562e        0x9 drivers/libdrivers.a(bbt.o)
+                0x0000000020305646        0x9 drivers/libdrivers.a(bbt.o)
  .rodata.str1.1
-                0x0000000020305637      0x15c drivers/libdrivers.a(nor.o)
+                0x000000002030564f      0x15c drivers/libdrivers.a(nor.o)
  .rodata.str1.1
-                0x0000000020305793       0x17 drivers/libdrivers.a(efuse.o)
+                0x00000000203057ab       0x17 drivers/libdrivers.a(efuse.o)
 
-.rel.dyn        0x00000000203057ac        0x0
+.rel.dyn        0x00000000203057c4        0x0
  .rel.iplt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x00000000203057ac                . = ALIGN (0x4)
+                0x00000000203057c4                . = ALIGN (0x4)
 
-.data           0x00000000203057ac       0xd0
+.data           0x00000000203057c4       0xd0
  *(.data)
- .data          0x00000000203057ac        0x0 cpu/m0/start.o
- .data          0x00000000203057ac        0x0 lib/libarm.a(board.o)
- .data          0x00000000203057ac        0x0 lib/libarm.a(string.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(ddr.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(uart.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(image.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(secure_verify.o)
- .data          0x00000000203057ac        0x0 drivers/libdrivers.a(spifc_loader2.o)
- .data          0x00000000203057ac       0x40 drivers/libdrivers.a(bbt.o)
- .data          0x00000000203057ec       0x40 drivers/libdrivers.a(sha256.o)
- .data          0x000000002030582c       0x50 drivers/libdrivers.a(nor.o)
-                0x000000002030582c                nor_cmd_table
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(drv_hash.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(drv_rsa.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(flash.o)
- .data          0x000000002030587c        0x0 drivers/libdrivers.a(efuse.o)
- .data          0x000000002030587c        0x0 cpu/m0/libm0.a(cpu.o)
+ .data          0x00000000203057c4        0x0 cpu/m0/start.o
+ .data          0x00000000203057c4        0x0 lib/libarm.a(board.o)
+ .data          0x00000000203057c4        0x0 lib/libarm.a(string.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(ddr.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(uart.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(image.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(secure_verify.o)
+ .data          0x00000000203057c4        0x0 drivers/libdrivers.a(spifc_loader2.o)
+ .data          0x00000000203057c4       0x40 drivers/libdrivers.a(bbt.o)
+ .data          0x0000000020305804       0x40 drivers/libdrivers.a(sha256.o)
+ .data          0x0000000020305844       0x50 drivers/libdrivers.a(nor.o)
+                0x0000000020305844                nor_cmd_table
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(drv_hash.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(flash.o)
+ .data          0x0000000020305894        0x0 drivers/libdrivers.a(efuse.o)
+ .data          0x0000000020305894        0x0 cpu/m0/libm0.a(cpu.o)
 
-.igot.plt       0x000000002030587c        0x0
+.igot.plt       0x0000000020305894        0x0
  .igot.plt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x000000002030587c                . = ALIGN (0x4)
+                0x0000000020305894                . = ALIGN (0x4)
 
 .got
  *(.got)
-                0x000000002030587c                . = ALIGN (0x4)
-                0x000000002030587c                __bss_start = .
+                0x0000000020305894                . = ALIGN (0x4)
+                0x0000000020305894                __bss_start = .
 
-.bss            0x000000002030587c      0x1e8
+.bss            0x0000000020305894      0x1e8
  *(.bss)
- .bss           0x000000002030587c        0x0 cpu/m0/start.o
- .bss           0x000000002030587c        0x4 lib/libarm.a(board.o)
-                0x000000002030587c                zloader_entry_point
- .bss           0x0000000020305880        0x0 lib/libarm.a(string.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(ddr.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(uart.o)
- .bss           0x0000000020305880        0x0 drivers/libdrivers.a(image.o)
- .bss           0x0000000020305880      0x104 drivers/libdrivers.a(secure_verify.o)
-                0x0000000020305880                result
- .bss           0x0000000020305984        0x4 drivers/libdrivers.a(spifc_loader2.o)
- .bss           0x0000000020305988       0x80 drivers/libdrivers.a(bbt.o)
- .bss           0x0000000020305a08        0x0 drivers/libdrivers.a(sha256.o)
- .bss           0x0000000020305a08       0x28 drivers/libdrivers.a(nor.o)
-                0x0000000020305a08                spi_nor_flash
-                0x0000000020305a0c                otp_data
- .bss           0x0000000020305a30        0x0 drivers/libdrivers.a(drv_hash.o)
- .bss           0x0000000020305a30        0x0 drivers/libdrivers.a(drv_rsa.o)
- .bss           0x0000000020305a30       0x24 drivers/libdrivers.a(flash.o)
-                0x0000000020305a30                flash
- .bss           0x0000000020305a54        0x0 drivers/libdrivers.a(efuse.o)
- .bss           0x0000000020305a54       0x10 cpu/m0/libm0.a(cpu.o)
-                0x0000000020305a54                g_tick
-                0x0000000020305a64                __bss_end = .
-                0x0000000020305a64                . = ALIGN (0x4)
+ .bss           0x0000000020305894        0x0 cpu/m0/start.o
+ .bss           0x0000000020305894        0x4 lib/libarm.a(board.o)
+                0x0000000020305894                zloader_entry_point
+ .bss           0x0000000020305898        0x0 lib/libarm.a(string.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(ddr.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(uart.o)
+ .bss           0x0000000020305898        0x0 drivers/libdrivers.a(image.o)
+ .bss           0x0000000020305898      0x104 drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305898                result
+ .bss           0x000000002030599c        0x4 drivers/libdrivers.a(spifc_loader2.o)
+ .bss           0x00000000203059a0       0x80 drivers/libdrivers.a(bbt.o)
+ .bss           0x0000000020305a20        0x0 drivers/libdrivers.a(sha256.o)
+ .bss           0x0000000020305a20       0x28 drivers/libdrivers.a(nor.o)
+                0x0000000020305a20                spi_nor_flash
+                0x0000000020305a24                otp_data
+ .bss           0x0000000020305a48        0x0 drivers/libdrivers.a(drv_hash.o)
+ .bss           0x0000000020305a48        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .bss           0x0000000020305a48       0x24 drivers/libdrivers.a(flash.o)
+                0x0000000020305a48                flash
+ .bss           0x0000000020305a6c        0x0 drivers/libdrivers.a(efuse.o)
+ .bss           0x0000000020305a6c       0x10 cpu/m0/libm0.a(cpu.o)
+                0x0000000020305a6c                g_tick
+                0x0000000020305a7c                __bss_end = .
+                0x0000000020305a7c                . = ALIGN (0x4)
 
-.para           0x0000000082000000        0x0 加载地址 0x0000000020305a64
+.para           0x0000000082000000        0x0 加载地址 0x0000000020305a7c
                 0x0000000082000000                __para_start = .
  *(.para)
                 0x0000000082000000                __para_end = .
diff --git a/boot/prj/zx297520v3/bootrom2/dl_off/loader2.bin b/boot/prj/zx297520v3/bootrom2/dl_off/loader2.bin
index dc24875..05efb02 100644
--- a/boot/prj/zx297520v3/bootrom2/dl_off/loader2.bin
+++ b/boot/prj/zx297520v3/bootrom2/dl_off/loader2.bin
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom2/dl_off/z-load2 b/boot/prj/zx297520v3/bootrom2/dl_off/z-load2
index 44de20a..9c50be1 100755
--- a/boot/prj/zx297520v3/bootrom2/dl_off/z-load2
+++ b/boot/prj/zx297520v3/bootrom2/dl_off/z-load2
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom2/dl_off/z-load2.map b/boot/prj/zx297520v3/bootrom2/dl_off/z-load2.map
index d4b4270..fa8fcd3 100755
--- a/boot/prj/zx297520v3/bootrom2/dl_off/z-load2.map
+++ b/boot/prj/zx297520v3/bootrom2/dl_off/z-load2.map
@@ -161,95 +161,95 @@
  .iplt          0x0000000000000000        0x0 cpu/m0/start.o
                 0x0000000020304e0c                . = ALIGN (0x4)
 
-.rodata         0x0000000020304e0c      0x3f0
+.rodata         0x0000000020304e0c      0x408
  *(.rodata)
- .rodata        0x0000000020304e0c      0x270 drivers/libdrivers.a(spifc_loader2.o)
- .rodata        0x000000002030507c       0x13 drivers/libdrivers.a(sha256.o)
-                0x000000002030507c                sha256_der_prefix
- *fill*         0x000000002030508f        0x1 
- .rodata        0x0000000020305090      0x16c drivers/libdrivers.a(nor.o)
+ .rodata        0x0000000020304e0c      0x288 drivers/libdrivers.a(spifc_loader2.o)
+ .rodata        0x0000000020305094       0x13 drivers/libdrivers.a(sha256.o)
+                0x0000000020305094                sha256_der_prefix
+ *fill*         0x00000000203050a7        0x1 
+ .rodata        0x00000000203050a8      0x16c drivers/libdrivers.a(nor.o)
 
-.rodata.str1.1  0x00000000203051fc      0x516
+.rodata.str1.1  0x0000000020305214      0x516
  .rodata.str1.1
-                0x00000000203051fc      0x213 lib/libarm.a(board.o)
+                0x0000000020305214      0x213 lib/libarm.a(board.o)
                                         0x24e (松开之前的大小)
  .rodata.str1.1
-                0x000000002030540f       0xef drivers/libdrivers.a(image.o)
+                0x0000000020305427       0xef drivers/libdrivers.a(image.o)
                                         0x115 (松开之前的大小)
  .rodata.str1.1
-                0x00000000203054fe       0x5b drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305516       0x5b drivers/libdrivers.a(secure_verify.o)
                                          0x5d (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305559       0x3d drivers/libdrivers.a(spifc_loader2.o)
+                0x0000000020305571       0x3d drivers/libdrivers.a(spifc_loader2.o)
                                          0x4a (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305596        0x9 drivers/libdrivers.a(bbt.o)
+                0x00000000203055ae        0x9 drivers/libdrivers.a(bbt.o)
  .rodata.str1.1
-                0x000000002030559f      0x15c drivers/libdrivers.a(nor.o)
+                0x00000000203055b7      0x15c drivers/libdrivers.a(nor.o)
  .rodata.str1.1
-                0x00000000203056fb       0x17 drivers/libdrivers.a(efuse.o)
+                0x0000000020305713       0x17 drivers/libdrivers.a(efuse.o)
 
-.rel.dyn        0x0000000020305714        0x0
+.rel.dyn        0x000000002030572c        0x0
  .rel.iplt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x0000000020305714                . = ALIGN (0x4)
+                0x000000002030572c                . = ALIGN (0x4)
 
-.data           0x0000000020305714       0xd0
+.data           0x000000002030572c       0xd0
  *(.data)
- .data          0x0000000020305714        0x0 cpu/m0/start.o
- .data          0x0000000020305714        0x0 lib/libarm.a(board.o)
- .data          0x0000000020305714        0x0 lib/libarm.a(string.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(uart.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(image.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(secure_verify.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(spifc_loader2.o)
- .data          0x0000000020305714       0x40 drivers/libdrivers.a(bbt.o)
- .data          0x0000000020305754       0x40 drivers/libdrivers.a(sha256.o)
- .data          0x0000000020305794       0x50 drivers/libdrivers.a(nor.o)
-                0x0000000020305794                nor_cmd_table
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(ddr.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(drv_hash.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(drv_rsa.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(flash.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(efuse.o)
- .data          0x00000000203057e4        0x0 cpu/m0/libm0.a(cpu.o)
+ .data          0x000000002030572c        0x0 cpu/m0/start.o
+ .data          0x000000002030572c        0x0 lib/libarm.a(board.o)
+ .data          0x000000002030572c        0x0 lib/libarm.a(string.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(uart.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(image.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(secure_verify.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(spifc_loader2.o)
+ .data          0x000000002030572c       0x40 drivers/libdrivers.a(bbt.o)
+ .data          0x000000002030576c       0x40 drivers/libdrivers.a(sha256.o)
+ .data          0x00000000203057ac       0x50 drivers/libdrivers.a(nor.o)
+                0x00000000203057ac                nor_cmd_table
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(ddr.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(drv_hash.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(flash.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(efuse.o)
+ .data          0x00000000203057fc        0x0 cpu/m0/libm0.a(cpu.o)
 
-.igot.plt       0x00000000203057e4        0x0
+.igot.plt       0x00000000203057fc        0x0
  .igot.plt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x00000000203057e4                . = ALIGN (0x4)
+                0x00000000203057fc                . = ALIGN (0x4)
 
 .got
  *(.got)
-                0x00000000203057e4                . = ALIGN (0x4)
-                0x00000000203057e4                __bss_start = .
+                0x00000000203057fc                . = ALIGN (0x4)
+                0x00000000203057fc                __bss_start = .
 
-.bss            0x00000000203057e4      0x1e8
+.bss            0x00000000203057fc      0x1e8
  *(.bss)
- .bss           0x00000000203057e4        0x0 cpu/m0/start.o
- .bss           0x00000000203057e4        0x4 lib/libarm.a(board.o)
-                0x00000000203057e4                zloader_entry_point
- .bss           0x00000000203057e8        0x0 lib/libarm.a(string.o)
- .bss           0x00000000203057e8        0x0 drivers/libdrivers.a(uart.o)
- .bss           0x00000000203057e8        0x0 drivers/libdrivers.a(image.o)
- .bss           0x00000000203057e8      0x104 drivers/libdrivers.a(secure_verify.o)
-                0x00000000203057e8                result
- .bss           0x00000000203058ec        0x4 drivers/libdrivers.a(spifc_loader2.o)
- .bss           0x00000000203058f0       0x80 drivers/libdrivers.a(bbt.o)
- .bss           0x0000000020305970        0x0 drivers/libdrivers.a(sha256.o)
- .bss           0x0000000020305970       0x28 drivers/libdrivers.a(nor.o)
-                0x0000000020305970                spi_nor_flash
-                0x0000000020305974                otp_data
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(ddr.o)
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(drv_hash.o)
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(drv_rsa.o)
- .bss           0x0000000020305998       0x24 drivers/libdrivers.a(flash.o)
-                0x0000000020305998                flash
- .bss           0x00000000203059bc        0x0 drivers/libdrivers.a(efuse.o)
- .bss           0x00000000203059bc       0x10 cpu/m0/libm0.a(cpu.o)
-                0x00000000203059bc                g_tick
-                0x00000000203059cc                __bss_end = .
-                0x00000000203059cc                . = ALIGN (0x4)
+ .bss           0x00000000203057fc        0x0 cpu/m0/start.o
+ .bss           0x00000000203057fc        0x4 lib/libarm.a(board.o)
+                0x00000000203057fc                zloader_entry_point
+ .bss           0x0000000020305800        0x0 lib/libarm.a(string.o)
+ .bss           0x0000000020305800        0x0 drivers/libdrivers.a(uart.o)
+ .bss           0x0000000020305800        0x0 drivers/libdrivers.a(image.o)
+ .bss           0x0000000020305800      0x104 drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305800                result
+ .bss           0x0000000020305904        0x4 drivers/libdrivers.a(spifc_loader2.o)
+ .bss           0x0000000020305908       0x80 drivers/libdrivers.a(bbt.o)
+ .bss           0x0000000020305988        0x0 drivers/libdrivers.a(sha256.o)
+ .bss           0x0000000020305988       0x28 drivers/libdrivers.a(nor.o)
+                0x0000000020305988                spi_nor_flash
+                0x000000002030598c                otp_data
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(ddr.o)
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(drv_hash.o)
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .bss           0x00000000203059b0       0x24 drivers/libdrivers.a(flash.o)
+                0x00000000203059b0                flash
+ .bss           0x00000000203059d4        0x0 drivers/libdrivers.a(efuse.o)
+ .bss           0x00000000203059d4       0x10 cpu/m0/libm0.a(cpu.o)
+                0x00000000203059d4                g_tick
+                0x00000000203059e4                __bss_end = .
+                0x00000000203059e4                . = ALIGN (0x4)
 
-.para           0x0000000082000000        0x0 加载地址 0x00000000203059cc
+.para           0x0000000082000000        0x0 加载地址 0x00000000203059e4
                 0x0000000082000000                __para_start = .
  *(.para)
                 0x0000000082000000                __para_end = .
diff --git a/boot/prj/zx297520v3/bootrom2/dl_on/loader2.bin b/boot/prj/zx297520v3/bootrom2/dl_on/loader2.bin
index e7d499c..759b7e5 100755
--- a/boot/prj/zx297520v3/bootrom2/dl_on/loader2.bin
+++ b/boot/prj/zx297520v3/bootrom2/dl_on/loader2.bin
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom2/dl_on/z-load2 b/boot/prj/zx297520v3/bootrom2/dl_on/z-load2
index 1f69c86..9c6790c 100755
--- a/boot/prj/zx297520v3/bootrom2/dl_on/z-load2
+++ b/boot/prj/zx297520v3/bootrom2/dl_on/z-load2
Binary files differ
diff --git a/boot/prj/zx297520v3/bootrom2/dl_on/z-load2.map b/boot/prj/zx297520v3/bootrom2/dl_on/z-load2.map
index d4b4270..fa8fcd3 100755
--- a/boot/prj/zx297520v3/bootrom2/dl_on/z-load2.map
+++ b/boot/prj/zx297520v3/bootrom2/dl_on/z-load2.map
@@ -161,95 +161,95 @@
  .iplt          0x0000000000000000        0x0 cpu/m0/start.o
                 0x0000000020304e0c                . = ALIGN (0x4)
 
-.rodata         0x0000000020304e0c      0x3f0
+.rodata         0x0000000020304e0c      0x408
  *(.rodata)
- .rodata        0x0000000020304e0c      0x270 drivers/libdrivers.a(spifc_loader2.o)
- .rodata        0x000000002030507c       0x13 drivers/libdrivers.a(sha256.o)
-                0x000000002030507c                sha256_der_prefix
- *fill*         0x000000002030508f        0x1 
- .rodata        0x0000000020305090      0x16c drivers/libdrivers.a(nor.o)
+ .rodata        0x0000000020304e0c      0x288 drivers/libdrivers.a(spifc_loader2.o)
+ .rodata        0x0000000020305094       0x13 drivers/libdrivers.a(sha256.o)
+                0x0000000020305094                sha256_der_prefix
+ *fill*         0x00000000203050a7        0x1 
+ .rodata        0x00000000203050a8      0x16c drivers/libdrivers.a(nor.o)
 
-.rodata.str1.1  0x00000000203051fc      0x516
+.rodata.str1.1  0x0000000020305214      0x516
  .rodata.str1.1
-                0x00000000203051fc      0x213 lib/libarm.a(board.o)
+                0x0000000020305214      0x213 lib/libarm.a(board.o)
                                         0x24e (松开之前的大小)
  .rodata.str1.1
-                0x000000002030540f       0xef drivers/libdrivers.a(image.o)
+                0x0000000020305427       0xef drivers/libdrivers.a(image.o)
                                         0x115 (松开之前的大小)
  .rodata.str1.1
-                0x00000000203054fe       0x5b drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305516       0x5b drivers/libdrivers.a(secure_verify.o)
                                          0x5d (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305559       0x3d drivers/libdrivers.a(spifc_loader2.o)
+                0x0000000020305571       0x3d drivers/libdrivers.a(spifc_loader2.o)
                                          0x4a (松开之前的大小)
  .rodata.str1.1
-                0x0000000020305596        0x9 drivers/libdrivers.a(bbt.o)
+                0x00000000203055ae        0x9 drivers/libdrivers.a(bbt.o)
  .rodata.str1.1
-                0x000000002030559f      0x15c drivers/libdrivers.a(nor.o)
+                0x00000000203055b7      0x15c drivers/libdrivers.a(nor.o)
  .rodata.str1.1
-                0x00000000203056fb       0x17 drivers/libdrivers.a(efuse.o)
+                0x0000000020305713       0x17 drivers/libdrivers.a(efuse.o)
 
-.rel.dyn        0x0000000020305714        0x0
+.rel.dyn        0x000000002030572c        0x0
  .rel.iplt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x0000000020305714                . = ALIGN (0x4)
+                0x000000002030572c                . = ALIGN (0x4)
 
-.data           0x0000000020305714       0xd0
+.data           0x000000002030572c       0xd0
  *(.data)
- .data          0x0000000020305714        0x0 cpu/m0/start.o
- .data          0x0000000020305714        0x0 lib/libarm.a(board.o)
- .data          0x0000000020305714        0x0 lib/libarm.a(string.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(uart.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(image.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(secure_verify.o)
- .data          0x0000000020305714        0x0 drivers/libdrivers.a(spifc_loader2.o)
- .data          0x0000000020305714       0x40 drivers/libdrivers.a(bbt.o)
- .data          0x0000000020305754       0x40 drivers/libdrivers.a(sha256.o)
- .data          0x0000000020305794       0x50 drivers/libdrivers.a(nor.o)
-                0x0000000020305794                nor_cmd_table
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(ddr.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(drv_hash.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(drv_rsa.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(flash.o)
- .data          0x00000000203057e4        0x0 drivers/libdrivers.a(efuse.o)
- .data          0x00000000203057e4        0x0 cpu/m0/libm0.a(cpu.o)
+ .data          0x000000002030572c        0x0 cpu/m0/start.o
+ .data          0x000000002030572c        0x0 lib/libarm.a(board.o)
+ .data          0x000000002030572c        0x0 lib/libarm.a(string.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(uart.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(image.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(secure_verify.o)
+ .data          0x000000002030572c        0x0 drivers/libdrivers.a(spifc_loader2.o)
+ .data          0x000000002030572c       0x40 drivers/libdrivers.a(bbt.o)
+ .data          0x000000002030576c       0x40 drivers/libdrivers.a(sha256.o)
+ .data          0x00000000203057ac       0x50 drivers/libdrivers.a(nor.o)
+                0x00000000203057ac                nor_cmd_table
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(ddr.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(drv_hash.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(flash.o)
+ .data          0x00000000203057fc        0x0 drivers/libdrivers.a(efuse.o)
+ .data          0x00000000203057fc        0x0 cpu/m0/libm0.a(cpu.o)
 
-.igot.plt       0x00000000203057e4        0x0
+.igot.plt       0x00000000203057fc        0x0
  .igot.plt      0x0000000000000000        0x0 cpu/m0/start.o
-                0x00000000203057e4                . = ALIGN (0x4)
+                0x00000000203057fc                . = ALIGN (0x4)
 
 .got
  *(.got)
-                0x00000000203057e4                . = ALIGN (0x4)
-                0x00000000203057e4                __bss_start = .
+                0x00000000203057fc                . = ALIGN (0x4)
+                0x00000000203057fc                __bss_start = .
 
-.bss            0x00000000203057e4      0x1e8
+.bss            0x00000000203057fc      0x1e8
  *(.bss)
- .bss           0x00000000203057e4        0x0 cpu/m0/start.o
- .bss           0x00000000203057e4        0x4 lib/libarm.a(board.o)
-                0x00000000203057e4                zloader_entry_point
- .bss           0x00000000203057e8        0x0 lib/libarm.a(string.o)
- .bss           0x00000000203057e8        0x0 drivers/libdrivers.a(uart.o)
- .bss           0x00000000203057e8        0x0 drivers/libdrivers.a(image.o)
- .bss           0x00000000203057e8      0x104 drivers/libdrivers.a(secure_verify.o)
-                0x00000000203057e8                result
- .bss           0x00000000203058ec        0x4 drivers/libdrivers.a(spifc_loader2.o)
- .bss           0x00000000203058f0       0x80 drivers/libdrivers.a(bbt.o)
- .bss           0x0000000020305970        0x0 drivers/libdrivers.a(sha256.o)
- .bss           0x0000000020305970       0x28 drivers/libdrivers.a(nor.o)
-                0x0000000020305970                spi_nor_flash
-                0x0000000020305974                otp_data
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(ddr.o)
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(drv_hash.o)
- .bss           0x0000000020305998        0x0 drivers/libdrivers.a(drv_rsa.o)
- .bss           0x0000000020305998       0x24 drivers/libdrivers.a(flash.o)
-                0x0000000020305998                flash
- .bss           0x00000000203059bc        0x0 drivers/libdrivers.a(efuse.o)
- .bss           0x00000000203059bc       0x10 cpu/m0/libm0.a(cpu.o)
-                0x00000000203059bc                g_tick
-                0x00000000203059cc                __bss_end = .
-                0x00000000203059cc                . = ALIGN (0x4)
+ .bss           0x00000000203057fc        0x0 cpu/m0/start.o
+ .bss           0x00000000203057fc        0x4 lib/libarm.a(board.o)
+                0x00000000203057fc                zloader_entry_point
+ .bss           0x0000000020305800        0x0 lib/libarm.a(string.o)
+ .bss           0x0000000020305800        0x0 drivers/libdrivers.a(uart.o)
+ .bss           0x0000000020305800        0x0 drivers/libdrivers.a(image.o)
+ .bss           0x0000000020305800      0x104 drivers/libdrivers.a(secure_verify.o)
+                0x0000000020305800                result
+ .bss           0x0000000020305904        0x4 drivers/libdrivers.a(spifc_loader2.o)
+ .bss           0x0000000020305908       0x80 drivers/libdrivers.a(bbt.o)
+ .bss           0x0000000020305988        0x0 drivers/libdrivers.a(sha256.o)
+ .bss           0x0000000020305988       0x28 drivers/libdrivers.a(nor.o)
+                0x0000000020305988                spi_nor_flash
+                0x000000002030598c                otp_data
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(ddr.o)
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(drv_hash.o)
+ .bss           0x00000000203059b0        0x0 drivers/libdrivers.a(drv_rsa.o)
+ .bss           0x00000000203059b0       0x24 drivers/libdrivers.a(flash.o)
+                0x00000000203059b0                flash
+ .bss           0x00000000203059d4        0x0 drivers/libdrivers.a(efuse.o)
+ .bss           0x00000000203059d4       0x10 cpu/m0/libm0.a(cpu.o)
+                0x00000000203059d4                g_tick
+                0x00000000203059e4                __bss_end = .
+                0x00000000203059e4                . = ALIGN (0x4)
 
-.para           0x0000000082000000        0x0 加载地址 0x00000000203059cc
+.para           0x0000000082000000        0x0 加载地址 0x00000000203059e4
                 0x0000000082000000                __para_start = .
  *(.para)
                 0x0000000082000000                __para_end = .
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/gigadevice.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/gigadevice.c
index 657039a..87e3206 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/gigadevice.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/gigadevice.c
@@ -12,6 +12,8 @@
 
 #define GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS	(1 << 4)
 #define GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS	(3 << 4)
+#define GD5FXGQ4XA_STATUS_ECC_ERROR	        (2 << 4)
+
 
 #define GD5FXGQ4UEXXG_REG_STATUS2		0xf0
 
@@ -306,6 +308,47 @@
 	return -EINVAL;
 }
 
+static int 	gd5f4gm8_ecc_get_status(struct spinand_device *spinand,
+				u8 status)
+{
+	u8 status2;
+	struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQ4UEXXG_REG_STATUS2,
+							  &status2);
+	int ret;
+
+	switch (status & STATUS_ECC_MASK) {
+	case STATUS_ECC_NO_BITFLIPS:
+		return 0;
+
+	case STATUS_ECC_HAS_BITFLIPS:
+		/*
+		 * Read status2 register to determine a more fine grained
+		 * bit error status
+		 */
+#if 0
+		ret = spi_mem_exec_op(spinand->spimem, &op);
+		if (ret)
+			return ret;
+		
+		/* bits sorted this way (3...0): ECCS1,ECCS0,ECCSE1,ECCSE0 */
+		return (status2 & STATUS_ECC_MASK) >> 4;
+#endif
+		return 7;
+
+	case GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS:
+		return 8;
+		
+	case GD5FXGQ4XA_STATUS_ECC_ERROR:
+		return -EBADMSG;
+
+	default:
+		break;
+	}
+
+	return -EINVAL;
+}
+
+
 static const struct spinand_info gigadevice_spinand_table[] = {
 	SPINAND_INFO("GD5F1GQ5RExxG",
 		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x41),
@@ -417,6 +460,16 @@
 		     SPINAND_HAS_QE_BIT,
 		     SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout,
 				     gd5f4gq6re_ecc_get_status)),
+	SPINAND_INFO("GD5F4GM8RExxG", 
+	         SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY,0x85),
+		     NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 1, 1),
+		     NAND_ECCREQ(8, 512),
+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+					      &write_cache_variants,
+					      &update_cache_variants),
+		     SPINAND_HAS_QE_BIT,
+		     SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout,
+				     gd5f4gm8_ecc_get_status)),				     
 };
 
 static const struct spinand_manufacturer_ops gigadevice_spinand_manuf_ops = {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/spinand_ramdump.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/spinand_ramdump.c
index 189dc03..05afd98 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/spinand_ramdump.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/mtd/nand/spi/spinand_ramdump.c
@@ -107,6 +107,8 @@
 	{0x0B, 0x53, 0x77, 4096, 12, 256, 18, 2048, 0x40000, 1},
 	/*UNIM UM19A0LISW 128M SPI-NAND*/
 	{0xB0, 0x15, 0x77, 2048, 11, 64, 17, 1024, 0x20000, 1},
+	//GD5F4GM8XEXXG
+    {0xC8, 0x85, 0x77, 2048, 11, 128, 17, 4096, 0x20000, 1},	
 	{0}
 };