summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2015-05-08 19:07:06 +0200
committerScott Wood <scottwood@freescale.com>2015-05-24 14:26:54 -0500
commitf55bc296a88c0a9d71ad363b89b54975d2aab14f (patch)
treea0eab65338b440a806a7bd4af64b5da53b990131 /drivers/mtd
parent6121560d7714d6d8e41ce1687a1388a1a8fea4cb (diff)
downloadu-boot-imx-f55bc296a88c0a9d71ad363b89b54975d2aab14f.zip
u-boot-imx-f55bc296a88c0a9d71ad363b89b54975d2aab14f.tar.gz
u-boot-imx-f55bc296a88c0a9d71ad363b89b54975d2aab14f.tar.bz2
mtd: vf610_nfc: remove caching of page in buffer
To improve performance we remember the current page in the buffer and avoid reading it twice. This implicit page cache increases complexity while does not increase performance in real world cases. This patch removes that feature. Acked-by: Bill Pringlemeir <bpringlemeir@nbsps.com> Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/vf610_nfc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index d98dd28..fa0bb9d 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -147,7 +147,6 @@ struct vf610_nfc {
uint column;
int spareonly;
int page_sz;
- int page;
/* Status and ID are in alternate locations. */
int alt_buf;
#define ALT_BUF_ID 1
@@ -347,7 +346,6 @@ static void vf610_nfc_command(struct mtd_info *mtd, unsigned command,
switch (command) {
case NAND_CMD_PAGEPROG:
- nfc->page = -1;
vf610_nfc_transfer_size(nfc->regs, nfc->page_sz);
vf610_nfc_send_commands(nfc->regs, NAND_CMD_SEQIN,
command, PROGRAM_PAGE_CMD_CODE);
@@ -367,10 +365,6 @@ static void vf610_nfc_command(struct mtd_info *mtd, unsigned command,
case NAND_CMD_SEQIN: /* Pre-read for partial writes. */
case NAND_CMD_READ0:
column = 0;
- /* Already read? */
- if (nfc->page == page)
- return;
- nfc->page = page;
vf610_nfc_transfer_size(nfc->regs, nfc->page_sz);
vf610_nfc_send_commands(nfc->regs, NAND_CMD_READ0,
NAND_CMD_READSTART, READ_PAGE_CMD_CODE);
@@ -378,7 +372,6 @@ static void vf610_nfc_command(struct mtd_info *mtd, unsigned command,
break;
case NAND_CMD_ERASE1:
- nfc->page = -1;
vf610_nfc_transfer_size(nfc->regs, 0);
vf610_nfc_send_commands(nfc->regs, command,
NAND_CMD_ERASE2, ERASE_CMD_CODE);
@@ -532,10 +525,8 @@ static inline int vf610_nfc_correct_data(struct mtd_info *mtd, u_char *dat)
flip = count_written_bits(dat, nfc->chip.ecc.size, ecc_count);
/* ECC failed. */
- if (flip > ecc_count) {
- nfc->page = -1;
+ if (flip > ecc_count)
return -1;
- }
/* Erased page. */
memset(dat, 0xff, nfc->chip.ecc.size);