* [U-Boot] [PATCH] mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector
@ 2013-08-23 7:09 Josh Wu
2013-09-04 15:14 ` [U-Boot] " Andreas Bießmann
0 siblings, 1 reply; 3+ messages in thread
From: Josh Wu @ 2013-08-23 7:09 UTC (permalink / raw)
To: u-boot
The PMECC use BCH algorithm to correct error. In BCH algorithm, the
primitive polynomial value is GF(2^13) for 512-bytes sector size. And it is
GF(2^14) for 1024-bytes sector size.
This patch will choose correct degree of the remainders(13 or 14) for
different sector size.
Tested in AT91SAM9X5-EK with MLC nand flash.
More detail can be refered to section 5.4.1 of:
AT91SAM ARM-based Embedded MPU Application Note
<http://www.atmel.com/Images/doc11127.pdf>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
drivers/mtd/nand/atmel_nand.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 96aca00..da83f06 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -827,7 +827,8 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand,
switch (mtd->writesize) {
case 2048:
case 4096:
- host->pmecc_degree = PMECC_GF_DIMENSION_13;
+ host->pmecc_degree = (sector_size == 512) ?
+ PMECC_GF_DIMENSION_13 : PMECC_GF_DIMENSION_14;
host->pmecc_cw_len = (1 << host->pmecc_degree) - 1;
host->pmecc_sector_number = mtd->writesize / sector_size;
host->pmecc_bytes_per_sector = pmecc_get_ecc_bytes(
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector
2013-08-23 7:09 [U-Boot] [PATCH] mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector Josh Wu
@ 2013-09-04 15:14 ` Andreas Bießmann
2013-09-04 15:14 ` [U-Boot] ARM: atmel: sama5d3: drop unused CONFIG_NET_MULTI Andreas Bießmann
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Bießmann @ 2013-09-04 15:14 UTC (permalink / raw)
To: u-boot
Dear Josh Wu,
Josh Wu <Josh.wu@atmel.com> writes:
>The PMECC use BCH algorithm to correct error. In BCH algorithm, the
>primitive polynomial value is GF(2^13) for 512-bytes sector size. And it is
>GF(2^14) for 1024-bytes sector size.
>
>This patch will choose correct degree of the remainders (13 or 14) for
applied to u-boot-atmel/master, thanks!
Best regards,
Andreas Bie?mann
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] ARM: atmel: sama5d3: drop unused CONFIG_NET_MULTI
2013-09-04 15:14 ` [U-Boot] " Andreas Bießmann
@ 2013-09-04 15:14 ` Andreas Bießmann
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Bießmann @ 2013-09-04 15:14 UTC (permalink / raw)
To: u-boot
Dear Bo Shen,
Bo Shen <voice.shen@gmail.com> writes:
>Drop unused CONFIG_NET_MULTI
>
>Signed-off-by: Bo Shen <voice.shen@gmail.com>
>
>---
>include/configs/sama5d3xek.h | 1 -
> 1 file changed, 1 deletion(-)
applied to u-boot-atmel/master, thanks!
Best regards,
Andreas Bie?mann
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-04 15:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 7:09 [U-Boot] [PATCH] mtd: atmel_nand: pmecc: fix bug fail to correct bit error in 1024-bytes sector Josh Wu
2013-09-04 15:14 ` [U-Boot] " Andreas Bießmann
2013-09-04 15:14 ` [U-Boot] ARM: atmel: sama5d3: drop unused CONFIG_NET_MULTI Andreas Bießmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox