Date:2011-06-06 05:57:25 (9 years 1 month ago)
Author:Maarten ter Huurne
Commit:60a59e939c23c4fe223140083a3976bf14a3e655
Message:Revert "NAND: Optimize reading the eec data for the JZ4740 (evil hack)"

This reverts commit b05a5adf03613de371c77c3235f7d970d7cd0c71.
This hack breaks compatibility with the ChinaChip FTL as used by the native OS of the Dingoo A320.
Files: drivers/mtd/nand/nand_base.c (4 diffs)

Change Details

drivers/mtd/nand/nand_base.c
13161316    /* Read the OOB area first */
13171317    /* Read the OOB area first */
13181318    if (mtd->writesize > 512) {
1319        chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
1320        chip->read_buf(mtd, ecc_code, chip->ecc.total);
1319        chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
1320        chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
13211321        chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0, -1);
13221322    } else {
13231323        chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
...... 
13251325        chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
13261326    }
13271327
1328    for (i = 0; i < chip->ecc.total; i++)
1329        ecc_code[i] = chip->oob_poi[eccpos[i]];
1330
13281331    for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
13291332        int stat;
13301333
...... 
13791382
13801383    /* Read the OOB area first */
13811384    if (mtd->writesize > 512) {
1382        chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
1383        chip->read_buf(mtd, ecc_code, chip->ecc.total);
1385        chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
1386        chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
13841387        chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
13851388    } else {
13861389        chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
...... 
13881391        chip->cmdfunc(mtd, NAND_CMD_READ0, data_col_addr, page);
13891392    }
13901393
1394    for (i = 0; i < chip->ecc.total; i++)
1395        ecc_code[i] = chip->oob_poi[eccpos[i]];
1396
13911397    p = bufpoi + data_col_addr;
13921398
13931399    for (i = eccbytes * start_step; num_steps; num_steps--, i += eccbytes, p += eccsize) {

Archive Download the corresponding diff file



interactive