linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	 Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Masahiro Yamada <masahiroy@kernel.org>
Cc: devicetree@vger.kernel.org,
	Michal Marek <michal.lkml@markovi.net>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	linux-kbuild@vger.kernel.org, Bill Mills <bill.mills@linaro.org>,
	linux-kernel@vger.kernel.org,
	Michal Simek <michal.simek@xilinx.com>,
	anmar.oueja@linaro.org, Geert Uytterhoeven <geert@linux-m68k.org>,
	Frank Rowand <frowand.list@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH V8 3/4] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
Date: Mon, 1 Mar 2021 21:12:14 -0600	[thread overview]
Message-ID: <34c67b01-6504-83c9-c7ec-cc351f0f2423@gmail.com> (raw)
In-Reply-To: <d4775a7280b93ffed64291f8f67d9d2dba564f21.1613127681.git.viresh.kumar@linaro.org>

Hi Viresh,

I commented on this patch in v7 after you had created v8.  You acknowledged
that comment and said that it will be corrected.

-Frank

On 2/12/21 5:18 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 <viresh.kumar@linaro.org>
> ---
>  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 = < 0x00000100 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 = < 0x00000100 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 = < 0x00000030 0x10 >;
> -				};
> -
> -				track@40 {
> -					reg = < 0x00000040 0x10 >;
> -				};
> -
> -			};
> -		};
> -
> -		lights_1: lights@30000 {
> -			compatible = "ot,work-lights";
> -			reg = < 0x00030000 0x1000 >;
> -			status = "disabled";
> -		};
> -
> -		lights_2: lights@40000 {
> -			compatible = "ot,show-lights";
> -			reg = < 0x00040000 0x1000 >;
> -			status = "disabled";
> -			rate = < 13 138 >;
> -		};
> -
> -		retail_1: vending@50000 {
> -			reg = < 0x00050000 0x1000 >;
> -			compatible = "ot,tickets";
> -			status = "disabled";
> -		};
> -
> -	};
> -};
> -
> +#include "overlay_common.dtsi"
> diff --git a/drivers/of/unittest-data/overlay_common.dtsi b/drivers/of/unittest-data/overlay_common.dtsi
> new file mode 100644
> index 000000000000..08874a72556e
> --- /dev/null
> +++ b/drivers/of/unittest-data/overlay_common.dtsi
> @@ -0,0 +1,91 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/*
> + * 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 = < 0x00000100 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 = < 0x00000100 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 = < 0x00000030 0x10 >;
> +				};
> +
> +				track@40 {
> +					reg = < 0x00000040 0x10 >;
> +				};
> +
> +			};
> +		};
> +
> +		lights_1: lights@30000 {
> +			compatible = "ot,work-lights";
> +			reg = < 0x00030000 0x1000 >;
> +			status = "disabled";
> +		};
> +
> +		lights_2: lights@40000 {
> +			compatible = "ot,show-lights";
> +			reg = < 0x00040000 0x1000 >;
> +			status = "disabled";
> +			rate = < 13 138 >;
> +		};
> +
> +		retail_1: vending@50000 {
> +			reg = < 0x00050000 0x1000 >;
> +			compatible = "ot,tickets";
> +			status = "disabled";
> +		};
> +
> +	};
> +};
> +
> diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dts
> index a85b5e1c381a..04b9e7bb30d9 100644
> --- a/drivers/of/unittest-data/testcases.dts
> +++ b/drivers/of/unittest-data/testcases.dts
> @@ -2,19 +2,15 @@
>  /dts-v1/;
>  /plugin/;
>  
> +#include "testcases_common.dtsi"
> +
>  / {
>  	testcase-data {
> -		changeset {
> -			prop-update = "hello";
> -			prop-remove = "world";
> -			node-remove {
> -			};
> +		testcase-device2 {
> +			compatible = "testcase-device";
> +			interrupt-parent = <&test_intc2>;
> +			interrupts = <1>; /* invalid specifier - too short */
>  		};
>  	};
> +
>  };
> -#include "tests-phandle.dtsi"
> -#include "tests-interrupts.dtsi"
> -#include "tests-match.dtsi"
> -#include "tests-address.dtsi"
> -#include "tests-platform.dtsi"
> -#include "tests-overlay.dtsi"
> diff --git a/drivers/of/unittest-data/testcases_common.dtsi b/drivers/of/unittest-data/testcases_common.dtsi
> new file mode 100644
> index 000000000000..19292bbb4cbb
> --- /dev/null
> +++ b/drivers/of/unittest-data/testcases_common.dtsi
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/ {
> +	testcase-data {
> +		changeset {
> +			prop-update = "hello";
> +			prop-remove = "world";
> +			node-remove {
> +			};
> +		};
> +	};
> +};
> +
> +#include "tests-phandle.dtsi"
> +#include "tests-interrupts.dtsi"
> +#include "tests-match.dtsi"
> +#include "tests-address.dtsi"
> +#include "tests-platform.dtsi"
> +#include "tests-overlay.dtsi"
> diff --git a/drivers/of/unittest-data/tests-interrupts.dtsi b/drivers/of/unittest-data/tests-interrupts.dtsi
> index ec175e800725..0e5914611107 100644
> --- a/drivers/of/unittest-data/tests-interrupts.dtsi
> +++ b/drivers/of/unittest-data/tests-interrupts.dtsi
> @@ -61,12 +61,5 @@ testcase-device1 {
>  			interrupt-parent = <&test_intc0>;
>  			interrupts = <1>;
>  		};
> -
> -		testcase-device2 {
> -			compatible = "testcase-device";
> -			interrupt-parent = <&test_intc2>;
> -			interrupts = <1>; /* invalid specifier - too short */
> -		};
>  	};
> -
>  };
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-03-02  3:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 11:18 [PATCH V8 0/4] dt: Add fdtoverlay rule and statically build unittest Viresh Kumar
2021-02-12 11:18 ` [PATCH V8 1/4] kbuild: Simplify builds with CONFIG_OF_ALL_DTBS Viresh Kumar
2021-02-12 11:18 ` [PATCH V8 2/4] kbuild: Add generic rule to apply fdtoverlay Viresh Kumar
2021-02-12 11:18 ` [PATCH V8 3/4] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Viresh Kumar
2021-03-02  3:12   ` Frank Rowand [this message]
2021-02-12 11:18 ` [PATCH V8 4/4] of: unittest: Statically apply overlays using fdtoverlay Viresh Kumar
2021-03-01  6:56 ` [PATCH V8 0/4] dt: Add fdtoverlay rule and statically build unittest Viresh Kumar
2021-03-02  3:14   ` Frank Rowand
2021-03-02  4:02     ` Viresh Kumar
2021-03-02 20:17       ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34c67b01-6504-83c9-c7ec-cc351f0f2423@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=anmar.oueja@linaro.org \
    --cc=bill.mills@linaro.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=michal.simek@xilinx.com \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robh+dt@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).