mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] Revert "mtd: atmel_nand: optimize read/write buffer functions"
Date: Fri, 23 Nov 2012 16:55:04 +0100	[thread overview]
Message-ID: <1353686104-31295-4-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1353686104-31295-1-git-send-email-plagnioj@jcrosoft.com>

As in the kernel we revert as this was supposed to work but does not yet
this may need more work on the smc to be able to use it
So for now revert it

This reverts commit 809f0f6327241504b5071622a8d573255f91a875.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/mtd/nand/atmel_nand.c |   33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 0477178..69e8171 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -159,16 +159,30 @@ static int atmel_nand_device_ready(struct mtd_info *mtd)
  */
 static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
 {
-	struct nand_chip *chip = mtd->priv;
+	struct nand_chip	*nand_chip = mtd->priv;
 
-	memcpy_fromio(buf, chip->IO_ADDR_R, len);
+	readsb(nand_chip->IO_ADDR_R, buf, len);
+}
+
+static void atmel_read_buf16(struct mtd_info *mtd, u8 *buf, int len)
+{
+	struct nand_chip	*nand_chip = mtd->priv;
+
+	readsw(nand_chip->IO_ADDR_R, buf, len / 2);
 }
 
 static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 {
-	struct nand_chip *chip = mtd->priv;
+	struct nand_chip	*nand_chip = mtd->priv;
 
-	memcpy_toio(chip->IO_ADDR_W, buf, len);
+	writesb(nand_chip->IO_ADDR_W, buf, len);
+}
+
+static void atmel_write_buf16(struct mtd_info *mtd, const u8 *buf, int len)
+{
+	struct nand_chip	*nand_chip = mtd->priv;
+
+	writesw(nand_chip->IO_ADDR_W, buf, len / 2);
 }
 
 /*
@@ -1112,11 +1126,14 @@ static int __init atmel_nand_probe(struct device_d *dev)
 
 	nand_chip->chip_delay = 20;		/* 20us command delay time */
 
-	if (host->board->bus_width_16)		/* 16-bit bus width */
+	if (host->board->bus_width_16) {	/* 16-bit bus width */
 		nand_chip->options |= NAND_BUSWIDTH_16;
-
-	nand_chip->read_buf = atmel_read_buf;
-	nand_chip->write_buf = atmel_write_buf;
+		nand_chip->read_buf = atmel_read_buf16;
+		nand_chip->write_buf = atmel_write_buf16;
+	} else {
+		nand_chip->read_buf = atmel_read_buf;
+		nand_chip->write_buf = atmel_write_buf;
+	}
 
 	atmel_nand_enable(host);
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-11-23 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 15:52 [PATCH 0/4] at91: some fixes Jean-Christophe PLAGNIOL-VILLARD
2012-11-23 15:55 ` [PATCH 1/4] at91: fix timer rate Jean-Christophe PLAGNIOL-VILLARD
2012-11-23 15:55   ` [PATCH 2/4] atmel_nand: fix pmecc timeout Jean-Christophe PLAGNIOL-VILLARD
2012-11-23 15:55   ` [PATCH 3/4] at91: clock: check overclock for sam9260/9261/9263/9rl Jean-Christophe PLAGNIOL-VILLARD
2012-11-23 15:55   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-11-24  3:42     ` [PATCH 4/4] Revert "mtd: atmel_nand: optimize read/write buffer functions" 张忠山
2012-11-24  8:45       ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-25  8:11         ` 张忠山
2012-11-25 19:32           ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-26  2:17             ` 张忠山
2012-11-26  7:31 ` [PATCH 0/4] at91: some fixes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353686104-31295-4-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox