[PATCH 2/2] ARM mxs Fix NAND FCB flashing

Joerg Krause jkrause at posteo.de
Fri May 30 00:01:22 CEST 2014


This is a fix for the previous patch. 

It is enough to write only a single page for the FCB block instead of the whole stride.

Before writing the DBBT area and the Boot Firmware the flash area is erased.

This patch is nothing more than a workaround. There is a problem of how mxsboot generates the boot image and using the nand write.raw command. The whole story is explained in this thread:
http://lists.denx.de/pipermail/u-boot/2013-April/150950.html

I am not sure if mxsboot or nand write.raw should be fixed instead?

---
 include/configs/m28evk.h  | 3 ++-
 include/configs/mx28evk.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index d6275ec..9680706 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -180,7 +180,7 @@
 				"${nand_erasesize} ; "			\
 			"nand write.raw ${loadaddr} "			\
 				"${update_nand_offset} "		\
-				"${update_nand_stride} ; "		\
+				"0x1 ; "				\
 			"setexpr i ${i} - 1 ; "				\
 			"setexpr update_nand_offset "			\
 				"${update_nand_offset} + "		\
@@ -195,6 +195,7 @@
 		"run update_nand_write_fcb ; "				\
 		"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
 		"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
+		"nand erase ${update_nand_fcb} ${update_sz} ; " \
 		"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
 		"fi\0"							\
 	"update_nand_firmware="		/* Update only firmware */	\
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 103b76e..447089d 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -182,7 +182,7 @@
 				"${nand_erasesize} ; "			\
 			"nand write.raw ${loadaddr} "			\
 				"${update_nand_offset} "		\
-				"${update_nand_stride} ; "		\
+				"0x1 ; "				\
 			"setexpr i ${i} - 1 ; "				\
 			"setexpr update_nand_offset "			\
 				"${update_nand_offset} + "		\
@@ -197,6 +197,7 @@
 		"run update_nand_write_fcb ; "				\
 		"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
 		"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
+		"nand erase ${update_nand_fcb} ${update_sz} ; " \
 		"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
 		"fi\0" \
 	"update_nand_firmware="		/* Update only firmware */ \
-- 
1.9.3



More information about the U-Boot mailing list