From patchwork Fri Jan 22 10:50:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 368620 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1446872jam; Fri, 22 Jan 2021 04:02:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs88LLiMDcZq4dpc5F1cmVjHnbvISyvWIyZVaFLhega4oj7DorVrgbsx6ZxxYxoFw4Kqn5 X-Received: by 2002:a17:907:9710:: with SMTP id jg16mr2831923ejc.286.1611316937230; Fri, 22 Jan 2021 04:02:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611316937; cv=none; d=google.com; s=arc-20160816; b=W3Gf0wmdCL3eHeYZJaJl+6svnbS/TXgWjyNvu4HmWGq9kmKlrFuCXL2RNfAikYAtxy n0SxVv6ljpLFq5lXYcYBkfMmnyjNs2alqk3uhSpKfLBKc4tbeQkvD/pNsOki+u+KGL7y 4jfB67yR0SWE60kPO1i6dFF+/mLlqFNW28nuHW6+M4AhVhE7EIpYuXET1nDOd/hjw6l5 bWhVN6Ve47Q45Wv0ogA5B3Nd2VIL0TkPKBnVLFUXDlG8Su26PiS7LSGUBe3CDyYyIQDk TooZS7ugyOLy0VxvgY//FmXmyVSvetSIFAelWaUVjFDKHaz6wmkN8pbBvz2pWPFPK7Ub e3KA== 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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=UqfA44GRzErn7jz1S89gSUWfTcayujwo2iNNUNtm1X3L6q6rBRLOctJkZEGc4SIdua 2ydWuvfOAyZoClSegOev+blIjK74N9DmcvYeaDkc+Udi9jXxe+iZAWNhq8exUzaY7N5q xtWe4+MbEG890H73Y5gyZ+RcDzMHRnrnclNM32VHXXyVVn7RwSMU2roIuvy9cao+HaYa hq2fyiJCS/EfaC708W8eYesEL2IMPBU4brV8tjbSEgSQj7XXCsra9PGRSRMlvJFY7q44 oCYZM0cmVP8h1BHztyQAeLPPqiEFSvWpfpb/J/N//ehjDLkMZHB5+uK9YsJ6Nuz3QLEv Riag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V+Hz5lr6; 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 r7si3400048edv.345.2021.01.22.04.02.17; Fri, 22 Jan 2021 04:02:17 -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=V+Hz5lr6; 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 S1727442AbhAVKz7 (ORCPT + 6 others); Fri, 22 Jan 2021 05:55:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727584AbhAVKwE (ORCPT ); Fri, 22 Jan 2021 05:52:04 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA1CC06121D for ; Fri, 22 Jan 2021 02:51:18 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id i7so3434580pgc.8 for ; Fri, 22 Jan 2021 02:51:18 -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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=V+Hz5lr6HX/rwkb7XWX0ZVFoYsa7Z6oigc7al8V8vGUi3astJhd+qexzbJ2yXMlcuH lIkc+An9dl9VuEI+iXslcp65fU4tsTywBsHS6BMsH72fXtrnRG/9sov745Nl5bXF82+Y YoCnvhP+vXOw438QQb9a1U2HzbICgZ9mwU6khvlOChY3CIm5mROzbRP5jAQu0CGSRq68 D1Y1NYxFsuvxON9dqPQJnUAdlqhRHKCUgjgyHWGFW0DDMIoWYgjStSkEIiJZgVdZXHG7 gtLnTn9j2xVHvWNqTxFANOBWKSj133pli5mDWg2FDJqv5EWLDVVBEwZ7T3QD98JANASA apZA== 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=LPFWN6gpauI4vigWfOz/xPJOdZeAxCmm0GF1zvJDfzo=; b=jdJmh1tgsdFaQB17KGko7ynI9ykCkKhHlXdKuoFXVqY9VpT44sZ7luhsyw2xqVqYcc Um9TVfwvRFkp2M8fqbLuUwhmUvSrWffAkmEe+jPkySdQevRKkBF9FJ9B1atKL0hCinXx 78JBwvzhzS4PQPagq+b5RQV/deSic3qCvu2THwZVIgdPolJQ70XUVLMo3G0m8Z5Y0QAP s3PF2oCI2du25xEKJK+Z4UUTMuI316E4/9dKLHap/QEP2By2iwbMqiqcNMmgSBMBSwZa g74wlWygHQlF03H7gtqbPBlhpi/DwGYj3ea+YiiCaJWa2bPoLVx1pr/Eu/Vf503i+j+D ySjw== X-Gm-Message-State: AOAM532UaHOryaZjIdICSOWf26OZtnm7BtPvQHT6Lz+0dDfmbu4AyxXQ 3ZTK7XHmwEMF+xsxSNFEfGWxbw== X-Received: by 2002:a62:d401:0:b029:1bd:4078:553b with SMTP id a1-20020a62d4010000b02901bd4078553bmr3575219pfh.21.1611312678067; Fri, 22 Jan 2021 02:51:18 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id j3sm8799732pjs.50.2021.01.22.02.51.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2021 02:51:17 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, anmar.oueja@linaro.org, Bill Mills , David Gibson , devicetree@vger.kernel.org, Michal Marek Subject: [PATCH V6 6/6] of: unittest: Statically apply overlays using fdtoverlay Date: Fri, 22 Jan 2021 16:20:36 +0530 Message-Id: <58e8523e1489b70b76211fb94a9229ae12c33cad.1611312122.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 a new base file static_base.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 in the static_test.dtb. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/Makefile | 51 ++++++++++++++++++++++++ drivers/of/unittest-data/static_base.dts | 5 +++ 2 files changed, 56 insertions(+) create mode 100644 drivers/of/unittest-data/static_base.dts -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index 009f4045c8e4..586fa8cda916 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -34,7 +34,58 @@ DTC_FLAGS_overlay += -@ DTC_FLAGS_overlay_bad_phandle += -@ DTC_FLAGS_overlay_bad_symbol += -@ DTC_FLAGS_overlay_base += -@ +DTC_FLAGS_static_base += -@ 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.dtb to create static_test.dtb +# If fdtoverlay detects an error than the kernel build will fail. +# static_test.dtb is 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 \ +# overlay_base.dtb \ + +apply_static_overlay := overlay.dtb \ + overlay_0.dtb \ + overlay_1.dtb \ + overlay_2.dtb \ + overlay_3.dtb \ + overlay_4.dtb \ + overlay_5.dtb \ + overlay_6.dtb \ + overlay_7.dtb \ + overlay_8.dtb \ + overlay_9.dtb \ + overlay_10.dtb \ + overlay_11.dtb \ + overlay_12.dtb \ + overlay_13.dtb \ + overlay_15.dtb \ + overlay_gpio_01.dtb \ + overlay_gpio_02a.dtb \ + overlay_gpio_02b.dtb \ + overlay_gpio_03.dtb \ + overlay_gpio_04a.dtb \ + overlay_gpio_04b.dtb + +quiet_cmd_fdtoverlay = FDTOVERLAY $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $^ + +$(obj)/static_test.dtb: $(obj)/static_base.dtb $(addprefix $(obj)/,$(apply_static_overlay)) + $(call if_changed,fdtoverlay) + +always-$(CONFIG_OF_OVERLAY) += static_test.dtb diff --git a/drivers/of/unittest-data/static_base.dts b/drivers/of/unittest-data/static_base.dts new file mode 100644 index 000000000000..3c9af4aefb96 --- /dev/null +++ b/drivers/of/unittest-data/static_base.dts @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "overlay_common.dtsi" +#include "testcases_common.dtsi"