Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1226919pxb; Wed, 10 Feb 2021 03:24:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiwQOpGIYtL0teZYhv5cs+qp/1EuPe83msFxP7tOFGtTmKUAiJQpQHvSolM65yy66vq07c X-Received: by 2002:a17:906:b6cc:: with SMTP id ec12mr2463202ejb.520.1612956289263; Wed, 10 Feb 2021 03:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612956289; cv=none; d=google.com; s=arc-20160816; b=zEy9Qe7oIJRJ1jO/5Q2ByUjqsBZtl9onYeoiOfEOfjUjWOJZJMXJWOvJhMe9LJSqTd qNZMCazX7ObDwk+FezYPpaF3fX2C0qzvWYJkUiCOHfbZlksl3DpdN6fHb7Trm6jK2vGt LQ4T+yr9SDrKOnXkqTWifImd0D5IFe4bfjEKv3mnAPfqlS4v4DUxGYotASnU/ApfZiwN 8u7nnXe++V2BRE/k+6UQjnM7z1MGzv9Sb6elwYDmfg0eb7POov3vB+8/096SkvoDGTqD kJOqQujLInc3yZRYxQiF7+5GE+mvwtqfBVaH6bJgkG6nZ+UROED7ASoh3PGg/Dio/DE2 Qvcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=GJ7K8WkttV4O+gDfRwBijy2ib8GIdZLNvLvOZIvNvb5xfHBcKOQzbvQUKhXvpAD/de el/b73wLflAC1ZyjaNLh6tn5DQ/I70K6XtnZ1pA1QSA09C82bgwcng9S8SKJN69Xrfl2 9AnlIwnqWgmoTpH8a3gGfig4M1s1bnF/mdhMvFaKJQbnoJMAjnp8VIYWjcUfu1ZzDLZg mmzyShmbqelckeJ4CGedBeOa/bJiLx/if9sBIxpanSwOrK/Wg17oJcr90IZNjf1IK7Gg UEwrpjbMCvS5JYfdfT/bjw0EdFK++/cN8cDJp52v2U81v/0kwxk/Ud6fc8xUIq4DiWGk JOtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UrqTWIRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si1123150ejc.112.2021.02.10.03.24.25; Wed, 10 Feb 2021 03:24:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UrqTWIRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231583AbhBJLWz (ORCPT + 99 others); Wed, 10 Feb 2021 06:22:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbhBJLPA (ORCPT ); Wed, 10 Feb 2021 06:15:00 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551B3C0617AA for ; Wed, 10 Feb 2021 03:13:46 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id lw17so2805305pjb.0 for ; Wed, 10 Feb 2021 03:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=UrqTWIRrmvhMgF0+rsFhusoe+vo7PodbDz5TOUeoVeEIpJVfMXDeOixZrmAqNg+DK5 h8tohSsQgyGIpkPHVnCrLCD4+05Y3rIVSY3xDiNqrEkS+OhuHqgsOBsB+Z1AcbYLtT6T U3e0/ymTUlEQxk+ZdnwE6WzunS8NA5CP8AUE9kQ1F+sn0PdO1igvRVb9OeFBhX1zJ+Zv a9235oUXKjNG8duajwSfpISOxc9bHc0zDT3AJi1dUKldxh/OYTjkl7+xa+Y+ngTrRr+o lhfbpyllZq20HW/A91xjJq/Ga0hLKK+G/KH3URUEViu7jJhPAHvJnpuzk9KvKH9NovPE g0eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=NNwLqM/4JFjsfbjnM06DuEl56HSxDJydNroOVoUowcqR7ryfA6hnLKIRH1fYe4bWcN fJP+ia7iC2Gwu/bSsyXl+6ljeN353pJb7f+XY2iyObqwRTP767PLV9OFka7bdhrMBeWZ tNxINu2fCA5teuV153i+QLiCL0EKV4v4sEr9rOs+P/OeecIZIw57Ug3xPR/bsmwqLSVw QzxhViMhwbZKbPFUXk60Xcszt1NwjBFhXrIIph+q5AZbWTfuljNpDnUP5b01W+SnUBSh pVXLLvSZukeyAb480CbkMM35aIvL95v472BHNt2g+2oxmNArF7b80vT/CSK5SpdSbl2E nr7w== X-Gm-Message-State: AOAM531jTUjBFWeNHP3DdNmohDSkrLoxb2D+/8ZbHjhgwyGe3TtJxDm6 5NaqcKWUClBo59tZ3EZHAurvdA== X-Received: by 2002:a17:90a:b282:: with SMTP id c2mr2711130pjr.54.1612955625786; Wed, 10 Feb 2021 03:13:45 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j26sm2004698pfa.35.2021.02.10.03.13.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2021 03:13:45 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , Michal Marek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org, Geert Uytterhoeven , Michal Simek Subject: [PATCH V7 2/3] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Date: Wed, 10 Feb 2021 16:43:29 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = < 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 */ - }; }; - }; -- 2.25.0.rc1.19.g042ed3e048af