Skip to contentSkip to conversation

ARM: mxs: Fix NAND FCB flashing

PATCH New Joerg Krause 2 participants 2 messages May 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: mxs: Fix NAND FCB flashing

From: Marek Vasut <[email protected]>

Fix the method of flashing FCB blocks into NAND. The new env writes all four FCB blocks and also does not scrub such a big part of the NAND. This fixed complains about busted NAND blocks in Linux.

Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/m28evk.h  | 23 +++++++++++++++++++++--
 include/configs/mx28evk.h | 23 +++++++++++++++++++++--
 2 files changed, 42 insertions(+), 4 deletions(-)
include/configs/m28evk.h +21 -2
index 3e387c4..d6275ec 100644
@@ -169,11 +169,30 @@
 		"nand info ; "						\
 		"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
 		"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+	"update_nand_write_fcb="					\
+		"setenv i ${update_nand_count} ; "			\
+		"setenv update_nand_offset 0x0 ; "			\
+		"setexpr update_nand_step "				\
+			"${update_nand_stride} * ${nand_writesize} ; "	\
+		"while test ${i} -gt 0 ; do "				\
+			"echo ${update_nand_offset} ; "			\
+			"nand scrub -y ${update_nand_offset} "		\
+				"${nand_erasesize} ; "			\
+			"nand write.raw ${loadaddr} "			\
+				"${update_nand_offset} "		\
+				"${update_nand_stride} ; "		\
+			"setexpr i ${i} - 1 ; "				\
+			"setexpr update_nand_offset "			\
+				"${update_nand_offset} + "		\
+				"${update_nand_step} ; "		\
+		"done ; "						\
+		"setenv i ; "						\
+		"setenv update_nand_offset ; "				\
+		"setenv update_nand_step\0"				\
 	"update_nand_full="		/* Update FCB, DBBT and FW */	\
 		"if tftp ${update_nand_full_filename} ; then "		\
 		"run update_nand_get_fcb_size ; "			\
-		"nand scrub -y 0x0 ${filesize} ; "			\
-		"nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "	\
+		"run update_nand_write_fcb ; "				\
 		"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
 		"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
 		"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
include/configs/mx28evk.h +21 -2
index 9b9124a..103b76e 100644
@@ -171,11 +171,30 @@
 		"nand info ; " \
 		"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
 		"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+	"update_nand_write_fcb="					\
+		"setenv i ${update_nand_count} ; "			\
+		"setenv update_nand_offset 0x0 ; "			\
+		"setexpr update_nand_step "				\
+			"${update_nand_stride} * ${nand_writesize} ; "	\
+		"while test ${i} -gt 0 ; do "				\
+			"echo ${update_nand_offset} ; "			\
+			"nand scrub -y ${update_nand_offset} "		\
+				"${nand_erasesize} ; "			\
+			"nand write.raw ${loadaddr} "			\
+				"${update_nand_offset} "		\
+				"${update_nand_stride} ; "		\
+			"setexpr i ${i} - 1 ; "				\
+			"setexpr update_nand_offset "			\
+				"${update_nand_offset} + "		\
+				"${update_nand_step} ; "		\
+		"done ; "						\
+		"setenv i ; "						\
+		"setenv update_nand_offset ; "				\
+		"setenv update_nand_step\0"				\
 	"update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
 		"if tftp ${update_nand_full_filename} ; then " \
 		"run update_nand_get_fcb_size ; " \
-		"nand scrub -y 0x0 ${filesize} ; " \
-		"nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
+		"run update_nand_write_fcb ; "				\
 		"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
 		"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
 		"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/2 ARM: mxs: Fix NAND FCB flashing

Quoted 6 lines · Joerg Krause

From: Marek Vasut <[email protected]>

Fix the method of flashing FCB blocks into NAND. The new env writes all four FCB blocks and also does not scrub such a big part of the NAND. This fixed complains about busted NAND blocks in Linux.

Please use git send-email to submit patches .

Thanks.

Best regards,
Marek Vasut