From: Stephen Warren <swarren@wwwdotorg.org> To: Jon Hunter <jon-hunter@ti.com> Cc: device-tree <devicetree-discuss@lists.ozlabs.org>, Stephen Warren <swarren@nvidia.com>, Benoit Cousson <b-cousson@ti.com>, Arnd Bergmann <arnd@arndb.de>, Nicolas Ferre <nicolas.ferre@atmel.com>, Rob Herring <rob.herring@calxeda.com>, Grant Likely <grant.likely@secretlab.ca>, Russell King <linux@arm.linux.org.uk>, linux-omap <linux-omap@vger.kernel.org>, linux-arm <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH V3 1/2] of: Add generic device tree DMA helpers Date: Fri, 04 May 2012 12:21:50 -0600 [thread overview] Message-ID: <4FA41E3E.3020303@wwwdotorg.org> (raw) In-Reply-To: <4FA3F08D.7030603@ti.com> On 05/04/2012 09:06 AM, Jon Hunter wrote: > Hi Stephen, > > On 05/03/2012 05:26 PM, Stephen Warren wrote: >> On 04/30/2012 03:17 PM, Jon Hunter wrote: >>> From: Jon Hunter <jon-hunter@ti.com> >>> >>> This is based upon the work by Benoit Cousson [1] and Nicolas Ferre [2] >>> to add some basic helpers to retrieve a DMA controller device_node and the >>> DMA request/channel information. ... >>> + >>> + sdma: dmaengine@48000000 { >>> + compatible = "ti,omap4-sdma" >>> + reg = <0x48000000 0x1000>; >>> + interrupts = <4>; >>> + #dma-cells = <2>; >>> + #dma-channels = <32>; >>> + #dma-requests = <127>; >>> + }; >>> + >>> + >>> +* DMA client >>> + >>> +Client drivers should specify the DMA property using a phandle to the controller >>> +followed by the number of DMA request/channel and the transfer type of the >> >> What exactly is "request/channel"? Is it a request ID, a channel ID, >> both packed into a single integer (which bits are used for each field), >> etc.? > > The thought here was that some DMAs may distinguish between devices by a > request ID or a channel ID or both. In the case of say an OMAP4, we have > 32 channels and 127 request IDs. From a h/w perspective we need to know > both. Each of the 32 channels can be programmed to use any one of the > 127 h/w request signals. >From a HW perspective, do you actually need to know both? I think the HW description must specify the request ID, but because any channel can be programmed to any request ID, you don't actually care about the channel ID; it can be dynamically allocated by the DMA driver when the client driver calls dma_request_channel(). Actually, you say the following below, so I guess you already agree here: > Yes this is the same as OMAPs SDMA. In the case of such DMA controllers > you only really care about the request ID and total number of channels > that are available to you. ... >> This is why I think DMA controller should specify the format of their >> own DMA specifier in DT, and why they should provide an xlate function >> to parse that. > > Ok fair enough. However, it seems that at a minimum we could provide one > or two xlate functions in the generic binding for people to use. One > could be the DMA engine xlate binding and another could be the simple > xlate binding Nicolas proposed for a DMA controller that returns a > single channel/request ID. > > However, at the same time, may be people would prefer that devices such > as tegra, omap, at91, etc, offer their own xlate function for DMA > engine. I am not sure, but we could go either way. I'd expect the bindings to be written to allow the individual DMA controllers to have complete control over the meaning of the DMA specifier. That said, I would certainly expect some common patterns to emerge, such as a single cell to specify the DMA channel ID, or a single cell to specify the DMA request/selector ID. We should certainly make sure that where different controllers need the same information, they use the same way to represent it, and use common utility code to implement the xlate functionality. We could perhaps even write these common cases into the core DMA bindings as examples to help ensure uniformity. However, we just need to do this in a way that allows other cases too.
WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V3 1/2] of: Add generic device tree DMA helpers Date: Fri, 04 May 2012 12:21:50 -0600 [thread overview] Message-ID: <4FA41E3E.3020303@wwwdotorg.org> (raw) In-Reply-To: <4FA3F08D.7030603@ti.com> On 05/04/2012 09:06 AM, Jon Hunter wrote: > Hi Stephen, > > On 05/03/2012 05:26 PM, Stephen Warren wrote: >> On 04/30/2012 03:17 PM, Jon Hunter wrote: >>> From: Jon Hunter <jon-hunter@ti.com> >>> >>> This is based upon the work by Benoit Cousson [1] and Nicolas Ferre [2] >>> to add some basic helpers to retrieve a DMA controller device_node and the >>> DMA request/channel information. ... >>> + >>> + sdma: dmaengine at 48000000 { >>> + compatible = "ti,omap4-sdma" >>> + reg = <0x48000000 0x1000>; >>> + interrupts = <4>; >>> + #dma-cells = <2>; >>> + #dma-channels = <32>; >>> + #dma-requests = <127>; >>> + }; >>> + >>> + >>> +* DMA client >>> + >>> +Client drivers should specify the DMA property using a phandle to the controller >>> +followed by the number of DMA request/channel and the transfer type of the >> >> What exactly is "request/channel"? Is it a request ID, a channel ID, >> both packed into a single integer (which bits are used for each field), >> etc.? > > The thought here was that some DMAs may distinguish between devices by a > request ID or a channel ID or both. In the case of say an OMAP4, we have > 32 channels and 127 request IDs. From a h/w perspective we need to know > both. Each of the 32 channels can be programmed to use any one of the > 127 h/w request signals. >From a HW perspective, do you actually need to know both? I think the HW description must specify the request ID, but because any channel can be programmed to any request ID, you don't actually care about the channel ID; it can be dynamically allocated by the DMA driver when the client driver calls dma_request_channel(). Actually, you say the following below, so I guess you already agree here: > Yes this is the same as OMAPs SDMA. In the case of such DMA controllers > you only really care about the request ID and total number of channels > that are available to you. ... >> This is why I think DMA controller should specify the format of their >> own DMA specifier in DT, and why they should provide an xlate function >> to parse that. > > Ok fair enough. However, it seems that at a minimum we could provide one > or two xlate functions in the generic binding for people to use. One > could be the DMA engine xlate binding and another could be the simple > xlate binding Nicolas proposed for a DMA controller that returns a > single channel/request ID. > > However, at the same time, may be people would prefer that devices such > as tegra, omap, at91, etc, offer their own xlate function for DMA > engine. I am not sure, but we could go either way. I'd expect the bindings to be written to allow the individual DMA controllers to have complete control over the meaning of the DMA specifier. That said, I would certainly expect some common patterns to emerge, such as a single cell to specify the DMA channel ID, or a single cell to specify the DMA request/selector ID. We should certainly make sure that where different controllers need the same information, they use the same way to represent it, and use common utility code to implement the xlate functionality. We could perhaps even write these common cases into the core DMA bindings as examples to help ensure uniformity. However, we just need to do this in a way that allows other cases too.
next prev parent reply other threads:[~2012-05-04 18:21 UTC|newest] Thread overview: 258+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-04-30 21:17 [PATCH V3 1/2] of: Add generic device tree DMA helpers Jon Hunter 2012-04-30 21:17 ` Jon Hunter 2012-05-03 22:26 ` Stephen Warren 2012-05-03 22:26 ` Stephen Warren [not found] ` <4FA30604.1030401-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 2012-05-03 23:25 ` Russell King - ARM Linux 2012-05-03 23:25 ` Russell King - ARM Linux 2012-05-04 12:39 ` Arnd Bergmann 2012-05-04 12:39 ` Arnd Bergmann 2012-05-04 15:06 ` Jon Hunter 2012-05-04 15:06 ` Jon Hunter [not found] ` <4FA3F08D.7030603-l0cyMroinI0@public.gmane.org> 2012-05-04 15:14 ` Russell King - ARM Linux 2012-05-04 15:14 ` Russell King - ARM Linux 2012-05-04 18:21 ` Stephen Warren [this message] 2012-05-04 18:21 ` Stephen Warren 2012-05-04 19:19 ` Jon Hunter 2012-05-04 19:19 ` Jon Hunter 2012-05-04 6:56 ` Jassi Brar 2012-05-04 6:56 ` Jassi Brar 2012-05-04 15:17 ` Jon Hunter 2012-05-04 15:17 ` Jon Hunter 2012-05-04 19:01 ` Jassi Brar 2012-05-04 19:01 ` Jassi Brar 2012-05-04 19:23 ` Arnd Bergmann 2012-05-04 19:23 ` Arnd Bergmann 2012-05-05 17:10 ` Jassi Brar 2012-05-05 17:10 ` Jassi Brar 2012-05-07 15:53 ` Stephen Warren 2012-05-07 15:53 ` Stephen Warren 2012-05-07 17:19 ` Jassi Brar 2012-05-07 17:19 ` Jassi Brar 2012-05-08 16:35 ` Stephen Warren 2012-05-08 16:35 ` Stephen Warren 2012-05-08 19:09 ` Jassi Brar 2012-05-08 19:09 ` Jassi Brar 2012-05-09 12:30 ` Arnd Bergmann 2012-05-09 12:30 ` Arnd Bergmann 2012-05-09 19:10 ` Stephen Warren 2012-05-09 19:10 ` Stephen Warren 2012-05-09 21:38 ` Jassi Brar 2012-05-09 21:38 ` Jassi Brar 2012-05-10 17:00 ` Stephen Warren 2012-05-10 17:00 ` Stephen Warren 2012-05-10 19:59 ` Jassi Brar 2012-05-10 19:59 ` Jassi Brar 2012-05-11 19:28 ` Stephen Warren 2012-05-11 19:28 ` Stephen Warren 2012-05-11 21:06 ` Jassi Brar 2012-05-11 21:06 ` Jassi Brar 2012-05-11 23:51 ` Stephen Warren 2012-05-11 23:51 ` Stephen Warren 2012-05-12 13:40 ` Jassi Brar 2012-05-12 13:40 ` Jassi Brar 2012-05-16 1:05 ` Jon Hunter 2012-05-16 1:05 ` Jon Hunter 2012-05-17 13:18 ` Russell King - ARM Linux 2012-05-17 13:18 ` Russell King - ARM Linux 2012-05-07 17:21 ` Arnd Bergmann 2012-05-07 17:21 ` Arnd Bergmann 2012-05-16 1:11 ` Jon Hunter 2012-05-16 1:11 ` Jon Hunter 2012-05-16 12:37 ` Jassi Brar 2012-05-16 12:37 ` Jassi Brar 2012-05-16 13:15 ` Jon Hunter 2012-05-16 13:15 ` Jon Hunter 2012-05-16 15:44 ` Stephen Warren 2012-05-16 15:44 ` Stephen Warren 2012-05-16 16:04 ` Jon Hunter 2012-05-16 16:04 ` Jon Hunter 2012-05-16 16:01 ` Jon Hunter 2012-05-16 16:01 ` Jon Hunter 2012-05-16 16:15 ` Stephen Warren 2012-05-16 16:15 ` Stephen Warren 2012-05-16 16:22 ` Jassi Brar 2012-05-16 16:22 ` Jassi Brar 2012-05-16 17:09 ` Jon Hunter 2012-05-16 17:09 ` Jon Hunter 2012-05-16 19:42 ` Arnd Bergmann 2012-05-16 19:42 ` Arnd Bergmann 2012-05-16 21:16 ` Jassi Brar 2012-05-16 21:16 ` Jassi Brar 2012-05-17 19:32 ` Stephen Warren 2012-05-17 19:32 ` Stephen Warren 2012-05-18 17:12 ` Jassi Brar 2012-05-18 17:12 ` Jassi Brar 2012-05-18 21:04 ` Arnd Bergmann 2012-05-18 21:04 ` Arnd Bergmann 2012-05-16 23:59 ` Stephen Warren 2012-05-16 23:59 ` Stephen Warren 2012-05-17 4:05 ` Jassi Brar 2012-05-17 4:05 ` Jassi Brar 2012-05-18 20:49 ` Arnd Bergmann 2012-05-18 20:49 ` Arnd Bergmann 2012-05-18 21:07 ` Stephen Warren 2012-05-18 21:07 ` Stephen Warren 2012-05-18 21:43 ` Arnd Bergmann 2012-05-18 21:43 ` Arnd Bergmann 2012-05-18 22:20 ` Stephen Warren 2012-05-18 22:20 ` Stephen Warren 2012-05-19 8:44 ` Arnd Bergmann 2012-05-19 8:44 ` Arnd Bergmann 2012-05-21 17:33 ` Stephen Warren 2012-05-21 17:33 ` Stephen Warren 2012-05-21 18:18 ` Arnd Bergmann 2012-05-21 18:18 ` Arnd Bergmann 2012-05-21 20:32 ` Stephen Warren 2012-05-21 20:32 ` Stephen Warren 2012-06-08 19:04 ` Jon Hunter 2012-06-08 19:04 ` Jon Hunter 2012-06-09 0:04 ` Arnd Bergmann 2012-06-09 0:04 ` Arnd Bergmann 2012-06-13 22:32 ` Jon Hunter 2012-06-13 22:32 ` Jon Hunter 2012-06-14 4:45 ` Jassi Brar 2012-06-14 4:45 ` Jassi Brar 2012-06-14 11:48 ` Arnd Bergmann 2012-06-14 11:48 ` Arnd Bergmann 2012-06-14 15:39 ` Jon Hunter 2012-06-14 15:39 ` Jon Hunter 2012-06-15 8:40 ` Arnd Bergmann 2012-06-15 8:40 ` Arnd Bergmann 2012-06-22 22:52 ` Jon Hunter 2012-06-22 22:52 ` Jon Hunter [not found] ` <4FE4F718.3080204-l0cyMroinI0@public.gmane.org> 2012-06-22 23:12 ` Russell King - ARM Linux 2012-06-22 23:12 ` Russell King - ARM Linux 2012-06-25 16:51 ` Jon Hunter 2012-06-25 16:51 ` Jon Hunter 2012-06-25 18:04 ` Vinod Koul 2012-06-25 18:04 ` Vinod Koul 2012-06-25 20:30 ` Arnd Bergmann 2012-06-25 20:30 ` Arnd Bergmann 2012-06-26 9:40 ` Vinod Koul 2012-06-26 9:40 ` Vinod Koul 2012-06-26 14:59 ` Arnd Bergmann 2012-06-26 14:59 ` Arnd Bergmann 2012-06-26 17:50 ` Vinod Koul 2012-06-26 17:50 ` Vinod Koul 2012-06-26 20:27 ` Arnd Bergmann 2012-06-26 20:27 ` Arnd Bergmann 2012-06-27 13:45 ` Vinod Koul 2012-06-27 13:45 ` Vinod Koul 2012-06-27 15:20 ` Arnd Bergmann 2012-06-27 15:20 ` Arnd Bergmann 2012-07-13 6:45 ` Vinod Koul 2012-07-13 6:45 ` Vinod Koul 2012-07-13 21:52 ` Guennadi Liakhovetski 2012-07-13 21:52 ` Guennadi Liakhovetski 2012-07-17 19:24 ` Arnd Bergmann 2012-07-17 19:24 ` Arnd Bergmann 2012-07-20 4:00 ` Vinod Koul 2012-07-20 4:00 ` Vinod Koul 2012-07-20 8:39 ` Arnd Bergmann 2012-07-20 8:39 ` Arnd Bergmann 2012-07-20 9:37 ` Vinod Koul 2012-07-20 9:37 ` Vinod Koul 2012-07-24 19:07 ` Jon Hunter 2012-07-24 19:07 ` Jon Hunter 2012-07-24 19:27 ` Arnd Bergmann 2012-07-24 19:27 ` Arnd Bergmann 2012-07-26 6:42 ` Vinod Koul 2012-07-26 6:42 ` Vinod Koul 2012-07-26 7:14 ` Arnd Bergmann 2012-07-26 7:14 ` Arnd Bergmann 2012-07-26 11:28 ` Vinod Koul 2012-07-26 11:28 ` Vinod Koul 2012-07-26 15:53 ` Jon Hunter 2012-07-26 15:53 ` Jon Hunter [not found] ` <5011680A.6040400-l0cyMroinI0@public.gmane.org> 2012-07-31 11:06 ` Vinod Koul 2012-07-31 11:06 ` Vinod Koul 2012-07-26 17:43 ` Jon Hunter 2012-07-26 17:43 ` Jon Hunter 2012-07-31 11:12 ` Vinod Koul 2012-07-31 11:12 ` Vinod Koul 2012-08-01 20:43 ` Jon Hunter 2012-08-01 20:43 ` Jon Hunter 2012-08-03 9:55 ` Vinod Koul 2012-08-03 9:55 ` Vinod Koul 2012-07-20 9:08 ` Robert Jarzmik 2012-07-20 9:08 ` Robert Jarzmik 2012-07-20 9:41 ` Vinod Koul 2012-07-20 9:41 ` Vinod Koul 2012-07-26 4:56 ` zhangfei gao 2012-07-26 4:56 ` zhangfei gao 2012-07-23 21:29 ` Stephen Warren 2012-07-23 21:29 ` Stephen Warren 2012-07-24 7:19 ` Arnd Bergmann 2012-07-24 7:19 ` Arnd Bergmann 2012-07-24 16:04 ` Stephen Warren 2012-07-24 16:04 ` Stephen Warren 2012-07-24 18:55 ` Arnd Bergmann 2012-07-24 18:55 ` Arnd Bergmann 2012-07-24 12:54 ` Sergei Shtylyov 2012-07-24 12:54 ` Sergei Shtylyov 2012-07-06 11:36 ` Guennadi Liakhovetski 2012-07-06 11:36 ` Guennadi Liakhovetski [not found] ` <Pine.LNX.4.64.1207061315470.29809-0199iw4Nj15frtckUFj5Ag@public.gmane.org> 2012-07-06 15:28 ` Arnd Bergmann 2012-07-06 15:28 ` Arnd Bergmann [not found] ` <201207061528.58291.arnd-r2nGTMty4D4@public.gmane.org> 2012-07-06 15:43 ` Guennadi Liakhovetski 2012-07-06 15:43 ` Guennadi Liakhovetski 2012-07-06 17:31 ` Arnd Bergmann 2012-07-06 17:31 ` Arnd Bergmann 2012-07-06 21:01 ` Russell King - ARM Linux 2012-07-06 21:01 ` Russell King - ARM Linux 2012-07-06 20:57 ` Russell King - ARM Linux 2012-07-06 20:57 ` Russell King - ARM Linux 2012-07-06 22:49 ` Guennadi Liakhovetski 2012-07-06 22:49 ` Guennadi Liakhovetski 2012-07-13 6:51 ` Vinod Koul 2012-07-13 6:51 ` Vinod Koul 2012-06-14 15:17 ` Guennadi Liakhovetski 2012-06-14 15:17 ` Guennadi Liakhovetski 2012-06-14 21:52 ` Jon Hunter 2012-06-14 21:52 ` Jon Hunter 2012-06-15 8:41 ` Guennadi Liakhovetski 2012-06-15 8:41 ` Guennadi Liakhovetski 2012-06-15 9:00 ` Arnd Bergmann 2012-06-15 9:00 ` Arnd Bergmann 2012-06-15 9:18 ` Guennadi Liakhovetski 2012-06-15 9:18 ` Guennadi Liakhovetski 2012-06-15 11:27 ` Arnd Bergmann 2012-06-15 11:27 ` Arnd Bergmann [not found] ` <201206151127.24386.arnd-r2nGTMty4D4@public.gmane.org> 2012-06-15 16:11 ` Mitch Bradley 2012-06-15 16:11 ` Mitch Bradley [not found] ` <4FDB5ECF.3000701-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org> 2012-06-16 6:56 ` Arnd Bergmann 2012-06-16 6:56 ` Arnd Bergmann 2012-06-21 11:21 ` Guennadi Liakhovetski 2012-06-21 11:21 ` Guennadi Liakhovetski 2012-06-21 14:56 ` Arnd Bergmann 2012-06-21 14:56 ` Arnd Bergmann [not found] ` <201205161942.20296.arnd-r2nGTMty4D4@public.gmane.org> 2012-05-17 13:22 ` Russell King - ARM Linux 2012-05-17 13:22 ` Russell King - ARM Linux 2012-05-17 13:52 ` Mark Brown 2012-05-17 13:52 ` Mark Brown 2012-05-17 14:16 ` Russell King - ARM Linux 2012-05-17 14:16 ` Russell King - ARM Linux 2012-05-16 16:16 ` Jassi Brar 2012-05-16 16:16 ` Jassi Brar 2012-05-16 17:12 ` Jon Hunter 2012-05-16 17:12 ` Jon Hunter 2012-05-16 17:24 ` Jassi Brar 2012-05-16 17:24 ` Jassi Brar 2012-05-16 17:37 ` Jon Hunter 2012-05-16 17:37 ` Jon Hunter 2012-05-16 17:46 ` Stephen Warren 2012-05-16 17:46 ` Stephen Warren 2012-05-16 18:03 ` Jon Hunter 2012-05-16 18:03 ` Jon Hunter 2012-05-04 15:22 ` Jon Hunter 2012-05-04 15:22 ` Jon Hunter 2012-05-04 15:56 ` Arnd Bergmann 2012-05-04 15:56 ` Arnd Bergmann 2012-05-04 17:19 ` Jon Hunter 2012-05-04 17:19 ` Jon Hunter 2012-05-04 19:06 ` Arnd Bergmann 2012-05-04 19:06 ` Arnd Bergmann 2012-05-04 19:26 ` Jon Hunter 2012-05-04 19:26 ` Jon Hunter 2012-05-04 18:30 ` Stephen Warren 2012-05-04 18:30 ` Stephen Warren
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4FA41E3E.3020303@wwwdotorg.org \ --to=swarren@wwwdotorg.org \ --cc=arnd@arndb.de \ --cc=b-cousson@ti.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=grant.likely@secretlab.ca \ --cc=jon-hunter@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=nicolas.ferre@atmel.com \ --cc=rob.herring@calxeda.com \ --cc=swarren@nvidia.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.