From patchwork Thu Aug 17 05:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 714383 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp2739762wrp; Wed, 16 Aug 2023 22:49:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyIme2FNm53aJ8iEqhvd5WWBWlUOz96FiZXRPx92tBrUdX/wcsFUOB8RP5f6t7NwYE7l2E X-Received: by 2002:adf:f2ca:0:b0:313:fe1b:f441 with SMTP id d10-20020adff2ca000000b00313fe1bf441mr2910139wrp.29.1692251364261; Wed, 16 Aug 2023 22:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692251364; cv=none; d=google.com; s=arc-20160816; b=B5Rce4joUf0rz92/IAOq4iJHJB90gAPbooaPsQ5jeUxNMB660tYT9G20FNeXM1FSwo vrAP3HQGcGq+64wn7CtBjq3d4osmcZwziXgEZr5GJHy1NazN/qurIh9vuGIjB7gk9TDp ir6SWhxlMOPgFlm7sBB1Q823AuTsjKJKRZmLRAlBzQXhTHI5NR68AcS6dTN66ghWr7Eb E216zlqXmvCX5GSfXQgj7c4oeXGzHnB9H/1LM1r7Vbm/de1VWQZ6/DBTxUWQsYuXfONn q91ubrTKFVASVJHoC6TR2r2z49leMWPWe7tgyt8cw4UzgwL3xE1TF3y2AyfDBzWQqxgM 5x+w== 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=cX4LRKOPsFg0MGAXnFf/2wkQCA0XfY3FeRl7uIn+E5w=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=p/fXkubC25SA3C3acCtdqCqPxpC4CSvy2sJb1N+deeDMG1CpwDQ1FAuF6eSpn4TQPb JiyWte9dYscFs0dXDLMVxOILkCFNNzS2LLQl+LUGXEIceztdKGTapaXzjxX8eVFouymP ZJ4J+Oh7+U2fYTK026x2+uAb7DYRay2WNOHAY0mqLHqbAUHxEpaVIHwBfn9F91W7vFTA fF+iQAfd4bckxvi7O5A4IoCc0idAtxRM9pyL67ZBk+wIfmBGiDfhE6STi0680XDCJN7f 6zbFsyXwcdkTx9w4v2QctBoQFSy9HUqIYoD7mzbEI9akvvuKSUpvbmCSUbdcXJGbGdI8 AJNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e15-20020a5d530f000000b00317df489cbcsi7509652wrv.158.2023.08.16.22.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 22:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 9AA5386A5F; Thu, 17 Aug 2023 07:49:17 +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 BD43086A5D; Thu, 17 Aug 2023 07:49:16 +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 21E6586979 for ; Thu, 17 Aug 2023 07:49:14 +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 53C97D75; Wed, 16 Aug 2023 22:49:54 -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 2837E3F762; Wed, 16 Aug 2023 22:49:10 -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: [PATCH v2 1/6] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Thu, 17 Aug 2023 11:18:51 +0530 Message-Id: <20230817054856.2019253-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817054856.2019253-1-sughosh.ganu@linaro.org> References: <20230817054856.2019253-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 Reviewed-by: Tom Rini Acked-by: Ilias Apalodimas --- Changes since V1: None scripts/Makefile.lib | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f5ab7af0f4..368b5a3e28 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 +dtsi_include_list = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) +# The CONFIG_DEVICE_TREE_INCLUDES also need to be included +dtsi_include_list += $(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),,$(dtsi_include_list)), \ 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 \