of: selftest/dma: Add selftest for new DT DMA
Subsystems (3)
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]>
Signed-off-by Jon Hunter <[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
@@ -154,3 +154,5 @@ }; }; }; + +/include/ "testcases/tests.dtsi"
arch/arm/boot/dts/omap4-panda.dts +2 -0
@@ -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
@@ -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
@@ -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