[PATCH] mtd: nand: add support for Samsung K9LCG08U0B

Brian Norris computersforpeace at gmail.com
Thu Jan 16 16:36:37 EST 2014


On Wed, Dec 25, 2013 at 05:18:55PM +0800, Huang Shijie wrote:
> Assume that:
>           tmp = ((extid >> 2) & 0x04) | (extid & 0x03));
> 
> From the K9LCG08U0B's datasheet, we know that:
>   the oob size is 640 when tmp is 6;
>   the oob size is 1024 when tmp is 7;
> 
> Signed-off-by: Huang Shijie <b32955 at freescale.com>
> ---
>  drivers/mtd/nand/nand_base.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ce4dec7..0d113cc 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3242,9 +3242,11 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
>  			mtd->oobsize = 512;
>  			break;
>  		case 6:
> -		default: /* Other cases are "reserved" (unknown) */
>  			mtd->oobsize = 640;
>  			break;
> +		case 7:
> +			mtd->oobsize = SZ_1K;

#include <linux/sizes.h>

Did you compile this?

Anyway, I think just using the literal 1024 is better. I can fix it up
and push myself in a bit.

> +			break;
>  		}
>  		extid >>= 2;
>  		/* Calc blocksize */

Brian



More information about the linux-mtd mailing list