Commit 00f5e098a16411ec5d5508815d17edf5bbd79909
1 parent
05d90d89f9
Exists in
master
arm:omap:nand - BCH8 read path corrected.
NAND read path for BCH8 is corrected to handle reading of erased pages. Previously on nand read, ecc was taken from wrong offset in oob_poi buffer and was giving non-0xff data and hence was giving ecc uncorrectable issue on erased pages. Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
Showing 1 changed file with 3 additions and 4 deletions Side-by-side Diff
drivers/mtd/nand/omap2.c
... | ... | @@ -816,7 +816,7 @@ |
816 | 816 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
817 | 817 | uint8_t *ecc_code = chip->buffers->ecccode; |
818 | 818 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
819 | - uint8_t *oob = chip->oob_poi; | |
819 | + uint8_t *oob = &chip->oob_poi[eccpos[0]]; | |
820 | 820 | uint32_t data_pos; |
821 | 821 | uint32_t oob_pos; |
822 | 822 | |
823 | 823 | |
... | ... | @@ -836,10 +836,9 @@ |
836 | 836 | /* read respective ecc from oob area */ |
837 | 837 | chip->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_pos, page); |
838 | 838 | |
839 | - if (info->ecc_opt == OMAP_ECC_BCH8_CODE_HW) { | |
839 | + if (info->ecc_opt == OMAP_ECC_BCH8_CODE_HW) | |
840 | 840 | chip->read_buf(mtd, oob, 13); |
841 | - oob++; | |
842 | - } else | |
841 | + else | |
843 | 842 | chip->read_buf(mtd, oob, eccbytes); |
844 | 843 | /* read syndrome */ |
845 | 844 | chip->ecc.calculate(mtd, p, &ecc_calc[i]); |