Skip to contentSkip to conversation

serial: fsl_lpuart: add DMA support

PATCH New Yuan Yao 3 participants 6 messages Feb 17, 2014 – Feb 18, 2014

Subsystems (2)
lore
Share & tools
lore

Yuan Yao

author
#0 lore raw

v6 cover serial: fsl_lpuart: add DMA support

Changed in v6:
- Change the explanations for dmas, dma-names in document.

Changed in v5:
- Revoke move dma properties from dtsi to dts.
- Change the explanations for dmas, dma-names in document.
- Change the description for [PATCH 3] serial: fsl_lpuart: documented the clock requirement.

Changed in v4:
- Move dma properties from dtsi to dts.
- Cancle the macro(SERIAL_FSL_LPUART_DMA) .
- Separate the document for clocks which undocumented before into a single patch.
- Change some explanations in document(clocks, clock-names, dmas, dma-names).
- Change "lpuart-tx" and "lpuart-rx" to "tx" and "rx".

Changed in v3:
- Use the streaming DMA API for receive.
- Add the macro(SERIAL_FSL_LPUART_DMA) and dts node propertie for whether using the dma.
- Adjust some coding style.

Changed in v2:
- Add eDMA support for lpuart receive.
- Use dma_mapping_error test dma_map_single.
- Change some names of variable.
- Fix some bugs.

Added in v1:
- Add device tree bindings for lupart eDMA support.
- Add eDMA support for lpuart send.

author
#1 lore raw

PATCH v6 1/3 ARM: dts: vf610: lpuart: Add eDMA support

Add lpuart dts node properties for eDMA support, them depend on the eDMA driver.

---
 arch/arm/boot/dts/vf610.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/vf610.dtsi +12 -0
index 365e0fa..8f523b0 100644
@@ -94,6 +94,9 @@
 				interrupts = <0 61 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_UART0>;
 				clock-names = "ipg";
+				dmas = <&edma0 0 2>,
+					<&edma0 0 3>;
+				dma-names = "rx","tx";
 				status = "disabled";
 			};
 
@@ -103,6 +106,9 @@
 				interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_UART1>;
 				clock-names = "ipg";
+				dmas = <&edma0 0 4>,
+					<&edma0 0 5>;
+				dma-names = "rx","tx";
 				status = "disabled";
 			};
 
@@ -112,6 +118,9 @@
 				interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_UART2>;
 				clock-names = "ipg";
+				dmas = <&edma0 0 6>,
+					<&edma0 0 7>;
+				dma-names = "rx","tx";
 				status = "disabled";
 			};
 
@@ -121,6 +130,9 @@
 				interrupts = <0 64 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks VF610_CLK_UART3>;
 				clock-names = "ipg";
+				dmas = <&edma0 0 8>,
+					<&edma0 0 9>;
+				dma-names = "rx","tx";
 				status = "disabled";
 			};
 
Signature · 1 line
1.8.4
author
#3 lore raw

PATCH v6 2/3 serial: fsl_lpuart: add DMA support

In reply to Yuan Yao

Add dma support for lpuart. This function depend on DMA driver. You can turn on it by write both the dmas and dma-name properties in dts node.

---
 .../devicetree/bindings/serial/fsl-lpuart.txt      |  19 +-
 drivers/tty/serial/fsl_lpuart.c                    | 430 ++++++++++++++++++++-
 2 files changed, 433 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/serial/fsl-lpuart.txt +13 -4
index 6fd1dd1..6e1cbbf 100644
@@ -5,10 +5,19 @@ Reqiuired properties:
 - reg : Address and length of the register set for the device
 - interrupts : Should contain uart interrupt
 
+Optional properties:
+- dmas: A list of two dma specifiers, one for each entry in dma-names.
+- dma-names: should contain "tx" and "rx".
+
+Note: Optional properties for DMA support. Write them both or both not.
+
 Example:
 
 uart0: serial at 40027000 {
-	       compatible = "fsl,vf610-lpuart";
-	       reg = <0x40027000 0x1000>;
-	       interrupts = <0 61 0x00>;
-       };
+		compatible = "fsl,vf610-lpuart";
+		reg = <0x40027000 0x1000>;
+		interrupts = <0 61 0x00>;
+		dmas = <&edma0 0 2>,
+			<&edma0 0 3>;
+		dma-names = "rx","tx";
+	};
drivers/tty/serial/fsl_lpuart.c +418 -12

507 lines not on this page · raw message

Signature · 1 line
1.8.4
#4 lore raw

PATCH v6 2/3 serial: fsl_lpuart: add DMA support

Quoted 28 lines · Yuan Yao

Add dma support for lpuart. This function depend on DMA driver. You can turn on it by write both the dmas and dma-name properties in dts node.

---
 .../devicetree/bindings/serial/fsl-lpuart.txt      |  19 +-
 drivers/tty/serial/fsl_lpuart.c                    | 430 ++++++++++++++++++++-
 2 files changed, 433 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/serial/fsl-lpuart.txt +6 -1
index 6fd1dd1..6e1cbbf 100644
@@ -5,10 +5,19 @@ Reqiuired properties:
 - reg : Address and length of the register set for the device
 - interrupts : Should contain uart interrupt
 
+Optional properties:
+- dmas: A list of two dma specifiers, one for each entry in dma-names.
+- dma-names: should contain "tx" and "rx".
+
+Note: Optional properties for DMA support. Write them both or both not.
+
 Example:
 
 uart0: serial at 40027000 {
-              compatible = "fsl,vf610-lpuart";

Documentation/devicetree/bindings/serial/fsl-lpuart.txt Reqiuired properties: · line 23

Quoted 10 lines
Documentation/devicetree/bindings/serial/fsl-lpuart.txt +7 -3
-              reg = <0x40027000 0x1000>;
-              interrupts = <0 61 0x00>;
-       };
+               compatible = "fsl,vf610-lpuart";
+               reg = <0x40027000 0x1000>;
+               interrupts = <0 61 0x00>;
+               dmas = <&edma0 0 2>,
+                       <&edma0 0 3>;
+               dma-names = "rx","tx";
+       };

For the binding:

Mark.

author
#5 lore raw

PATCH v6 3/3 serial: fsl_lpuart: documented the clock requirement.

In reply to Yuan Yao

This is a correction to the documentation. It was previously required but not documented.

---
 Documentation/devicetree/bindings/serial/fsl-lpuart.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/serial/fsl-lpuart.txt +4 -0
index 6e1cbbf..9666f97 100644
@@ -4,6 +4,8 @@ Required properties:
 - compatible : Should be "fsl,<soc>-lpuart"
 - reg : Address and length of the register set for the device
 - interrupts : Should contain uart interrupt
+- clocks : phandle + clock specifier pairs, one for each entry in clock-names
+- clock-names : should contain: "ipg" - the uart clock
 
 Optional properties:
 - dmas: A list of two dma specifiers, one for each entry in dma-names.
@@ -22,6 +24,8 @@ uart0: serial at 40027000 {
 		compatible = "fsl,vf610-lpuart";
 		reg = <0x40027000 0x1000>;
 		interrupts = <0 61 0x00>;
+		clocks = <&clks VF610_CLK_UART0>;
+		clock-names = "ipg";
 		dmas = <&edma0 0 2>,
 			<&edma0 0 3>;
 		dma-names = "rx","tx";
Signature · 1 line
1.8.4