* [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2
@ 2016-12-01 10:49 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 2/3] ARM: dts: at91: sama5d2: move UART3 to DMA1 Nicolas Ferre
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Nicolas Ferre @ 2016-12-01 10:49 UTC (permalink / raw)
To: linux-arm-kernel
The sama5d2 SoC has a second DMA controller and can be used just like DMA0.
By default both DMA controllers are configured as "Secure" in
MATRIX_SPSELR so we can use whichever we want in a "single Secure World"
configuration.
Surprisingly the DMA1 has a lower address than DMA0. To avoid confusion
place it after DMA0 node anyway.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/boot/dts/sama5d2.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index ceb9783ff7e1..c791ce9c750c 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -395,6 +395,16 @@
clock-names = "dma_clk";
};
+ /* Place dma1 here despite its address */
+ dma1: dma-controller at f0004000 {
+ compatible = "atmel,sama5d4-dma";
+ reg = <0xf0004000 0x1000>;
+ interrupts = <7 IRQ_TYPE_LEVEL_HIGH 0>;
+ #dma-cells = <1>;
+ clocks = <&dma1_clk>;
+ clock-names = "dma_clk";
+ };
+
pmc: pmc at f0014000 {
compatible = "atmel,sama5d2-pmc", "syscon";
reg = <0xf0014000 0x160>;
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/3] ARM: dts: at91: sama5d2: move UART3 to DMA1
2016-12-01 10:49 [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Nicolas Ferre
@ 2016-12-01 10:49 ` Nicolas Ferre
2016-12-01 10:49 ` [PATCH 3/3] ARM: dts: at91: sama5d2 Xplained: use DMA for UART3 Nicolas Ferre
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nicolas Ferre @ 2016-12-01 10:49 UTC (permalink / raw)
To: linux-arm-kernel
Now that DMA1 is defined, use it to distribute channel usage among the two
controllers.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/boot/dts/sama5d2.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index c791ce9c750c..5b69eff523d9 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -1151,10 +1151,10 @@
compatible = "atmel,at91sam9260-usart";
reg = <0xfc008000 0x100>;
interrupts = <27 IRQ_TYPE_LEVEL_HIGH 7>;
- dmas = <&dma0
+ dmas = <&dma1
(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
AT91_XDMAC_DT_PERID(41))>,
- <&dma0
+ <&dma1
(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
AT91_XDMAC_DT_PERID(42))>;
dma-names = "tx", "rx";
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] ARM: dts: at91: sama5d2 Xplained: use DMA for UART3
2016-12-01 10:49 [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 2/3] ARM: dts: at91: sama5d2: move UART3 to DMA1 Nicolas Ferre
@ 2016-12-01 10:49 ` Nicolas Ferre
2016-12-02 11:28 ` [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Alexandre Belloni
2016-12-07 8:57 ` Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: Nicolas Ferre @ 2016-12-01 10:49 UTC (permalink / raw)
To: linux-arm-kernel
Use DMA for UART3 as we have enough channels and to show how to
specify DMA use with serial nodes.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/boot/dts/at91-sama5d2_xplained.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 0b9a59d5fdac..e2d5cb3fecb1 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -256,6 +256,8 @@
};
uart3: serial at fc008000 {
+ atmel,use-dma-rx;
+ atmel,use-dma-tx;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3_default>;
status = "okay";
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2
2016-12-01 10:49 [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 2/3] ARM: dts: at91: sama5d2: move UART3 to DMA1 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 3/3] ARM: dts: at91: sama5d2 Xplained: use DMA for UART3 Nicolas Ferre
@ 2016-12-02 11:28 ` Alexandre Belloni
2016-12-07 8:57 ` Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2016-12-02 11:28 UTC (permalink / raw)
To: linux-arm-kernel
On 01/12/2016 at 11:49:47 +0100, Nicolas Ferre wrote :
> The sama5d2 SoC has a second DMA controller and can be used just like DMA0.
> By default both DMA controllers are configured as "Secure" in
> MATRIX_SPSELR so we can use whichever we want in a "single Secure World"
> configuration.
> Surprisingly the DMA1 has a lower address than DMA0. To avoid confusion
> place it after DMA0 node anyway.
>
sama5d2.dtsi is probably the only one that is properly ordered and I
feel like we should keep it this way.
If one of the nodes is not ordered properly, other ones will follow...
We don't care about the name, it is just an alias. We only care about
the address.
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> arch/arm/boot/dts/sama5d2.dtsi | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
> index ceb9783ff7e1..c791ce9c750c 100644
> --- a/arch/arm/boot/dts/sama5d2.dtsi
> +++ b/arch/arm/boot/dts/sama5d2.dtsi
> @@ -395,6 +395,16 @@
> clock-names = "dma_clk";
> };
>
> + /* Place dma1 here despite its address */
> + dma1: dma-controller at f0004000 {
> + compatible = "atmel,sama5d4-dma";
> + reg = <0xf0004000 0x1000>;
> + interrupts = <7 IRQ_TYPE_LEVEL_HIGH 0>;
> + #dma-cells = <1>;
> + clocks = <&dma1_clk>;
> + clock-names = "dma_clk";
> + };
> +
> pmc: pmc at f0014000 {
> compatible = "atmel,sama5d2-pmc", "syscon";
> reg = <0xf0014000 0x160>;
> --
> 2.9.0
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2
2016-12-01 10:49 [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Nicolas Ferre
` (2 preceding siblings ...)
2016-12-02 11:28 ` [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Alexandre Belloni
@ 2016-12-07 8:57 ` Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2016-12-07 8:57 UTC (permalink / raw)
To: linux-arm-kernel
On 01/12/2016 at 11:49:47 +0100, Nicolas Ferre wrote :
> The sama5d2 SoC has a second DMA controller and can be used just like DMA0.
> By default both DMA controllers are configured as "Secure" in
> MATRIX_SPSELR so we can use whichever we want in a "single Secure World"
> configuration.
> Surprisingly the DMA1 has a lower address than DMA0. To avoid confusion
> place it after DMA0 node anyway.
>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> arch/arm/boot/dts/sama5d2.dtsi | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
All applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-07 8:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01 10:49 [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 2/3] ARM: dts: at91: sama5d2: move UART3 to DMA1 Nicolas Ferre
2016-12-01 10:49 ` [PATCH 3/3] ARM: dts: at91: sama5d2 Xplained: use DMA for UART3 Nicolas Ferre
2016-12-02 11:28 ` [PATCH 1/3] ARM: dts: at91: add dma1 definition to sama5d2 Alexandre Belloni
2016-12-07 8:57 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox