[U-Boot] [U-Boot, v4] nand: Hack to support 4k page in fsl_elbc_nand

Scott Wood scottwood at freescale.com
Wed Feb 20 00:46:35 CET 2013


On Tue, Jul 03, 2012 at 11:07:26AM -0000, Rafael Beims wrote:
> Freescale FCM controller has a 2K size limitation of buffer RAM. In order
> to support the Nand flash chip with pagesize larger than 2K bytes,
> we read/write 2k data repeatedly by issuing FIR_OP_RB/FIR_OP_WB and save
> them to a large buffer.
> Because of this, the in flash layout of the oob is different from the
> default for 4096kiB page sizes. Therefore, we need to migrate the
> factory bad block markers from the original position to the new layout.
> 
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu at freescale.com>
> Signed-off-by: Liu Shuo <b35362 at freescale.com>
> Signed-off-by: Rafael Beims <rafael.beims at gmail.com>
> 
> ---
> Changes in v2:
>  - Added check to disallow the migration code to run in devices with
>  page size <= 2048
> 
> Changes in v3:
>  - Corrected memset writing beyond newoob buffer
>  - Corrected various code formatting errors
>  - Cosmetic changes
>  - Generated random magic number for migration marker
>  - Removed direct references to nand_bbt.c code
>  - Removed useless bbt free
>  - Removed useless dir variable
>  - Removed vmalloc and kmalloc calls. Only malloc() and free() used now
>  - Start searching the migration marker from the end of NAND
> 
> Changes in v4:
>  - Read all the pages of the block until migrated marker is found
>  - Write the marker in all pages of the block
> 
>  drivers/mtd/nand/fsl_elbc_nand.c |  443 +++++++++++++++++++++++++++++++++++---
>  1 files changed, 415 insertions(+), 28 deletions(-)
> 
>  	     "index %x, pes %d ps %d\n",
> @@ -256,13 +291,14 @@ static int fsl_elbc_run_command(struct mtd_info *mtd)

Sorry for the delay, but this patch is mangled and cannot be applied. 
E.g. the above diff chunk is missing the header that indicates the file
it is for (I can guess, but "git am" can't, and it suggests that part of
the patch may be missing).

> @@ -295,6 +331,7 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd,
> unsigned int command,

There is also line wrapping.

I'd also like to see at least the larger portions of the code that this
adds be ifdeffed to avoid increasing image size further for boards that
don't need it.

-Scott



More information about the U-Boot mailing list