All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: devicetree-discuss@lists.ozlabs.org, boojin.kim@samsung.com,
	kgene.kim@samsung.com, patches@linaro.org, vinod.koul@intel.com,
	jassisinghbrar@gmail.com, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/6] DMA: PL330: Add device tree support
Date: Wed, 31 Aug 2011 21:16:17 +0530	[thread overview]
Message-ID: <CAJuYYwQ17MPD=hTYUxES5touFfd73W1unbtWfu_XqPR48t3P0w@mail.gmail.com> (raw)
In-Reply-To: <4E5E2E36.1070006@gmail.com>

Hi Rob,

On 31 August 2011 18:21, Rob Herring <robherring2@gmail.com> wrote:
> Thomas,

[...]

>> For PL330 dma controllers instantiated from device tree, the channel
>> lookup is based on phandle of the dma controller and dma request id
>> specified by the client node. During probe, the private data of each
>> channel of the controller is set to point to the device node of the
>> dma controller. The 'chan_id' of the each channel is used as the
>> dma request id.
>>
>> Client driver requesting dma channels specify the phandle of the
>> dma controller and the request id. The pl330 filter function
>> converts the phandle to the device node pointer and matches that
>> with channel's private data. If a match is found, the request id
>> from the client node and the 'chan_id' of the channel is matched.
>> A channel is found if both the values match.
>>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>>  .../devicetree/bindings/dma/arm-pl330.txt          |   29 ++++++++++++++++
>>  drivers/dma/pl330.c                                |   35 +++++++++++++++++---
>>  2 files changed, 59 insertions(+), 5 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/dma/arm-pl330.txt
>>
>> diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> b/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> new file mode 100644
>> index 0000000..89f4b9c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> @@ -0,0 +1,29 @@
>> +* ARM PrimeCell PL330 DMA Controller
>> +
>> +The ARM PrimeCell PL330 DMA controller can move blocks of memory contents
>> +between memory and peripherals or memory to memory.
>> +
>> +Required properties:
>> +  - compatible: should be "arm,primecell".
>
> Sorry, I guess I wasn't clear. This has to be "arm,primecell" plus
> something else. In this case, "arm,pl330". If the IP is modified from
> standard ARM version (like ST likes to do), then something like
> "samsung,pl330" would be appropriate.
>
> This is not actually used by the kernel at the moment, but could if
> modified versions of pl330 show up.

of_platform_bus_create() checks for  "arm,primecell" compatible value
to instantiate a amba device from device tree. The peripheral_id is
also noted in the amba device instance. The amba drivers register with
a with a peripheral_id and peripheral_id is used match amba device
with a driver.

In cases of modified version of the same IP, the peripheral_id would
be different. So, "arm,primecell" would just be enough for now. Any
other compatible value would anyway go unused. I did use
"arm,primecell-pdma" and "arm-primecell-mdma" to derive the dma_cap
value. But, as per your comments, I dropped it.

So, for now, I will just list "arm,primecell" as required compatible
value. Please let me know if "arm,pl330" would be required here.

>
>> +  - reg: physical base address of the controller and length of memory mapped
>> +    region.
>> +  - interrupts: interrupt number to the cpu.
>> +
>> +Example: (from Samsung's Exynos4 processor dtsi file)
>> +
>> +     pdma0: pdma@12680000 {
>> +             compatible = "arm,primecell";
>> +             reg = <0x12680000 0x1000>;
>> +             interrupts = <99>;
>> +     };
>> +
>> +Client drivers (device nodes requiring dma transfers from dev-to-mem or
>> +mem-to-dev) should specify the DMA channel numbers using a two-value pair
>> +as shown below.
>> +
>> +  [property name]  = <[phandle of the dma controller] [dma request id]>;
>
> At least fix the "-dma-channel" part of the name. It not clear if that's
> the case or just an example.
>
> [name]-dma-channel = <[phandle of the dma controller] [dma request id]>;

The name of the property that specifies the dma channel to use is
decided by the client device node. It is not enforced by the dma
device node. So, there will be no specific requirement stated in the
documentation for pl330 device node.

>
>
> The rest looks good.

Thanks for your review and comments.

Regards,
Thomas.

>
> Rob
>

[...]

WARNING: multiple messages have this Message-ID (diff)
From: thomas.abraham@linaro.org (Thomas Abraham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] DMA: PL330: Add device tree support
Date: Wed, 31 Aug 2011 21:16:17 +0530	[thread overview]
Message-ID: <CAJuYYwQ17MPD=hTYUxES5touFfd73W1unbtWfu_XqPR48t3P0w@mail.gmail.com> (raw)
In-Reply-To: <4E5E2E36.1070006@gmail.com>

Hi Rob,

On 31 August 2011 18:21, Rob Herring <robherring2@gmail.com> wrote:
> Thomas,

[...]

>> For PL330 dma controllers instantiated from device tree, the channel
>> lookup is based on phandle of the dma controller and dma request id
>> specified by the client node. During probe, the private data of each
>> channel of the controller is set to point to the device node of the
>> dma controller. The 'chan_id' of the each channel is used as the
>> dma request id.
>>
>> Client driver requesting dma channels specify the phandle of the
>> dma controller and the request id. The pl330 filter function
>> converts the phandle to the device node pointer and matches that
>> with channel's private data. If a match is found, the request id
>> from the client node and the 'chan_id' of the channel is matched.
>> A channel is found if both the values match.
>>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>> ?.../devicetree/bindings/dma/arm-pl330.txt ? ? ? ? ?| ? 29 ++++++++++++++++
>> ?drivers/dma/pl330.c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 35 +++++++++++++++++---
>> ?2 files changed, 59 insertions(+), 5 deletions(-)
>> ?create mode 100644 Documentation/devicetree/bindings/dma/arm-pl330.txt
>>
>> diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> b/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> new file mode 100644
>> index 0000000..89f4b9c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
>> @@ -0,0 +1,29 @@
>> +* ARM PrimeCell PL330 DMA Controller
>> +
>> +The ARM PrimeCell PL330 DMA controller can move blocks of memory contents
>> +between memory and peripherals or memory to memory.
>> +
>> +Required properties:
>> + ?- compatible: should be "arm,primecell".
>
> Sorry, I guess I wasn't clear. This has to be "arm,primecell" plus
> something else. In this case, "arm,pl330". If the IP is modified from
> standard ARM version (like ST likes to do), then something like
> "samsung,pl330" would be appropriate.
>
> This is not actually used by the kernel at the moment, but could if
> modified versions of pl330 show up.

of_platform_bus_create() checks for  "arm,primecell" compatible value
to instantiate a amba device from device tree. The peripheral_id is
also noted in the amba device instance. The amba drivers register with
a with a peripheral_id and peripheral_id is used match amba device
with a driver.

In cases of modified version of the same IP, the peripheral_id would
be different. So, "arm,primecell" would just be enough for now. Any
other compatible value would anyway go unused. I did use
"arm,primecell-pdma" and "arm-primecell-mdma" to derive the dma_cap
value. But, as per your comments, I dropped it.

So, for now, I will just list "arm,primecell" as required compatible
value. Please let me know if "arm,pl330" would be required here.

>
>> + ?- reg: physical base address of the controller and length of memory mapped
>> + ? ?region.
>> + ?- interrupts: interrupt number to the cpu.
>> +
>> +Example: (from Samsung's Exynos4 processor dtsi file)
>> +
>> + ? ? pdma0: pdma at 12680000 {
>> + ? ? ? ? ? ? compatible = "arm,primecell";
>> + ? ? ? ? ? ? reg = <0x12680000 0x1000>;
>> + ? ? ? ? ? ? interrupts = <99>;
>> + ? ? };
>> +
>> +Client drivers (device nodes requiring dma transfers from dev-to-mem or
>> +mem-to-dev) should specify the DMA channel numbers using a two-value pair
>> +as shown below.
>> +
>> + ?[property name] ?= <[phandle of the dma controller] [dma request id]>;
>
> At least fix the "-dma-channel" part of the name. It not clear if that's
> the case or just an example.
>
> [name]-dma-channel = <[phandle of the dma controller] [dma request id]>;

The name of the property that specifies the dma channel to use is
decided by the client device node. It is not enforced by the dma
device node. So, there will be no specific requirement stated in the
documentation for pl330 device node.

>
>
> The rest looks good.

Thanks for your review and comments.

Regards,
Thomas.

>
> Rob
>

[...]

  reply	other threads:[~2011-08-31 15:46 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  8:40 [PATCH 0/6] Add device tree support for PL330 dma controller driver Thomas Abraham
2011-08-26  8:40 ` Thomas Abraham
2011-08-26  8:40 ` [PATCH 1/6] DMA: PL330: move filter function into driver Thomas Abraham
2011-08-26  8:40   ` Thomas Abraham
2011-08-26  8:40   ` [PATCH 2/6] DMA: PL330: Infer transfer direction from transfer request instead of platform data Thomas Abraham
2011-08-26  8:40     ` Thomas Abraham
2011-08-26  8:40     ` [PATCH 3/6] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-08-26  8:40       ` Thomas Abraham
2011-08-26  8:40       ` [PATCH 4/6] DMA: PL330: Add device tree support Thomas Abraham
2011-08-26  8:40         ` Thomas Abraham
2011-08-26  8:40         ` [PATCH 5/6] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers Thomas Abraham
2011-08-26  8:40           ` Thomas Abraham
2011-08-26  8:40           ` [PATCH 6/6] ARM: EXYNOS4: Limit usage of pl330 device instance to non-dt build Thomas Abraham
2011-08-26  8:40             ` Thomas Abraham
2011-08-26 13:16         ` [PATCH 4/6] DMA: PL330: Add device tree support Rob Herring
2011-08-26 13:16           ` Rob Herring
2011-08-26 14:23           ` Russell King - ARM Linux
2011-08-26 14:23             ` Russell King - ARM Linux
2011-08-30 12:21             ` Thomas Abraham
2011-08-30 12:21               ` Thomas Abraham
     [not found]           ` <4E579C9B.7030807-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-08-30 12:18             ` Thomas Abraham
2011-08-30 13:19               ` Rob Herring
2011-08-30 13:19                 ` Rob Herring
2011-08-31  6:46                 ` Thomas Abraham
2011-08-31  6:46                   ` Thomas Abraham
2011-08-31 12:51                   ` Rob Herring
2011-08-31 12:51                     ` Rob Herring
2011-08-31 15:46                     ` Thomas Abraham [this message]
2011-08-31 15:46                       ` Thomas Abraham
2011-08-31 16:04                       ` Rob Herring
2011-08-31 16:04                         ` Rob Herring
2011-09-01  9:03                         ` Thomas Abraham
2011-09-01  9:03                           ` Thomas Abraham
2011-08-30 13:09           ` Thomas Abraham
2011-08-30 13:09             ` Thomas Abraham
2011-08-29 17:29 ` [PATCH 0/6] Add device tree support for PL330 dma controller driver Vinod Koul
2011-08-29 17:29   ` Vinod Koul
2011-08-30 12:28   ` Thomas Abraham
2011-08-30 12:28     ` Thomas Abraham
2011-09-05 13:14     ` Vinod Koul
2011-09-05 13:14       ` Vinod Koul
2011-09-05  5:17   ` Kukjin Kim
2011-09-05  5:17     ` Kukjin Kim
2011-09-05 10:16     ` Thomas Abraham
2011-09-05 10:16       ` Thomas Abraham
2011-09-19  6:28 [PATCH v4 " Thomas Abraham
2011-09-19  6:28 ` [PATCH 1/6] DMA: PL330: move filter function into driver Thomas Abraham
2011-09-19  6:28   ` [PATCH 2/6] DMA: PL330: Infer transfer direction from transfer request instead of platform data Thomas Abraham
2011-09-19  6:28     ` [PATCH 3/6] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-09-19  6:29       ` [PATCH 4/6] DMA: PL330: Add device tree support Thomas Abraham
2011-09-19  6:29         ` Thomas Abraham

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='CAJuYYwQ17MPD=hTYUxES5touFfd73W1unbtWfu_XqPR48t3P0w@mail.gmail.com' \
    --to=thomas.abraham@linaro.org \
    --cc=boojin.kim@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=robherring2@gmail.com \
    --cc=vinod.koul@intel.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: link
Be 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.