]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
of: convert unittest overlay devicetree source to sugar syntax
authorFrank Rowand <frank.rowand@sony.com>
Mon, 12 Feb 2018 08:23:45 +0000 (00:23 -0800)
committerFrank Rowand <frowand.list@gmail.com>
Sun, 4 Mar 2018 08:29:34 +0000 (00:29 -0800)
The unittest-data overlays have been pulled into proper overlay
devicetree source files without changing their format.  The
next step is to convert them to use sugar syntax instead of
hand coding overlay fragments structure.

A few of the overlays can not be converted because they test
absolute target paths in the overlay fragment.  dtc does not
generate this type of target:
  overlay_0.dts
  overlay_1.dts
  overlay_12.dts
  overlay_13.dts

Two pre-existing unittest overlay devicetree source files are
also converted:
  overlay_bad_phandle.dts
  overlay_bad_symbol.dts

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
15 files changed:
drivers/of/unittest-data/overlay.dts
drivers/of/unittest-data/overlay_10.dts
drivers/of/unittest-data/overlay_11.dts
drivers/of/unittest-data/overlay_15.dts
drivers/of/unittest-data/overlay_2.dts
drivers/of/unittest-data/overlay_3.dts
drivers/of/unittest-data/overlay_4.dts
drivers/of/unittest-data/overlay_5.dts
drivers/of/unittest-data/overlay_6.dts
drivers/of/unittest-data/overlay_7.dts
drivers/of/unittest-data/overlay_8.dts
drivers/of/unittest-data/overlay_9.dts
drivers/of/unittest-data/overlay_bad_phandle.dts
drivers/of/unittest-data/overlay_bad_symbol.dts
drivers/of/unittest-data/tests-overlay.dtsi

index ab5e89b5e27e10cef2137073ecaa42fe838b9268..3bbc59e922fe71c343e34008f498212e36a7ede0 100644 (file)
@@ -2,76 +2,63 @@
 /dts-v1/;
 /plugin/;
 
-/ {
+&electric_1 {
 
-       fragment@0 {
-               target = <&electric_1>;
+       status = "okay";
 
-               __overlay__ {
-                       status = "okay";
-
-                       hvac_2: hvac-large-1 {
-                               compatible = "ot,hvac-large";
-                               heat-range = < 40 75 >;
-                               cool-range = < 65 80 >;
-                       };
-               };
+       hvac_2: hvac-large-1 {
+               compatible = "ot,hvac-large";
+               heat-range = < 40 75 >;
+               cool-range = < 65 80 >;
        };
+};
 
-       fragment@1 {
-               target = <&rides_1>;
-
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-                       status = "okay";
-
-                       ride@100 {
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-
-                               track@30 {
-                                       incline-up = < 48 32 16 >;
-                               };
+&rides_1 {
 
-                               track@40 {
-                                       incline-up = < 47 31 15 >;
-                               };
-                       };
+       #address-cells = <1>;
+       #size-cells = <1>;
+       status = "okay";
 
-                       ride_200: ride@200 {
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               compatible = "ot,ferris-wheel";
-                               reg = < 0x00000200 0x100 >;
-                               hvac-provider = < &hvac_2 >;
-                               hvac-thermostat = < 27 32 > ;
-                               hvac-zones = < 12 5 >;
-                               hvac-zone-names = "operator", "snack-bar";
-                               spin-controller = < &spin_ctrl_1 3 >;
-                               spin-rph = < 30 >;
-                               gondolas = < 16 >;
-                               gondola-capacity = < 6 >;
+       ride@100 {
+               #address-cells = <1>;
+               #size-cells = <1>;
 
-                               ride_200_left: track@10 {
-                                       reg = < 0x00000010 0x10 >;
-                               };
+               track@30 {
+                       incline-up = < 48 32 16 >;
+               };
 
-                               ride_200_right: track@20 {
-                                       reg = < 0x00000020 0x10 >;
-                               };
-                       };
+               track@40 {
+                       incline-up = < 47 31 15 >;
                };
        };
 
-       fragment@2 {
-               target = <&lights_2>;
+       ride_200: ride@200 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "ot,ferris-wheel";
+               reg = < 0x00000200 0x100 >;
+               hvac-provider = < &hvac_2 >;
+               hvac-thermostat = < 27 32 > ;
+               hvac-zones = < 12 5 >;
+               hvac-zone-names = "operator", "snack-bar";
+               spin-controller = < &spin_ctrl_1 3 >;
+               spin-rph = < 30 >;
+               gondolas = < 16 >;
+               gondola-capacity = < 6 >;
+
+               ride_200_left: track@10 {
+                       reg = < 0x00000010 0x10 >;
+               };
 
-               __overlay__ {
-                       status = "okay";
-                       color = "purple", "white", "red", "green";
-                       rate = < 3 256 >;
+               ride_200_right: track@20 {
+                       reg = < 0x00000020 0x10 >;
                };
        };
+};
+
+&lights_2 {
 
+       status = "okay";
+       color = "purple", "white", "red", "green";
+       rate = < 3 256 >;
 };
index 445925a10cd3daff49d55241331f1a4a8bee3fbb..73993bf23bf8b5693fa67eefeec86c1e51729c45 100644 (file)
@@ -2,33 +2,26 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_10 */
-       /* overlays 8, 9, 10, 11 application and removal in bad sequence */
+/* overlay_10 */
+/* overlays 8, 9, 10, 11 application and removal in bad sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus";
-               __overlay__ {
+&unittest_test_bus {
+       /* suppress DTC warning */
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       /* suppress DTC warning */
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+       test-unittest10 {
+               compatible = "unittest";
+               status = "okay";
+               reg = <10>;
 
-                       test-unittest10 {
-                               compatible = "unittest";
-                               status = "okay";
-                               reg = <10>;
+               #address-cells = <1>;
+               #size-cells = <0>;
 
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-
-                               test-unittest101 {
-                                       compatible = "unittest";
-                                       status = "okay";
-                                       reg = <1>;
-                               };
-
-                       };
+               test-unittest101 {
+                       compatible = "unittest";
+                       status = "okay";
+                       reg = <1>;
                };
        };
 };
index c1d14f34359e3a4759b2717eafe88756afb3c57c..9a79b253a809883366bf7046991ffdcae2018966 100644 (file)
@@ -2,33 +2,27 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_11 */
-       /* overlays 8, 9, 10, 11 application and removal in bad sequence */
+/* overlay_11 */
+/* overlays 8, 9, 10, 11 application and removal in bad sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus";
-               __overlay__ {
+&unittest_test_bus {
+       /* suppress DTC warning */
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       /* suppress DTC warning */
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+       test-unittest11 {
+               compatible = "unittest";
+               status = "okay";
+               reg = <11>;
 
-                       test-unittest11 {
-                               compatible = "unittest";
-                               status = "okay";
-                               reg = <11>;
+               #address-cells = <1>;
+               #size-cells = <0>;
 
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-
-                               test-unittest111 {
-                                       compatible = "unittest";
-                                       status = "okay";
-                                       reg = <1>;
-                               };
-
-                       };
+               test-unittest111 {
+                       compatible = "unittest";
+                       status = "okay";
+                       reg = <1>;
                };
+
        };
 };
index 44e44c62b739dc6fbae65b225f67c983bb32bd5c..b98f2514df4b35b42c38bc4b2b7abef697b8ff75 100644 (file)
@@ -2,33 +2,28 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_15 - mux overlay */
+/* overlay_15 - mux overlay */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus";
-               __overlay__ {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       test-unittest15 {
-                               reg = <11>;
-                               compatible = "unittest-i2c-mux";
-                               status = "okay";
+&unittest_i2c_test_bus {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       test-unittest15 {
+               reg = <11>;
+               compatible = "unittest-i2c-mux";
+               status = "okay";
 
-                               #address-cells = <1>;
-                               #size-cells = <0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
 
-                               i2c@0 {
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-                                       reg = <0>;
+               i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
 
-                                       test-mux-dev {
-                                               reg = <32>;
-                                               compatible = "unittest-i2c-dev";
-                                               status = "okay";
-                                       };
-                               };
+                       test-mux-dev {
+                               reg = <32>;
+                               compatible = "unittest-i2c-dev";
+                               status = "okay";
                        };
                };
        };
index cf1e4245b7ce5e1a44daf4a96f2912124e6bbdda..db8684ba89d98b8874f4ae7c5062270593593e37 100644 (file)
@@ -2,13 +2,8 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_2 -  enable using label */
+/* overlay_2 -  enable using label */
 
-       fragment@0 {
-               target = <&unittest2>;
-               __overlay__ {
-                       status = "okay";
-               };
-       };
+&unittest2 {
+       status = "okay";
 };
index 158dc44fc20a7af8196b5f9448a99ac5d4e58f56..40f289e7c23773cdc7bc86e572e79b5bd4a3bbad 100644 (file)
@@ -2,13 +2,8 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_3 - disable using label */
+/* overlay_3 - disable using label */
 
-       fragment@0 {
-               target = <&unittest3>;
-               __overlay__ {
-                       status = "disabled";
-               };
-       };
+&unittest3 {
+       status = "disabled";
 };
index b4a2e6c6b0166e35f97120e4d45100e16dc68e7c..a8a77ddf9abe829c84017f9f6f393da0bfe64faf 100644 (file)
@@ -2,22 +2,17 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_4 - test insertion of a full node */
+/* overlay_4 - test insertion of a full node */
 
-       fragment@0 {
-               target = <&unittestbus>;
-               __overlay__ {
+&unittest_test_bus {
 
-                       /* suppress DTC warning */
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+       /* suppress DTC warning */
+       #address-cells = <1>;
+       #size-cells = <0>;
 
-                       test-unittest4 {
-                               compatible = "unittest";
-                               status = "okay";
-                               reg = <4>;
-                       };
-               };
+       test-unittest4 {
+               compatible = "unittest";
+               status = "okay";
+               reg = <4>;
        };
 };
index 02ad25c1f19c347171b89f80384727337f006e10..706f5f1b737cac9efd15ae0d58a0e5e456b1b924 100644 (file)
@@ -2,13 +2,8 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_5 - test overlay apply revert */
+/* overlay_5 - test overlay apply revert */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/test-unittest5";
-               __overlay__ {
-                       status = "okay";
-               };
-       };
+&unittest5 {
+       status = "okay";
 };
index a14e965f5497761d8a7b8ad10bd83836bf958a2b..21a7fa4ca45e915cb02ca3f9d1e9d5e257f0a2bc 100644 (file)
@@ -2,14 +2,9 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_6 */
-       /* overlays 6, 7 application and removal in sequence */
+/* overlay_6 */
+/* overlays 6, 7 application and removal in sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/test-unittest6";
-               __overlay__ {
-                       status = "okay";
-               };
-       };
+&unittest6 {
+       status = "okay";
 };
index 4bd7e423209c05af0f37abd346cdab31c5554aa2..58ba1bb51b50213882b1395358713b5dd33b5717 100644 (file)
@@ -2,14 +2,9 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_7 */
-       /* overlays 6, 7 application and removal in sequence */
+/* overlay_7 */
+/* overlays 6, 7 application and removal in sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/test-unittest7";
-               __overlay__ {
-                       status = "okay";
-               };
-       };
+&unittest7 {
+       status = "okay";
 };
index 5b21c53945a9497b235d94a17ca5bcc2e900016d..e9718d118e38bbc2a751871500da97a182494364 100644 (file)
@@ -2,14 +2,9 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_8 */
-       /* overlays 8, 9, 10, 11 application and removal in bad sequence */
+/* overlay_8 */
+/* overlays 8, 9, 10, 11 application and removal in bad sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/test-unittest8";
-               __overlay__ {
-                       status = "okay";
-               };
-       };
+&unittest8 {
+       status = "okay";
 };
index 20ff055a53495ddbcb75123ce9f70dae3fcb86d7..b35e23edae500740325908d7db4be16efa1853fd 100644 (file)
@@ -2,14 +2,9 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-       /* overlay_9 */
-       /* overlays 8, 9, 10, 11 application and removal in bad sequence */
+/* overlay_9 */
+/* overlays 8, 9, 10, 11 application and removal in bad sequence */
 
-       fragment@0 {
-               target-path = "/testcase-data/overlay-node/test-bus/test-unittest8";
-               __overlay__ {
-                       property-foo = "bar";
-               };
-       };
+&unittest8 {
+       property-foo = "bar";
 };
index 4d5b99723bad03fdd8ad464c7514ef0aed70c2fb..83b79736031878fc4dbf3b12332d7f23ec841cdb 100644 (file)
@@ -2,20 +2,13 @@
 /dts-v1/;
 /plugin/;
 
-/ {
-
-       fragment@0 {
-               target = <&electric_1>;
-
-               __overlay__ {
-
-                       // This label should cause an error when the overlay
-                       // is applied.  There is already a phandle value
-                       // in the base tree for motor-1.
-                       spin_ctrl_1_conflict: motor-1 {
-                               accelerate = < 3 >;
-                               decelerate = < 5 >;
-                       };
-               };
+&electric_1 {
+
+       // This label should cause an error when the overlay
+       // is applied.  There is already a phandle value
+       // in the base tree for motor-1.
+       spin_ctrl_1_conflict: motor-1 {
+               accelerate = < 3 >;
+               decelerate = < 5 >;
        };
 };
index 135052ee1517185761c62f45e22a9c14e44a6f7f..98c6d1de144a21abe44e44bd917bbbc8bfa8d14a 100644 (file)
@@ -2,22 +2,15 @@
 /dts-v1/;
 /plugin/;
 
-/ {
+&electric_1 {
 
-       fragment@0 {
-               target = <&electric_1>;
-
-               __overlay__ {
-
-                       // This label should cause an error when the overlay
-                       // is applied.  There is already a symbol hvac_1
-                       // in the base tree
-                       hvac_1: hvac-medium-2 {
-                               compatible = "ot,hvac-medium";
-                               heat-range = < 50 75 >;
-                               cool-range = < 60 80 >;
-                       };
-
-               };
+       // This label should cause an error when the overlay
+       // is applied.  There is already a symbol hvac_1
+       // in the base tree
+       hvac_1: hvac-medium-2 {
+               compatible = "ot,hvac-medium";
+               heat-range = < 50 75 >;
+               cool-range = < 60 80 >;
        };
+
 };
index fa2fb43bccac3be9a5c5961a205f051d9e13c07d..25cf397b8f6b67f964646d4b310e5daf8b76b10e 100644 (file)
@@ -5,7 +5,7 @@
                overlay-node {
 
                        /* test bus */
-                       unittestbus: test-bus {
+                       unittest_test_bus: test-bus {
                                compatible = "simple-bus";
                                #address-cells = <1>;
                                #size-cells = <0>;
@@ -70,7 +70,7 @@
                                        reg = <8>;
                                };
 
-                               i2c-test-bus {
+                               unittest_i2c_test_bus: i2c-test-bus {
                                        compatible = "unittest-i2c-bus";
                                        status = "okay";
                                        reg = <50>;