From patchwork Wed Feb 10 11:13:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 380218 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1058296jah; Wed, 10 Feb 2021 03:17:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrX5lQ44rbE54afxBY2BHp6B26DWnAgiFIPmlS6t2nR2JuJFBApkQqsiAbAxf6Wj0YdTao X-Received: by 2002:aa7:d8da:: with SMTP id k26mr2652008eds.364.1612955863085; Wed, 10 Feb 2021 03:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612955863; cv=none; d=google.com; s=arc-20160816; b=CqCjDU8JJvG6ALWbmCK+MPTMKgfve4D6sAPOxZgotZ0SBlEpAJoC8oi1oQsMdtDfLL ilXQdD85I0bO74vqK7V+WQ5TcjpUpE1rN5QHF8tFXeQIZCTudq9g6h3mkVwiUrgBUuCx YuzLMLvnEMbyjk45/2LOVH0QmEsbk1tfpJZaUfd7aMrlb6fwVldjlkcKumnUDesLlvlC RsuTdbbXGr5yjyxWve5DZL+JE8zv48NDO/N6s0PyzEC4C9P1Ljy5UiE8C2QQq7oIkfzD jaI0HHLFWhgCzNWMV22y5aE2JgtnP1Ezv/dQw8e59NPqbjl06i2E9mpGHjWPzEsRFG/U qQDw== 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=QRU7LnSUwsy2J1LUcByliifcDkevWGi1e/7l1FGxdFY=; b=kjcr871BooFvfT/oTjfOxcSut4JO9FwxRth5sVRXgxeIuZQBCwRlyqH37OqFtd+KyV 5TlYL/gv/a9uVKJowjJESdbM79YBmyVOUsxdlBw+ec6M7k2/FQjRo5mHTycp/6NZ6Gd/ kLB98iZEqbeWRgLGe77hJEfB26aO/k0XMY8VuilZPa/66THnscZ+gt/dLSyYA2wlgbXy c3jgMWOwz6fU6yQtGOZT35yzrZ9d790XTyQlWPzI0duJzb/0kEqpwjlu8eo6XjWOtMpS UP8GTwyWV+vcCz5YycIJhDcLdckNhMbmERlfvPxqD69AJ+cMkOz/Ny7C/6GdJCOt7Ciz qFSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g7X4InNp; 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 v2si1126518ejf.326.2021.02.10.03.17.42; Wed, 10 Feb 2021 03:17:43 -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=g7X4InNp; 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 S231220AbhBJLQv (ORCPT + 6 others); Wed, 10 Feb 2021 06:16:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbhBJLOs (ORCPT ); Wed, 10 Feb 2021 06:14:48 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505CEC0617AB for ; Wed, 10 Feb 2021 03:13:49 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id w18so1037821pfu.9 for ; Wed, 10 Feb 2021 03:13:49 -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=QRU7LnSUwsy2J1LUcByliifcDkevWGi1e/7l1FGxdFY=; b=g7X4InNpSo7NEg4suX2BeSEGrpDV26yKM5BqqZkeSr/4o8ywcQXQzv0aC+/MBYnZd0 fC+ipxMjsvmPhwCK0C5bZtf687ZxDgvraWUybv5VE2h69zapWBR6go6VRRNMfnqFedzm i/jJeZqWKTKdiikUrO6ZTVg93qXjEOyw+Rvxgk1qkRAhjygrQCm/a6SeduOz2oMzyuA9 WsmEEcrFAQ1ROZED540Fi9yBr2c2iM3gTEnogjMHya+lLRRWSszNqIGT7To5jU9lLCA3 0LOprTGRy5auRvpHEzViCdbWROCyc4uyiV54ILrBfgk/R2xVaEEUY2OifQVQuN7e4eJI 5ksw== 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=QRU7LnSUwsy2J1LUcByliifcDkevWGi1e/7l1FGxdFY=; b=mTekBgOBOtB0z2AXgUV4I3oFN8DsVrcvagkVdhlWNf8JkrAwA8Y3cbCD+gbywAaKGf kwMVfQIF16R3W4MOXU6rFjzoYg460aPtZI2VbpxiaE9/KOIu8pNmRaYehlLH2II5kmK0 ynwknaehIw9Ox4VQrUzAkQJngiSRknLq1FcusKGbMH9K7Z7OJ0xlIGMXQUazMAUYnqoG Zqvd1BnMnohKJ2rMUQ3LCQZj1wtFhLCoPGOu5MvMEtP4UMVICMNWPtRa7rokl8vsVGX0 1kYXVEk4DnZrmn+KDD+fdmmiP6xUJmuHab7vGm18BowF6y3idJW24hKO+JXlQZKiGg5Q scsw== X-Gm-Message-State: AOAM531hmv0DSfCpsmAIPEymAb6bwaBiMEMne8Iozy9Cx0g3h73F9l5B hyVSnyhJ02px3/Q+omP15Hp7iQ== X-Received: by 2002:a63:c741:: with SMTP id v1mr2603957pgg.316.1612955628899; Wed, 10 Feb 2021 03:13:48 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id e26sm2108659pfm.87.2021.02.10.03.13.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2021 03:13:48 -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 3/3] of: unittest: Statically apply overlays using fdtoverlay Date: Wed, 10 Feb 2021 16:43:30 +0530 Message-Id: <72f0396f0eeed6dad25527368ee9e471312f9a59.1612955268.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 | 50 ++++++++++++++++++++++ drivers/of/unittest-data/static_base_1.dts | 4 ++ drivers/of/unittest-data/static_base_2.dts | 4 ++ 3 files changed, 58 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..1d6029e722c0 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -34,7 +34,57 @@ DTC_FLAGS_overlay += -@ DTC_FLAGS_overlay_bad_phandle += -@ DTC_FLAGS_overlay_bad_symbol += -@ DTC_FLAGS_overlay_base += -@ +DTC_FLAGS_static_base_1 += -@ +DTC_FLAGS_static_base_2 += -@ 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.dtb \ +# overlay_bad_add_dup_prop.dtb \ +# overlay_bad_phandle.dtb \ +# overlay_bad_symbol.dtb \ + +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) + +overlay-$(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"