* [U-Boot] [PATCH] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
@ 2011-07-11 15:19 Mike Hench
2011-07-11 19:58 ` Scott Wood
2011-07-11 22:29 ` [U-Boot] [PATCH v2] " Mike Hench
0 siblings, 2 replies; 4+ messages in thread
From: Mike Hench @ 2011-07-11 15:19 UTC (permalink / raw)
To: u-boot
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: mhench <mhench@elutions.com>
---
drivers/mtd/nand/fsl_elbc_nand.c | 32
++------------------------------
1 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c
b/drivers/mtd/nand/fsl_elbc_nand.c
index acdb431..4d1e527 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -85,7 +85,6 @@ struct fsl_elbc_ctrl {
unsigned int mdr; /* UPM/FCM Data Register value
*/
unsigned int use_mdr; /* Non zero if the MDR is to be set
*/
unsigned int oob; /* Non zero if operating on OOB data
*/
- uint8_t *oob_poi; /* Place to write ECC after read back
*/
};
/* These map to the positions used by the FCM hardware ECC generator */
@@ -436,7 +435,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;
vdbg("fsl_elbc_cmdfunc: NAND_CMD_PAGEPROG "
"writing %d bytes.\n", ctrl->index);
@@ -445,34 +443,13 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd,
unsigned int command,
* write so the HW generates the ECC.
*/
if (ctrl->oob || ctrl->column != 0 ||
- ctrl->index != mtd->writesize + mtd->oobsize) {
+ ctrl->index != mtd->writesize + mtd->oobsize)
out_be32(&lbc->fbcr, 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 && ctrl->oob_poi) {
- out_be32(&lbc->fbcr, 3);
- set_addr(mtd, 6, page_addr, 1);
-
- ctrl->read_bytes = mtd->writesize + 9;
-
- fsl_elbc_do_read(chip, 1);
- fsl_elbc_run_command(mtd);
-
- memcpy_fromio(ctrl->oob_poi + 6,
- &ctrl->addr[ctrl->index], 3);
- ctrl->index += 3;
- }
-
- ctrl->oob_poi = NULL;
return;
}
@@ -680,13 +657,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_ctrl *ctrl = priv->ctrl;
-
fsl_elbc_write_buf(mtd, buf, mtd->writesize);
fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize);
-
- ctrl->oob_poi = chip->oob_poi;
}
static struct fsl_elbc_ctrl *elbc_ctrl;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
2011-07-11 15:19 [U-Boot] [PATCH] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi Mike Hench
@ 2011-07-11 19:58 ` Scott Wood
2011-07-11 22:29 ` [U-Boot] [PATCH v2] " Mike Hench
1 sibling, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-07-11 19:58 UTC (permalink / raw)
To: u-boot
On Mon, 11 Jul 2011 11:19:12 -0400
Mike Hench <mhench@elutions.com> wrote:
> 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: mhench <mhench@elutions.com>
> ---
> drivers/mtd/nand/fsl_elbc_nand.c | 32
> ++------------------------------
> 1 files changed, 2 insertions(+), 30 deletions(-)
Patch is line wrapped.
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
2011-07-11 15:19 [U-Boot] [PATCH] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi Mike Hench
2011-07-11 19:58 ` Scott Wood
@ 2011-07-11 22:29 ` Mike Hench
2011-09-27 19:08 ` [U-Boot] [U-Boot, " Scott Wood
1 sibling, 1 reply; 4+ messages in thread
From: Mike Hench @ 2011-07-11 22:29 UTC (permalink / raw)
To: u-boot
From: mhench <mhench@elutions.com>
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.
v2: fix broken mailer
Signed-off-by: mhench <mhench@elutions.com>
---
drivers/mtd/nand/fsl_elbc_nand.c | 32 ++------------------------------
1 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index acdb431..4d1e527 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -85,7 +85,6 @@ struct fsl_elbc_ctrl {
unsigned int mdr; /* UPM/FCM Data Register value */
unsigned int use_mdr; /* Non zero if the MDR is to be set */
unsigned int oob; /* Non zero if operating on OOB data */
- uint8_t *oob_poi; /* Place to write ECC after read back */
};
/* These map to the positions used by the FCM hardware ECC generator */
@@ -436,7 +435,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;
vdbg("fsl_elbc_cmdfunc: NAND_CMD_PAGEPROG "
"writing %d bytes.\n", ctrl->index);
@@ -445,34 +443,13 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
* write so the HW generates the ECC.
*/
if (ctrl->oob || ctrl->column != 0 ||
- ctrl->index != mtd->writesize + mtd->oobsize) {
+ ctrl->index != mtd->writesize + mtd->oobsize)
out_be32(&lbc->fbcr, 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 && ctrl->oob_poi) {
- out_be32(&lbc->fbcr, 3);
- set_addr(mtd, 6, page_addr, 1);
-
- ctrl->read_bytes = mtd->writesize + 9;
-
- fsl_elbc_do_read(chip, 1);
- fsl_elbc_run_command(mtd);
-
- memcpy_fromio(ctrl->oob_poi + 6,
- &ctrl->addr[ctrl->index], 3);
- ctrl->index += 3;
- }
-
- ctrl->oob_poi = NULL;
return;
}
@@ -680,13 +657,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_ctrl *ctrl = priv->ctrl;
-
fsl_elbc_write_buf(mtd, buf, mtd->writesize);
fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize);
-
- ctrl->oob_poi = chip->oob_poi;
}
static struct fsl_elbc_ctrl *elbc_ctrl;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot, v2] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
2011-07-11 22:29 ` [U-Boot] [PATCH v2] " Mike Hench
@ 2011-09-27 19:08 ` Scott Wood
0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-09-27 19:08 UTC (permalink / raw)
To: u-boot
On Mon, Jul 11, 2011 at 12:29:43PM -0000, Mike Hench wrote:
> From: mhench <mhench@elutions.com>
>
> 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.
>
> v2: fix broken mailer
>
> Signed-off-by: mhench <mhench@elutions.com>
>
> ---
> drivers/mtd/nand/fsl_elbc_nand.c | 32 ++------------------------------
> 1 files changed, 2 insertions(+), 30 deletions(-)
Applied to u-boot-nand-flash next.
Sorry for the delay, lost track of this one and recently found it
again in Patchwork.
In the future, please use your full name in the signed-off-by line.
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-27 19:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-11 15:19 [U-Boot] [PATCH] mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi Mike Hench
2011-07-11 19:58 ` Scott Wood
2011-07-11 22:29 ` [U-Boot] [PATCH v2] " Mike Hench
2011-09-27 19:08 ` [U-Boot] [U-Boot, " Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox