From d4888958d64bd9b3e0e2e6582af665f9b81706c9 Mon Sep 17 00:00:00 2001 From: Johannes Beisswenger Date: Wed, 10 May 2023 11:40:53 +0200 Subject: 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 Signed-off-by: David Gibson --- tests/bad-graph-child-address.dts | 22 ++++++++++++++++++++++ tests/bad-graph-reg-cells.dts | 36 ++++++++++++++++++++++++++++++++++++ tests/run_tests.sh | 3 +++ 3 files changed, 61 insertions(+) create mode 100644 tests/bad-graph-child-address.dts create mode 100644 tests/bad-graph-reg-cells.dts 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 -- cgit v1.2.1