[PATCH] mtd: atmel_nand: add SOFT_BCH support

Sascha Hauer s.hauer at pengutronix.de
Wed Jul 16 22:30:50 PDT 2014


On Tue, Jul 15, 2014 at 11:16:40AM +0200, Raphael Poggi wrote:
> To use soft ecc with nand with 8k page, we need the BCH support.
> This commit adds the possibilty for atmel_nand to enable SOFT_BCH.
> 
> Signed-off-by: Raphaël Poggi <poggi.raph at gmail.com>
> ---
>  drivers/mtd/nand/atmel_nand.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index e9b2af7..d542a83 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -1164,6 +1164,11 @@ static int __init atmel_nand_probe(struct device_d *dev)
>  		nand_chip->ecc.mode = NAND_ECC_HW;
>  	}
>  
> +	if (IS_ENABLED(CONFIG_NAND_ECC_BCH) &&
> +		pdata->ecc_mode == NAND_ECC_SOFT_BCH) {
> +		nand_chip->ecc.mode = NAND_ECC_SOFT_BCH;
> +	}
> +
>  	nand_chip->chip_delay = 40;		/* 40us command delay time */

The mainline code has 20us here. Do you need that change?

Anyway, applied this patch.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list