* MPC8349E's DMA controller like ISA controller but with more feature? @ 2009-04-20 12:38 lhthanh 2009-04-20 15:55 ` Scott Wood 0 siblings, 1 reply; 6+ messages in thread From: lhthanh @ 2009-04-20 12:38 UTC (permalink / raw) To: linuxppc-dev [-- Attachment #1: Type: text/html, Size: 1638 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: MPC8349E's DMA controller like ISA controller but with more feature? 2009-04-20 12:38 MPC8349E's DMA controller like ISA controller but with more feature? lhthanh @ 2009-04-20 15:55 ` Scott Wood 2009-04-20 17:23 ` Timur Tabi [not found] ` <49EFEA26.2010602@kobekara.com> 0 siblings, 2 replies; 6+ messages in thread From: Scott Wood @ 2009-04-20 15:55 UTC (permalink / raw) To: lhthanh; +Cc: linuxppc-dev On Mon, Apr 20, 2009 at 07:38:13PM +0700, lhthanh wrote: > <body bgcolor="#ffffff" text="#000000"> > <font size="+1">Hi EveryOne!<br> > <br> > This is first time I send a letter to everyone. If I make mistake, > please free to correct me. :)<br> Please post in plaintext, not HTML. > MPC8349's DMA controller like ISA controller but with more features? No. It is for software-directed memory-to-memory transfers (where "memory" can be main-memory, or the buffer of a device that doesn't do DMA itself). There is no need for anything like ISA's DMA controller, as devices that want to initiate DMA can master the bus themselves. > So in DMA APIs such as dma_addr_t dma_map_single(struct device *dev, > void *cpu_addr, size_t size, enum dma_data_direction direction) > *dev will pointer to DMA controller or to peripheral device(FPGA, > ISA device)? It is whatever device is going to be doing the DMA. > From dmatest.c , *dev seem to pointer to a channel of DMA > controller. That's because in that case, the DMA controller is the peripheral device being used. > I want to DMA from device to memory. What kind of device? > So how to I can get address of peripheral device ? If you have to ask that, it probably means you don't have a specific device buffer in mind that you want an external entity to stuff data into (or suck data from), but rather are dealing with device-initiated DMA. In that case, ignore the DMA controller. -Scott ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: MPC8349E's DMA controller like ISA controller but with more feature? 2009-04-20 15:55 ` Scott Wood @ 2009-04-20 17:23 ` Timur Tabi [not found] ` <49EFEA26.2010602@kobekara.com> 1 sibling, 0 replies; 6+ messages in thread From: Timur Tabi @ 2009-04-20 17:23 UTC (permalink / raw) To: Scott Wood; +Cc: linuxppc-dev, lhthanh On Mon, Apr 20, 2009 at 10:55 AM, Scott Wood <scottwood@freescale.com> wrot= e: > No. =A0It is for software-directed memory-to-memory transfers (where > "memory" can be main-memory, or the buffer of a device that doesn't do > DMA itself). It can also be used to transfer data to/from a single I/O register, which is how ISA DMA is frequently used. --=20 Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <49EFEA26.2010602@kobekara.com>]
[parent not found: <20090423154311.GA19717@ld0162-tx32.am.freescale.net>]
[parent not found: <49F08FBC.9010903@freescale.com>]
* Re: MPC8349E's DMA controller like ISA controller but with more feature? [not found] ` <49F08FBC.9010903@freescale.com> @ 2009-04-24 6:12 ` lhthanh 2009-04-24 14:40 ` Timur Tabi 0 siblings, 1 reply; 6+ messages in thread From: lhthanh @ 2009-04-24 6:12 UTC (permalink / raw) To: Timur Tabi; +Cc: Scott Wood, linuxppc-dev Thank Scott and Timur! > Scott Wood wrote: > >> Timur Tabi (CCed) has written an audio >> driver that does something very similar; he could probably tell you more >> about how to do that (this is why such discussions should be kept on the >> mailing list rather than taken to private e-mail). >> > > The code in drivers/dma cannot be used to send a buffer of data to a > single I/O port. That code is just an elaborate version of memcpy that > uses the DMA engine to copy data in the background. > > Thanks for your explaination! So if I want to transfer a buffer of data from a single I/O port, will not DMA framework also be able ? Have I to write aother driver? > If you want to transfer a buffer to a single I/O port, you will need to > write your own DMA driver, similar to what I've done in > sound/soc/fsl/fsl_dma.c. This is not trivial. You will need to > understand the DMA hardware programming model to determine whether you > can use direct mode or if you need to create link descriptors. > > Actually, I don't want write all because there are serveral DMA code at hand. I only want to use a framework instead of re-writing. And I afraid that I can not write code which assure sharing DMA channels. Regards! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: MPC8349E's DMA controller like ISA controller but with more feature? 2009-04-24 6:12 ` lhthanh @ 2009-04-24 14:40 ` Timur Tabi 2009-05-07 1:59 ` lhthanh 0 siblings, 1 reply; 6+ messages in thread From: Timur Tabi @ 2009-04-24 14:40 UTC (permalink / raw) To: lhthanh; +Cc: Scott Wood, linuxppc-dev lhthanh wrote: > Thanks for your explaination! So if I want to transfer a buffer of data > from a single I/O port, will not DMA framework > also be able ? No. > Have I to write aother driver? Yes. > Actually, I don't want write all because there are serveral DMA code at > hand. I only want to use a framework instead of re-writing. There is no framework for what you want to do. There is only one other driver that does what you want (sound/soc/fsl/fsl_dma.c), and that is a complicated driver that does many things besides transferring data to an I/O port. > And I afraid that I can not write code which assure sharing DMA channels. Look at arch/powerpc/boot/dts/mpc8610_hpcd.dts. The DMA channels that are needed by the 8610 audio driver have a different 'compatible' property. This is how you prevent the generic DMA driver from using a channel that you want. I'm afraid that you're going to have to study the DMA programming model, and my device driver, and write a brand new driver from scratch. -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: MPC8349E's DMA controller like ISA controller but with more feature? 2009-04-24 14:40 ` Timur Tabi @ 2009-05-07 1:59 ` lhthanh 0 siblings, 0 replies; 6+ messages in thread From: lhthanh @ 2009-05-07 1:59 UTC (permalink / raw) To: Timur Tabi; +Cc: Scott Wood, linuxppc-dev lhthanh wrote: > >> Thanks for your explaination! So if I want to transfer a buffer of data >> from a single I/O port, will not DMA framework >> also be able ? >> > > No. > > >> Have I to write aother driver? >> > > Yes. > > >> Actually, I don't want write all because there are serveral DMA code at >> hand. I only want to use a framework instead of re-writing. >> > > There is no framework for what you want to do. There is only one other > driver that does what you want (sound/soc/fsl/fsl_dma.c), and that is a > complicated driver that does many things besides transferring data to an > I/O port. > > >> And I afraid that I can not write code which assure sharing DMA channels. >> > > Look at arch/powerpc/boot/dts/mpc8610_hpcd.dts. The DMA channels that > are needed by the 8610 audio driver have a different 'compatible' > property. This is how you prevent the generic DMA driver from using a > channel that you want. > > I'm afraid that you're going to have to study the DMA programming model, > and my device driver, and write a brand new driver from scratch. > > Thank Scott and Timur very much! I will study more DMA driver and come back later. :) Regard! ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-07 2:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 12:38 MPC8349E's DMA controller like ISA controller but with more feature? lhthanh
2009-04-20 15:55 ` Scott Wood
2009-04-20 17:23 ` Timur Tabi
[not found] ` <49EFEA26.2010602@kobekara.com>
[not found] ` <20090423154311.GA19717@ld0162-tx32.am.freescale.net>
[not found] ` <49F08FBC.9010903@freescale.com>
2009-04-24 6:12 ` lhthanh
2009-04-24 14:40 ` Timur Tabi
2009-05-07 1:59 ` lhthanh
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).