Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274904
b: refs/heads/master
c: 52a474d
h: refs/heads/master
v: v3
  • Loading branch information
Mike Hench authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 6ce590a commit c9d307c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 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: fb5427508abbd635e877fabdf55795488119c2d6
refs/heads/master: 52a474de0a830bdf4305ef19c3321064ce5da438
33 changes: 2 additions & 31 deletions trunk/drivers/mtd/nand/fsl_elbc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct fsl_elbc_fcm_ctrl {
unsigned int use_mdr; /* Non zero if the MDR is to be set */
unsigned int oob; /* Non zero if operating on OOB data */
unsigned int counter; /* counter for the initializations */
char *oob_poi; /* Place to write ECC after read back */
};

/* These map to the positions used by the FCM hardware ECC generator */
Expand Down Expand Up @@ -435,7 +434,6 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,

/* PAGEPROG reuses all of the setup from SEQIN and adds the length */
case NAND_CMD_PAGEPROG: {
int full_page;
dev_vdbg(priv->dev,
"fsl_elbc_cmdfunc: NAND_CMD_PAGEPROG "
"writing %d bytes.\n", elbc_fcm_ctrl->index);
Expand All @@ -445,34 +443,12 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
* write so the HW generates the ECC.
*/
if (elbc_fcm_ctrl->oob || elbc_fcm_ctrl->column != 0 ||
elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize) {
elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize)
out_be32(&lbc->fbcr, elbc_fcm_ctrl->index);
full_page = 0;
} else {
else
out_be32(&lbc->fbcr, 0);
full_page = 1;
}

fsl_elbc_run_command(mtd);

/* Read back the page in order to fill in the ECC for the
* caller. Is this really needed?
*/
if (full_page && elbc_fcm_ctrl->oob_poi) {
out_be32(&lbc->fbcr, 3);
set_addr(mtd, 6, page_addr, 1);

elbc_fcm_ctrl->read_bytes = mtd->writesize + 9;

fsl_elbc_do_read(chip, 1);
fsl_elbc_run_command(mtd);

memcpy_fromio(elbc_fcm_ctrl->oob_poi + 6,
&elbc_fcm_ctrl->addr[elbc_fcm_ctrl->index], 3);
elbc_fcm_ctrl->index += 3;
}

elbc_fcm_ctrl->oob_poi = NULL;
return;
}

Expand Down Expand Up @@ -752,13 +728,8 @@ static void fsl_elbc_write_page(struct mtd_info *mtd,
struct nand_chip *chip,
const uint8_t *buf)
{
struct fsl_elbc_mtd *priv = chip->priv;
struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand;

fsl_elbc_write_buf(mtd, buf, mtd->writesize);
fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize);

elbc_fcm_ctrl->oob_poi = chip->oob_poi;
}

static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
Expand Down

0 comments on commit c9d307c

Please sign in to comment.