[U-Boot] [PATCH 1/2] ARM: mxs: Fix NAND FCB flashing

2014-05-30 Thread Joerg Krause
From: Marek Vasut ma...@denx.de

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.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
---
 include/configs/m28evk.h  | 23 +--
 include/configs/mx28evk.h | 23 +--
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 3e387c4..d6275ec 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -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} ;  \
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 9b9124a..103b76e 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -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 ;  \
- 

Re: [U-Boot] [PATCH 1/2] ARM: mxs: Fix NAND FCB flashing

2014-05-30 Thread Marek Vasut
On Friday, May 30, 2014 at 01:14:33 AM, Joerg Krause wrote:
 From: Marek Vasut ma...@denx.de
 
 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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot