mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH for next] mtd: nand: nand_omap_gpmc: Fix GPMC_BCH_RESULT offset
@ 2018-12-19 12:27 Teresa Remmet
  2018-12-20  7:52 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Teresa Remmet @ 2018-12-19 12:27 UTC (permalink / raw)
  To: barebox

Using BCH rom code mode we start calculating with GPMC_BCH_RESULTx_1.
Fix offset for correct error correction.

Fixes: d4077860c902 ("mtd: nand: omap: unbreak BCH8 support")

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 277e23e57f7d..2dcf7e723b9f 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -676,7 +676,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
 	p = buf;
 
 	for (i = 0, j = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize, j++) {
-		__omap_calculate_ecc(mtd, &ecc_calc[i - j], j);
+		__omap_calculate_ecc(mtd, &ecc_calc[i - j], j + 1);
 		stat = omap_correct_bch(mtd, p, &ecc_code[i], &ecc_calc[i - j]);
 		if (stat < 0) {
 			mtd->ecc_stats.failed++;
-- 
2.7.4


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

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

end of thread, other threads:[~2018-12-20  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 12:27 [PATCH for next] mtd: nand: nand_omap_gpmc: Fix GPMC_BCH_RESULT offset Teresa Remmet
2018-12-20  7:52 ` Sascha Hauer

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