of: Move testcase FDT data into drivers/of
authorGrant Likely <grant.likely@linaro.org>
Tue, 18 Feb 2014 21:46:16 +0000 (21:46 +0000)
committerGrant Likely <grant.likely@linaro.org>
Thu, 20 Feb 2014 11:52:08 +0000 (11:52 +0000)
The testcase data is usable by any platform. This patch moves it into
the drivers/of directory so it can be included by any architecture.

Using the test cases requires manually adding #include <testcases.dtsi>
to the end of the boards .dtsi file and enabling CONFIG_OF_SELFTEST. Not
pretty though. A useful project would be to make the testcase code
easier to execute.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
arch/arm/boot/dts/testcases/tests-interrupts.dtsi [deleted file]
arch/arm/boot/dts/testcases/tests-phandle.dtsi [deleted file]
arch/arm/boot/dts/testcases/tests.dtsi [deleted file]
arch/arm/boot/dts/versatile-pb.dts
drivers/of/testcase-data/testcases.dtsi [new file with mode: 0644]
drivers/of/testcase-data/tests-interrupts.dtsi [new file with mode: 0644]
drivers/of/testcase-data/tests-phandle.dtsi [new file with mode: 0644]
scripts/Makefile.lib

diff --git a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi
deleted file mode 100644 (file)
index c843720..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/ {
-       testcase-data {
-               interrupts {
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-                       test_intc0: intc0 {
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-
-                       test_intc1: intc1 {
-                               interrupt-controller;
-                               #interrupt-cells = <3>;
-                       };
-
-                       test_intc2: intc2 {
-                               interrupt-controller;
-                               #interrupt-cells = <2>;
-                       };
-
-                       test_intmap0: intmap0 {
-                               #interrupt-cells = <1>;
-                               #address-cells = <0>;
-                               interrupt-map = <1 &test_intc0 9>,
-                                               <2 &test_intc1 10 11 12>,
-                                               <3 &test_intc2 13 14>,
-                                               <4 &test_intc2 15 16>;
-                       };
-
-                       test_intmap1: intmap1 {
-                               #interrupt-cells = <2>;
-                               interrupt-map = <0x5000 1 2 &test_intc0 15>;
-                       };
-
-                       interrupts0 {
-                               interrupt-parent = <&test_intc0>;
-                               interrupts = <1>, <2>, <3>, <4>;
-                       };
-
-                       interrupts1 {
-                               interrupt-parent = <&test_intmap0>;
-                               interrupts = <1>, <2>, <3>, <4>;
-                       };
-
-                       interrupts-extended0 {
-                               reg = <0x5000 0x100>;
-                               interrupts-extended = <&test_intc0 1>,
-                                                     <&test_intc1 2 3 4>,
-                                                     <&test_intc2 5 6>,
-                                                     <&test_intmap0 1>,
-                                                     <&test_intmap0 2>,
-                                                     <&test_intmap0 3>,
-                                                     <&test_intmap1 1 2>;
-                       };
-               };
-       };
-};
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi
deleted file mode 100644 (file)
index 0007d3c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/ {
-       testcase-data {
-               phandle-tests {
-                       provider0: provider0 {
-                               #phandle-cells = <0>;
-                       };
-
-                       provider1: provider1 {
-                               #phandle-cells = <1>;
-                       };
-
-                       provider2: provider2 {
-                               #phandle-cells = <2>;
-                       };
-
-                       provider3: provider3 {
-                               #phandle-cells = <3>;
-                       };
-
-                       consumer-a {
-                               phandle-list =  <&provider1 1>,
-                                               <&provider2 2 0>,
-                                               <0>,
-                                               <&provider3 4 4 3>,
-                                               <&provider2 5 100>,
-                                               <&provider0>,
-                                               <&provider1 7>;
-                               phandle-list-names = "first", "second", "third";
-
-                               phandle-list-bad-phandle = <12345678 0 0>;
-                               phandle-list-bad-args = <&provider2 1 0>,
-                                                       <&provider3 0>;
-                               empty-property;
-                               unterminated-string = [40 41 42 43];
-                       };
-               };
-       };
-};
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi
deleted file mode 100644 (file)
index 3f123ec..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/include/ "tests-phandle.dtsi"
-/include/ "tests-interrupts.dtsi"
index f43907c40c93a8cb9b101d72043fc48621e0f795..65f6577113235749c3635dc30d321fa3c775b1c0 100644 (file)
@@ -1,4 +1,4 @@
-/include/ "versatile-ab.dts"
+#include <versatile-ab.dts>
 
 / {
        model = "ARM Versatile PB";
@@ -47,4 +47,4 @@
        };
 };
 
-/include/ "testcases/tests.dtsi"
+#include <testcases.dtsi>
diff --git a/drivers/of/testcase-data/testcases.dtsi b/drivers/of/testcase-data/testcases.dtsi
new file mode 100644 (file)
index 0000000..3cc2f55
--- /dev/null
@@ -0,0 +1,2 @@
+#include "tests-phandle.dtsi"
+#include "tests-interrupts.dtsi"
diff --git a/drivers/of/testcase-data/tests-interrupts.dtsi b/drivers/of/testcase-data/tests-interrupts.dtsi
new file mode 100644 (file)
index 0000000..c843720
--- /dev/null
@@ -0,0 +1,58 @@
+
+/ {
+       testcase-data {
+               interrupts {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       test_intc0: intc0 {
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                       };
+
+                       test_intc1: intc1 {
+                               interrupt-controller;
+                               #interrupt-cells = <3>;
+                       };
+
+                       test_intc2: intc2 {
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       test_intmap0: intmap0 {
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               interrupt-map = <1 &test_intc0 9>,
+                                               <2 &test_intc1 10 11 12>,
+                                               <3 &test_intc2 13 14>,
+                                               <4 &test_intc2 15 16>;
+                       };
+
+                       test_intmap1: intmap1 {
+                               #interrupt-cells = <2>;
+                               interrupt-map = <0x5000 1 2 &test_intc0 15>;
+                       };
+
+                       interrupts0 {
+                               interrupt-parent = <&test_intc0>;
+                               interrupts = <1>, <2>, <3>, <4>;
+                       };
+
+                       interrupts1 {
+                               interrupt-parent = <&test_intmap0>;
+                               interrupts = <1>, <2>, <3>, <4>;
+                       };
+
+                       interrupts-extended0 {
+                               reg = <0x5000 0x100>;
+                               interrupts-extended = <&test_intc0 1>,
+                                                     <&test_intc1 2 3 4>,
+                                                     <&test_intc2 5 6>,
+                                                     <&test_intmap0 1>,
+                                                     <&test_intmap0 2>,
+                                                     <&test_intmap0 3>,
+                                                     <&test_intmap1 1 2>;
+                       };
+               };
+       };
+};
diff --git a/drivers/of/testcase-data/tests-phandle.dtsi b/drivers/of/testcase-data/tests-phandle.dtsi
new file mode 100644 (file)
index 0000000..0007d3c
--- /dev/null
@@ -0,0 +1,39 @@
+
+/ {
+       testcase-data {
+               phandle-tests {
+                       provider0: provider0 {
+                               #phandle-cells = <0>;
+                       };
+
+                       provider1: provider1 {
+                               #phandle-cells = <1>;
+                       };
+
+                       provider2: provider2 {
+                               #phandle-cells = <2>;
+                       };
+
+                       provider3: provider3 {
+                               #phandle-cells = <3>;
+                       };
+
+                       consumer-a {
+                               phandle-list =  <&provider1 1>,
+                                               <&provider2 2 0>,
+                                               <0>,
+                                               <&provider3 4 4 3>,
+                                               <&provider2 5 100>,
+                                               <&provider0>,
+                                               <&provider1 7>;
+                               phandle-list-names = "first", "second", "third";
+
+                               phandle-list-bad-phandle = <12345678 0 0>;
+                               phandle-list-bad-args = <&provider2 1 0>,
+                                                       <&provider3 0>;
+                               empty-property;
+                               unterminated-string = [40 41 42 43];
+                       };
+               };
+       };
+};
index 49392ecbef17baf113bb9e3771384d06413bbb25..79c059e708600b04b63f8bc27cca94b485684cc8 100644 (file)
@@ -152,6 +152,7 @@ ld_flags       = $(LDFLAGS) $(ldflags-y)
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
                 -I$(srctree)/arch/$(SRCARCH)/boot/dts                   \
                 -I$(srctree)/arch/$(SRCARCH)/boot/dts/include           \
+                -I$(srctree)/drivers/of/testcase-data                   \
                 -undef -D__DTS__
 
 # Finds the multi-part object the current object will be linked into