linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 1/2] of: Add generic device tree DMA helpers
Date: Tue, 15 May 2012 20:11:22 -0500	[thread overview]
Message-ID: <4FB2FEBA.1030404@ti.com> (raw)
In-Reply-To: <CAJe_ZhfFhZVG4gyaaVUgeQedJiSE=zj9nE28XCNH9DkPVgqj=A@mail.gmail.com>

Hi Jassi,

On 05/04/2012 02:01 PM, Jassi Brar wrote:
> On 4 May 2012 20:47, Jon Hunter <jon-hunter@ti.com> wrote:
>> Hi Jassi,
>>
>> On 05/04/2012 01:56 AM, Jassi Brar wrote:
>>> On 1 May 2012 02:47, Jon Hunter <jon-hunter@ti.com> 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.
>>>>
>>>> Aim of DMA helpers
>>>> - The purpose of device-tree (as far as I understand), is to describe the
>>>>  capabilites of the hardware. Thinking about DMA controllers purely from the
>>>>  context of the hardware to begin with, we can describe a device in terms of
>>>>  a DMA controller as follows ...
>>>>        1. Number of DMA controllers
>>>>        2. Number of channels (maybe physical or logical)
>>>>        3. Mapping of DMA requests signals to DMA controller
>>>>        4. Number of DMA interrupts
>>>>        5. Mapping of DMA interrupts to channels
>>>> - With the above in mind the aim of the DT DMA helper functions is to extract
>>>>  the above information from the DT and provide to the appropriate driver.
>>>>  However, due to the vast number of DMA controllers and not all are using a
>>>>  common driver (such as DMA Engine) it has been seen that this is not a
>>>>  trivial task.
>>>>
>>> Sorry for being slow, but so far I thought DT is only to provide _h/w_
>>> specific info
>>> to the _controller_ drivers. It was not supposed to provide any info
>>> pertaining to
>>> some API (dmaengine in this case).
>>>
>>> And I believe this is one of few situations where we are better off
>>> not generalizing
>>> the interface - pass controller specific info in the controller
>>> driver's specified format.
>>> Generalizing only seems to complicate things here, when we anyway have machine
>>> specific dtb, which could always have clients requesting and the
>>> controllers given
>>> dma's info in controller driver's specific format.
>>>
>>> Perhaps I am overlooking the need to generalize. If you think so, please help me
>>> understand by pointing out some use case for it.
>>
>> No not really, your points are valid. From reading the previous
>> discussions one of the items that was clearly lacking was the ability to
>> represent and identify a device having more than one DMA controller. In
>> other words, when you request the DMA resource, how do you identify
>> which DMA controller in the system that resource belongs too. With DMA
>> engine there are ways we can do this.
>>
> Well, if we really can't have dmac drivers make 'intelligent' runtime decision
> of request mapping on more than one capable controllers, we still can
> make it simpler than the proposed scheme.
> 
> +       i2c1: i2c at 1 {
> +               ...
> +               dma = <&sdma 2 1 &sdma 3 2>;
> +               ...
> +       };
>>
> I see this requires a client driver to specify a particular req_line on a
> particular dma controller. I am not sure if this is most optimal.

Actually, no. The phandle in the DT specifies the DMA controller to use.
Then the client simply asks for a channel with a particular property,
for example, DMA_MEM_TO_DEV (ie. TX) and the channel information is return.

> I think such client->req_line map should be provided to the dmac controller
> driver via its dt node in some format. The dmac driver could then populate
> a dma_chan, or similar, only for that req_line and not for the unused one
> which otherwise could also have served the same client.
> 
> Ideally the I2C driver should simply ask, say, a channel for TX and another
> for RX, everything else should already be setup via dmac's dt nodes.

Yes that is the intention here.

Cheers
Jon

  parent reply	other threads:[~2012-05-16  1:11 UTC|newest]

Thread overview: 129+ 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-05-03 22:26 ` Stephen Warren
2012-05-03 23:25   ` Russell King - ARM Linux
2012-05-04 12:39   ` Arnd Bergmann
2012-05-04 15:06   ` Jon Hunter
2012-05-04 15:14     ` Russell King - ARM Linux
2012-05-04 18:21     ` Stephen Warren
2012-05-04 19:19       ` Jon Hunter
2012-05-04  6:56 ` Jassi Brar
2012-05-04 15:17   ` Jon Hunter
2012-05-04 19:01     ` Jassi Brar
2012-05-04 19:23       ` Arnd Bergmann
2012-05-05 17:10         ` Jassi Brar
2012-05-07 15:53           ` Stephen Warren
2012-05-07 17:19             ` Jassi Brar
2012-05-08 16:35               ` Stephen Warren
2012-05-08 19:09                 ` Jassi Brar
2012-05-09 12:30                   ` Arnd Bergmann
2012-05-09 19:10                   ` Stephen Warren
2012-05-09 21:38                     ` Jassi Brar
2012-05-10 17:00                       ` Stephen Warren
2012-05-10 19:59                         ` Jassi Brar
2012-05-11 19:28                           ` Stephen Warren
2012-05-11 21:06                             ` Jassi Brar
2012-05-11 23:51                               ` Stephen Warren
2012-05-12 13:40                                 ` Jassi Brar
2012-05-16  1:05                                   ` Jon Hunter
2012-05-17 13:18                         ` Russell King - ARM Linux
2012-05-07 17:21             ` Arnd Bergmann
2012-05-16  1:11       ` Jon Hunter [this message]
2012-05-16 12:37         ` Jassi Brar
2012-05-16 13:15           ` Jon Hunter
2012-05-16 15:44             ` Stephen Warren
2012-05-16 16:04               ` Jon Hunter
2012-05-16 16:01             ` Jon Hunter
2012-05-16 16:15               ` Stephen Warren
2012-05-16 16:22                 ` Jassi Brar
2012-05-16 17:09                   ` Jon Hunter
2012-05-16 19:42                   ` Arnd Bergmann
2012-05-16 21:16                     ` Jassi Brar
2012-05-17 19:32                       ` Stephen Warren
2012-05-18 17:12                         ` Jassi Brar
2012-05-18 21:04                       ` Arnd Bergmann
2012-05-16 23:59                     ` Stephen Warren
2012-05-17  4:05                       ` Jassi Brar
2012-05-18 20:49                       ` Arnd Bergmann
2012-05-18 21:07                         ` Stephen Warren
2012-05-18 21:43                           ` Arnd Bergmann
2012-05-18 22:20                             ` Stephen Warren
2012-05-19  8:44                               ` Arnd Bergmann
2012-05-21 17:33                                 ` Stephen Warren
2012-05-21 18:18                                   ` Arnd Bergmann
2012-05-21 20:32                                     ` Stephen Warren
2012-06-08 19:04                                       ` Jon Hunter
2012-06-09  0:04                                         ` Arnd Bergmann
2012-06-13 22:32                                           ` Jon Hunter
2012-06-14  4:45                                             ` Jassi Brar
2012-06-14 11:48                                             ` Arnd Bergmann
2012-06-14 15:39                                               ` Jon Hunter
2012-06-15  8:40                                                 ` Arnd Bergmann
2012-06-22 22:52                                               ` Jon Hunter
2012-06-22 23:12                                                 ` Russell King - ARM Linux
2012-06-25 16:51                                                   ` Jon Hunter
2012-06-25 18:04                                                     ` Vinod Koul
2012-06-25 20:30                                                       ` Arnd Bergmann
2012-06-26  9:40                                                         ` Vinod Koul
2012-06-26 14:59                                                           ` Arnd Bergmann
2012-06-26 17:50                                                             ` Vinod Koul
2012-06-26 20:27                                                               ` Arnd Bergmann
2012-06-27 13:45                                                                 ` Vinod Koul
2012-06-27 15:20                                                                   ` Arnd Bergmann
2012-07-13  6:45                                                                     ` Vinod Koul
2012-07-13 21:52                                                                       ` Guennadi Liakhovetski
2012-07-17 19:24                                                                       ` Arnd Bergmann
2012-07-20  4:00                                                                         ` Vinod Koul
2012-07-20  8:39                                                                           ` Arnd Bergmann
2012-07-20  9:37                                                                             ` Vinod Koul
2012-07-24 19:07                                                                               ` Jon Hunter
2012-07-24 19:27                                                                                 ` Arnd Bergmann
2012-07-26  6:42                                                                                 ` Vinod Koul
2012-07-26  7:14                                                                                   ` Arnd Bergmann
2012-07-26 11:28                                                                                     ` Vinod Koul
2012-07-26 15:53                                                                                       ` Jon Hunter
2012-07-31 11:06                                                                                         ` Vinod Koul
2012-07-26 17:43                                                                                   ` Jon Hunter
2012-07-31 11:12                                                                                     ` Vinod Koul
2012-08-01 20:43                                                                                       ` Jon Hunter
2012-08-03  9:55                                                                                         ` Vinod Koul
2012-07-20  9:08                                                                           ` Robert Jarzmik
2012-07-20  9:41                                                                             ` Vinod Koul
2012-07-26  4:56                                                                           ` zhangfei gao
2012-07-23 21:29                                                                         ` Stephen Warren
2012-07-24  7:19                                                                           ` Arnd Bergmann
2012-07-24 16:04                                                                             ` Stephen Warren
2012-07-24 18:55                                                                               ` Arnd Bergmann
2012-07-24 12:54                                                                           ` Sergei Shtylyov
2012-07-06 11:36                                                         ` Guennadi Liakhovetski
2012-07-06 15:28                                                           ` Arnd Bergmann
2012-07-06 15:43                                                             ` Guennadi Liakhovetski
2012-07-06 17:31                                                               ` Arnd Bergmann
2012-07-06 21:01                                                               ` Russell King - ARM Linux
2012-07-06 20:57                                                           ` Russell King - ARM Linux
2012-07-06 22:49                                                             ` Guennadi Liakhovetski
2012-07-13  6:51                                                           ` Vinod Koul
2012-06-14 15:17                                           ` Guennadi Liakhovetski
2012-06-14 21:52                                             ` Jon Hunter
2012-06-15  8:41                                               ` Guennadi Liakhovetski
2012-06-15  9:00                                               ` Arnd Bergmann
2012-06-15  9:18                                                 ` Guennadi Liakhovetski
2012-06-15 11:27                                                   ` Arnd Bergmann
2012-06-15 16:11                                                     ` Mitch Bradley
2012-06-16  6:56                                                       ` Arnd Bergmann
2012-06-21 11:21                                                     ` Guennadi Liakhovetski
2012-06-21 14:56                                                       ` Arnd Bergmann
2012-05-17 13:22                     ` Russell King - ARM Linux
2012-05-17 13:52                       ` Mark Brown
2012-05-17 14:16                         ` Russell King - ARM Linux
2012-05-16 16:16               ` Jassi Brar
2012-05-16 17:12                 ` Jon Hunter
2012-05-16 17:24                   ` Jassi Brar
2012-05-16 17:37                     ` Jon Hunter
2012-05-16 17:46                       ` Stephen Warren
2012-05-16 18:03                         ` Jon Hunter
2012-05-04 15:22   ` Jon Hunter
2012-05-04 15:56 ` Arnd Bergmann
2012-05-04 17:19   ` Jon Hunter
2012-05-04 19:06     ` Arnd Bergmann
2012-05-04 19:26       ` Jon Hunter
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=4FB2FEBA.1030404@ti.com \
    --to=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).