linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND v4 1/4] omap3: nand: prefetch in irq mode support
Date: Fri, 17 Sep 2010 10:55:04 -0700	[thread overview]
Message-ID: <20100917175504.GG29610@atomide.com> (raw)
In-Reply-To: <1284624059-1741-2-git-send-email-s-ghorai@ti.com>

* Sukumar Ghorai <s-ghorai@ti.com> [100916 00:53]:
> This patch enable prefetch-irq mode for NAND.
> 
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -467,6 +485,152 @@ static void omap_write_buf_dma_pref(struct mtd_info *mtd,
>  		omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1);
>  }
>  
> +/*
> + * omap_nand_irq - GMPC irq handler
> + * @this_irq: gpmc irq number
> + * @dev: omap_nand_info structure pointer is passed here
> + */
> +static irqreturn_t omap_nand_irq(int this_irq, void *dev)
> +{
> +	struct omap_nand_info *info = (struct omap_nand_info *) dev;
> +	u32 bytes;
> +	u32 irq_stat;
> +
> +	irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
> +	bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
> +	bytes = bytes  & 0xFFFC; /* io in multiple of 4 bytes */
> +	if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
> +		if (irq_stat & 0x2)
> +			goto done;
> +
> +		if (info->buf_len & (info->buf_len < bytes))
> +			bytes = info->buf_len;
> +		else if (!info->buf_len)
> +			bytes = 0;
> +		iowrite32_rep(info->nand.IO_ADDR_W,
> +						(u32 *)info->buf, bytes >> 2);
> +		info->buf = info->buf + bytes;
> +		info->buf_len -= bytes;
> +
> +	} else {
> +		ioread32_rep(info->nand.IO_ADDR_R,
> +						(u32 *)info->buf, bytes >> 2);
> +		info->buf = info->buf + bytes;
> +
> +		if (irq_stat & 0x2)
> +			goto done;
> +	}
> +	gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
> +	irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
> +
> +	return IRQ_HANDLED;
> +
> +done:
> +	complete(&info->comp);
> +	/* disable irq */
> +	gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0);
> +
> +	/* clear status */
> +	gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
> +	irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
> +
> +	return IRQ_HANDLED;
> +}

This handler should be in gpmc.c as it may be needed for other GPMC
connected devices on the same system. You can use chained irq handlers
to allow all the drivers to use the interrupt then.

Regards,

Tony

  reply	other threads:[~2010-09-17 17:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16  8:00 [PATCH RESEND v4 0/4] nand prefetch-irq support and ecc layout chanage Sukumar Ghorai
2010-09-16  8:00 ` [PATCH RESEND v4 1/4] omap3: nand: prefetch in irq mode support Sukumar Ghorai
2010-09-17 17:55   ` Tony Lindgren [this message]
2010-09-18 18:24     ` Ghorai, Sukumar
2010-09-21 14:58       ` Tony Lindgren
2010-09-24 12:33         ` Ghorai, Sukumar
2010-09-20 13:31     ` Ghorai, Sukumar
2010-09-21 12:54       ` Ghorai, Sukumar
2010-09-16  8:00 ` [PATCH RESEND v4 2/4] omap3: nand: configurable fifo threshold to gain the throughput Sukumar Ghorai
2010-09-16  8:00 ` [PATCH RESEND v4 3/4] omap: nand: ecc layout select from board file Sukumar Ghorai
2010-09-16  8:00 ` [PATCH RESEND v4 4/4] omap: nand: making ecc layout as compatible with romcode ecc Sukumar Ghorai

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=20100917175504.GG29610@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).