mmc: tmio: Add SDIO IRQ support
Subsystems (7)
v3 cover mmc: tmio: Add SDIO IRQ support
[PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
[PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs [PATCH 4/6 v3] sh: sh7724 Enable SDIO IRQs
[PATCH 5/6 v3] sh: sh7722 Enable SDIO IRQs
[PATCH 6/6 v3] sh: sh7723 / ap325rxa enable SDIO IRQs
These patches add SDIO IRQ support for the tmio mmc cell of the sh_mobile_sdhi mfd and activate the usage of SDIO IRQs on all SoCs where sh_mobile_sdhi is currently used.
The patchset depends on:
mmc: tmio_mmc: allow multi-element scatter-gather lists
https://patchwork.kernel.org/patch/317142/
mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
https://patchwork.kernel.org/patch/317162/
mmc: tmio: merge the private header into the driver
https://patchwork.kernel.org/patch/349931/
mmc: tmio: implement a bounce buffer for unaligned DMA
https://patchwork.kernel.org/patch/349941/
Changes in v3:
- Drop the patch which disables IRQs early in remove it caused hangs during rmmod
- Disable device IRQ in tmio_mmc_clk_start/stop to avoid spurious SDIO IRQs (previously there was a small time window where this could happen)
- Fix a null pointer dereference which would have been triggered when spurious SDIO IRQs would have been generated
- Include patch for sh7723 / ap325rx
Changes in v2:
- Add TMIO_MMC_SDIO_IRQ flag, which expresses that the hardware is known to support SDIO IRQ as suggested by Magnus Damm
- Activate this flag for sh_mobile_sdhi
- Add a patch which disables IRQs early in remove
to avoid spurious SDIO IRQs, during module unload
- Patches 4-6 are unmodified but included for
completeness
PATCH v3 1/6 mmc: tmio: implement SDIO IRQ
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.
---
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(-)
drivers/mmc/host/tmio_mmc.c +78 -0
@@ -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);
include/linux/mfd/tmio.h +4 -0
@@ -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);
Signature · 1 line
1.7.2.3
Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
Hi Arnd,
Quoted 6 lines · Arnd Hannemann
This patch implements SDIO IRQ support for mfds which announce the
TMIO_MMC_SDIO_IRQflag fortmio_mmc.
IfMMC_CAP_SDIO_IRQis also set SDIO IRQ signalling is activated. Tested with a b43-based wireless SDIO card andsh_mobile_sdhi.Signed-off-by Arnd Hannemann <[email protected]>
Thanks, pushed to mmc-next for .38 with minor 80-col changes below:
drivers/mmc/host/tmio_mmc.c +6 -4
@@ -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; }
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
Hi Chris
Quoted 29 lines · Chris Ball
Hi Arnd,
Quoted 6 lines · Arnd Hannemann
This patch implements SDIO IRQ support for mfds which announce the
TMIO_MMC_SDIO_IRQflag fortmio_mmc.
IfMMC_CAP_SDIO_IRQis also set SDIO IRQ signalling is activated. Tested with a b43-based wireless SDIO card andsh_mobile_sdhi.Signed-off-by Arnd Hannemann <[email protected]>Thanks, pushed to mmc-next for .38 with minor 80-col changes below:
drivers/mmc/host/tmio_mmc.c +3
-2@@ -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);
drivers/mmc/host/tmio_mmc.c static irqreturn_t tmio_mmc_irq(int irq, void *devid) · line 629
Quoted 8 lines
drivers/mmc/host/tmio_mmc.c +3
-2@@ -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
Quoted 7 lines
drivers/mmc/host/tmio_mmc.c +0
-0tmio_mmc_enable_sdio_irq (host->mmc,0 ); goto out; }Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Re: [PATCH 1/6 v3] mmc: tmio: implement SDIO IRQ
Hi Guennadi,
Quoted 11 lines · Guennadi Liakhovetski
drivers/mmc/host/tmio_mmc.c static irqreturn_t tmio_mmc_irq(int irq, void *devid) · line 629
Quoted 5 lines
drivers/mmc/host/tmio_mmc.c +3
-2-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,
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH v3 2/6 mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
In reply to Arnd HannemannThe SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling. This patch advertises this fact to the tmio_mmc driver.
--- drivers/mfd/sh_mobile_sdhi.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/mfd/sh_mobile_sdhi.c +5 -0
@@ -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;
Signature · 1 line
1.7.2.3
Re: [PATCH 2/6 v3] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
Hi Arnd,
Quoted 15 lines · Arnd Hannemann
The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling. This patch advertises this fact to the
tmio_mmcdriver.Signed-off-by Arnd Hannemann <[email protected]>Acked-by Samuel Ortiz <[email protected]>--- drivers/mfd/sh_mobile_sdhi.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)drivers/mfd/sh_mobile_sdhi.c +0
-0@@ -131,6 +131,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)*/
drivers/mfd/sh_mobile_sdhi.c static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) · line 141
Quoted 10 lines
drivers/mfd/sh_mobile_sdhi.c +5
-0mmc_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.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH v3 3/6 ARM: mach-shmobile: sh7372 Enable SDIO IRQs
In reply to Arnd HannemannThis 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.
--- arch/arm/mach-shmobile/board-ap4evb.c | 3 ++- arch/arm/mach-shmobile/intc-sh7372.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-shmobile/board-ap4evb.c +2 -1
@@ -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, };
arch/arm/mach-shmobile/intc-sh7372.c +2 -2
@@ -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,
Signature · 1 line
1.7.2.3
Paul Mundt
AppliedRe: [PATCH 3/6 v3] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
Quoted 6 lines · 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_IRQcapability on AP4EVB. Tested with a b43-based SDIO wireless card.Signed-off-by Arnd Hannemann <[email protected]>
Applied to rmobile/sdio, thanks.
PATCH v3 4/6 sh: sh7724 Enable SDIO IRQs
In reply to Arnd HannemannThis 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.
---
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(-)
arch/sh/boards/mach-ecovec24/setup.c +2 -0
@@ -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, };
arch/sh/boards/mach-kfr2r09/setup.c +2 -0
@@ -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 = {
arch/sh/boards/mach-se/7724/setup.c +3 -0
@@ -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 = {
arch/sh/kernel/cpu/sh4a/setup-sh7724.c +2 -2
@@ -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 } },
Signature · 1 line
1.7.2.3
PATCH v3 5/6 sh: sh7722 Enable SDIO IRQs
In reply to Arnd HannemannThis 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.
---
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(-)
arch/sh/boards/mach-migor/setup.c +2 -0
@@ -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 = {
arch/sh/kernel/cpu/sh4a/setup-sh7722.c +1 -1
@@ -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 */
Signature · 1 line
1.7.2.3
PATCH v3 6/6 sh: sh7723 / ap325rxa enable SDIO IRQs
In reply to Arnd HannemannThis 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.
--- arch/sh/boards/mach-ap325rxa/setup.c | 16 ++++++++++++++++ arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)
arch/sh/boards/mach-ap325rxa/setup.c +16 -0
@@ -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 , },
arch/sh/kernel/cpu/sh4a/setup-sh7723.c +2 -2
@@ -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 } },
Signature · 1 line
1.7.2.3
Re: [PATCH 4/6 v3] sh: sh7724 Enable SDIO IRQs
Quoted 6 lines · 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_IRQcapability on ecovec, kfr2r09 and se7724.Tested with a b43-based SDIO wireless card on ecovec.
Quoted 4 lines · 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_IRQcapability on migor.
Quoted 4 lines · 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_IRQcapability on ap325rxa.
All applied to sh/sdio, thanks.