Re: [PATCH V7 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
On 18-02-21, 23:20, Frank Rowand wrote: > Hi Viresh, > > I am in the wrong version with the comments below. You are at version 8 now. Yeah, it is fine. I have updated the patches already based on your comments. -- viresh
Re: [PATCH V7 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
Hi Viresh, I am in the wrong version with the comments below. You are at version 8 now. -Frank On 2/18/21 3:02 PM, Frank Rowand wrote: > On 1/29/21 1:24 AM, Viresh Kumar wrote: >> In order to build-test the same unit-test files using fdtoverlay tool, >> move the device nodes from the existing overlay_base.dts and >> testcases_common.dts files to .dtsi counterparts. The .dts files now >> include the new .dtsi files, resulting in exactly the same behavior as >> earlier. >> >> The .dtsi files can now be reused for compile time tests using >> fdtoverlay (will be done by a later commit). >> >> This is required because the base files passed to fdtoverlay tool >> shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; >> tag). >> >> Note that this commit also moves "testcase-device2" node to >> testcases.dts from tests-interrupts.dtsi, as this node has a deliberate >> error in it and is only relevant for runtime testing done with >> unittest.c. >> >> Signed-off-by: Viresh Kumar >> --- >> drivers/of/unittest-data/overlay_base.dts | 90 +- >> drivers/of/unittest-data/overlay_common.dtsi | 91 +++ >> drivers/of/unittest-data/testcases.dts| 18 ++-- >> .../of/unittest-data/testcases_common.dtsi| 19 >> .../of/unittest-data/tests-interrupts.dtsi| 7 -- >> 5 files changed, 118 insertions(+), 107 deletions(-) >> create mode 100644 drivers/of/unittest-data/overlay_common.dtsi >> create mode 100644 drivers/of/unittest-data/testcases_common.dtsi >> >> diff --git a/drivers/of/unittest-data/overlay_base.dts >> b/drivers/of/unittest-data/overlay_base.dts >> index 99ab9d12d00b..ab9014589c5d 100644 >> --- a/drivers/of/unittest-data/overlay_base.dts >> +++ b/drivers/of/unittest-data/overlay_base.dts >> @@ -2,92 +2,4 @@ >> /dts-v1/; >> /plugin/; >> >> -/* >> - * Base device tree that overlays will be applied against. >> - * >> - * Do not add any properties in node "/". >> - * Do not add any nodes other than "/testcase-data-2" in node "/". >> - * Do not add anything that would result in dtc creating node "/__fixups__". >> - * dtc will create nodes "/__symbols__" and "/__local_fixups__". >> - */ >> - >> -/ { >> -testcase-data-2 { >> -#address-cells = <1>; >> -#size-cells = <1>; >> - >> -electric_1: substation@100 { >> -compatible = "ot,big-volts-control"; >> -reg = < 0x0100 0x100 >; >> -status = "disabled"; >> - >> -hvac_1: hvac-medium-1 { >> -compatible = "ot,hvac-medium"; >> -heat-range = < 50 75 >; >> -cool-range = < 60 80 >; >> -}; >> - >> -spin_ctrl_1: motor-1 { >> -compatible = "ot,ferris-wheel-motor"; >> -spin = "clockwise"; >> -rpm_avail = < 50 >; >> -}; >> - >> -spin_ctrl_2: motor-8 { >> -compatible = "ot,roller-coaster-motor"; >> -}; >> -}; >> - >> -rides_1: fairway-1 { >> -#address-cells = <1>; >> -#size-cells = <1>; >> -compatible = "ot,rides"; >> -status = "disabled"; >> -orientation = < 127 >; >> - >> -ride@100 { >> -#address-cells = <1>; >> -#size-cells = <1>; >> -compatible = "ot,roller-coaster"; >> -reg = < 0x0100 0x100 >; >> -hvac-provider = < &hvac_1 >; >> -hvac-thermostat = < 29 > ; >> -hvac-zones = < 14 >; >> -hvac-zone-names = "operator"; >> -spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 >> 7 >; >> -spin-controller-names = "track_1", "track_2"; >> -queues = < 2 >; >> - >> -track@30 { >> -reg = < 0x0030 0x10 >; >> -}; >> - >> -track@40 { >> -reg = < 0x0040 0x10 >; >> -}; >> - >> -}; >> -}; >> - >> -lights_1: lights@3 { >> -compatible = "ot,work-lights"; >> -reg = < 0x0003 0x1000 >; >> -status = "disabled"; >> -}; >> - >> -lights_2: lights@4 { >> -compatible = "ot,show-lights"; >> -reg = < 0x0004 0x1000 >; >> -status = "disabled"; >> -rate = < 13 138 >; >> -
Re: [PATCH V7 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
On 1/29/21 1:24 AM, Viresh Kumar wrote: > In order to build-test the same unit-test files using fdtoverlay tool, > move the device nodes from the existing overlay_base.dts and > testcases_common.dts files to .dtsi counterparts. The .dts files now > include the new .dtsi files, resulting in exactly the same behavior as > earlier. > > The .dtsi files can now be reused for compile time tests using > fdtoverlay (will be done by a later commit). > > This is required because the base files passed to fdtoverlay tool > shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; > tag). > > Note that this commit also moves "testcase-device2" node to > testcases.dts from tests-interrupts.dtsi, as this node has a deliberate > error in it and is only relevant for runtime testing done with > unittest.c. > > Signed-off-by: Viresh Kumar > --- > drivers/of/unittest-data/overlay_base.dts | 90 +- > drivers/of/unittest-data/overlay_common.dtsi | 91 +++ > drivers/of/unittest-data/testcases.dts| 18 ++-- > .../of/unittest-data/testcases_common.dtsi| 19 > .../of/unittest-data/tests-interrupts.dtsi| 7 -- > 5 files changed, 118 insertions(+), 107 deletions(-) > create mode 100644 drivers/of/unittest-data/overlay_common.dtsi > create mode 100644 drivers/of/unittest-data/testcases_common.dtsi > > diff --git a/drivers/of/unittest-data/overlay_base.dts > b/drivers/of/unittest-data/overlay_base.dts > index 99ab9d12d00b..ab9014589c5d 100644 > --- a/drivers/of/unittest-data/overlay_base.dts > +++ b/drivers/of/unittest-data/overlay_base.dts > @@ -2,92 +2,4 @@ > /dts-v1/; > /plugin/; > > -/* > - * Base device tree that overlays will be applied against. > - * > - * Do not add any properties in node "/". > - * Do not add any nodes other than "/testcase-data-2" in node "/". > - * Do not add anything that would result in dtc creating node "/__fixups__". > - * dtc will create nodes "/__symbols__" and "/__local_fixups__". > - */ > - > -/ { > - testcase-data-2 { > - #address-cells = <1>; > - #size-cells = <1>; > - > - electric_1: substation@100 { > - compatible = "ot,big-volts-control"; > - reg = < 0x0100 0x100 >; > - status = "disabled"; > - > - hvac_1: hvac-medium-1 { > - compatible = "ot,hvac-medium"; > - heat-range = < 50 75 >; > - cool-range = < 60 80 >; > - }; > - > - spin_ctrl_1: motor-1 { > - compatible = "ot,ferris-wheel-motor"; > - spin = "clockwise"; > - rpm_avail = < 50 >; > - }; > - > - spin_ctrl_2: motor-8 { > - compatible = "ot,roller-coaster-motor"; > - }; > - }; > - > - rides_1: fairway-1 { > - #address-cells = <1>; > - #size-cells = <1>; > - compatible = "ot,rides"; > - status = "disabled"; > - orientation = < 127 >; > - > - ride@100 { > - #address-cells = <1>; > - #size-cells = <1>; > - compatible = "ot,roller-coaster"; > - reg = < 0x0100 0x100 >; > - hvac-provider = < &hvac_1 >; > - hvac-thermostat = < 29 > ; > - hvac-zones = < 14 >; > - hvac-zone-names = "operator"; > - spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 > 7 >; > - spin-controller-names = "track_1", "track_2"; > - queues = < 2 >; > - > - track@30 { > - reg = < 0x0030 0x10 >; > - }; > - > - track@40 { > - reg = < 0x0040 0x10 >; > - }; > - > - }; > - }; > - > - lights_1: lights@3 { > - compatible = "ot,work-lights"; > - reg = < 0x0003 0x1000 >; > - status = "disabled"; > - }; > - > - lights_2: lights@4 { > - compatible = "ot,show-lights"; > - reg = < 0x0004 0x1000 >; > - status = "disabled"; > - rate = < 13 138 >; > - }; > - > - retail_1: vending@5 { > - reg = < 0x0005 0x1000 >; > - compatible = "ot,tickets"; > - status =
[PATCH V7 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
In order to build-test the same unit-test files using fdtoverlay tool, move the device nodes from the existing overlay_base.dts and testcases_common.dts files to .dtsi counterparts. The .dts files now include the new .dtsi files, resulting in exactly the same behavior as earlier. The .dtsi files can now be reused for compile time tests using fdtoverlay (will be done by a later commit). This is required because the base files passed to fdtoverlay tool shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; tag). Note that this commit also moves "testcase-device2" node to testcases.dts from tests-interrupts.dtsi, as this node has a deliberate error in it and is only relevant for runtime testing done with unittest.c. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/overlay_base.dts | 90 +- drivers/of/unittest-data/overlay_common.dtsi | 91 +++ drivers/of/unittest-data/testcases.dts| 18 ++-- .../of/unittest-data/testcases_common.dtsi| 19 .../of/unittest-data/tests-interrupts.dtsi| 7 -- 5 files changed, 118 insertions(+), 107 deletions(-) create mode 100644 drivers/of/unittest-data/overlay_common.dtsi create mode 100644 drivers/of/unittest-data/testcases_common.dtsi diff --git a/drivers/of/unittest-data/overlay_base.dts b/drivers/of/unittest-data/overlay_base.dts index 99ab9d12d00b..ab9014589c5d 100644 --- a/drivers/of/unittest-data/overlay_base.dts +++ b/drivers/of/unittest-data/overlay_base.dts @@ -2,92 +2,4 @@ /dts-v1/; /plugin/; -/* - * Base device tree that overlays will be applied against. - * - * Do not add any properties in node "/". - * Do not add any nodes other than "/testcase-data-2" in node "/". - * Do not add anything that would result in dtc creating node "/__fixups__". - * dtc will create nodes "/__symbols__" and "/__local_fixups__". - */ - -/ { - testcase-data-2 { - #address-cells = <1>; - #size-cells = <1>; - - electric_1: substation@100 { - compatible = "ot,big-volts-control"; - reg = < 0x0100 0x100 >; - status = "disabled"; - - hvac_1: hvac-medium-1 { - compatible = "ot,hvac-medium"; - heat-range = < 50 75 >; - cool-range = < 60 80 >; - }; - - spin_ctrl_1: motor-1 { - compatible = "ot,ferris-wheel-motor"; - spin = "clockwise"; - rpm_avail = < 50 >; - }; - - spin_ctrl_2: motor-8 { - compatible = "ot,roller-coaster-motor"; - }; - }; - - rides_1: fairway-1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,rides"; - status = "disabled"; - orientation = < 127 >; - - ride@100 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,roller-coaster"; - reg = < 0x0100 0x100 >; - hvac-provider = < &hvac_1 >; - hvac-thermostat = < 29 > ; - hvac-zones = < 14 >; - hvac-zone-names = "operator"; - spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 7 >; - spin-controller-names = "track_1", "track_2"; - queues = < 2 >; - - track@30 { - reg = < 0x0030 0x10 >; - }; - - track@40 { - reg = < 0x0040 0x10 >; - }; - - }; - }; - - lights_1: lights@3 { - compatible = "ot,work-lights"; - reg = < 0x0003 0x1000 >; - status = "disabled"; - }; - - lights_2: lights@4 { - compatible = "ot,show-lights"; - reg = < 0x0004 0x1000 >; - status = "disabled"; - rate = < 13 138 >; - }; - - retail_1: vending@5 { - reg = < 0x0005 0x1000 >; - compatible = "ot,tickets"; - status = "disabled"; - }; - - }; -}; - +#include "overlay_common.dtsi" diff --git a/drivers/of/unittest-data/overlay_common.dtsi b/drivers/of/unittest