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: 12085037 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 265F6C433DB for ; Fri, 12 Feb 2021 11:20:08 +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 C4F0364DE0 for ; Fri, 12 Feb 2021 11:20:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4F0364DE0 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=4fb2Jsp7AwdMv8Z2YjQ9FWI148UKz1Q7kMoUtnrZCds=; b=ghdrFu2gt5ULYaT5p0OrYFDCI 5TmfU1AlcKK7MT9z6cpIyozaXGijQAUMdgpVmzon3+muB4cWDSeJVywJ9jJQFXqZfkt8wFPWZLr2D BMmDcR30LOS5e9oG+SYvDixeDbB5nvMsTQ5CQspFXqwM1XQq89FhtHbtgxkeFiv0umFco7f755Vf3 60yonIv8xBgS+wV/Y7IV/kVXsIOdzFpr8pStHbqBFZ09wVCrgSYZhi69XXIbPmRzeIgz7ZrGXKqJw cJIfrlN6RY6RL7HdSglpBK+XmgQwXfBj+1MAbY1tXlnWrYR+8KJpr5BuRqtQrDDllO9Qycjo2S232 fw2XbsuQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAWTX-0007Pg-2c; Fri, 12 Feb 2021 11:19:03 +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 1lAWTN-0007Me-50 for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2021 11:18:55 +0000 Received: by mail-pg1-x52a.google.com with SMTP id m2so6022293pgq.5 for ; Fri, 12 Feb 2021 03:18:52 -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=SE9QalLQr/Nn3nxaNg/LxZkzzN4G58upMZktmHV4LXx9aA8FTZFOAn2wF8CkLCZceS 8mEP7YJDoCcNkm/lLEJ/PYTpXbkttTUGZ5G2+3AN9ls95ElSo4R2KIuRgq5L4YzlEayb Jp7+KGym7sxWXonlorrOOR1siAlNdmif/OV8btxNZUl14ToHyPgTKo3iElk9X4rhsTCL RnoO0IPt3+eBRlcKYoOuYbJTAPDVUYKm2kD2xu0QgTlI7bFcp2wstAvug5CcmEcMrOwp r/ScCyDk1xtDMuty07rxjuKpung0B7HtvkDaOBzjdzHJjVLUQrnqTeEH5c8Zw7iPj2wx JCYg== X-Gm-Message-State: AOAM532RZ0gpVezy3bxG/DZ7Aooy+pH2mU7YTy8p6B4639SI8pzKtZTt mIOfQLKl3Qoc383tzjpdrAVWYA== X-Google-Smtp-Source: ABdhPJwEa9cAqDMrrNkWc6CGYQzJ3YY0YTih43P3yWd5mO8VRfNgoGWyHiLfAUWJF07maB2OFv78MA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210212_061853_643062_3789D14B X-CRM114-Status: GOOD ( 13.56 ) 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, Vincent Guittot , linux-kbuild@vger.kernel.org, Viresh Kumar , Bill Mills , linux-kernel@vger.kernel.org, Michal Simek , anmar.oueja@linaro.org, Geert Uytterhoeven , Rob Herring , 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 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(-) 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