Merge branch 'master' of /home/wd/git/u-boot/custodians
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 694ead6..bec9277 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -508,6 +508,8 @@
 		size_t block_offset = offset & (nand->erasesize - 1);
 		size_t write_size;
 
+		WATCHDOG_RESET ();
+
 		if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
 			printf ("Skip bad block 0x%08llx\n",
 				offset & ~(nand->erasesize - 1));
@@ -578,6 +580,8 @@
 		size_t block_offset = offset & (nand->erasesize - 1);
 		size_t read_length;
 
+		WATCHDOG_RESET ();
+
 		if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
 			printf ("Skipping bad block 0x%08llx\n",
 				offset & ~(nand->erasesize - 1));
diff --git a/nand_spl/nand_boot_fsl_elbc.c b/nand_spl/nand_boot_fsl_elbc.c
index 0d0c44e..7f14a6f 100644
--- a/nand_spl/nand_boot_fsl_elbc.c
+++ b/nand_spl/nand_boot_fsl_elbc.c
@@ -120,7 +120,7 @@
 
 			pos += page_size;
 			offs += page_size;
-		} while (offs & (block_size - 1));
+		} while ((offs & (block_size - 1)) && (pos < uboot_size));
 	}
 }