All of lore.kernel.org
 help / color / mirror / Atom feed
From: jiri.prchal@aksignal.cz (Jiří Prchal)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] at91: sam9x5 dt: add usart dma definitions to dt
Date: Fri, 10 Oct 2014 11:22:04 +0200	[thread overview]
Message-ID: <5437A53C.9060105@aksignal.cz> (raw)
In-Reply-To: <54379B4C.8060703@atmel.com>

Hi,

Dne 10.10.2014 v 10:39 Nicolas Ferre napsal(a):
> On 10/10/2014 10:12, Ludovic Desroches :
>> Hi,
>>
>> On Fri, Oct 10, 2014 at 08:35:56AM +0200, Jiri Prchal wrote:
>>> This patch adds usart dma definitions to both dtsi for sam9x5 chips. Without
>>> usage of dma it's unable to catch all bytes on usart receiver.
>
> At which speed, with which kind of load on the CPU?
At 115200b/s, load aprox. 10% at 400MHz.
>
>> Adding DMA configuration is a good idea. But I think we will have an
>> issue because we have too many requested channels for DMA0.
I discovered that dma has only 8 channels for 15 peripherals right now.
And it makes big problem to me, I need at least 9ch on dma0 since on dma1 need only 6.
>>
>> Adding usart0, 9 dma channels will be requested. So a choice has to be
>> done. On DMA0 we have:
>> - 2 channels for SSC,
>> - 1 channel for MMC,
>> - 2 channels for I2C0,
>> - 2 channels for SPI0,
>> - 2 channels for USART0.
>
> Yes, so maybe disable the DMA for SPI0. But the decision is pretty
> related to the use of the board. So I would not change things...
No, SPI0 need too.
>
>> I have only mentioned enabled devices.
>
> Yes indeed,
>
> So maybe we can add the "dmas" properties in the files mentioned by
> Jiri, but not enable them like you did Ludovic in this patch:
>
> d24cd78399a3625a69887c8124638260c1c37a2b (ARM: at91: sama5d3: add usart
> dma configurations)
>
> Bye,
But is it possible to enable/disable dma at runtime from userspace?
>
>
>>> Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
>>> ---
>>>   arch/arm/boot/dts/at91sam9x5.dtsi        | 20 ++++++++++++++++++++
>>>   arch/arm/boot/dts/at91sam9x5_usart3.dtsi |  5 +++++
>>>   2 files changed, 25 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
>>> index 726274f..f9acf6d 100644
>>> --- a/arch/arm/boot/dts/at91sam9x5.dtsi
>>> +++ b/arch/arm/boot/dts/at91sam9x5.dtsi
>>> @@ -860,6 +860,11 @@
>>>   				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>>>   				pinctrl-names = "default";
>>>   				pinctrl-0 = <&pinctrl_dbgu>;
>>> +				atmel,use-dma-tx;
>>> +				atmel,use-dma-rx;
>>> +				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(8)>,
>>> +				       <&dma1 1 (AT91_DMA_CFG_PER_ID(9) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
>>> +				dma-names = "tx", "rx";
>>>   				clocks = <&mck>;
>>>   				clock-names = "usart";
>>>   				status = "disabled";
>>> @@ -871,6 +876,11 @@
>>>   				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>;
>>>   				pinctrl-names = "default";
>>>   				pinctrl-0 = <&pinctrl_usart0>;
>>> +				atmel,use-dma-rx;
>>> +				atmel,use-dma-tx;
>>> +				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(3)>,
>>> +				       <&dma0 1 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
>>> +				dma-names = "tx", "rx";
>>>   				clocks = <&usart0_clk>;
>>>   				clock-names = "usart";
>>>   				status = "disabled";
>>> @@ -882,6 +892,11 @@
>>>   				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
>>>   				pinctrl-names = "default";
>>>   				pinctrl-0 = <&pinctrl_usart1>;
>>> +				atmel,use-dma-rx;
>>> +				atmel,use-dma-tx;
>>> +				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(5)>,
>>> +				       <&dma0 1 (AT91_DMA_CFG_PER_ID(6) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
>>> +				dma-names = "tx", "rx";
>>>   				clocks = <&usart1_clk>;
>>>   				clock-names = "usart";
>>>   				status = "disabled";
>>> @@ -893,6 +908,11 @@
>>>   				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
>>>   				pinctrl-names = "default";
>>>   				pinctrl-0 = <&pinctrl_usart2>;
>>> +				atmel,use-dma-rx;
>>> +				atmel,use-dma-tx;
>>> +				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(12)>,
>>> +				       <&dma1 1 (AT91_DMA_CFG_PER_ID(13) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
>>> +				dma-names = "tx", "rx";
>>>   				clocks = <&usart2_clk>;
>>>   				clock-names = "usart";
>>>   				status = "disabled";
>>> diff --git a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
>>> index 140217a5..731da0e 100644
>>> --- a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
>>> +++ b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
>>> @@ -57,6 +57,11 @@
>>>   				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
>>>   				pinctrl-names = "default";
>>>   				pinctrl-0 = <&pinctrl_usart3>;
>>> +				atmel,use-dma-rx;
>>> +				atmel,use-dma-tx;
>>> +				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(14)>,
>>> +				       <&dma1 1 (AT91_DMA_CFG_PER_ID(15) | AT91_DMA_CFG_FIFOCFG_ASAP)>;
>>> +				dma-names = "tx", "rx";
>>>   				clocks = <&usart3_clk>;
>>>   				clock-names = "usart";
>>>   				status = "disabled";
>>> --
>>> 1.9.1
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>>
>
>

  reply	other threads:[~2014-10-10  9:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  6:35 [PATCH] at91: sam9x5 dt: add usart dma definitions to dt Jiri Prchal
2014-10-10  8:12 ` Ludovic Desroches
2014-10-10  8:39   ` Nicolas Ferre
2014-10-10  9:22     ` Jiří Prchal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-13  9:02 Jiri Prchal
2014-10-14 12:24 ` Ludovic Desroches
2014-10-21 16:38   ` Nicolas Ferre

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=5437A53C.9060105@aksignal.cz \
    --to=jiri.prchal@aksignal.cz \
    --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 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.