summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/bad-graph-child-address.dts22
-rw-r--r--tests/bad-graph-reg-cells.dts36
-rwxr-xr-xtests/run_tests.sh3
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