All of lore.kernel.org
 help / color / mirror / Atom feed
* DMA omap
@ 2007-10-24 19:28 Luís Cargnini
  2007-10-26  0:32 ` Nishanth Menon
  0 siblings, 1 reply; 3+ messages in thread
From: Luís Cargnini @ 2007-10-24 19:28 UTC (permalink / raw)
  To: OMAP

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Dear fellows,
I want to use DMA on my driver, please someone can help me,
how could I use the functions omap_mcbsp_xmit_buffer, omap_mcbsp_recv_buffer
and how to obtain the DMA addres that  could be used as the parameter
dma_addr_t buffer in both functions

-- 
------------------------------------------------------------------------------
Thanks && Regards
Msc. Bsc. Luís Vitório Cargnini
IEEE Member
Electrical Engineer Faculty @ PUCRS
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500  extension: 7696
---------------------------------------------------------------------------------

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: DMA omap
  2007-10-24 19:28 DMA omap Luís Cargnini
@ 2007-10-26  0:32 ` Nishanth Menon
  2007-10-26 16:58   ` Hingkwan Huen
  0 siblings, 1 reply; 3+ messages in thread
From: Nishanth Menon @ 2007-10-26  0:32 UTC (permalink / raw)
  To: lvcargnini; +Cc: OMAP

Luís Cargnini stated on 10/24/2007 2:28 PM:
> Dear fellows,
> I want to use DMA on my driver, please someone can help me,
> how could I use the functions omap_mcbsp_xmit_buffer, omap_mcbsp_recv_buffer
> and how to obtain the DMA addres that  could be used as the parameter
> dma_addr_t buffer in both functions
I am a bit rusty around this now a days, so please correct me if I am wrong:

There used to be dma_alloc_coherent when I used to work on audio driver.
you could check up again.. there are two ways you can use this buffer:
a) cached memory: this is the general form when u do a kalloc and use
memory.. Some recommend this esp if you are doing a mmap and there is
large amoung of user space processing required-cached memory speeds up
things for u. the trouble is that when u give it to DMA, it tends to
read what is directly in SDRAM as it does not know what is in MPU Cache.
so the trick is that before you give it to dma, u need to flush the
cache.. this is a tricky business, if you have small memory buffers and
u flush often.. u will kill system performance.
b) uncached memory: u might on the other hand not want any flushing to
be done, instead allocate memory in which all accesses are done straight
to the SDRAM. This is called write-through mode. in this any access to
allocated memory will go straight to the SDRAM instead of being cached..
some folks consider this as not optimal, but again it is use case
dependent. this kind of memory can be got using dma_alloc_coherent or
it's equivalent.
Regards,
Nishanth Menon

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

* RE: DMA omap
  2007-10-26  0:32 ` Nishanth Menon
@ 2007-10-26 16:58   ` Hingkwan Huen
  0 siblings, 0 replies; 3+ messages in thread
From: Hingkwan Huen @ 2007-10-26 16:58 UTC (permalink / raw)
  To: 'Nishanth Menon', lvcargnini; +Cc: 'OMAP'

Nishanth,
I am working on the DMA implementation of our device driver on OMAP5912 as
well. In a), what function can I use to flush the cache before passing the
buffer to DMA?
Thanks,
kwan


-----Original Message-----
From: linux-omap-open-source-bounces+hkh=cypress.com@linux.omap.com
[mailto:linux-omap-open-source-bounces+hkh=cypress.com@linux.omap.com] On
Behalf Of Nishanth Menon
Sent: Thursday, October 25, 2007 5:32 PM
To: lvcargnini@gmail.com
Cc: OMAP
Subject: Re: DMA omap

Luís Cargnini stated on 10/24/2007 2:28 PM:
> Dear fellows,
> I want to use DMA on my driver, please someone can help me,
> how could I use the functions omap_mcbsp_xmit_buffer,
omap_mcbsp_recv_buffer
> and how to obtain the DMA addres that  could be used as the parameter
> dma_addr_t buffer in both functions
I am a bit rusty around this now a days, so please correct me if I am wrong:

There used to be dma_alloc_coherent when I used to work on audio driver.
you could check up again.. there are two ways you can use this buffer:
a) cached memory: this is the general form when u do a kalloc and use
memory.. Some recommend this esp if you are doing a mmap and there is
large amoung of user space processing required-cached memory speeds up
things for u. the trouble is that when u give it to DMA, it tends to
read what is directly in SDRAM as it does not know what is in MPU Cache.
so the trick is that before you give it to dma, u need to flush the
cache.. this is a tricky business, if you have small memory buffers and
u flush often.. u will kill system performance.
b) uncached memory: u might on the other hand not want any flushing to
be done, instead allocate memory in which all accesses are done straight
to the SDRAM. This is called write-through mode. in this any access to
allocated memory will go straight to the SDRAM instead of being cached..
some folks consider this as not optimal, but again it is use case
dependent. this kind of memory can be got using dma_alloc_coherent or
it's equivalent.
Regards,
Nishanth Menon
_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

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

end of thread, other threads:[~2007-10-26 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 19:28 DMA omap Luís Cargnini
2007-10-26  0:32 ` Nishanth Menon
2007-10-26 16:58   ` Hingkwan Huen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.