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