Merge "usbdump: Add support to scan maximum possible partitions"
diff --git a/board/qca/arm/common/crashdump.c b/board/qca/arm/common/crashdump.c
index 300348e..cc951d8 100644
--- a/board/qca/arm/common/crashdump.c
+++ b/board/qca/arm/common/crashdump.c
@@ -47,6 +47,7 @@
 #define CONFIG_SYS_MMC_CRASHDUMP_DEV	0
 #endif
 
+#define CONFIG_TZ_SIZE			0x400000
 DECLARE_GLOBAL_DATA_PTR;
 static qca_smem_flash_info_t *sfi = &qca_smem_flash_info;
 /* USB device id and part index used by usbdump */
@@ -495,7 +496,7 @@
 				     "EBICS_S1", strlen("EBICS_S1")))
 				dumpinfo[indx].size = gd->ram_size
 						      - dumpinfo[indx - 1].size
-						      - 0x400000;
+						      - CONFIG_TZ_SIZE;
 
 			if (usb_dump) {
 				ret = dump_to_dst (dumpinfo[indx].is_aligned_access, memaddr, dumpinfo[indx].size, dumpinfo[indx].name);
diff --git a/board/qca/arm/ipq6018/ipq6018.c b/board/qca/arm/ipq6018/ipq6018.c
index 62a14bc..2bb4f2b 100644
--- a/board/qca/arm/ipq6018/ipq6018.c
+++ b/board/qca/arm/ipq6018/ipq6018.c
@@ -71,7 +71,7 @@
 int dump_entries_n = ARRAY_SIZE(dumpinfo_n);
 
 struct dumpinfo_t dumpinfo_s[] = {
-	{ "EBICS_S0.BIN", 0x40000000, 0x8D00000, 0 },
+	{ "EBICS_S0.BIN", 0x40000000, 0xA600000, 0 },
 	{ "EBICS_S1.BIN", CONFIG_TZ_END_ADDR, 0x10000000, 0 },
 	{ "DATARAM.BIN", 0x00290000, 0x00014000, 0 },
 	{ "MSGRAM.BIN", 0x00060000, 0x00006000, 1 },
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index af828d0..d087f6c 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -819,7 +819,7 @@
 	if (offset != 0)
 		sect_num++;
 
-	if (startsect + sect_num > cur_part_info.start + total_sector)
+	if (startsect + sect_num > total_sector)
 		return -1;
 	return 0;
 }
diff --git a/include/configs/ipq6018.h b/include/configs/ipq6018.h
index 116a0ca..9ab217d 100644
--- a/include/configs/ipq6018.h
+++ b/include/configs/ipq6018.h
@@ -119,7 +119,7 @@
  * TFTP file can only be written in Linux HLOS region and WLAN AREA.
  */
 #define IPQ_TFTP_MIN_ADDR		(CONFIG_SYS_SDRAM_BASE + (16 << 20))
-#define CONFIG_TZ_END_ADDR		0x4AB00000
+#define CONFIG_TZ_END_ADDR		0x4AA00000
 #define CONFIG_SYS_SDRAM_END	((long long)CONFIG_SYS_SDRAM_BASE + gd->ram_size)
 
 #ifndef __ASSEMBLY__