From patchwork Mon Mar 8 10:45:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 395377 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1596738jai; Mon, 8 Mar 2021 02:46:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJaXSM6tlhx687JceebU8Mjn0lBUoAmVQeWn8tpxdlr3p+WyocCSxzAi9VnmhETMrVHVtv X-Received: by 2002:a17:907:94d4:: with SMTP id dn20mr14451530ejc.397.1615200395853; Mon, 08 Mar 2021 02:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615200395; cv=none; d=google.com; s=arc-20160816; b=kscf9uzhQ0XEKrkBWWMEdZloALCI01czJtD1caRyuFjeMoBKnlFfeIASd6s4gOZDnJ s/ASRFwAs5Ve02T2tW6UKc6v+r4mnbbW4aZag/VuXQRfR71K9nsK+jRS9p91cthfvl2E MHxCJFdSP9aYKfh+kp7U78RMDyCSO9s2fTyAZ4F6l7tcp53z8SIHf0676zS6t5BJOFUM jH8cmWU1mGwWalShqD66QI+sB4pJZRoCpNCjrBf2smG8v7GQLbNP8/m9xmarIGFAEzyj nU8YwkYV2eK81eYeI7V110BHhMzlGg6EkB+/dwsH/b5jKm6EpKqMr1Z6Huo/2uwFlpNG bO+g== 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=pEOCC7PlEJVBpxNTWQ21nzHgeN5hexKekf7n8pcGxMjM3wXd2ZPaj+CKk5XdmYAh6V o9ogn0Qx+zvHlfpuIBpLpb1XxztMr+/WORRx4LEH8Rn2lsZxu6jEYa4uucAxT6VSrBeE 1TJXsF+2pCFRJ2HaTBDpMZt+hnFQTia3BmUSuDbGfbnxxFOFkNmayrE26A1Las2vT2U9 lIMpqlOOrQpOZ76yAFRoC1eRR4/2ZeNXSAPdzoq8qJqMrElayQb4UKJiCZZ3oyLQsrF7 pJagkoxtnSnosZ7gM7xqLASFlWSWQg+r2717q85g0adGRQpa0UXXjdmGESM/gDxEb3/s TY1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqDwByIe; 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 kq25si6852973ejb.366.2021.03.08.02.46.35; Mon, 08 Mar 2021 02:46: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=LqDwByIe; 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 S231320AbhCHKqD (ORCPT + 6 others); Mon, 8 Mar 2021 05:46:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231636AbhCHKpe (ORCPT ); Mon, 8 Mar 2021 05:45:34 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDAAC06175F for ; Mon, 8 Mar 2021 02:45:34 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id u11so4645802plg.13 for ; Mon, 08 Mar 2021 02:45:34 -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=LqDwByIeuwQYzR2bhJQ2URfoiZZf6kiHEGdH6iisqNOeBLthDw3rATLZ3IWNMdwjw+ mDMf2ot0HywnTy+ZFgDwSe0LNDlMgz60w+o1O7HrMZNN2G7FoCLfZg+pHBS960nxMZJy uAVZssBZ6lhXevjFVP4dW4k0FfteIvSYnGRYFOcvUtb7Y8Pwc70ms6j5RWtegvnsTEtu ybGIuiTjgh8oZ6BFLSVRitpg+oQNuE3Gy7pHg/9441jkcmepiin2sBYNIM7m1oEml+WP E/TyBgOGBFhO5piDxzz5y9rjGmBlFt7Gpr5DAa/+tivZmoAR3FDDUgKOg9I0VXRs/SsE HMjA== 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=sP5B1suc075a/qEtjOKujdlFgqttb4GodL3bWpbDM8BZVjqRyCxZ5+LJGSN6UmOoEz WpltZfGPpy24sc9pVOELhqD/xreDjXzXJsxL41sws++LxpEDwP/kfy52El0mzEZtQf9H 3UGmqeSVFqdau7xhC8MjN1HFRqZX3qTiWR1RW2GDup4QoMn5AdIB2eW59zgzzXbRyZRR Iw+Q/QqHgWymYYYMzkRmzH18udmP4/Aq7k/mvJXNieRAmJkTjDOVfp6MqdGtgMex+Hmf RrEFJzMkda1oA1VV2xM/FB86t06v7f7jtApZW5lSBFmTKQ74aLTgW9gvLrNy1DxYmTJX AKSw== X-Gm-Message-State: AOAM532U+oVnuTt6LURXf4xHn5CbjiEMIPHCYFnFaFrbU4DO3/DaJ0+i igHGz/dHx1+jsmIjIEvBdK0AzA== X-Received: by 2002:a17:90a:5510:: with SMTP id b16mr24325005pji.87.1615200334259; Mon, 08 Mar 2021 02:45:34 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id x190sm10045278pfx.60.2021.03.08.02.45.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Mar 2021 02:45:33 -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 V10 5/5] of: unittest: Statically apply overlays using fdtoverlay Date: Mon, 8 Mar 2021 16:15:10 +0530 Message-Id: <72cb0c45cb61e0fa739249dbc0aacb1c97d1a8e8.1615199908.git.viresh.kumar@linaro.org> 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"