diff options
author | Mike Hench <mhench@elutions.com> | 2011-07-05 19:14:48 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:15 -0400 |
commit | 52a474de0a830bdf4305ef19c3321064ce5da438 (patch) | |
tree | 97e35517e0f9eabe97fe02ee9a154774402c08f9 /drivers/mtd/nand | |
parent | fb5427508abbd635e877fabdf55795488119c2d6 (diff) |
mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
The eLBC NAND driver currently follows up each program/write operation with a
read-back of the page, in order to [ostensibly] fill in ECC data for the
caller. However, the page address used for this read is always -1, so the read
will never work correctly. Remove this useless (and potentially problematic)
block of code.
Signed-off-by: Matthew L. Creech <mlcreech@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/fsl_elbc_nand.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 3c2f03c55cac..acc27ee04749 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -75,7 +75,6 @@ struct fsl_elbc_fcm_ctrl { | |||
75 | unsigned int use_mdr; /* Non zero if the MDR is to be set */ | 75 | unsigned int use_mdr; /* Non zero if the MDR is to be set */ |
76 | unsigned int oob; /* Non zero if operating on OOB data */ | 76 | unsigned int oob; /* Non zero if operating on OOB data */ |
77 | unsigned int counter; /* counter for the initializations */ | 77 | unsigned int counter; /* counter for the initializations */ |
78 | char *oob_poi; /* Place to write ECC after read back */ | ||
79 | }; | 78 | }; |
80 | 79 | ||
81 | /* These map to the positions used by the FCM hardware ECC generator */ | 80 | /* These map to the positions used by the FCM hardware ECC generator */ |
@@ -435,7 +434,6 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, | |||
435 | 434 | ||
436 | /* PAGEPROG reuses all of the setup from SEQIN and adds the length */ | 435 | /* PAGEPROG reuses all of the setup from SEQIN and adds the length */ |
437 | case NAND_CMD_PAGEPROG: { | 436 | case NAND_CMD_PAGEPROG: { |
438 | int full_page; | ||
439 | dev_vdbg(priv->dev, | 437 | dev_vdbg(priv->dev, |
440 | "fsl_elbc_cmdfunc: NAND_CMD_PAGEPROG " | 438 | "fsl_elbc_cmdfunc: NAND_CMD_PAGEPROG " |
441 | "writing %d bytes.\n", elbc_fcm_ctrl->index); | 439 | "writing %d bytes.\n", elbc_fcm_ctrl->index); |
@@ -445,34 +443,12 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, | |||
445 | * write so the HW generates the ECC. | 443 | * write so the HW generates the ECC. |
446 | */ | 444 | */ |
447 | if (elbc_fcm_ctrl->oob || elbc_fcm_ctrl->column != 0 || | 445 | if (elbc_fcm_ctrl->oob || elbc_fcm_ctrl->column != 0 || |
448 | elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize) { | 446 | elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize) |
449 | out_be32(&lbc->fbcr, elbc_fcm_ctrl->index); | 447 | out_be32(&lbc->fbcr, elbc_fcm_ctrl->index); |
450 | full_page = 0; | 448 | else |
451 | } else { | ||
452 | out_be32(&lbc->fbcr, 0); | 449 | out_be32(&lbc->fbcr, 0); |
453 | full_page = 1; | ||
454 | } | ||
455 | 450 | ||
456 | fsl_elbc_run_command(mtd); | 451 | fsl_elbc_run_command(mtd); |
457 | |||
458 | /* Read back the page in order to fill in the ECC for the | ||
459 | * caller. Is this really needed? | ||
460 | */ | ||
461 | if (full_page && elbc_fcm_ctrl->oob_poi) { | ||
462 | out_be32(&lbc->fbcr, 3); | ||
463 | set_addr(mtd, 6, page_addr, 1); | ||
464 | |||
465 | elbc_fcm_ctrl->read_bytes = mtd->writesize + 9; | ||
466 | |||
467 | fsl_elbc_do_read(chip, 1); | ||
468 | fsl_elbc_run_command(mtd); | ||
469 | |||
470 | memcpy_fromio(elbc_fcm_ctrl->oob_poi + 6, | ||
471 | &elbc_fcm_ctrl->addr[elbc_fcm_ctrl->index], 3); | ||
472 | elbc_fcm_ctrl->index += 3; | ||
473 | } | ||
474 | |||
475 | elbc_fcm_ctrl->oob_poi = NULL; | ||
476 | return; | 452 | return; |
477 | } | 453 | } |
478 | 454 | ||
@@ -752,13 +728,8 @@ static void fsl_elbc_write_page(struct mtd_info *mtd, | |||
752 | struct nand_chip *chip, | 728 | struct nand_chip *chip, |
753 | const uint8_t *buf) | 729 | const uint8_t *buf) |
754 | { | 730 | { |
755 | struct fsl_elbc_mtd *priv = chip->priv; | ||
756 | struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand; | ||
757 | |||
758 | fsl_elbc_write_buf(mtd, buf, mtd->writesize); | 731 | fsl_elbc_write_buf(mtd, buf, mtd->writesize); |
759 | fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); | 732 | fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); |
760 | |||
761 | elbc_fcm_ctrl->oob_poi = chip->oob_poi; | ||
762 | } | 733 | } |
763 | 734 | ||
764 | static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) | 735 | static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) |