From patchwork Mon Aug 21 07:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 715362 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1698771wrs; Mon, 21 Aug 2023 00:29:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFi190Xz/5K5YB8AnwI9ogBg+j6igqxgjeFJLAGd8W/K/uT0x8iTPpbkABdIb8YDLAUS0XD X-Received: by 2002:adf:f7c9:0:b0:313:eaf5:515 with SMTP id a9-20020adff7c9000000b00313eaf50515mr3726333wrq.6.1692602982976; Mon, 21 Aug 2023 00:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692602982; cv=none; d=google.com; s=arc-20160816; b=aQvwx80AMIu0uqYVIFy8xPnYWF6haIFn+QSvp9/pW/01ippgnZwZbS+qeUUADCUmVT 92O6F45wzFheVA8cJkSCJuGSYbt8kF9yiUoPxSDRvBdjzgzDBXnDV6CbSdf/1bmVLusS V8fQKZXMXW8DCkFTTJMkK2UHs3Xupg0DiNv98bVSHnSnDMkEVz1NFhrHD1OqtwRFuDl7 lVQhfg9n/mSSwojSqMbFq+Cmm7Ka6kSDq0IchUSdfLDP/ztVO/BblKFFmYj5ClDGW0ed nYF0ryI/sakvKEy/MTlrHFSPOvgu393bJ11Zd/u9yiuQx1+tRdfBSp/T7nn3djmY49rK jupA== 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=6HlS/On3fR84RRCTNrzkZWV8AZlgc2+9LhIrAokn24Y=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=oHshLnighXjhSYt/BHeY8c8UV54ZEJvQt7fdAHPKHVd5t9nXzG3tfIycW2G30Zx4oS wRGPOF0yelVcxwZVDnZd4h6/jos84P1UH2qU4uA9hYn6v2X71jybfDF3WfTmooKWrJ9J GiRVZ9SpmpV0LZA/IfrtVs88W8VHWzLpuWj8TxqttwsLVtgXaQzS1Be21HgNxWR5wr8h dSosYlCZ3he2jFXcNn3fJ/D0PVoUX7yX7aVJVdQkwBdLqMrM/bEwAa6/HLxDL+GY33v4 xWCitx94eBsMmgiXfK+DMaSqlcE9yzw7q7oiNzJy1siRUXYnYN0/FPmwIRK9lJ+O9nBd cQUQ== 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 j8-20020adfe508000000b00317b3c71838si3480862wrm.55.2023.08.21.00.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 00:29:42 -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 F2BB08701B; Mon, 21 Aug 2023 09:29:33 +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 7600887015; Mon, 21 Aug 2023 09:29:32 +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 CADF18695F for ; Mon, 21 Aug 2023 09:29:29 +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 E93412F4; Mon, 21 Aug 2023 00:30:09 -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 EA81E3F740; Mon, 21 Aug 2023 00:29:26 -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 v3 1/6] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Mon, 21 Aug 2023 12:59:04 +0530 Message-Id: <20230821072909.2387400-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821072909.2387400-1-sughosh.ganu@linaro.org> References: <20230821072909.2387400-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 V2: 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 \