public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] MTD: add s3c2440-specific read_buf/write_buf
@ 2007-10-19  0:43 Matt Reimer
  2007-10-19  7:47 ` Ben Dooks
       [not found] ` <f383264b0804151157i6f635045h49021f33b6fef268@mail.gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Reimer @ 2007-10-19  0:43 UTC (permalink / raw)
  To: linux-mtd; +Cc: Matt Reimer

From: Matt Reimer <mreimer@vpop.net>

Add read_buf/write_buf for s3c2440, which can read/write 32 bits at a
time rather than just 8. In my testing on an s3c2440a running at 400 MHz
with a 100 MHz HCLK, read performance improves by 36% (from 5.19 MB/s
to 7.07 MB/s).

Signed-off-by: Matt Reimer <mreimer@vpop.net>
---
 drivers/mtd/nand/s3c2410.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 5fac4c4..903db18 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -488,12 +488,24 @@ static void s3c2410_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 	readsb(this->IO_ADDR_R, buf, len);
 }
 
+static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
+{
+	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
+	readsl(info->regs + S3C2440_NFDATA, buf, len / 4);
+}
+
 static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
 	struct nand_chip *this = mtd->priv;
 	writesb(this->IO_ADDR_W, buf, len);
 }
 
+static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
+{
+	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
+	writesl(info->regs + S3C2440_NFDATA, buf, len / 4);
+}
+
 /* device management functions */
 
 static int s3c2410_nand_remove(struct platform_device *pdev)
@@ -604,6 +616,8 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
 		info->sel_bit	= S3C2440_NFCONT_nFCE;
 		chip->cmd_ctrl  = s3c2440_nand_hwcontrol;
 		chip->dev_ready = s3c2440_nand_devready;
+		chip->read_buf  = s3c2440_nand_read_buf;
+		chip->write_buf	= s3c2440_nand_write_buf;
 		break;
 
 	case TYPE_S3C2412:
-- 
1.5.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MTD: add s3c2440-specific read_buf/write_buf
  2007-10-19  0:43 [PATCH] MTD: add s3c2440-specific read_buf/write_buf Matt Reimer
@ 2007-10-19  7:47 ` Ben Dooks
       [not found] ` <f383264b0804151157i6f635045h49021f33b6fef268@mail.gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2007-10-19  7:47 UTC (permalink / raw)
  To: Matt Reimer; +Cc: Matt Reimer, linux-mtd

On Thu, Oct 18, 2007 at 05:43:07PM -0700, Matt Reimer wrote:
> From: Matt Reimer <mreimer@vpop.net>
> 
> Add read_buf/write_buf for s3c2440, which can read/write 32 bits at a
> time rather than just 8. In my testing on an s3c2440a running at 400 MHz
> with a 100 MHz HCLK, read performance improves by 36% (from 5.19 MB/s
> to 7.07 MB/s).
> 
> Signed-off-by: Matt Reimer <mreimer@vpop.net>
Acked-by: Ben Dooks <ben-linux@fluff.org>
> ---
>  drivers/mtd/nand/s3c2410.c |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> index 5fac4c4..903db18 100644
> --- a/drivers/mtd/nand/s3c2410.c
> +++ b/drivers/mtd/nand/s3c2410.c
> @@ -488,12 +488,24 @@ static void s3c2410_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
>  	readsb(this->IO_ADDR_R, buf, len);
>  }
>  
> +static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> +{
> +	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
> +	readsl(info->regs + S3C2440_NFDATA, buf, len / 4);
> +}
> +
>  static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
>  {
>  	struct nand_chip *this = mtd->priv;
>  	writesb(this->IO_ADDR_W, buf, len);
>  }
>  
> +static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
> +{
> +	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
> +	writesl(info->regs + S3C2440_NFDATA, buf, len / 4);
> +}
> +
>  /* device management functions */
>  
>  static int s3c2410_nand_remove(struct platform_device *pdev)
> @@ -604,6 +616,8 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
>  		info->sel_bit	= S3C2440_NFCONT_nFCE;
>  		chip->cmd_ctrl  = s3c2440_nand_hwcontrol;
>  		chip->dev_ready = s3c2440_nand_devready;
> +		chip->read_buf  = s3c2440_nand_read_buf;
> +		chip->write_buf	= s3c2440_nand_write_buf;
>  		break;
>  
>  	case TYPE_S3C2412:
> -- 
> 1.5.3.2
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MTD: add s3c2440-specific read_buf/write_buf
       [not found] ` <f383264b0804151157i6f635045h49021f33b6fef268@mail.gmail.com>
@ 2008-04-15 18:59   ` Matt Reimer
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Reimer @ 2008-04-15 18:59 UTC (permalink / raw)
  To: Linux MTD

On Tue, Apr 15, 2008 at 11:57 AM, Matt Reimer <mattjreimer@gmail.com> wrote:
> Can this be pushed upstream? Ben has already acked it.
>
>  http://lists.infradead.org/pipermail/linux-mtd/2007-October/019590.html
>
>  Matt

Oops, never mind; this is already in. I was checking an old tree.

Matt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-15 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19  0:43 [PATCH] MTD: add s3c2440-specific read_buf/write_buf Matt Reimer
2007-10-19  7:47 ` Ben Dooks
     [not found] ` <f383264b0804151157i6f635045h49021f33b6fef268@mail.gmail.com>
2008-04-15 18:59   ` Matt Reimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox