From patchwork Mon Aug 14 09:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 713465 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp1129801wrp; Mon, 14 Aug 2023 02:03:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBTmIOm1s3SWG520agK+Yhe7alU+0YcpvTftPsPZxK+E+LkvxSmbmdewU94j/q+p0J3nA9 X-Received: by 2002:a5d:6646:0:b0:319:7487:9144 with SMTP id f6-20020a5d6646000000b0031974879144mr2425615wrw.69.1692003837938; Mon, 14 Aug 2023 02:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692003837; cv=none; d=google.com; s=arc-20160816; b=yV5F96+VxMHdD8llIyqI+HNkQo1zeLPd5pVNQ0aP3C7kyo6S4LkHaGK77n/C0Cg50U uzBfTwqqkfOrGAuh0dv3nTmPFrgvOiA6/lCqsEHLjeAgSGtLGOfJj36I50lwA+Lm9akI 183TknHS0/VkDGAq45Fg8JiJkP8+7mp2DrUQeywKgKNHdPfs/3dzrKze+xEC89bm1Euy +ZNDg491IBGR8pINl1zEaiBRUuGAmFKlg+P7UWY14LQwTPZkD96txzGl9Bwy0tm2FcZM 0AraG5kceHdh3ZQ3Jgl/AU5i0kTsigIlYhHIflQDR2OLqLcqxQeV+xKGiIaTVeOj5HSH puVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=SmnCumYFVsGnhsZ1zY4uSziMworJEAUAqy0mKPPZ0QA=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=dWqRmUoqyJn8ekhrCv/2wDy8z/FfsJ6kFvlhfXP5c/tL3liN6+ppUIkPcugEAfobUz BpOVrbivhrdu5ouC3jgNZRS3SeWRj6o02RFQdw2OGcgp4OfX0EDSrJ8mU+aAqC9JrNUR h86fd1bgK1MVUKS9Az/enXm7yXG+6/vy60MiFlNKamCfICo0VF2J6GGWTVJHhv+HmWSb 1OIhA/B7rXgv7PdsLaE5lCOj9Hel5oUZzhkA5mPo2igiNcRF4XQfl4WKDcIoAx597bxE NBfQiLSVdpbQu7ctc0Iv6qsMn5sVNQOlPKwR0Mnf/dQbYc6vLN78nwFFyFk+MSUDX5qc obSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id d16-20020adfe890000000b003175debcfb3si75594wrm.520.2023.08.14.02.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 02:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3AE3E8664F; Mon, 14 Aug 2023 11:03:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 733B68679C; Mon, 14 Aug 2023 11:03:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 8A20C86614 for ; Mon, 14 Aug 2023 11:03:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5859F2F4; Mon, 14 Aug 2023 02:04:27 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CBF983F6C4; Mon, 14 Aug 2023 02:03:42 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Sughosh Ganu Subject: [RFC PATCH 1/4] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Mon, 14 Aug 2023 14:33:06 +0530 Message-Id: <20230814090309.1548310-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230814090309.1548310-1-sughosh.ganu@linaro.org> References: <20230814090309.1548310-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean At the time of building a device-tree file, all the *u-boot.dtsi files are looked for, in a particular order, and the first file found is included. Then, the list of files specified in the CONFIG_DEVICE_TREE_INCLUDES symbol are included. Combine these files that are to be included into a variable, and then include all these files in one go. Signed-off-by: Sughosh Ganu --- scripts/Makefile.lib | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f5ab7af0f4..f41b16781d 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -179,10 +179,13 @@ ifdef DEVICE_TREE_DEBUG u_boot_dtsi_options_debug = $(warning $(u_boot_dtsi_options_raw)) endif -# We use the first match -u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \ +# We use the first match to be included +include_files = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) +# The CONFIG_DEVICE_TREE_INCLUDES also need to be included +include_files += $(CONFIG_DEVICE_TREE_INCLUDES) + # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ $(UBOOTINCLUDE) \ @@ -320,8 +323,8 @@ quiet_cmd_dtc = DTC $@ # Bring in any U-Boot-specific include at the end of the file # And finally any custom .dtsi fragments specified with CONFIG_DEVICE_TREE_INCLUDES cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - (cat $<; $(if $(u_boot_dtsi),echo '$(pound)include "$(u_boot_dtsi)"')) > $(pre-tmp); \ - $(foreach f,$(subst $(quote),,$(CONFIG_DEVICE_TREE_INCLUDES)), \ + (cat $< > $(pre-tmp)); \ + $(foreach f,$(subst $(quote),,$(include_files)), \ echo '$(pound)include "$(f)"' >> $(pre-tmp);) \ $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \