Skip to contentSkip to conversation

of: selftest/dma: Add selftest for new DT DMA

PATCH Superseded Jon Hunter 1 participant 1 message Apr 30, 2012

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jon Hunter

author
#0 lore raw

PATCH v3 2/2 of: selftest/dma: Add selftest for new DT DMA

From: Jon Hunter <[email protected]>

These selftests are covering the new DT DMA helpers for both legacy controllers (not supporting DMA Engine) and controllers supporting DMA Engine. They will test both error and normal cases.

A dummy DMA engine filter function is also provided to show how this is used when registering a new DMA controller if the driver uses DMA engine.

Cc Nicolas Ferre <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Grant Likely <[email protected]>
Cc Russell King <[email protected]>
Cc Rob Herring <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/boot/dts/at91sam9m10g45ek.dts     |    2 +
 arch/arm/boot/dts/omap4-panda.dts          |    2 +
 arch/arm/boot/dts/testcases/tests-dma.dtsi |   32 ++++++++
 arch/arm/boot/dts/testcases/tests.dtsi     |    1 +
 drivers/of/selftest.c                      |  118 ++++++++++++++++++++++++++++
 5 files changed, 155 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/testcases/tests-dma.dtsi
arch/arm/boot/dts/at91sam9m10g45ek.dts +2 -0
index a3633bd..4b3c942 100644
@@ -154,3 +154,5 @@
 		};
 	};
 };
+
+/include/ "testcases/tests.dtsi"
arch/arm/boot/dts/omap4-panda.dts +2 -0
index ea6f5bb..a79d637 100644
@@ -74,3 +74,5 @@
 	ti,non-removable;
 	ti,bus-width = <4>;
 };
+
+/include/ "testcases/tests.dtsi"
arch/arm/boot/dts/testcases/tests-dma.dtsi new file +32 -0
new file mode 100644
index 0000000..a75d155
@@ -0,0 +1,32 @@
+
+/ {
+	testcase-data {
+		dma-tests {
+			testdmac0: test-dma-controller0 {
+				#dma-cells = <2>;
+			};
+
+			testdmac1: test-dma-controller1 {
+				#dma-cells = <2>;
+			};
+
+			/* wrong number of cells */
+			testdmac2: test-dma-controller2 {
+				#dma-cells = <1>;
+			};
+
+			dma-slave-a {
+				dma = <&testdmac0 42 1>;
+			};
+
+			/* wrong number of values */
+			dma-slave-b {
+				dma = <&testdmac1 24>;
+			};
+
+			dma-slave-c {
+				dma = <&testdmac1 24 2>;
+			};
+		};
+	};
+};
arch/arm/boot/dts/testcases/tests.dtsi +1 -0
index a7c5067..e3afb2b 100644
@@ -1 +1,2 @@
 /include/ "tests-phandle.dtsi"
+/include/ "tests-dma.dtsi"
drivers/of/selftest.c +118 -0

140 lines not on this page · raw message

Signature · 1 line
1.7.5.4