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: 12080559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE104C433E0 for ; Wed, 10 Feb 2021 11:15:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D77864D99 for ; Wed, 10 Feb 2021 11:15:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D77864D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gLwnz5eWCT4nS1JSUXFXlgvPgb3Es54CX2FfxGUKHJ8=; b=K3T78GEpSJzHIVRc52h88xUJI 97L2/OhK39sgiFiTG3Ojcjc8Ock3FpDTFGJHkONGLsiIczacw99ESU3aAfpvvFRT4MKEdRUZCZWU5 5enYhelX7s8sXfznsrt90q5hsWMmSmMkoTaI8IMYNYP5Bw+zduBCV1PLhTNekzsLVCi7iDSnHxYod kN9KzNi4nWWlyV6P9qM5YdCeRgU3IOypFecPzCh9tXigIj74AkWn7WjtWqRZRTC3KUglppn4MEzO6 BpglFmdAgawHWVMf89JwGhD3UgqIGnfBd2QVh+y7GVzcSIfmFSIH3OLf+bgpQyLAt87FkVL0fqzTE XaDGjD7tg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9nRn-0003S1-3y; Wed, 10 Feb 2021 11:14:15 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9nRP-0003Hd-Cl for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 11:13:52 +0000 Received: by mail-pg1-x52a.google.com with SMTP id e7so1030358pge.0 for ; Wed, 10 Feb 2021 03:13: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=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=hN2kSyVgLwl2tVqkPCDnhexow3FktTpFzaDAhalWbjIJr/dJh64Z6uI+b4GuVDqztC KXWu491NA9puXiVHCXT6ESAG0S8fcf2e0O/pIC6a1Ogxa2U7xExyrgHxN0DMpjM5qY2q CxgsWEKA9dERHsSujxhQ+alsyuNZrh08vLXH0jW3Dxhn9QJXjw4oE4dUF56D8zjv+lT+ ugQHWqT3zwlSiLG1H4nBv5SWdUDTR9ZdoSRAW51spSSxJ63/r98fkhSUb89jJNXy5l+N 9LLdfB1Hz7DFv3zUu0It8dysOTyCQM/885ihBzl5+LnWp/XHaPpze//WadzLWmB2o6FB 3ddA== X-Gm-Message-State: AOAM532DSgP5TYTY7Nfv0Qxsa+3fb3v9gDXCrcdcL2SFl/hcUhouXHJv tXtwu4tJa4K0d9WErtEd2JlTcA== X-Google-Smtp-Source: ABdhPJzBP3OqpqSZEkEdtiGKaG9/SUHfEWELDMOS7uSdecD3j4DWi5Q3ln5ROFTnJM+FPHtphI9LuA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_061351_675083_A9A49B06 X-CRM114-Status: GOOD ( 18.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Michal Marek , Vincent Guittot , linux-kbuild@vger.kernel.org, Viresh Kumar , Bill Mills , linux-kernel@vger.kernel.org, Michal Simek , anmar.oueja@linaro.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, David Gibson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 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"