Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332624
b: refs/heads/master
c: 50ed399
h: refs/heads/master
v: v3
  • Loading branch information
Bastian Hecht authored and David Woodhouse committed Jul 6, 2012
1 parent 822ffad commit 479cd26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 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: ef4ce0bcb3c91375d2bdefd7a0e2fead95c97620
refs/heads/master: 50ed399cc3fbe5e16de78f7b62a39b8280f9001b
25 changes: 2 additions & 23 deletions trunk/drivers/mtd/nand/sh_flctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,35 +353,14 @@ static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_va
static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
uint8_t *p = buf;
struct sh_flctl *flctl = mtd_to_flctl(mtd);

for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
chip->read_buf(mtd, p, eccsize);

for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
if (flctl->hwecc_cant_correct[i])
mtd->ecc_stats.failed++;
else
mtd->ecc_stats.corrected += 0; /* FIXME */
}

chip->read_buf(mtd, buf, mtd->writesize);
return 0;
}

static void flctl_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
const uint8_t *p = buf;

for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
chip->write_buf(mtd, p, eccsize);
chip->write_buf(mtd, buf, mtd->writesize);
}

static void execmd_read_page_sector(struct mtd_info *mtd, int page_addr)
Expand Down

0 comments on commit 479cd26

Please sign in to comment.