Skip to contentSkip to conversation

ARM mxs Fix NAND FCB flashing

PATCH New Joerg Krause 1 participant 1 message May 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ARM mxs Fix NAND FCB flashing

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(-)
include/configs/m28evk.h +2 -1
index d6275ec..9680706 100644
@@ -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 */	\
include/configs/mx28evk.h +2 -1
index 103b76e..447089d 100644
@@ -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 */ \
Signature · 1 line
1.9.3