* [PATCH] OMAP HSMMC: fix MMC3 dma
@ 2009-01-27 10:36 Grazvydas Ignotas
2009-01-27 12:02 ` Adrian Hunter
2009-02-08 19:10 ` David Brownell
0 siblings, 2 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2009-01-27 10:36 UTC (permalink / raw)
To: tony
Cc: drzeus-mmc, ext-adrian.hunter, linux-omap, linux-kernel,
Grazvydas Ignotas
Data transfers on third OMAP3 MMC controller don't work
because DMA line numbers are only defined for MMC1 and MMC2.
Fix that and store line numbers in mmc_omap_host structure
to reduce code size.
Tested on OMAP3 pandora board.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/mmc/host/omap_hsmmc.c | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 70d8d78..a2c4aee 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -97,6 +97,7 @@
*/
#define OMAP_MMC1_DEVID 0
#define OMAP_MMC2_DEVID 1
+#define OMAP_MMC3_DEVID 2
#define OMAP_MMC_DATADIR_NONE 0
#define OMAP_MMC_DATADIR_READ 1
@@ -148,6 +149,7 @@ struct mmc_omap_host {
int irq;
int carddetect;
int use_dma, dma_ch;
+ int dma_line_tx, dma_line_rx;
int initstr;
int slot_id;
int dbclk_enabled;
@@ -672,16 +674,10 @@ mmc_omap_start_dma_transfer(struct mmc_omap_host *host, struct mmc_request *req)
if (!(data->flags & MMC_DATA_WRITE)) {
host->dma_dir = DMA_FROM_DEVICE;
- if (host->id == OMAP_MMC1_DEVID)
- sync_dev = OMAP24XX_DMA_MMC1_RX;
- else
- sync_dev = OMAP24XX_DMA_MMC2_RX;
+ sync_dev = host->dma_line_rx;
} else {
host->dma_dir = DMA_TO_DEVICE;
- if (host->id == OMAP_MMC1_DEVID)
- sync_dev = OMAP24XX_DMA_MMC1_TX;
- else
- sync_dev = OMAP24XX_DMA_MMC2_TX;
+ sync_dev = host->dma_line_tx;
}
ret = omap_request_dma(sync_dev, "MMC/SD", mmc_omap_dma_cb,
@@ -1058,6 +1054,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
+ /* Select DMA lines */
+ switch (host->id) {
+ case OMAP_MMC1_DEVID:
+ host->dma_line_tx = OMAP24XX_DMA_MMC1_TX;
+ host->dma_line_rx = OMAP24XX_DMA_MMC1_RX;
+ break;
+ case OMAP_MMC2_DEVID:
+ host->dma_line_tx = OMAP24XX_DMA_MMC2_TX;
+ host->dma_line_rx = OMAP24XX_DMA_MMC2_RX;
+ break;
+ case OMAP_MMC3_DEVID:
+ host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
+ host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
+ break;
+ default:
+ dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
+ goto err_irq;
+ }
+
/* Request IRQ for MMC operations */
ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED,
mmc_hostname(mmc), host);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] OMAP HSMMC: fix MMC3 dma
2009-01-27 10:36 [PATCH] OMAP HSMMC: fix MMC3 dma Grazvydas Ignotas
@ 2009-01-27 12:02 ` Adrian Hunter
2009-01-27 17:00 ` Grazvydas Ignotas
2009-02-08 19:10 ` David Brownell
1 sibling, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2009-01-27 12:02 UTC (permalink / raw)
To: Grazvydas Ignotas
Cc: tony@atomide.com, drzeus-mmc@drzeus.cx,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Grazvydas Ignotas wrote:
> Data transfers on third OMAP3 MMC controller don't work
> because DMA line numbers are only defined for MMC1 and MMC2.
> Fix that and store line numbers in mmc_omap_host structure
> to reduce code size.
> Tested on OMAP3 pandora board.
>
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 31 +++++++++++++++++++++++--------
> 1 files changed, 23 insertions(+), 8 deletions(-)
>
Have you considered using the scatter-gather emulation patch:
http://marc.info/?l=linux-omap&m=122726069922195&w=2
It was reverted:
http://marc.info/?l=linux-omap&m=122904725322787&w=2
because of a hardware problem with OMAP3430 before ES3.0, but applying:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6a79e391df295bd7c2aa1309ea5031f361c197fd
seems to overcome even that.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] OMAP HSMMC: fix MMC3 dma
2009-01-27 12:02 ` Adrian Hunter
@ 2009-01-27 17:00 ` Grazvydas Ignotas
2009-01-27 17:13 ` Tony Lindgren
2009-01-28 8:35 ` Adrian Hunter
0 siblings, 2 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2009-01-27 17:00 UTC (permalink / raw)
To: Adrian Hunter
Cc: tony@atomide.com, drzeus-mmc@drzeus.cx,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
On Tue, Jan 27, 2009 at 2:02 PM, Adrian Hunter
<ext-adrian.hunter@nokia.com> wrote:
> Grazvydas Ignotas wrote:
>>
>> Data transfers on third OMAP3 MMC controller don't work
>> because DMA line numbers are only defined for MMC1 and MMC2.
>> Fix that and store line numbers in mmc_omap_host structure
>> to reduce code size.
>> Tested on OMAP3 pandora board.
>>
>> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
>> ---
>> drivers/mmc/host/omap_hsmmc.c | 31 +++++++++++++++++++++++--------
>> 1 files changed, 23 insertions(+), 8 deletions(-)
>>
>
> Have you considered using the scatter-gather emulation patch:
>
> http://marc.info/?l=linux-omap&m=122726069922195&w=2
>
> It was reverted:
>
> http://marc.info/?l=linux-omap&m=122904725322787&w=2
>
> because of a hardware problem with OMAP3430 before ES3.0, but applying:
>
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6a79e391df295bd7c2aa1309ea5031f361c197fd
>
> seems to overcome even that.
Hmm, but it still doesn't know about MMC3. But in case that SG patch
goes first, I can resend.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] OMAP HSMMC: fix MMC3 dma
2009-01-27 17:00 ` Grazvydas Ignotas
@ 2009-01-27 17:13 ` Tony Lindgren
2009-01-28 8:35 ` Adrian Hunter
1 sibling, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2009-01-27 17:13 UTC (permalink / raw)
To: Grazvydas Ignotas
Cc: Adrian Hunter, drzeus-mmc@drzeus.cx, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, Jarkko Lavinen (NMP/Helsinki)
* Grazvydas Ignotas <notasas@gmail.com> [090127 09:00]:
> On Tue, Jan 27, 2009 at 2:02 PM, Adrian Hunter
> <ext-adrian.hunter@nokia.com> wrote:
> > Grazvydas Ignotas wrote:
> >>
> >> Data transfers on third OMAP3 MMC controller don't work
> >> because DMA line numbers are only defined for MMC1 and MMC2.
> >> Fix that and store line numbers in mmc_omap_host structure
> >> to reduce code size.
> >> Tested on OMAP3 pandora board.
> >>
> >> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> >> ---
> >> drivers/mmc/host/omap_hsmmc.c | 31 +++++++++++++++++++++++--------
> >> 1 files changed, 23 insertions(+), 8 deletions(-)
> >>
> >
> > Have you considered using the scatter-gather emulation patch:
> >
> > http://marc.info/?l=linux-omap&m=122726069922195&w=2
> >
> > It was reverted:
> >
> > http://marc.info/?l=linux-omap&m=122904725322787&w=2
> >
> > because of a hardware problem with OMAP3430 before ES3.0, but applying:
> >
> >
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6a79e391df295bd7c2aa1309ea5031f361c197fd
> >
> > seems to overcome even that.
>
> Hmm, but it still doesn't know about MMC3. But in case that SG patch
> goes first, I can resend.
On related news, looks like the hsmmc.c has finally hit the mainline
tree!
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] OMAP HSMMC: fix MMC3 dma
2009-01-27 17:00 ` Grazvydas Ignotas
2009-01-27 17:13 ` Tony Lindgren
@ 2009-01-28 8:35 ` Adrian Hunter
1 sibling, 0 replies; 6+ messages in thread
From: Adrian Hunter @ 2009-01-28 8:35 UTC (permalink / raw)
To: Grazvydas Ignotas
Cc: tony@atomide.com, drzeus-mmc@drzeus.cx,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Grazvydas Ignotas wrote:
> On Tue, Jan 27, 2009 at 2:02 PM, Adrian Hunter
> <ext-adrian.hunter@nokia.com> wrote:
>> Grazvydas Ignotas wrote:
>>> Data transfers on third OMAP3 MMC controller don't work
>>> because DMA line numbers are only defined for MMC1 and MMC2.
>>> Fix that and store line numbers in mmc_omap_host structure
>>> to reduce code size.
>>> Tested on OMAP3 pandora board.
>>>
>>> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
>>> ---
>>> drivers/mmc/host/omap_hsmmc.c | 31 +++++++++++++++++++++++--------
>>> 1 files changed, 23 insertions(+), 8 deletions(-)
>>>
>> Have you considered using the scatter-gather emulation patch:
>>
>> http://marc.info/?l=linux-omap&m=122726069922195&w=2
>>
>> It was reverted:
>>
>> http://marc.info/?l=linux-omap&m=122904725322787&w=2
>>
>> because of a hardware problem with OMAP3430 before ES3.0, but applying:
>>
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6a79e391df295bd7c2aa1309ea5031f361c197fd
>>
>> seems to overcome even that.
>
> Hmm, but it still doesn't know about MMC3. But in case that SG patch
> goes first, I can resend.
I just meant, you might be interested because it gives better performance.
No, it doesn't know about MMC3, but it does hit some of the same lines of
code.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] OMAP HSMMC: fix MMC3 dma
2009-01-27 10:36 [PATCH] OMAP HSMMC: fix MMC3 dma Grazvydas Ignotas
2009-01-27 12:02 ` Adrian Hunter
@ 2009-02-08 19:10 ` David Brownell
1 sibling, 0 replies; 6+ messages in thread
From: David Brownell @ 2009-02-08 19:10 UTC (permalink / raw)
To: Grazvydas Ignotas
Cc: tony, drzeus-mmc, ext-adrian.hunter, linux-omap, linux-kernel
On Tuesday 27 January 2009, Grazvydas Ignotas wrote:
> @@ -1058,6 +1054,25 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
> OMAP_HSMMC_WRITE(host->base, HCTL,
> OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
>
> + /* Select DMA lines */
> + switch (host->id) {
> + case OMAP_MMC1_DEVID:
> + host->dma_line_tx = OMAP24XX_DMA_MMC1_TX;
> + host->dma_line_rx = OMAP24XX_DMA_MMC1_RX;
> + break;
Actually the cleanest way to do that is through IORESOURCE_DMA
type resources associated with the platform devices ... but
doing it that way requires reworking the MMC platform device
setup logic. Which I can understand wanting to avoid here.
(I think that rework is worth doing for multiple reasons; this
is just one more.)
> + case OMAP_MMC2_DEVID:
> + host->dma_line_tx = OMAP24XX_DMA_MMC2_TX;
> + host->dma_line_rx = OMAP24XX_DMA_MMC2_RX;
> + break;
> + case OMAP_MMC3_DEVID:
> + host->dma_line_tx = OMAP34XX_DMA_MMC3_TX;
> + host->dma_line_rx = OMAP34XX_DMA_MMC3_RX;
> + break;
> + default:
> + dev_err(mmc_dev(host->mmc), "Invalid MMC id\n");
> + goto err_irq;
> + }
> +
> /* Request IRQ for MMC operations */
> ret = request_irq(host->irq, mmc_omap_irq, IRQF_DISABLED,
> mmc_hostname(mmc), host);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-08 19:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27 10:36 [PATCH] OMAP HSMMC: fix MMC3 dma Grazvydas Ignotas
2009-01-27 12:02 ` Adrian Hunter
2009-01-27 17:00 ` Grazvydas Ignotas
2009-01-27 17:13 ` Tony Lindgren
2009-01-28 8:35 ` Adrian Hunter
2009-02-08 19:10 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox