From patchwork Wed Mar 10 05:35:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 396679 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp97990jai; Tue, 9 Mar 2021 21:36:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeaEN+DZjaJWvg9UmEaxB4s4S4qKVHdKO6qYfpgZdywUck20Frra7sFTSRcgOtQ9nSqShD X-Received: by 2002:a17:906:f44:: with SMTP id h4mr1719233ejj.204.1615354592833; Tue, 09 Mar 2021 21:36:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615354592; cv=none; d=google.com; s=arc-20160816; b=sT7IoZ/hI0hfvVAiinq/lhh67/6kNJLdSH9By0AGOzfmcTCs2KQYIfkpi9IGtQtSY0 dXuObzsWIw2h1yx7Ar8yTLb+B5EcZAqZmymCeWydL/7XskPSGSxsJcdPKEryAOCDkQnH zW51RY64RNR5JCtDDG3xYWH5drvDPEpfptMPmOR/UyB+Tv+c5F2eyQ45ZRiRfpXEYHnR fCmPgu+aVyTIHS/nUzrnD7DRDjPOsPoXEjjuqML2wBWzDZuQmS1vq0pWWP4idIVjA+q1 0w9DVgbLB/6pN7JCHtfaTV1qKUmwZPNl96dr9jKD5JABIFcC4sMwuP5tzXhnU/G7BOhQ wb5g== 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=kK3AKZrJOeQCtKAtMxB8Z9Z1Ce2b0S4o5SnGTaS0jr8=; b=ET+QSuNrWhmOWK+Jofs5ME82N0DTr1JJUvLxlMnaqdU+9cqABMj828ME/5slH4u8Im sGLAE7UBzLq8AailvgEXPZtAFxFzgxZacY+YOUrM2OZbtCxpWJoaji2KYp/cktS5wu4o sUJeYaDapRzKgz0AdNkRMMjvmfLkgaSbk8UM/kTUipocmtXXJcXu3yTZ/RFSyvufwa82 ELrZyzts+H4PYvYOTJBoohAWASqsH6TY1V0+NUsjsQkavhdnvHdUnT8hzoWFa3DzFMsF MadHnVdfTQuVoKWRUvNzfaJxENEGnRCzBQTx3fSUFXpM0/VRN/pvNk8RM/Lc9fDpnRsx g4Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jAOtON/A"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 x21si11161859ejb.180.2021.03.09.21.36.32; Tue, 09 Mar 2021 21:36:32 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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="jAOtON/A"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S231140AbhCJFgB (ORCPT + 6 others); Wed, 10 Mar 2021 00:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbhCJFfu (ORCPT ); Wed, 10 Mar 2021 00:35:50 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9F4C061760 for ; Tue, 9 Mar 2021 21:35:50 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id o38so10630238pgm.9 for ; Tue, 09 Mar 2021 21:35:50 -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=kK3AKZrJOeQCtKAtMxB8Z9Z1Ce2b0S4o5SnGTaS0jr8=; b=jAOtON/ADRU2LM+bMWOWLuSxDRe4xLFYByb1GAeAVw2wO2vHuBVgvKajB0Ib9c/3ZL as65TQifvapKtUV9j6WUkPhOqENie2IiO3lrAJ4y7p1fdGs+bZXQmmTnk+gQXxv0SWI5 ZhBa0JT3IpyvUc7uD4LApppjKVfvLJrVloFpL9LTcOF1Kv/vPb6I+6ebVHPfwR0ONck2 pox+D6DCxcTZDB+T5uyT8e5BbTjcMBe+2ebdeAZUrbe1x4krzSydtoy7Yczc48YIZZp5 FTg6xh4jtUuF9VWCJ8jJ2UuDq2NnxykWRyyLmpN8IgyBnfQmzQep2MJD4dSadLnzX5RJ BfmA== 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=kK3AKZrJOeQCtKAtMxB8Z9Z1Ce2b0S4o5SnGTaS0jr8=; b=cH/jKv5EriBRacd/ufGjJ6YdOtTovusSzBkzS6it4ZE3riXrrYexXun57C5/gVoqHg TovKWFO6TyZ7LTl7jAFt+edERYxrsgW5VZI4N6rFgGZEADG2wRUGzkkAH8w+qe0/nPW7 gh0Yqbw6QHPPrixp6VORKDv60JEd1C+wRoe/n85Kd9bwNELnXE8Y3VsZOcWHRbuHOqip n5jWwEEhU4RCRcpMJ1Qa5XhtHrv92yD4FXyHj2baZHh5GQbIQSiPJBplnrtquE+rXn3n CGCO7LqAKkxZgmJuX92mM8WlVpEzH97pMM12xAF/quxBNH2dball/fcHJT3NG8SczEpT uOJA== X-Gm-Message-State: AOAM531NJ+AXupUZ+X+PNizh7TcW5ga3ZmKGTq3e7XMxn7N99QmZmz7w 8Ou3AA1scF3ShE506g2yleoq0w== X-Received: by 2002:a65:6208:: with SMTP id d8mr1308074pgv.365.1615354549712; Tue, 09 Mar 2021 21:35:49 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id z2sm14694881pfa.121.2021.03.09.21.35.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Mar 2021 21:35:49 -0800 (PST) From: Viresh Kumar To: Masahiro Yamada , Rob Herring , Frank Rowand Cc: Viresh Kumar , Vincent Guittot , David Gibson , Michal Simek , Geert Uytterhoeven , anmar.oueja@linaro.org, Bill Mills , Michal Marek , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH V11 4/5] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Date: Wed, 10 Mar 2021 11:05:32 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 | 23 ++--- .../of/unittest-data/testcases_common.dtsi | 19 ++++ .../of/unittest-data/tests-interrupts.dtsi | 11 +-- 5 files changed, 128 insertions(+), 106 deletions(-) create mode 100644 drivers/of/unittest-data/overlay_common.dtsi create mode 100644 drivers/of/unittest-data/testcases_common.dtsi -- 2.25.0.rc1.19.g042ed3e048af 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..61cdd3d5fccb 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dts @@ -2,19 +2,20 @@ /dts-v1/; /plugin/; +#include "testcases_common.dtsi" + / { + /* + * testcase data that intentionally results in an error is located here + * instead of in testcases_common.dtsi so that the static overlay apply + * tests will not include the error. + */ 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..9b60a549f502 100644 --- a/drivers/of/unittest-data/tests-interrupts.dtsi +++ b/drivers/of/unittest-data/tests-interrupts.dtsi @@ -62,11 +62,10 @@ testcase-device1 { interrupts = <1>; }; - testcase-device2 { - compatible = "testcase-device"; - interrupt-parent = <&test_intc2>; - interrupts = <1>; /* invalid specifier - too short */ - }; + /* + * testcase data that intentionally results in an error is + * located in testcases.dts instead of in this file so that the + * static overlay apply tests will not include the error. + */ }; - }; From patchwork Wed Mar 10 05:35:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 396681 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp98015jai; Tue, 9 Mar 2021 21:36:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrkdsD2as0gzRk2ySdh4c/MGivUQdjbBZKUTCrxxvqFX6xr6crFBqdzXw75X7irX2KeYBU X-Received: by 2002:aa7:d98b:: with SMTP id u11mr1324009eds.352.1615354595907; Tue, 09 Mar 2021 21:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615354595; cv=none; d=google.com; s=arc-20160816; b=fi6lrRTKVYpBesUydsep4SeOhiD8lomKNandbiuusFLuGwoxDiD6s0g8kPqXlwj3gY bCgjnj1pDjYRQfblX3BfrjkQzz8WmB3dtDyevPqWVPW3eopNHjva0JoF31Sv3np8QZou J5TZEI+IPLJMFYGC97K0frLxaMBweqLfndiP8dJDfgqz362UR4Qr+IFF1Sqzjg6lvFE0 CU/uXQFUP8Ou50z7HYXfCYnZqRFNNDjsYQT/HzcmW6eDJ8LgJce0KvJMtDcpXK/xnpqk yqEkkizCpmELP/g8K/ZV6tvEqOAZ/7U0B+/A4NwYTBdcXq32Ud/O/CfbXhn0y7RsqMYR glQg== 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=K1QgQjNHtN761sdXJlMXANZwX7Jh8JMy1gwv4GNPG4g=; b=o0/xRg0kVGOTDbnGjw2Pt82LEQ6iNGU/ydzBR4Om9adcK2FtHZXOiZjxdi2yCJb3G1 MzLYs6TWo3QEJfMMWG+wGpSezMKyX/CfTRbwExxjOFO1C36RnDNY76kvZJ1Cwt6wVgEz in5BS8yTU3f4PIKA6UlDGYm1RQL40BKwvs9y2eoPWH+XBcycqL9jJebMsWnWddk3otVb VbsNygkrOuehbFkz+YIZVIFBMID/wO6sOkTA8yir8NFaXk3ZT4BdkpCi2sbW3xYTc7uL PPZnGQeHSmP5/GAhGREupGdc/5T9FunsXnuXsroDmyLDvcfgkM4cqWVWLs3YtDiu2I8+ nwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GAmoNgP4; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 x21si11161859ejb.180.2021.03.09.21.36.35; Tue, 09 Mar 2021 21:36:35 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=GAmoNgP4; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S232287AbhCJFgB (ORCPT + 6 others); Wed, 10 Mar 2021 00:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231453AbhCJFfx (ORCPT ); Wed, 10 Mar 2021 00:35:53 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4077EC061760 for ; Tue, 9 Mar 2021 21:35:53 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id ga23-20020a17090b0397b02900c0b81bbcd4so6591501pjb.0 for ; Tue, 09 Mar 2021 21:35:53 -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=K1QgQjNHtN761sdXJlMXANZwX7Jh8JMy1gwv4GNPG4g=; b=GAmoNgP4FDyWsdN8ADxZHm2HF/PpUIuwD2TAHqGkzLkkQ2FrTAmk6LYHBA8F+vhkUP N7KCM2PzgzTV1Vt5Txr2m+J993oiyImR5eh/C3DzbtG3DJd9B02Zk8uxijAaX+9jaKeQ 1o6xUDr7U7rIWz2I7+nijQ6aMx755NfuD5Otr2VPT6LfWvgeG1qks3Nc510pcexiWjJA oVk/ecPg1jDoaM70h/BLgF9GxmwmYR8w3SQKiNu3pYgHUAnv0/i6djDb/UkZpRsT5xoJ pYRTm83ZiB04qIPx0sLWzLLjaxjba0H53fzDOjEcjt8WHQyoCw2Oaj693fQxwC01kCMP xvTA== 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=K1QgQjNHtN761sdXJlMXANZwX7Jh8JMy1gwv4GNPG4g=; b=rbdMKHCCBltg6+Pz/ZVlCeiMFowKbb2nyghpsbv4xkXS3zHJLguprDXe4b0JseRVM/ HS0nHYXxTN2SqQaThiCD0LtBeOCTecRMcCONR6HHrGtg0kwC6MSaj70YySRtuHYDcoNB 3FrMUhdU8hzlHq3G+1llslE+V+QDIwg0dDfScDwz7kNrjSad2WTbsyyvm7ESLY+UZB1z 25zWtF33wZlQSIOXQKcdJ7nJoSfMpRKxb8V4laLtWNzNZD/Hk4FlEYu4paVyOWf6sJmj V5KycC2iYxkkP7StOa7hV7hhYzadoNdXp1sbnKiBRML+PAnY6uaE6246DYxqOpMzFjQS e/Ig== X-Gm-Message-State: AOAM532P2JZIVhBZC/BrIE8Nt7HpOMO3PsSGJrdAJqPQsM2+bN0yobgq 0bXDh6Mhjyumpn4ZY19aN/R072QrSFSVXg== X-Received: by 2002:a17:902:74cb:b029:e4:7a16:9925 with SMTP id f11-20020a17090274cbb02900e47a169925mr1351494plt.39.1615354552808; Tue, 09 Mar 2021 21:35:52 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id ch15sm4766966pjb.46.2021.03.09.21.35.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Mar 2021 21:35:52 -0800 (PST) From: Viresh Kumar To: Masahiro Yamada , Rob Herring , Frank Rowand Cc: Viresh Kumar , Vincent Guittot , David Gibson , Michal Simek , Geert Uytterhoeven , anmar.oueja@linaro.org, Bill Mills , Michal Marek , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH V11 5/5] of: unittest: Statically apply overlays using fdtoverlay Date: Wed, 10 Mar 2021 11:05:33 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Now that fdtoverlay is part of the kernel build, start using it to test the unitest overlays we have by applying them statically. Create two new base files static_base_1.dts and static_base_2.dts which includes other .dtsi files. Some unittest overlays deliberately contain errors that unittest checks for. These overlays will cause fdtoverlay to fail, and are thus not included for static builds. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/Makefile | 48 ++++++++++++++++++++++ drivers/of/unittest-data/static_base_1.dts | 4 ++ drivers/of/unittest-data/static_base_2.dts | 4 ++ 3 files changed, 56 insertions(+) create mode 100644 drivers/of/unittest-data/static_base_1.dts create mode 100644 drivers/of/unittest-data/static_base_2.dts -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 009f4045c8e4..a5d2d9254b2c 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -38,3 +38,51 @@ DTC_FLAGS_testcases += -@ # suppress warnings about intentional errors DTC_FLAGS_testcases += -Wno-interrupts_property + +# Apply overlays statically with fdtoverlay. This is a build time test that +# the overlays can be applied successfully by fdtoverlay. This does not +# guarantee that the overlays can be applied successfully at run time by +# unittest, but it provides a bit of build time test coverage for those +# who do not execute unittest. +# +# The overlays are applied on top of static_base_1.dtb and static_base_2.dtb to +# create static_test_1.dtb and static_test_2.dtb. If fdtoverlay detects an +# error than the kernel build will fail. static_test_1.dtb and +# static_test_2.dtb are not consumed by unittest. +# +# Some unittest overlays deliberately contain errors that unittest checks for. +# These overlays will cause fdtoverlay to fail, and are thus not included +# in the static test: +# overlay_bad_add_dup_node.dtbo \ +# overlay_bad_add_dup_prop.dtbo \ +# overlay_bad_phandle.dtbo \ +# overlay_bad_symbol.dtbo \ + +apply_static_overlay_1 := overlay_0.dtbo \ + overlay_1.dtbo \ + overlay_2.dtbo \ + overlay_3.dtbo \ + overlay_4.dtbo \ + overlay_5.dtbo \ + overlay_6.dtbo \ + overlay_7.dtbo \ + overlay_8.dtbo \ + overlay_9.dtbo \ + overlay_10.dtbo \ + overlay_11.dtbo \ + overlay_12.dtbo \ + overlay_13.dtbo \ + overlay_15.dtbo \ + overlay_gpio_01.dtbo \ + overlay_gpio_02a.dtbo \ + overlay_gpio_02b.dtbo \ + overlay_gpio_03.dtbo \ + overlay_gpio_04a.dtbo \ + overlay_gpio_04b.dtbo + +apply_static_overlay_2 := overlay.dtbo + +static_test_1-dtbs := static_base_1.dtb $(apply_static_overlay_1) +static_test_2-dtbs := static_base_2.dtb $(apply_static_overlay_2) + +dtb-$(CONFIG_OF_OVERLAY) += static_test_1.dtb static_test_2.dtb diff --git a/drivers/of/unittest-data/static_base_1.dts b/drivers/of/unittest-data/static_base_1.dts new file mode 100644 index 000000000000..10556cb3f01f --- /dev/null +++ b/drivers/of/unittest-data/static_base_1.dts @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "testcases_common.dtsi" diff --git a/drivers/of/unittest-data/static_base_2.dts b/drivers/of/unittest-data/static_base_2.dts new file mode 100644 index 000000000000..b0ea9504d6f3 --- /dev/null +++ b/drivers/of/unittest-data/static_base_2.dts @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "overlay_common.dtsi"