mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: atmel_nand: add SOFT_BCH support
@ 2014-07-15  9:16 Raphael Poggi
  2014-07-17  5:30 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael Poggi @ 2014-07-15  9:16 UTC (permalink / raw)
  To: barebox; +Cc: Raphael Poggi

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@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 */
 
 	if (host->board->bus_width_16) {	/* 16-bit bus width */
-- 
1.7.9.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: atmel_nand: add SOFT_BCH support
  2014-07-15  9:16 [PATCH] mtd: atmel_nand: add SOFT_BCH support Raphael Poggi
@ 2014-07-17  5:30 ` Sascha Hauer
  2014-07-17  6:53   ` Raphaël Poggi
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2014-07-17  5:30 UTC (permalink / raw)
  To: Raphael Poggi; +Cc: barebox

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@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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: atmel_nand: add SOFT_BCH support
  2014-07-17  5:30 ` Sascha Hauer
@ 2014-07-17  6:53   ` Raphaël Poggi
  0 siblings, 0 replies; 3+ messages in thread
From: Raphaël Poggi @ 2014-07-17  6:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

Thanks for applied, yes I changed the 20us to 40us for handle 8k page
NAND. I will send patchs about that.

2014-07-17 7:30 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> 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@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 |
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-17  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15  9:16 [PATCH] mtd: atmel_nand: add SOFT_BCH support Raphael Poggi
2014-07-17  5:30 ` Sascha Hauer
2014-07-17  6:53   ` Raphaël Poggi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox