diff options
author | Johannes Beisswenger <johannes.beisswenger@cetitec.com> | 2023-05-10 11:40:53 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2023-05-14 15:22:37 +1000 |
commit | d4888958d64bd9b3e0e2e6582af665f9b81706c9 (patch) | |
tree | d10b3fedbab539b4eceeddbd0bb23890df5bca5b | |
parent | ea3b9a1d2c5af56c602fbfb1585536d5b21cb874 (diff) | |
download | device-tree-compiler-d4888958d64bd9b3e0e2e6582af665f9b81706c9.tar.gz |
tests: Add additional tests for device graph checks
* bad-graph-child-address.dts: additional child address test since the
one in bad-graph.dts is now shadowed by its prerequisites also
failing.
* bad-graph-reg-cells.dts: test warnings produced by check_graph_reg().
Signed-off-by: Johannes Beisswenger <johannes.beisswenger@cetitec.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | tests/bad-graph-child-address.dts | 22 | ||||
-rw-r--r-- | tests/bad-graph-reg-cells.dts | 36 | ||||
-rwxr-xr-x | tests/run_tests.sh | 3 |
3 files changed, 61 insertions, 0 deletions
diff --git a/tests/bad-graph-child-address.dts b/tests/bad-graph-child-address.dts new file mode 100644 index 0000000..f0ae26c --- /dev/null +++ b/tests/bad-graph-child-address.dts @@ -0,0 +1,22 @@ +/dts-v1/; + / { + bar: bar { + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + bar_con: endpoint { + remote-endpoint = <&foo_con>; + }; + }; + }; + }; + foo { + port { + foo_con: endpoint { + remote-endpoint = <&bar_con>; + }; + }; + }; +}; diff --git a/tests/bad-graph-reg-cells.dts b/tests/bad-graph-reg-cells.dts new file mode 100644 index 0000000..0533db0 --- /dev/null +++ b/tests/bad-graph-reg-cells.dts @@ -0,0 +1,36 @@ +/dts-v1/; + / { + bar: bar { + ports { + #address-cells = <1>; + #size-cells = <1>; // should always be 0 + port@1 { + reg = <1 2>; // should always contain only a single cell + bar_con: endpoint { + remote-endpoint = <&foo_con>; + }; + }; + port@2 { + reg = <2>; + bar_con2: endpoint { + remote-endpoint = <&foo_con2>; + }; + }; + }; + }; + foo { + port { + #address-cells = <1>; + #size-cells = <1>; // should always be 0 + foo_con: endpoint@1 { + reg = <1 2>; // should always contain only a single cell + remote-endpoint = <&bar_con>; + }; + foo_con2: endpoint@2 { + reg = <2>; + remote-endpoint = <&bar_con2>; + }; + }; + + }; +}; diff --git a/tests/run_tests.sh b/tests/run_tests.sh index d7a6d49..8aa1f89 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -734,6 +734,9 @@ dtc_tests () { check_tests "$SRCDIR/bad-graph-root2.dts" graph_nodes check_tests "$SRCDIR/bad-graph-root3.dts" graph_nodes check_tests "$SRCDIR/bad-graph-root4.dts" graph_nodes + check_tests "$SRCDIR/bad-graph-reg-cells.dts" graph_endpoint + check_tests "$SRCDIR/bad-graph-reg-cells.dts" graph_port + check_tests "$SRCDIR/bad-graph-child-address.dts" graph_child_address run_sh_test "$SRCDIR/dtc-checkfails.sh" deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/bad-gpio.dts" run_sh_test "$SRCDIR/dtc-checkfails.sh" -n deprecated_gpio_property -- -Wdeprecated_gpio_property -I dts -O dtb "$SRCDIR/good-gpio.dts" check_tests "$SRCDIR/bad-interrupt-cells.dts" interrupts_property |