* [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
2011-01-05 20:57 ` Chris Ball
2010-12-28 22:22 ` [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Arnd Hannemann
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
This patch implements SDIO IRQ support for mfds which
announce the TMIO_MMC_SDIO_IRQ flag for tmio_mmc.
If MMC_CAP_SDIO_IRQ is also set SDIO IRQ signalling is activated.
Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
Changes in v3:
- Fix bug which triggered when spurious SDIO IRQs happened
- Disable device IRQ in tmio_mmc_clk_start/stop to prevent
spurious SDIO IRQs from happening
Changes in v2:
- added TMIO_MMC_SDIO_IRQ flag to support the case where SDIO IRQ
interrupts are generated but SDIO IRQ signalling to the core
should not be used
- rearranged code, so that either an SDIO IRQ or a normal IRQ is
handled, this marginally increases interrupt load, but preserves
the current timing, which seems to be crucial for DMA handling
drivers/mmc/host/tmio_mmc.c | 78 +++++++++++++++++++++++++++++++++++++++++++
include/linux/mfd/tmio.h | 4 ++
2 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 57ece9d..ac47710 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -53,6 +53,8 @@
#define CTL_SD_ERROR_DETAIL_STATUS 0x2c
#define CTL_SD_DATA_PORT 0x30
#define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
#define CTL_RESET_SD 0xe0
#define CTL_SDIO_REGS 0x100
#define CTL_CLK_AND_WAIT_CTL 0x138
@@ -81,6 +83,12 @@
#define TMIO_STAT_CMD_BUSY 0x40000000
#define TMIO_STAT_ILL_ACCESS 0x80000000
+/* Definitions for values the CTRL_SDIO_STATUS register can take. */
+#define TMIO_SDIO_STAT_IOIRQ 0x0001
+#define TMIO_SDIO_STAT_EXPUB52 0x4000
+#define TMIO_SDIO_STAT_EXWT 0x8000
+#define TMIO_SDIO_MASK_ALL 0xc007
+
/* Define some IRQ masks */
/* This is the mask used at reset by the chip */
#define TMIO_MASK_ALL 0x837f031d
@@ -122,6 +130,7 @@ struct tmio_mmc_host {
struct mmc_data *data;
struct mmc_host *mmc;
int irq;
+ unsigned int sdio_irq_enabled;
/* Callbacks for clock / power control */
void (*set_pwr)(struct platform_device *host, int state);
@@ -247,6 +256,22 @@ void pr_debug_status(u32 status)
#define pr_debug_status(s) do { } while (0)
#endif
+static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+ struct tmio_mmc_host *host = mmc_priv(mmc);
+
+ if (enable) {
+ host->sdio_irq_enabled = 1;
+ sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
+ sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK,
+ (TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ));
+ } else {
+ sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, TMIO_SDIO_MASK_ALL);
+ sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
+ host->sdio_irq_enabled = 0;
+ }
+}
+
static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
{
u32 clk = 0, clock;
@@ -266,8 +291,22 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
{
+ struct mfd_cell *cell = host->pdev->dev.platform_data;
+ struct tmio_mmc_data *pdata = cell->driver_data;
+
+ /*
+ * Testing on sh-mobile showed that SDIO IRQs are unmasked when
+ * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the device IRQ
+ * here and restore the SDIO IRQ mask before re-enabling the device IRQ.
+ */
+ if (pdata->flags & TMIO_MMC_SDIO_IRQ)
+ disable_irq(host->irq);
sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
msleep(10);
+ if (pdata->flags & TMIO_MMC_SDIO_IRQ) {
+ tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
+ enable_irq(host->irq);
+ }
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
msleep(10);
@@ -275,11 +312,21 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
{
+ struct mfd_cell *cell = host->pdev->dev.platform_data;
+ struct tmio_mmc_data *pdata = cell->driver_data;
+
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
msleep(10);
+ /* see comment in tmio_mmc_clk_stop above */
+ if (pdata->flags & TMIO_MMC_SDIO_IRQ)
+ disable_irq(host->irq);
sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
msleep(10);
+ if (pdata->flags & TMIO_MMC_SDIO_IRQ) {
+ tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
+ enable_irq(host->irq);
+ }
}
static void reset(struct tmio_mmc_host *host)
@@ -556,7 +605,10 @@ static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
static irqreturn_t tmio_mmc_irq(int irq, void *devid)
{
struct tmio_mmc_host *host = devid;
+ struct mfd_cell *cell = host->pdev->dev.platform_data;
+ struct tmio_mmc_data *pdata = cell->driver_data;
unsigned int ireg, irq_mask, status;
+ unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
pr_debug("MMC IRQ begin\n");
@@ -564,6 +616,29 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
ireg = status & TMIO_MASK_IRQ & ~irq_mask;
+ sdio_ireg = 0;
+ if (!ireg && pdata->flags & TMIO_MMC_SDIO_IRQ) {
+ sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
+ sdio_irq_mask = sd_ctrl_read16(host, CTL_SDIO_IRQ_MASK);
+ sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL & ~sdio_irq_mask;
+
+ sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
+
+ if (sdio_ireg && !host->sdio_irq_enabled) {
+ pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
+ sdio_status, sdio_irq_mask, sdio_ireg);
+ tmio_mmc_enable_sdio_irq(host->mmc, 0);
+ goto out;
+ }
+
+ if (host->mmc->caps & MMC_CAP_SDIO_IRQ &&
+ sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
+ mmc_signal_sdio_irq(host->mmc);
+
+ if (sdio_ireg)
+ goto out;
+ }
+
pr_debug_status(status);
pr_debug_status(ireg);
@@ -1033,6 +1108,7 @@ static const struct mmc_host_ops tmio_mmc_ops = {
.set_ios = tmio_mmc_set_ios,
.get_ro = tmio_mmc_get_ro,
.get_cd = tmio_mmc_get_cd,
+ .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
};
#ifdef CONFIG_PM
@@ -1147,6 +1223,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
goto cell_disable;
disable_mmc_irqs(host, TMIO_MASK_ALL);
+ if (pdata->flags & TMIO_MMC_SDIO_IRQ)
+ tmio_mmc_enable_sdio_irq(mmc, 0);
ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index dbfc053..8e70310 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -57,6 +57,10 @@
* is configured in 4-bit mode.
*/
#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
+/*
+ * Some controllers can support SDIO IRQ signalling.
+ */
+#define TMIO_MMC_SDIO_IRQ (1 << 2)
int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
2010-12-28 22:22 ` [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ Arnd Hannemann
@ 2011-01-05 20:57 ` Chris Ball
2011-01-05 21:09 ` Guennadi Liakhovetski
0 siblings, 1 reply; 13+ messages in thread
From: Chris Ball @ 2011-01-05 20:57 UTC (permalink / raw)
To: Arnd Hannemann
Cc: linux-mmc, Magnus Damm, linux-sh, g.liakhovetski, Ian Molton,
Samuel Ortiz
Hi Arnd,
On Tue, Dec 28, 2010 at 11:22:31PM +0100, Arnd Hannemann wrote:
> This patch implements SDIO IRQ support for mfds which
> announce the TMIO_MMC_SDIO_IRQ flag for tmio_mmc.
> If MMC_CAP_SDIO_IRQ is also set SDIO IRQ signalling is activated.
> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Thanks, pushed to mmc-next for .38 with minor 80-col changes below:
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index d74cdac..8d55b8a 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -298,8 +298,9 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
/*
* Testing on sh-mobile showed that SDIO IRQs are unmasked when
- * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the device IRQ
- * here and restore the SDIO IRQ mask before re-enabling the device IRQ.
+ * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the
+ * device IRQ here and restore the SDIO IRQ mask before
+ * re-enabling the device IRQ.
*/
if (pdata->flags & TMIO_MMC_SDIO_IRQ)
disable_irq(host->irq);
@@ -623,8 +624,9 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
if (sdio_ireg && !host->sdio_irq_enabled) {
- pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
- sdio_status, sdio_irq_mask, sdio_ireg);
+ pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! "
+ "0x%04x 0x%04x 0x%04x\n",
+ sdio_status, sdio_irq_mask, sdio_ireg);
tmio_mmc_enable_sdio_irq(host->mmc, 0);
goto out;
}
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
2011-01-05 20:57 ` Chris Ball
@ 2011-01-05 21:09 ` Guennadi Liakhovetski
2011-01-05 22:10 ` Chris Ball
0 siblings, 1 reply; 13+ messages in thread
From: Guennadi Liakhovetski @ 2011-01-05 21:09 UTC (permalink / raw)
To: Chris Ball
Cc: Arnd Hannemann, linux-mmc, Magnus Damm, linux-sh, Ian Molton,
Samuel Ortiz
Hi Chris
On Wed, 5 Jan 2011, Chris Ball wrote:
> Hi Arnd,
>
> On Tue, Dec 28, 2010 at 11:22:31PM +0100, Arnd Hannemann wrote:
> > This patch implements SDIO IRQ support for mfds which
> > announce the TMIO_MMC_SDIO_IRQ flag for tmio_mmc.
> > If MMC_CAP_SDIO_IRQ is also set SDIO IRQ signalling is activated.
> > Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
> >
> > Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>
> Thanks, pushed to mmc-next for .38 with minor 80-col changes below:
>
> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index d74cdac..8d55b8a 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -298,8 +298,9 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
>
> /*
> * Testing on sh-mobile showed that SDIO IRQs are unmasked when
> - * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the device IRQ
> - * here and restore the SDIO IRQ mask before re-enabling the device IRQ.
> + * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the
> + * device IRQ here and restore the SDIO IRQ mask before
> + * re-enabling the device IRQ.
> */
> if (pdata->flags & TMIO_MMC_SDIO_IRQ)
> disable_irq(host->irq);
> @@ -623,8 +624,9 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
> sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
>
> if (sdio_ireg && !host->sdio_irq_enabled) {
> - pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
> - sdio_status, sdio_irq_mask, sdio_ireg);
> + pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! "
> + "0x%04x 0x%04x 0x%04x\n",
> + sdio_status, sdio_irq_mask, sdio_ireg);
Don't think this is a good idea. 80-columns restriction stopped being a
requirement since some time, and - it has always been explicitly requested
_not_ to break strings in prints because of this. Yes, it is not very
likely, that someone will grep for "IRQ.*\%" or similar, still, I would
prefer to keep the original version.
Thanks
Guennadi
> tmio_mmc_enable_sdio_irq(host->mmc, 0);
> goto out;
> }
> --
> Chris Ball <cjb@laptop.org> <http://printf.net/>
> One Laptop Per Child
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
2011-01-05 21:09 ` Guennadi Liakhovetski
@ 2011-01-05 22:10 ` Chris Ball
0 siblings, 0 replies; 13+ messages in thread
From: Chris Ball @ 2011-01-05 22:10 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Arnd Hannemann, linux-mmc, Magnus Damm, linux-sh, Ian Molton,
Samuel Ortiz
Hi Guennadi,
On Wed, Jan 05, 2011 at 10:09:42PM +0100, Guennadi Liakhovetski wrote:
> > - pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
> > - sdio_status, sdio_irq_mask, sdio_ireg);
> > + pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! "
> > + "0x%04x 0x%04x 0x%04x\n",
> > + sdio_status, sdio_irq_mask, sdio_ireg);
>
> Don't think this is a good idea. 80-columns restriction stopped being a
> requirement since some time, and - it has always been explicitly requested
> _not_ to break strings in prints because of this. Yes, it is not very
> likely, that someone will grep for "IRQ.*\%" or similar, still, I would
> prefer to keep the original version.
Okay, I'll use the original version of the pr_warning().
Thanks,
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
2010-12-28 22:22 ` [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
2011-01-05 20:58 ` [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for Chris Ball
2010-12-28 22:22 ` [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs Arnd Hannemann
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling.
This patch advertises this fact to the tmio_mmc driver.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
---
drivers/mfd/sh_mobile_sdhi.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index 3ca20ec..0a7df44 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -131,6 +131,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
*/
mmc_data->flags |= TMIO_MMC_BLKSZ_2BYTES;
+ /*
+ * All SDHI blocks support SDIO IRQ signalling.
+ */
+ mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
+
if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
priv->param_tx.slave_id = p->dma_slave_tx;
priv->param_rx.slave_id = p->dma_slave_rx;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for
2010-12-28 22:22 ` [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Arnd Hannemann
@ 2011-01-05 20:58 ` Chris Ball
0 siblings, 0 replies; 13+ messages in thread
From: Chris Ball @ 2011-01-05 20:58 UTC (permalink / raw)
To: Arnd Hannemann
Cc: linux-mmc, Magnus Damm, linux-sh, g.liakhovetski, Ian Molton,
Samuel Ortiz
Hi Arnd,
On Tue, Dec 28, 2010 at 11:22:32PM +0100, Arnd Hannemann wrote:
> The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling.
> This patch advertises this fact to the tmio_mmc driver.
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
> ---
> drivers/mfd/sh_mobile_sdhi.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
> index 3ca20ec..0a7df44 100644
> --- a/drivers/mfd/sh_mobile_sdhi.c
> +++ b/drivers/mfd/sh_mobile_sdhi.c
> @@ -131,6 +131,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
> */
> mmc_data->flags |= TMIO_MMC_BLKSZ_2BYTES;
>
> + /*
> + * All SDHI blocks support SDIO IRQ signalling.
> + */
> + mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
> +
> if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
> priv->param_tx.slave_id = p->dma_slave_tx;
> priv->param_rx.slave_id = p->dma_slave_rx;
Thanks, pushed to mmc-next for .38. You can send on the arch
dependencies now, explaining that the code they depend on is
waiting in -next.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
2010-12-28 22:22 ` [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ Arnd Hannemann
2010-12-28 22:22 ` [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
2011-01-06 4:11 ` Paul Mundt
2010-12-28 22:22 ` [PATCH 4/6 v3] sh: sh7724 " Arnd Hannemann
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on AP4EVB. Tested with a b43-based SDIO wireless card.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
arch/arm/mach-shmobile/board-ap4evb.c | 3 ++-
arch/arm/mach-shmobile/intc-sh7372.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 16eba07..5763b0d 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -310,6 +310,7 @@ static u64 sdhi0_dma_mask = DMA_BIT_MASK(32);
static struct sh_mobile_sdhi_info sdhi0_info = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct resource sdhi0_resources[] = {
@@ -344,7 +345,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
.tmio_ocr_mask = MMC_VDD_165_195,
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
- .tmio_caps = MMC_CAP_NEEDS_POLL,
+ .tmio_caps = MMC_CAP_NEEDS_POLL | MMC_CAP_SDIO_IRQ,
.get_cd = slot_cn7_get_cd,
};
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 30b2f40..f78a1ea 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -230,10 +230,10 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
{ SCIFB, SCIFA5, SCIFA4, MSIOF1,
0, 0, MSIOF2, 0 } },
{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
- { DISABLED, DISABLED, ENABLED, ENABLED,
+ { DISABLED, ENABLED, ENABLED, ENABLED,
FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
- { 0, DISABLED, ENABLED, ENABLED,
+ { 0, ENABLED, ENABLED, ENABLED,
TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
{ CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
2010-12-28 22:22 ` [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs Arnd Hannemann
@ 2011-01-06 4:11 ` Paul Mundt
0 siblings, 0 replies; 13+ messages in thread
From: Paul Mundt @ 2011-01-06 4:11 UTC (permalink / raw)
To: Arnd Hannemann
Cc: linux-mmc, Magnus Damm, linux-sh, g.liakhovetski, Ian Molton,
Samuel Ortiz
On Tue, Dec 28, 2010 at 11:22:33PM +0100, Arnd Hannemann wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure interrupts
> are handled announce the MMC_CAP_SDIO_IRQ capability
> on AP4EVB. Tested with a b43-based SDIO wireless card.
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Applied to rmobile/sdio, thanks.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/6 v3] sh: sh7724 Enable SDIO IRQs
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
` (2 preceding siblings ...)
2010-12-28 22:22 ` [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
2011-01-06 4:12 ` Paul Mundt
2010-12-28 22:22 ` [PATCH 5/6 v3] sh: sh7722 " Arnd Hannemann
2010-12-28 22:22 ` [PATCH 6/6 v3] sh: sh7723 / ap325rxa enable " Arnd Hannemann
5 siblings, 1 reply; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure interrupt
are handled announce the MMC_CAP_SDIO_IRQ capability
on ecovec, kfr2r09 and se7724.
Tested with a b43-based SDIO wireless card on ecovec.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
Changes in v3:
- Added missing includes for se7724 and kfr2r09.
arch/sh/boards/mach-ecovec24/setup.c | 2 ++
arch/sh/boards/mach-kfr2r09/setup.c | 2 ++
arch/sh/boards/mach-se/7724/setup.c | 3 +++
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 4 ++--
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 4e0e65a..36d7ca7 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -476,6 +476,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
.set_pwr = sdhi0_set_pwr,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct resource sdhi0_resources[] = {
@@ -517,6 +518,7 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
static struct sh_mobile_sdhi_info sdhi1_info = {
.dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
.set_pwr = sdhi1_set_pwr,
};
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 1423aa3..4e2eefe 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -12,6 +12,7 @@
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
#include <linux/mfd/tmio.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/onenand.h>
@@ -369,6 +369,7 @@ static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct platform_device kfr2r09_sh_sdhi0_device = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index ab187c9..4eeb7c7 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -16,6 +16,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/delay.h>
#include <linux/smc91x.h>
@@ -470,6 +470,7 @@ static struct resource sdhi0_cn7_resources[] = {
static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct platform_device sdhi0_cn7_device = {
@@ -504,6 +505,7 @@ static struct resource sdhi1_cn8_resources[] = {
static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct platform_device sdhi1_cn8_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 828c965..c598a7f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -1144,7 +1144,7 @@ static struct intc_group groups[] __initdata = {
static struct intc_mask_reg mask_registers[] __initdata = {
{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
{ 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
- 0, DISABLED, ENABLED, ENABLED } },
+ 0, ENABLED, ENABLED, ENABLED } },
{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
{ VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0,
DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } },
@@ -1166,7 +1166,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
{ I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI,
I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } },
{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
- { DISABLED, DISABLED, ENABLED, ENABLED,
+ { DISABLED, ENABLED, ENABLED, ENABLED,
0, 0, SCIFA5, FSI } },
{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
{ 0, 0, 0, CMT, 0, USB1, USB0, 0 } },
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 4/6 v3] sh: sh7724 Enable SDIO IRQs
2010-12-28 22:22 ` [PATCH 4/6 v3] sh: sh7724 " Arnd Hannemann
@ 2011-01-06 4:12 ` Paul Mundt
0 siblings, 0 replies; 13+ messages in thread
From: Paul Mundt @ 2011-01-06 4:12 UTC (permalink / raw)
To: Arnd Hannemann
Cc: linux-mmc, Magnus Damm, linux-sh, g.liakhovetski, Ian Molton,
Samuel Ortiz
On Tue, Dec 28, 2010 at 11:22:34PM +0100, Arnd Hannemann wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure interrupt
> are handled announce the MMC_CAP_SDIO_IRQ capability
> on ecovec, kfr2r09 and se7724.
>
> Tested with a b43-based SDIO wireless card on ecovec.
On Tue, Dec 28, 2010 at 11:22:35PM +0100, Arnd Hannemann wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure SDIO IRQs
> are used, announce the MMC_CAP_SDIO_IRQ capability
> on migor.
On Tue, Dec 28, 2010 at 11:22:36PM +0100, Arnd Hannemann wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure SDIO IRQs
> are used announce the MMC_CAP_SDIO_IRQ capability
> on ap325rxa.
All applied to sh/sdio, thanks.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/6 v3] sh: sh7722 Enable SDIO IRQs
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
` (3 preceding siblings ...)
2010-12-28 22:22 ` [PATCH 4/6 v3] sh: sh7724 " Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
2010-12-28 22:22 ` [PATCH 6/6 v3] sh: sh7723 / ap325rxa enable " Arnd Hannemann
5 siblings, 0 replies; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure SDIO IRQs
are used, announce the MMC_CAP_SDIO_IRQ capability
on migor.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
Changes in v3:
- Added missing include to migor.
arch/sh/boards/mach-migor/setup.c | 2 ++
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 2 +-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 5dc72b4..affeec4 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -14,6 +14,7 @@
#include <linux/input.h>
#include <linux/input/sh_keysc.h>
#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/nand.h>
#include <linux/i2c.h>
@@ -413,6 +414,7 @@ static struct resource sdhi_cn9_resources[] = {
static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
};
static struct platform_device sdhi_cn9_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index d551ed8..a164f89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -699,7 +699,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
{ I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
- { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
+ { DISABLED, ENABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
{ 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
{ 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 6/6 v3] sh: sh7723 / ap325rxa enable SDIO IRQs
2010-12-28 22:22 [PATCH 0/6 v3] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
` (4 preceding siblings ...)
2010-12-28 22:22 ` [PATCH 5/6 v3] sh: sh7722 " Arnd Hannemann
@ 2010-12-28 22:22 ` Arnd Hannemann
5 siblings, 0 replies; 13+ messages in thread
From: Arnd Hannemann @ 2010-12-28 22:22 UTC (permalink / raw)
To: linux-mmc
Cc: Magnus Damm, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
Arnd Hannemann
This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure SDIO IRQs
are used announce the MMC_CAP_SDIO_IRQ capability
on ap325rxa.
Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Acked-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/mach-ap325rxa/setup.c | 16 ++++++++++++++++
arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 4 ++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 07ea908..3e5fc3b 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -14,6 +14,8 @@
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
+#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/sh_flctl.h>
#include <linux/delay.h>
@@ -430,11 +432,18 @@ static struct resource sdhi0_cn3_resources[] = {
},
};
+static struct sh_mobile_sdhi_info sdhi0_cn3_data = {
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
+};
+
static struct platform_device sdhi0_cn3_device = {
.name = "sh_mobile_sdhi",
.id = 0, /* "sdhi0" clock */
.num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
.resource = sdhi0_cn3_resources,
+ .dev = {
+ .platform_data = &sdhi0_cn3_data,
+ },
.archdata = {
.hwblk_id = HWBLK_SDHI0,
},
@@ -453,11 +462,18 @@ static struct resource sdhi1_cn7_resources[] = {
},
};
+static struct sh_mobile_sdhi_info sdhi1_cn7_data = {
+ .tmio_caps = MMC_CAP_SDIO_IRQ,
+};
+
static struct platform_device sdhi1_cn7_device = {
.name = "sh_mobile_sdhi",
.id = 1, /* "sdhi1" clock */
.num_resources = ARRAY_SIZE(sdhi1_cn7_resources),
.resource = sdhi1_cn7_resources,
+ .dev = {
+ .platform_data = &sdhi1_cn7_data,
+ },
.archdata = {
.hwblk_id = HWBLK_SDHI1,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 0eadefd..d764122 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -719,7 +719,7 @@ static struct intc_group groups[] __initdata = {
static struct intc_mask_reg mask_registers[] __initdata = {
{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
{ 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
- 0, DISABLED, ENABLED, ENABLED } },
+ 0, ENABLED, ENABLED, ENABLED } },
{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
{ VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } },
{ 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */
@@ -736,7 +736,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
{ I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
- { 0, DISABLED, ENABLED, ENABLED,
+ { 0, ENABLED, ENABLED, ENABLED,
0, 0, SCIFA_SCIFA2, SIU_SIUI } },
{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
{ 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } },
--
1.7.2.3
^ permalink raw reply related [flat|nested] 13+ messages in thread