Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231679
b: refs/heads/master
c: 9118ea3
h: refs/heads/master
i:
  231677: 5378ec2
  231675: ffc08ea
  231671: 06ec336
  231663: 9b57585
  231647: a766b39
  231615: 5e0b01f
  231551: 4a8433c
  231423: 879069e
v: v3
  • Loading branch information
Lars-Peter Clausen authored and David Woodhouse committed Dec 3, 2010
1 parent e2790e1 commit 3390df4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a338adafed0d09d823169161e938b1eab4dce901
refs/heads/master: 9118ea321ee320e3c670540122857ff0eba91e32
55 changes: 0 additions & 55 deletions trunk/drivers/mtd/nand/jz4740_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,58 +251,6 @@ static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat,
return 0;
}


/* Copy paste of nand_read_page_hwecc_oob_first except for different eccpos
* handling. The ecc area is for 4k chips 72 bytes long and thus does not fit
* into the eccpos array. */
static int jz_nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
struct nand_chip *chip, uint8_t *buf, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
uint8_t *p = buf;
unsigned int ecc_offset = chip->page_shift;

/* Read the OOB area first */
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);

for (i = ecc_offset; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
int stat;

chip->ecc.hwctl(mtd, NAND_ECC_READ);
chip->read_buf(mtd, p, eccsize);

stat = chip->ecc.correct(mtd, p, &chip->oob_poi[i], NULL);
if (stat < 0)
mtd->ecc_stats.failed++;
else
mtd->ecc_stats.corrected += stat;
}
return 0;
}

/* Copy-and-paste of nand_write_page_hwecc with different eccpos handling. */
static void jz_nand_write_page_hwecc(struct mtd_info *mtd,
struct nand_chip *chip, const uint8_t *buf)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
const uint8_t *p = buf;
unsigned int ecc_offset = chip->page_shift;

for (i = ecc_offset; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
chip->write_buf(mtd, p, eccsize);
chip->ecc.calculate(mtd, p, &chip->oob_poi[i]);
}

chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
}

#ifdef CONFIG_MTD_CMDLINE_PARTS
static const char *part_probes[] = {"cmdline", NULL};
#endif
Expand Down Expand Up @@ -393,9 +341,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
chip->ecc.size = 512;
chip->ecc.bytes = 9;

chip->ecc.read_page = jz_nand_read_page_hwecc_oob_first;
chip->ecc.write_page = jz_nand_write_page_hwecc;

if (pdata)
chip->ecc.layout = pdata->ecc_layout;

Expand Down

0 comments on commit 3390df4

Please sign in to comment.