[PATCH] MTD: NAND Add support for MLC nand with alternate BB marker locations

Nishanth Menon menon.nishanth at gmail.com
Fri Feb 6 05:34:45 EST 2009


Reuben Dowle said the following on 02/03/2009 09:20 PM:
> This patch adds support for some MLC NAND flashes that place the BB
> marker in the LAST page of the bad block rather than the FIRST page used
> for SLC NAND and other types of MLC nand.
>
> Lifted from Samsung datasheet for K9LG8G08U0A (1Gbyte MLC NAND):
> "
>
>   
link to the datasheet might be quick ;)..
> Signed-off-by: Reuben Dowle <reuben.dowle at navico.com>
> ---
>  drivers/mtd/nand/nand_base.c |   12 ++++++++++++
>  drivers/mtd/nand/nand_bbt.c  |    3 +++
>  include/linux/mtd/nand.h     |    3 ++-
>  3 files changed, 17 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> old mode 100644
> new mode 100755
> index 0c3afcc..a76ff7b
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -306,6 +306,9 @@ static int nand_block_bad(struct mtd_info *mtd,
> loff_t ofs, int getchip)
>  
>  	page = (int)(ofs >> chip->page_shift) & chip->pagemask;
>  
> +	if( chip->options & NAND_BB_LAST_PAGE )
>   
formatting... if( chip Vs if (chip.. did you run checkpatch.pl to verify
the patch?
> +		ofs += (mtd->erasesize - mtd->writesize);
>   
Would we consider extending bbt_desc as a generic handling technique for
all current and future NAND and kill the need ofchip->options for
BB_LAST_PAGE, ALL_PAGES etc? The argument being: what if a different
manufacturer uses last 2 pages of nand or 2 pages at a different page
offset - in all cases ALL_PAGES would not be efficient enough)..

Regards,
Nishanth Menon
Regards,
Nishanth Menon



More information about the linux-mtd mailing list