[PATCH 3/5] mtd: nand: atmel: use default ecc layout

David Brownell david-b at pacbell.net
Thu May 14 01:12:11 EDT 2009


On Wednesday 13 May 2009, Troy Kisky wrote:
> atmel should not need to override default

Doesn't this break compatibility with every system now
in the field?  As in, "install a new kernel, trash all
the data now in your NAND flash"??


> Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
> ---
>  drivers/mtd/nand/atmel_nand.c |   34 ----------------------------------
>  1 files changed, 0 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 7b52637..8537e86 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -55,32 +55,6 @@
>  
>  #include "atmel_nand_ecc.h"	/* Hardware ECC registers */
>  
> -/* oob layout for large page size
> - * bad block info is on bytes 0 and 1
> - * the bytes have to be consecutives to avoid
> - * several NAND_CMD_RNDOUT during read
> - */
> -static const struct nand_ecclayout atmel_oobinfo_large __initdata = {
> -	.eccbytes = 4,
> -	.eccpos = {60, 61, 62, 63},
> -	.oobfree = {
> -		{2, 58}
> -	},
> -};
> -
> -/* oob layout for small page size
> - * bad block info is on bytes 4 and 5
> - * the bytes have to be consecutives to avoid
> - * several NAND_CMD_RNDOUT during read
> - */
> -static const struct nand_ecclayout atmel_oobinfo_small __initdata = {
> -	.eccbytes = 4,
> -	.eccpos = {0, 1, 2, 3},
> -	.oobfree = {
> -		{6, 10}
> -	},
> -};
> -
>  struct atmel_nand_host {
>  	struct nand_chip	nand_chip;
>  	struct mtd_info		mtd;
> @@ -477,23 +451,15 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
>  		/* set ECC page size and oob layout */
>  		switch (mtd->writesize) {
>  		case 512:
> -			memcpy(&nand_chip->ecc.layout, &atmel_oobinfo_small,
> -					sizeof(nand_chip->ecc.layout));
>  			ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_528);
>  			break;
>  		case 1024:
> -			memcpy(&nand_chip->ecc.layout, &atmel_oobinfo_large,
> -					sizeof(nand_chip->ecc.layout));
>  			ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_1056);
>  			break;
>  		case 2048:
> -			memcpy(&nand_chip->ecc.layout, &atmel_oobinfo_large,
> -					sizeof(nand_chip->ecc.layout));
>  			ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_2112);
>  			break;
>  		case 4096:
> -			memcpy(&nand_chip->ecc.layout, &atmel_oobinfo_large,
> -					sizeof(nand_chip->ecc.layout));
>  			ecc_writel(host->ecc, MR, ATMEL_ECC_PAGESIZE_4224);
>  			break;
>  		default:
> -- 
> 1.5.4.3
> 
> 





More information about the linux-mtd mailing list