public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexander Clouter <alex@digriz.org.uk>
To: linux-mtd@lists.infradead.org
Cc: hsweeten@visionengravers.com
Subject: [PATCH] [REPOST] mtd: extend plat_nand for (read|write)_buf
Date: Mon, 11 May 2009 19:28:01 +0100	[thread overview]
Message-ID: <20090511182801.GK32684@woodchuck> (raw)

This patch adds (write|read)_buf callbacks to plat_nand.

The NAND on the TS-7800 provisioned by the FPGA allows readw() and 
readl() to be used which gives a 2.5x speed up.  To be able to use this 
from the plat_nand driver a hook for read_buf (and also write_buf whilst 
we are in there) need to be made available.  This patch adds the hook.

This is a repost[1] of a feature asked for before[2], plus other helpful 
patches to plat_nand[3] would be welcomed if at all possible too.

[1] http://lists.infradead.org/pipermail/linux-mtd/2009-March/024747.html
[2] http://lists.infradead.org/pipermail/linux-mtd/2007-October/019659.html
[3] http://lists.infradead.org/pipermail/linux-mtd/2009-March/024780.html

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 86e1d08..4cdec46 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -61,6 +61,8 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
 	data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl;
 	data->chip.dev_ready = pdata->ctrl.dev_ready;
 	data->chip.select_chip = pdata->ctrl.select_chip;
+	data->chip.write_buf = pdata->ctrl.write_buf;
+	data->chip.read_buf = pdata->ctrl.read_buf;
 	data->chip.chip_delay = pdata->chip.chip_delay;
 	data->chip.options |= pdata->chip.options;
 
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 7efb9be..0e35375 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -584,6 +584,8 @@ struct platform_nand_chip {
  * @select_chip:	platform specific chip select function
  * @cmd_ctrl:		platform specific function for controlling
  *			ALE/CLE/nCE. Also used to write command and address
+ * @write_buf:		platform specific function for write buffer
+ * @read_buf:		platform specific function for read buffer
  * @priv:		private data to transport driver specific settings
  *
  * All fields are optional and depend on the hardware driver requirements
@@ -594,6 +596,10 @@ struct platform_nand_ctrl {
 	void		(*select_chip)(struct mtd_info *mtd, int chip);
 	void		(*cmd_ctrl)(struct mtd_info *mtd, int dat,
 				    unsigned int ctrl);
+	void		(*write_buf)(struct mtd_info *mtd,
+				    const uint8_t *buf, int len);
+	void		(*read_buf)(struct mtd_info *mtd,
+				    uint8_t *buf, int len);
 	void		*priv;
 };

             reply	other threads:[~2009-05-11 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 18:28 Alexander Clouter [this message]
2009-05-15 13:51 ` [PATCH] [REPOST] mtd: extend plat_nand for (read|write)_buf Artem Bityutskiy
2009-05-15 15:05   ` Alexander Clouter
2009-05-15 15:27     ` Alexander Clouter
2009-05-15 15:31     ` Artem Bityutskiy

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=20090511182801.GK32684@woodchuck \
    --to=alex@digriz.org.uk \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-mtd@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