public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
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: Wed, 16 May 2012 10:15:16 -0600	[thread overview]
Message-ID: <4FB3D294.4020505@wwwdotorg.org> (raw)
In-Reply-To: <4FB3CF44.4040603@ti.com>

On 05/16/2012 10:01 AM, Jon Hunter wrote:
...
> By the way, I do see your point. You wish to describe the all the
> mappings available to all dma controllers and then set a mapping in the
> device tree. Where as I am simply setting a mapping and do not list all
> other possibilities (assuming that there some).
> 
> What is still unclear to me, is if you use this token approach how
> readable is the device-tree? For example, if you have a client that can
> use one of two dmac and for each dmac the request/channel number is
> different, then by using a global token how can I determine what the
> options available for this client are?
> 
> Take your example ...
> 
> mmc1: mmc at 13002000 {
>         ...
>         dma_tx = <891>   //some platform-wide unique value
>         dma_rx = <927>   //some platform-wide unique value
>         ...
> };

I believe those properties (in the DMA client) should be completely
omitted; there's no need for them.

Also, we definitely should not be using "some platform-wide unique
value", but rather the phandle of the DMA client, plus some
client-defined client channel ID. ...

(oh, and - rather than _ is idiomatic for DT property names)

> DMAC's Node:-
> 
> pdma2: pdma at 10800000 {
>          .......
> 	dma_map = <891, 7>,       // Map mmc1_tx onto i/f 7
> 		  <927, 8>,       // Map mmc1_rx onto i/f 8
> 	.......
> };

So this would become:

pdma2: pdma at 10800000 {
	.......
	dma-map =
		... entries for channels 0.. 6
		<&mmc1, 0>,       // Map mmc1_tx onto i/f 7
		<&mmc1, 1>,       // Map mmc1_rx onto i/f 8
		... ;
	.......
};

This (a) follows existing DT practice of using phandle + specifier, and
(b) makes it easy to know exactly what clients you're talking about,
since all you need to do is search for the label "mmc1" throughout the DT.

> But now I have another dmac which has the following options ...
> 
> pdma1: pdma at 10000000 {
>          .......
> 	dma_map = <598, 2>,       // Map mmc1_tx onto i/f 2
> 		  <230, 3>,       // Map mmc1_rx onto i/f 3
> 	.......
> };

Which would become something very similar:

pdma1: pdma at 10000000 {
	.......
	dma-map =
		... entries for channels 0.. 1
		<&mmc1, 0>,       // Map mmc1_tx onto i/f 2
		<&mmc1, 1>,       // Map mmc1_rx onto i/f 3
		... ;
	.......
};

Note that dma-map here is describing the list of DMA requests that the
DMA controller knows about. As far as the binding goes, these are
irrelevant to channels; only the driver for the DMAC knows whether it
needs to use a specific channel ID to service a particular DMA request
signal, or not.

> Other than using a comment or yet another token to represent the client,
> it is not clear from the arbitrary token value itself what my options are.
> 
> One way around this would be to have an enable/disable flag along with
> the token such as ...
> 
> mmc1: mmc at 13002000 {
>         ...
>         dma_tx = <891, 1>   // default tx channel
>         dma_rx = <927, 1>   // default rx channel
>         dma_tx = <598, 0>   // other available tx channel
>         dma_rx = <230, 0>   // other available rx channel
>         ...
> };
> 
> That being said, we could take the same approach with using the dmac
> phandle instead of the token. So you would have ...
> 
> 
> mmc1: mmc at 13002000 {
>         ...
> 		// phandle + channel + enable/disable
>         dma_tx = <pdma0, 7, 1>   // default tx channel
>         dma_rx = <pdma0, 8, 1>   // default rx channel
>         dma_tx = <pdma1, 2, 0>   // other available tx channel
>         dma_rx = <pdma1, 3, 0>   // other available rx channel
>         ...
> };
> 
> Then you could eliminate the random token and dma map from the dmac.
> Seems easier to read too.

  reply	other threads:[~2012-05-16 16:15 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
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 [this message]
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=4FB3D294.4020505@wwwdotorg.org \
    --to=swarren@wwwdotorg$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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