From patchwork Fri Feb 12 11:18:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 381795 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2846757jah; Fri, 12 Feb 2021 03:20:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVmk9sIMymQksQoEsIQpQRvngeqIiDECn8ikbH/iIUF+JRFZ6KylAMdpgoaiJarmMjf09K X-Received: by 2002:a05:6402:3590:: with SMTP id y16mr2825397edc.21.1613128826081; Fri, 12 Feb 2021 03:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613128826; cv=none; d=google.com; s=arc-20160816; b=yhN1Jax+EyAtetyFkumb9CBdNqxkDgZnedhtvheHyYDhwUnicgS1s/HsW8c3psWq9y Gs3yznxviGomyRLDD2rjuC673NcIkXpXdkrFtrX5yXS6XBp3ba+ZMGwZy7Mpls5GIFq2 jEq7XxEKjkM3Dpxahi0cielNMQI0up0HoCb2LIu6sy8pnoAeQ18d5GqG+OwGU6idtNs4 p0rl7bDbPuhDMXXCk7LIR/iqmG9OxHLCAfMqG3L6ighFHmpd48akMhDyKNkusgDGeIHV MwQtNUKNgdbOOHyVex6JY0y3VYQmnpeJEfZJg7qT1G0oqxqIM3I0KBJSyK9HTCTlQvtX jktw== 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=5biKq7NugFH5645R57SKe1mgC1BP2ckBoaTjbO3BPZE=; b=hV5ToWxEphjurWnAS2fCXkksM3Y1cDXNDTJdFcW6kor1nNPcV4/ek3hgyF1KNGtBaA fB0pEARD5c14reUb0vwelWdq+8iWpMfOrwjkRVFKWeSVEDzor3H9Sq9/HRsLlpvDtE23 kN50tnSvVLVv+mj7u6EgUUZ3YrpZ1lQS0VQJMnl9V47X+We8aCHkPZt+TcxBnKyzpHKA TE2XsGdUAVr39qWV+Ms12WyXnfjTWA66m69qzSLxOAjWHXxHIj7uYh3EQMOfB2Mm49Ch +Uork4gYZ4eMJV/IIpzCNZVf2n2J5bYNAEF7hCLYDILqsJlAqVYR8Qqz4y7x/OoXWO41 Z+3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NCgoSjY/"; 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.25; Fri, 12 Feb 2021 03:20:26 -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="NCgoSjY/"; 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 S230131AbhBLLTg (ORCPT + 6 others); Fri, 12 Feb 2021 06:19:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbhBLLTd (ORCPT ); Fri, 12 Feb 2021 06:19:33 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2581DC06178A for ; Fri, 12 Feb 2021 03:18:48 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id gx20so261096pjb.1 for ; Fri, 12 Feb 2021 03:18:48 -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=5biKq7NugFH5645R57SKe1mgC1BP2ckBoaTjbO3BPZE=; b=NCgoSjY/AMkFT1Q+TOjkW+QtV2Tgv5rRg6PXJ7EnfbP1PPBhrvLSMGJ2tMnLqGjvtS hTZ1DG03+SMrZ6Bs3yBMlN5TnazwJrXYZNZvBQFot6TT7ndKRG4QylMsD6ASbF42Tyfa C5XqIi0RdqUAiQAn4klCJX7wGydhpLNWEQcTuBnZ5R4vEUyVMTGeagoy3iwV2HTMcwB4 TnR1Ic+DM2P4BmPExrCFrXBZA/JS3eH2C3/Mn+gkULvE3kuz+Ujw0N0KntqfdXAwv1Iw ilwczRfJcAuISVv6gcIH2Xjd9fH4xaIdiRqDg8rWPfEmvwHn4cTepuwpoG++vZdyNKKI ur5g== 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=5biKq7NugFH5645R57SKe1mgC1BP2ckBoaTjbO3BPZE=; b=F/nY2dgWf+AX6lzHqXfmiVHNiVrGIudNai9JvrhyqvS7tc/SKYd9GfvY2EalqcwY45 V+eIuEVY+pSIVQNvToyoUKJsMCU4fvI7+xBfTKDZVOC0ElqXgKeeJQCWwEzXet0oM/qY 8OhGUTrcW0oIQJhA/rheb14J6fEtu4v3SxH+r6Q6ln9V6+LrNzy3BwohtELxGAnjfBHe ZTZR7JKL+NC2zB4V32ouJsE7Iiprc03byd/cign4OAmWKtaK9KxXwnGaI4wEzaCOFiwm YEw6pjOKxnTsgPX5RzwnTpLZ4fz0ZFgrzB/19Muxc8F8+YAhjZ4NH5fZ57+tTca6KuYF tvFg== X-Gm-Message-State: AOAM531Co7uDRkLWoZpzMT5gin/UdUL5Z9yWJ+VpcGcsRQ/AoDaJt2QS ctc8wcnejZ1ed2aERtzWKskeqw== X-Received: by 2002:a17:902:c9c3:b029:e3:12d4:f2ca with SMTP id q3-20020a170902c9c3b02900e312d4f2camr2433994pld.33.1613128727728; Fri, 12 Feb 2021 03:18:47 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id a37sm8763963pgm.79.2021.02.12.03.18.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 03:18:47 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada , Michal Marek Cc: Viresh Kumar , Vincent Guittot , 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 1/4] kbuild: Simplify builds with CONFIG_OF_ALL_DTBS Date: Fri, 12 Feb 2021 16:48:35 +0530 Message-Id: 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 We update 'extra-y' based on CONFIG_OF_ALL_DTBS three times. It would be far more straight forward if we rather update dtb-y to include all .dtb files if CONFIG_OF_ALL_DTBS is enabled. Signed-off-by: Viresh Kumar --- scripts/Makefile.lib | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index b00855b247e0..fa0db696120f 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -81,14 +81,13 @@ always-y += $(userprogs-always-y) $(userprogs-always-m) # DTB # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built +dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) + extra-y += $(dtb-y) -extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) ifneq ($(CHECK_DTBS),) extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y)) -extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) -extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-)) endif # Add subdir path From patchwork Fri Feb 12 11:18: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: 381796 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2846783jah; Fri, 12 Feb 2021 03:20:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGOvaiAD/km/MBPxl6CqN5KqOEdA5kY8VVW10kgFepDY4NQEGiQHfLVCXfhgP+j5frFrc6 X-Received: by 2002:a05:6402:3590:: with SMTP id y16mr2825599edc.21.1613128828723; Fri, 12 Feb 2021 03:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613128828; cv=none; d=google.com; s=arc-20160816; b=HBMZGkv9e70RUD3tPpomt3/TQQ0VH5N4aN2Tka65TUkZwAja59VdDrjKC9BTv8e2M4 KFIrfb7Co+l5ykowm+bFMBCM4hmgETiELVCBF9h61okYfjYCxYbSFYh7nJ+9/tSm+qLM fBR3/gvXonsUp1dgwKYMf94Klj/sHOs5ErpxiMptqxLopX5cyDKY5ZvRzbCQuG0qqIsO /XjhyAN9Gy42SQwFUxDM8RbXuvfBex3ByViKv3uK7OVWNvZlvw+MlKsdb+bC5eJzD4CB iUeabcV/VV10phv1aiO6TGl53vzwNj0tg9COYHDrQRfcjww72/luDtZgxqFUUISLhgqS F0OA== 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=WlFdDyGQ/GyyV1yLJE8ER90AFhPfewXl+s4lJ7PrNZo=; b=ChA9atpBhNn2oV8iZKZIj8rI3Nw7isfJGUKqbbA9xk9AXYbW/ikZcSIntDncwJiiZ1 pN6hDiqcs9xFK0CuL1qFFoDuoPRk/AKJplWPl5Zkrasps+005bt70e/vULYYUcYnrVFZ lW6E4LDFHgS6K+x239H1Q7FgGcdjuJ7wRdiv7jvGkhycmDS4UzO9y8y6P5TAFmKDijWC /yllEkL9TMWIyDWqlexivYU/6AiuxKh1UXJpyRdUhmZ6eQzmUR97cG9W7qdXtnw03Xmq unlgckkU3JY/hJlNGPeLpaWwoOBRO6w8pAeWc5DfmpWrbUQYabVm35Dz0HqTW9jRzQ9e 4vGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJRLNn9m; 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.28; Fri, 12 Feb 2021 03:20:28 -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=rJRLNn9m; 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 S230260AbhBLLUV (ORCPT + 6 others); Fri, 12 Feb 2021 06:20:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbhBLLUO (ORCPT ); Fri, 12 Feb 2021 06:20:14 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7688AC061793 for ; Fri, 12 Feb 2021 03:18:51 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id o21so6004288pgn.12 for ; Fri, 12 Feb 2021 03:18:51 -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=WlFdDyGQ/GyyV1yLJE8ER90AFhPfewXl+s4lJ7PrNZo=; b=rJRLNn9m5kSZ0YMaUALbsiU/2Yl8iEo8pmMVj8Wbcg+gAwcvGYGd7iSmGUcSUpj/WM fMBSGIX+hwvdJwa4/bia4GuNXroSKbnsdJisKS5YIWJtuwGXtmDpEuLyd7t/CTdp3qho UHD2cJby8qJi2eW+HQ7/FXmdn3p5sES+sLReAkNsnF57xB6MdPIogSrJqIy6S7BGvNDs rH7+ppW3PXmu7iZy70zTKHFEU71UmyzKgAAx9nEdHcmo86dp2ECc2mDIx4boGHeU1rHs XM18ZO47ERWvWBnrU8fVnBHVQ08SnOmRCMqavDWYRsHOZhxSULSBbHhsS5I3bqY9rRGT Be9w== 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=WlFdDyGQ/GyyV1yLJE8ER90AFhPfewXl+s4lJ7PrNZo=; b=RP7v0x6G6JK/WrL29D/s9zYWEJ7ZgfxrmonQsOhzmRoHnkYKzG2PVXeVs697QPNpI2 YxuLRol8p8BxIr9pXZ5GtF+7O2lWICNw2T8Q4M6dPAY2vBpACBwOPA1osHnlmiXQih+F 38ZulFaJPNEpnBohAy8dZ7jIr+piG6dI9xzXOl9LabsZ6sCaJcNx40ZKwMQQ5PfyEbqA LeCmzOmlIRRRzwPwp/iIW9KtK/PTWZvrdgRa9SvgwhkY0FKtAKxTr0FBu12YceEyrxvl EHfd5RUKx/zaG/wYc7eW34cFI6ikL9xd9+mou19ZQqlgY7KWEWxGA8L4QmtVhiaGVGKC zhJQ== X-Gm-Message-State: AOAM532pRbn4hpIyiH/hG/FsLEZ59IwUH0F7N+DVNQPX9Bew/IJoucBp HQGbfGgFPq3Qk+dtyctKdabACw== X-Received: by 2002:a63:e108:: with SMTP id z8mr2616603pgh.363.1613128730998; Fri, 12 Feb 2021 03:18:50 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id k4sm8349156pfk.44.2021.02.12.03.18.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 03:18:50 -0800 (PST) From: Viresh Kumar To: Frank Rowand , Rob Herring , Pantelis Antoniou , Masahiro Yamada , Michal Marek Cc: Viresh Kumar , Vincent Guittot , 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 , Rob Herring Subject: [PATCH V8 2/4] kbuild: Add generic rule to apply fdtoverlay Date: Fri, 12 Feb 2021 16:48:36 +0530 Message-Id: <2654369a72516ff612976252636dd80677e22cb8.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 From: Rob Herring Add a generic rule to apply fdtoverlay in Makefile.lib, so every platform doesn't need to carry the complex rule. The platform's Makefile only needs to have this now: DTC_FLAGS_foo_base += -@ foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo dtb-y := foo.dtb We don't want to run schema checks on foo.dtb (as foo.dts doesn't exist) and the Makefile is updated accordingly. Signed-off-by: Rob Herring Co-developed-by: Viresh Kumar Signed-off-by: Viresh Kumar --- scripts/Makefile.lib | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index fa0db696120f..3c450bfec015 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -66,6 +66,10 @@ multi-used := $(multi-used-y) $(multi-used-m) real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) +# List all dtbs to be generated by fdtoverlay +overlay-y := $(foreach m,$(dtb-y), $(if $(strip $($(m:.dtb=-dtbs))),$(m),)) +overlay-$(CONFIG_OF_ALL_DTBS) += $(foreach m,$(dtb-), $(if $(strip $($(m:.dtb=-dtbs))),$(m),)) + always-y += $(always-m) # hostprogs-always-y += foo @@ -80,14 +84,21 @@ userprogs += $(userprogs-always-y) $(userprogs-always-m) always-y += $(userprogs-always-y) $(userprogs-always-m) # DTB +# Add base dtb and overlay dtbo +dtb-y += $(foreach m,$(overlay-y), $($(m:.dtb=-dtbs))) + # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) extra-y += $(dtb-y) ifneq ($(CHECK_DTBS),) -extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) -extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dtb-y)) +# Don't run schema checks for dtbs created by fdtoverlay as they don't +# have corresponding dts files. +dt-yaml-y := $(filter-out $(overlay-y),$(dtb-y)) + +extra-y += $(patsubst %.dtb,%.dt.yaml, $(dt-yaml-y)) +extra-y += $(patsubst %.dtbo,%.dt.yaml, $(dt-yaml-y)) endif # Add subdir path @@ -331,6 +342,15 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE $(call if_changed_dep,dtc) +overlay-y := $(addprefix $(obj)/, $(overlay-y)) + +quiet_cmd_fdtoverlay = DTOVL $@ + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs) + +$(overlay-y): FORCE + $(call if_changed,fdtoverlay) +$(call multi_depend, $(overlay-y), .dtb, -dtbs) + DT_CHECKER ?= dt-validate DT_BINDING_DIR := Documentation/devicetree/bindings # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile From patchwork Fri Feb 12 11:18:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 381797 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2846926jah; Fri, 12 Feb 2021 03:20:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+Ha3cPoy9JvFYEvCOgh7iaiz5u8cVJVlyCJqcKLUfS4D5OsqCHYF9iC7X7cP/aKLxPK1V X-Received: by 2002:aa7:c312:: with SMTP id l18mr458478edq.278.1613128838666; Fri, 12 Feb 2021 03:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613128838; cv=none; d=google.com; s=arc-20160816; b=iR5mFgPH56jc1I8R7/E3v6Hz7eTEORnGUXfC90kJH8/aABa6May8VlnwgVHZjDQ0vA 82dqoz8t+hgF+y3ir2Qk+bNL8PwqZSpDofq5DxCzG6ZoYvszbjGQh1ieTDZOI6EAPm16 /UIbVNCcOM25OK68Ka0OuCCjBCuJCRbKPOQ6hw4Z4TPRCBGlEx/5Rid4w9QR3jK0fPAI W7G0reNU8f58QOJX3Bw5qyDK2Dt49HUZs99OOghW8QHiqoPKV+vYB1Ylq2mNWMJG7MLE QkGBY/zubcnG55KDbWIh1RMst6y5uf/O3HECY8MHgwdmEjuVs+9ChYDUSEb55/vG9c1f 6REQ== 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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=YqSTmVugo3wwxBmpdXuypydoryh8OLB2EjMVsVMVxF8DuxOrsVQTFhqyamrJ3tMm/X vVlxTav8p3ADwH0ikxCZlfeABHH0KPR4Nt3cnUrw/GZ0JCT73/yvSyxgXIP/uSTa4OR4 IGutwdswiKx7jvMRrFcFCMsMwRrEQm/R6scbY35CVmeQXUV3pxU0kmTcE86gfBoaWs+J L1H80nVy+JSsOVPfyMYNVG+DEKQgHuvZOet+1gwkbxIXzPiMC8sfbCVVvmTN4JtYbdNi hCblXYLXv9zwlWtzZi3ntSgPsrtEPNYoUTzghPF82w+x2ow6VAm+3lh2fjqJdlc0jnii 70gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mBuDh4Jh; 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.38; Fri, 12 Feb 2021 03:20:38 -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=mBuDh4Jh; 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 S230289AbhBLLUb (ORCPT + 6 others); Fri, 12 Feb 2021 06:20:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhBLLUQ (ORCPT ); Fri, 12 Feb 2021 06:20:16 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA20C0617A7 for ; Fri, 12 Feb 2021 03:18:55 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id z7so4909174plk.7 for ; Fri, 12 Feb 2021 03:18:55 -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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=mBuDh4JhVZFUlLO0ghVElWUk/iloxC4fMfcwt4pm/nr1NW48JumlKA6JQau23mCWR4 uW+pMN+gTeH36/lNAIRHeBdpbnq2wXx7LDK/q6S7nPwDV4kNWYMmh5a9bnLIDDPoqAFN uriuRqAAI5deHEwPV2bSHntmvj02JSIKkiKeTyo3THBFeN29Y+ayIhKTLikz9f31vvYQ 8HD8NqEfw6H8TJV+ceR1pyGYJcfAcY3EsU6jJd1wzBuFe/9nCKe4ds0ouN4/RJLhitBC isc16dUJmKjkOoxsg1QB+L1qLnNsd8Om6vfWx0ODf8Oa+cB87k75U8GQY0wdtwKTvSTT ic7Q== 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=zGwObSDNhpTlCqU8x6dXBIYlNo68oQYaoM82x8ri0qg=; b=nSKSXGCd70Akf5ZL8aP2vrN7VMCu3qJ/Utkte3vUKX+pmWcZWr6611eQmJV102ruB9 nIrmcAyJMzZ8yND6Dj5Ska0XUEP/LNBSwxCLyKJlykZ5i/N813D7CH+2sOdwvEBy8BQw Zpw9jAy0N7qqG9S+IZTIYKSGngvc5To0zj8YunMbFUvepav/d400yxfDMqP6MfAmyj/w UUDEvVjm5g2F9yQ/ZX0HKcSP346fkZncJIdFhVZxP7d/pJ0TeNGit2ppzd60ALjg7qHm 5n6leivTyz+WcUcalxZtIs5yCv78aLekmTwnRCQjXk9hdbj3PkuXdu5msSG9DTjvKG0m 2fuw== X-Gm-Message-State: AOAM533FyZ2gI1Sz9IVZ9waqdyh7gomBMdLaPM3Wy80SoUtMp9XDKf82 2PFn+kVSrGX4xhmBGiyt+XaMfA== X-Received: by 2002:a17:90a:f2d3:: with SMTP id gt19mr2346831pjb.212.1613128734577; Fri, 12 Feb 2021 03:18:54 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id z12sm7606796pjz.16.2021.02.12.03.18.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 03:18:54 -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 3/4] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi Date: Fri, 12 Feb 2021 16:48:37 +0530 Message-Id: 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 In order to build-test the same unit-test files using fdtoverlay tool, move the device nodes from the existing overlay_base.dts and testcases_common.dts files to .dtsi counterparts. The .dts files now include the new .dtsi files, resulting in exactly the same behavior as earlier. The .dtsi files can now be reused for compile time tests using fdtoverlay (will be done by a later commit). This is required because the base files passed to fdtoverlay tool shouldn't be overlays themselves (i.e. shouldn't have the /plugin/; tag). Note that this commit also moves "testcase-device2" node to testcases.dts from tests-interrupts.dtsi, as this node has a deliberate error in it and is only relevant for runtime testing done with unittest.c. Signed-off-by: Viresh Kumar --- drivers/of/unittest-data/overlay_base.dts | 90 +----------------- drivers/of/unittest-data/overlay_common.dtsi | 91 +++++++++++++++++++ drivers/of/unittest-data/testcases.dts | 18 ++-- .../of/unittest-data/testcases_common.dtsi | 19 ++++ .../of/unittest-data/tests-interrupts.dtsi | 7 -- 5 files changed, 118 insertions(+), 107 deletions(-) create mode 100644 drivers/of/unittest-data/overlay_common.dtsi create mode 100644 drivers/of/unittest-data/testcases_common.dtsi -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/of/unittest-data/overlay_base.dts b/drivers/of/unittest-data/overlay_base.dts index 99ab9d12d00b..ab9014589c5d 100644 --- a/drivers/of/unittest-data/overlay_base.dts +++ b/drivers/of/unittest-data/overlay_base.dts @@ -2,92 +2,4 @@ /dts-v1/; /plugin/; -/* - * Base device tree that overlays will be applied against. - * - * Do not add any properties in node "/". - * Do not add any nodes other than "/testcase-data-2" in node "/". - * Do not add anything that would result in dtc creating node "/__fixups__". - * dtc will create nodes "/__symbols__" and "/__local_fixups__". - */ - -/ { - testcase-data-2 { - #address-cells = <1>; - #size-cells = <1>; - - electric_1: substation@100 { - compatible = "ot,big-volts-control"; - reg = < 0x00000100 0x100 >; - status = "disabled"; - - hvac_1: hvac-medium-1 { - compatible = "ot,hvac-medium"; - heat-range = < 50 75 >; - cool-range = < 60 80 >; - }; - - spin_ctrl_1: motor-1 { - compatible = "ot,ferris-wheel-motor"; - spin = "clockwise"; - rpm_avail = < 50 >; - }; - - spin_ctrl_2: motor-8 { - compatible = "ot,roller-coaster-motor"; - }; - }; - - rides_1: fairway-1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,rides"; - status = "disabled"; - orientation = < 127 >; - - ride@100 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "ot,roller-coaster"; - reg = < 0x00000100 0x100 >; - hvac-provider = < &hvac_1 >; - hvac-thermostat = < 29 > ; - hvac-zones = < 14 >; - hvac-zone-names = "operator"; - spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 7 >; - spin-controller-names = "track_1", "track_2"; - queues = < 2 >; - - track@30 { - reg = < 0x00000030 0x10 >; - }; - - track@40 { - reg = < 0x00000040 0x10 >; - }; - - }; - }; - - lights_1: lights@30000 { - compatible = "ot,work-lights"; - reg = < 0x00030000 0x1000 >; - status = "disabled"; - }; - - lights_2: lights@40000 { - compatible = "ot,show-lights"; - reg = < 0x00040000 0x1000 >; - status = "disabled"; - rate = < 13 138 >; - }; - - retail_1: vending@50000 { - reg = < 0x00050000 0x1000 >; - compatible = "ot,tickets"; - status = "disabled"; - }; - - }; -}; - +#include "overlay_common.dtsi" diff --git a/drivers/of/unittest-data/overlay_common.dtsi b/drivers/of/unittest-data/overlay_common.dtsi new file mode 100644 index 000000000000..08874a72556e --- /dev/null +++ b/drivers/of/unittest-data/overlay_common.dtsi @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Base device tree that overlays will be applied against. + * + * Do not add any properties in node "/". + * Do not add any nodes other than "/testcase-data-2" in node "/". + * Do not add anything that would result in dtc creating node "/__fixups__". + * dtc will create nodes "/__symbols__" and "/__local_fixups__". + */ + +/ { + testcase-data-2 { + #address-cells = <1>; + #size-cells = <1>; + + electric_1: substation@100 { + compatible = "ot,big-volts-control"; + reg = < 0x00000100 0x100 >; + status = "disabled"; + + hvac_1: hvac-medium-1 { + compatible = "ot,hvac-medium"; + heat-range = < 50 75 >; + cool-range = < 60 80 >; + }; + + spin_ctrl_1: motor-1 { + compatible = "ot,ferris-wheel-motor"; + spin = "clockwise"; + rpm_avail = < 50 >; + }; + + spin_ctrl_2: motor-8 { + compatible = "ot,roller-coaster-motor"; + }; + }; + + rides_1: fairway-1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ot,rides"; + status = "disabled"; + orientation = < 127 >; + + ride@100 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ot,roller-coaster"; + reg = < 0x00000100 0x100 >; + hvac-provider = < &hvac_1 >; + hvac-thermostat = < 29 > ; + hvac-zones = < 14 >; + hvac-zone-names = "operator"; + spin-controller = < &spin_ctrl_2 5 &spin_ctrl_2 7 >; + spin-controller-names = "track_1", "track_2"; + queues = < 2 >; + + track@30 { + reg = < 0x00000030 0x10 >; + }; + + track@40 { + reg = < 0x00000040 0x10 >; + }; + + }; + }; + + lights_1: lights@30000 { + compatible = "ot,work-lights"; + reg = < 0x00030000 0x1000 >; + status = "disabled"; + }; + + lights_2: lights@40000 { + compatible = "ot,show-lights"; + reg = < 0x00040000 0x1000 >; + status = "disabled"; + rate = < 13 138 >; + }; + + retail_1: vending@50000 { + reg = < 0x00050000 0x1000 >; + compatible = "ot,tickets"; + status = "disabled"; + }; + + }; +}; + diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dts index a85b5e1c381a..04b9e7bb30d9 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dts @@ -2,19 +2,15 @@ /dts-v1/; /plugin/; +#include "testcases_common.dtsi" + / { testcase-data { - changeset { - prop-update = "hello"; - prop-remove = "world"; - node-remove { - }; + testcase-device2 { + compatible = "testcase-device"; + interrupt-parent = <&test_intc2>; + interrupts = <1>; /* invalid specifier - too short */ }; }; + }; -#include "tests-phandle.dtsi" -#include "tests-interrupts.dtsi" -#include "tests-match.dtsi" -#include "tests-address.dtsi" -#include "tests-platform.dtsi" -#include "tests-overlay.dtsi" diff --git a/drivers/of/unittest-data/testcases_common.dtsi b/drivers/of/unittest-data/testcases_common.dtsi new file mode 100644 index 000000000000..19292bbb4cbb --- /dev/null +++ b/drivers/of/unittest-data/testcases_common.dtsi @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + testcase-data { + changeset { + prop-update = "hello"; + prop-remove = "world"; + node-remove { + }; + }; + }; +}; + +#include "tests-phandle.dtsi" +#include "tests-interrupts.dtsi" +#include "tests-match.dtsi" +#include "tests-address.dtsi" +#include "tests-platform.dtsi" +#include "tests-overlay.dtsi" diff --git a/drivers/of/unittest-data/tests-interrupts.dtsi b/drivers/of/unittest-data/tests-interrupts.dtsi index ec175e800725..0e5914611107 100644 --- a/drivers/of/unittest-data/tests-interrupts.dtsi +++ b/drivers/of/unittest-data/tests-interrupts.dtsi @@ -61,12 +61,5 @@ testcase-device1 { interrupt-parent = <&test_intc0>; interrupts = <1>; }; - - testcase-device2 { - compatible = "testcase-device"; - interrupt-parent = <&test_intc2>; - interrupts = <1>; /* invalid specifier - too short */ - }; }; - }; 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"