From patchwork Fri Feb 12 11:18:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 381798 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2846953jah; Fri, 12 Feb 2021 03:20:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyT8eDTbpAAfUhiH6s5MVZ/hQBAn8bZQSbocIMuN8nQ9/f61W7gFUkONIrOlEVqnOB13ow+ X-Received: by 2002:a05:6402:1589:: with SMTP id c9mr2853056edv.282.1613128840672; Fri, 12 Feb 2021 03:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613128840; cv=none; d=google.com; s=arc-20160816; b=i5ZXml67lzBDdryr3j1ZgGJnnJKUfotFsmlMc+Jvw156Z2sPrpQjH84J2yaq8Lrb5l dPRSrUhGHWWbA15pTzt73OTvS4awFeQEo0wiLSOAIqFvdPcKB1KR4Ds8cLsu6FUQ5exK 30w8I1ndh/+Be9ou0V0f6KyIh8waDnTpNfokxTmuMbYZ/5JOFScx6X0GzJme6lo9nh4W OZ//EKoVbSU0BhSqz8BkKde1C6WHB0LCNurUU5NyLWA5Gh95w8O+vF7f3qLPMpKyFqYu U97vijeQRL46OlrPoeKGY43c9CN2b/ZIHM1QmhQisW6XLqt5P4JDZt4ZLbCBRDB1dflh Pn1w== 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=wF13wHlH8AwN31lqAZwhyJR4x/IvJw4g38aibW4ph8w=; b=WaRTAbEIMJ2x8pefqWHinjiCgWGEUMJhUFIuWh0P2ZXLU0LPqzRRDGt5yM6VZOJxWw fyxtdZGnUVR00YXx7rKXBALznIcJMZq1U5WuwhMUaXCRrD+401bZovM7khF1Px0XE+47 17LNgOzbj57jow4lm4IxgLGd7/Aw/K/Pa2ZfR9jfC3KaGdfjzMv2ATwnJBFXtNECUoq0 vZgOuIzmg3uKJBA/GSXuoOCuZ+tYcPqTHiaKifCBv4uYR6FFngaEUHBcz0lw/UnHlXxK N65yEMSGRQq1X4J2M2YX4qND70QXKngHVh4ykNgKrCjW+fFx+cMG39d2yi5NudbR9IPA gQnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Amb+jKC7; 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 j24si5885999edr.101.2021.02.12.03.20.40; Fri, 12 Feb 2021 03:20:40 -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=Amb+jKC7; 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 S230242AbhBLLUe (ORCPT + 6 others); Fri, 12 Feb 2021 06:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbhBLLUQ (ORCPT ); Fri, 12 Feb 2021 06:20:16 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05D27C0617A9 for ; Fri, 12 Feb 2021 03:18:58 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id o38so6013571pgm.9 for ; Fri, 12 Feb 2021 03:18:58 -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=wF13wHlH8AwN31lqAZwhyJR4x/IvJw4g38aibW4ph8w=; b=Amb+jKC7GS9/Nh89skSUnbGw/MjcxgSTvKj+QeSofjwQWAB72O+crjokGbjJKp4nzt 0xo1aAAVZYXXctB3fqwFF4Z+IlaZ4SK61Cl9x07BQVVSGo/NPxaZ7/BKR45XDib8/37A 2e/c4V+MhTJ+ag97f4Soca6W4JFcfW/3XOjB6SOty7Jpfp60Jn4MlHY3vqcvQ+cigg15 WorvVsnqqfvh7bBwDIQW1p0K7nFd18ZnhXYr3/fhVNbztDxo5c2VALk8iwX2veHnUMDm aYY0dK6GJxq4oJv/hPQ6KOnCWKnlB6TvEjJlu8rmKTSzQwBFEEBhstacZA1Rn/z4LNiY XPKg== 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=wF13wHlH8AwN31lqAZwhyJR4x/IvJw4g38aibW4ph8w=; b=btosaDg6ZfTEdRpdaB7Z+fqOaMmfBcC14hwtcxGj4lFRWOwWRHktpuazzZKCJ4+3Q2 8s1NyJwC9vPpgNAPJQS0kuWDGF0XpkyXk5B+hRvxFy0d/kBdgiEOMxWx4PB72E/fPGu+ pR+rNPmYigVusAyJr2g0l859sqoxHwXr+GhjudBWJ64a3kjlY88jhrg/AUY6Uh55Po/e o4hdaxep8qcV7EK5MUUri5GbDixB1nyqYXM9xBxdcnyiiAfHhUOcnpxijWY9zExKLIrG B6OJmPIivjuzXmVRKHQPMuNI3Nz2REMnodIbuPAWLv9tj+MgwivOUV389L0ugx2NH+Di CRrw== X-Gm-Message-State: AOAM5304YqQglNWzwAQ5t2mWxFGM7Q+7dFETKr0x8GMtKRAZ2JZCOQ/H DgoCL7KmQ2dKAZcV1qNk8wvUIw== X-Received: by 2002:a63:4f1f:: with SMTP id d31mr2802136pgb.104.1613128737563; Fri, 12 Feb 2021 03:18:57 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id 74sm8836106pfw.53.2021.02.12.03.18.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 03:18:57 -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 V8 4/4] of: unittest: Statically apply overlays using fdtoverlay Date: Fri, 12 Feb 2021 16:48:38 +0530 Message-Id: <3fd43e11012d0c21606aef6d2af1e01a4efe274c.1613127681.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..f88b2f48f172 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.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"