arm64: dts: rockchip: add rk3399 UART DMAs
diff mbox series

Message ID 20190321144058.16918-1-katsuhiro@katsuster.net
State New
Headers show
Series
  • arm64: dts: rockchip: add rk3399 UART DMAs
Related show

Commit Message

Katsuhiro Suzuki March 21, 2019, 2:40 p.m. UTC
Add UART dma channels as specified by the rk3399 TRM.

Refer:
RK3399 TRM V1.4: Chapter 12 DMA Controller

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Robin Murphy March 21, 2019, 3:21 p.m. UTC | #1
On 21/03/2019 14:40, Katsuhiro Suzuki wrote:
> Add UART dma channels as specified by the rk3399 TRM.

No UART4? That's arguably one of the more useful ones, since 1 and 3 
often end up muxed to ethernet instead.

Also, does UART DMA actually work yet? I guess I can try for myself once 
I get home, but I remember last time I looked it was bailing out because 
the 8250 driver wanted a dmaengine feature that the pl330 driver didn't 
implement.

Robin.

> Refer:
> RK3399 TRM V1.4: Chapter 12 DMA Controller
> 
> Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
> ---
>   arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> index 0301e3e01b38..4eed7aae6989 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> @@ -635,6 +635,8 @@
>   		clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
>   		clock-names = "baudclk", "apb_pclk";
>   		interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH 0>;
> +		dmas = <&dmac_peri 0>, <&dmac_peri 1>;
> +		dma-names = "tx", "rx";
>   		reg-shift = <2>;
>   		reg-io-width = <4>;
>   		pinctrl-names = "default";
> @@ -648,6 +650,8 @@
>   		clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
>   		clock-names = "baudclk", "apb_pclk";
>   		interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH 0>;
> +		dmas = <&dmac_peri 2>, <&dmac_peri 3>;
> +		dma-names = "tx", "rx";
>   		reg-shift = <2>;
>   		reg-io-width = <4>;
>   		pinctrl-names = "default";
> @@ -661,6 +665,8 @@
>   		clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
>   		clock-names = "baudclk", "apb_pclk";
>   		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH 0>;
> +		dmas = <&dmac_peri 4>, <&dmac_peri 5>;
> +		dma-names = "tx", "rx";
>   		reg-shift = <2>;
>   		reg-io-width = <4>;
>   		pinctrl-names = "default";
> @@ -674,6 +680,8 @@
>   		clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
>   		clock-names = "baudclk", "apb_pclk";
>   		interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH 0>;
> +		dmas = <&dmac_peri 6>, <&dmac_peri 7>;
> +		dma-names = "tx", "rx";
>   		reg-shift = <2>;
>   		reg-io-width = <4>;
>   		pinctrl-names = "default";
>
Katsuhiro Suzuki March 21, 2019, 4:13 p.m. UTC | #2
Hello Robin,

On 2019/03/22 0:21, Robin Murphy wrote:
> On 21/03/2019 14:40, Katsuhiro Suzuki wrote:
>> Add UART dma channels as specified by the rk3399 TRM.
> 
> No UART4? That's arguably one of the more useful ones, since 1 and 3 
> often end up muxed to ethernet instead.
> 

Oops... I forgot to add for UART4. Thank you for pointing out.


> Also, does UART DMA actually work yet? I guess I can try for myself once 
> I get home, but I remember last time I looked it was bailing out because 
> the 8250 driver wanted a dmaengine feature that the pl330 driver didn't 
> implement.
> 

I think it works correctly. Because pl330_irq_handler() that is
IRQ handler of PL330 is called when my patch applied and handler
is not called if not applied.


Best Regards,
Katsuhiro Suzuki

> Robin.
> 
>> Refer:
>> RK3399 TRM V1.4: Chapter 12 DMA Controller
>>
>> Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
>> ---
>>   arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
>> b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> index 0301e3e01b38..4eed7aae6989 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> @@ -635,6 +635,8 @@
>>           clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
>>           clock-names = "baudclk", "apb_pclk";
>>           interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH 0>;
>> +        dmas = <&dmac_peri 0>, <&dmac_peri 1>;
>> +        dma-names = "tx", "rx";
>>           reg-shift = <2>;
>>           reg-io-width = <4>;
>>           pinctrl-names = "default";
>> @@ -648,6 +650,8 @@
>>           clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
>>           clock-names = "baudclk", "apb_pclk";
>>           interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH 0>;
>> +        dmas = <&dmac_peri 2>, <&dmac_peri 3>;
>> +        dma-names = "tx", "rx";
>>           reg-shift = <2>;
>>           reg-io-width = <4>;
>>           pinctrl-names = "default";
>> @@ -661,6 +665,8 @@
>>           clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
>>           clock-names = "baudclk", "apb_pclk";
>>           interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH 0>;
>> +        dmas = <&dmac_peri 4>, <&dmac_peri 5>;
>> +        dma-names = "tx", "rx";
>>           reg-shift = <2>;
>>           reg-io-width = <4>;
>>           pinctrl-names = "default";
>> @@ -674,6 +680,8 @@
>>           clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
>>           clock-names = "baudclk", "apb_pclk";
>>           interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH 0>;
>> +        dmas = <&dmac_peri 6>, <&dmac_peri 7>;
>> +        dma-names = "tx", "rx";
>>           reg-shift = <2>;
>>           reg-io-width = <4>;
>>           pinctrl-names = "default";
>>
>

Patch
diff mbox series

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 0301e3e01b38..4eed7aae6989 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -635,6 +635,8 @@ 
 		clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
 		clock-names = "baudclk", "apb_pclk";
 		interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH 0>;
+		dmas = <&dmac_peri 0>, <&dmac_peri 1>;
+		dma-names = "tx", "rx";
 		reg-shift = <2>;
 		reg-io-width = <4>;
 		pinctrl-names = "default";
@@ -648,6 +650,8 @@ 
 		clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
 		clock-names = "baudclk", "apb_pclk";
 		interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH 0>;
+		dmas = <&dmac_peri 2>, <&dmac_peri 3>;
+		dma-names = "tx", "rx";
 		reg-shift = <2>;
 		reg-io-width = <4>;
 		pinctrl-names = "default";
@@ -661,6 +665,8 @@ 
 		clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
 		clock-names = "baudclk", "apb_pclk";
 		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH 0>;
+		dmas = <&dmac_peri 4>, <&dmac_peri 5>;
+		dma-names = "tx", "rx";
 		reg-shift = <2>;
 		reg-io-width = <4>;
 		pinctrl-names = "default";
@@ -674,6 +680,8 @@ 
 		clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
 		clock-names = "baudclk", "apb_pclk";
 		interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH 0>;
+		dmas = <&dmac_peri 6>, <&dmac_peri 7>;
+		dma-names = "tx", "rx";
 		reg-shift = <2>;
 		reg-io-width = <4>;
 		pinctrl-names = "default";