diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 11:25:57 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 15:40:16 -0500 |
commit | 53a42093d96ef5ede3b4f4cdb8f3256f27228ab0 (patch) | |
tree | 7ed1bf6fc3b9aa764072a2969903b316fd333871 /arch/arm/boot | |
parent | 15c9a0acc3f7873db4b7d35d016729b2dc229b49 (diff) |
of: Add device tree selftests
Add some runtime test cases for the library of device tree parsing functions.
v2: - Add testcase for phandle with 0 args
- Don't run testcases if testcase data isn't present in device tree
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/boot')
-rw-r--r-- | arch/arm/boot/dts/testcases/tests-phandle.dtsi | 37 | ||||
-rw-r--r-- | arch/arm/boot/dts/testcases/tests.dtsi | 1 | ||||
-rw-r--r-- | arch/arm/boot/dts/versatile-pb.dts | 2 |
3 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi new file mode 100644 index 000000000000..ec0c4e6212c9 --- /dev/null +++ b/arch/arm/boot/dts/testcases/tests-phandle.dtsi | |||
@@ -0,0 +1,37 @@ | |||
1 | |||
2 | / { | ||
3 | testcase-data { | ||
4 | phandle-tests { | ||
5 | provider0: provider0 { | ||
6 | #phandle-cells = <0>; | ||
7 | }; | ||
8 | |||
9 | provider1: provider1 { | ||
10 | #phandle-cells = <1>; | ||
11 | }; | ||
12 | |||
13 | provider2: provider2 { | ||
14 | #phandle-cells = <2>; | ||
15 | }; | ||
16 | |||
17 | provider3: provider3 { | ||
18 | #phandle-cells = <3>; | ||
19 | }; | ||
20 | |||
21 | consumer-a { | ||
22 | phandle-list = <&provider1 1>, | ||
23 | <&provider2 2 0>, | ||
24 | <0>, | ||
25 | <&provider3 4 4 3>, | ||
26 | <&provider2 5 100>, | ||
27 | <&provider0>, | ||
28 | <&provider1 7>; | ||
29 | phandle-list-names = "first", "second", "third"; | ||
30 | |||
31 | phandle-list-bad-phandle = <12345678 0 0>; | ||
32 | phandle-list-bad-args = <&provider2 1 0>, | ||
33 | <&provider3 0>; | ||
34 | }; | ||
35 | }; | ||
36 | }; | ||
37 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi new file mode 100644 index 000000000000..a7c5067622e8 --- /dev/null +++ b/arch/arm/boot/dts/testcases/tests.dtsi | |||
@@ -0,0 +1 @@ | |||
/include/ "tests-phandle.dtsi" | |||
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts index 8a614e398004..166461073b78 100644 --- a/arch/arm/boot/dts/versatile-pb.dts +++ b/arch/arm/boot/dts/versatile-pb.dts | |||
@@ -46,3 +46,5 @@ | |||
46 | }; | 46 | }; |
47 | }; | 47 | }; |
48 | }; | 48 | }; |
49 | |||
50 | /include/ "testcases/tests.dtsi" | ||