From patchwork Tue Aug 15 16:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 713788 Delivered-To: patch@linaro.org Received: by 2002:a5d:4012:0:b0:317:ecd7:513f with SMTP id n18csp1875576wrp; Tue, 15 Aug 2023 09:27:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhUkoVro4d2OGSNAB/OHJqSfFrSGOTK6vh/+hTs2GdVkNPWSI8qQa5Kj8Y8AvchWdXu6es X-Received: by 2002:a05:600c:ad2:b0:3fb:fa9f:5292 with SMTP id c18-20020a05600c0ad200b003fbfa9f5292mr9266018wmr.25.1692116821526; Tue, 15 Aug 2023 09:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692116821; cv=none; d=google.com; s=arc-20160816; b=bJel3ft5nCKLvHlGkN1U33YlkG/KjKfB4s3e50P9a04VF1NcV+a8nluqqVBtrSRNJ9 XyY3BPBXbFgey391dvYsaOE0cH5m3M1M1TXvEnCaVSpaNC3Kq+ywWRh80424qxZoOZ1Z cZGJQzUTwyF/Dp69mQSIt53/vO7kagAKMkevbIqDN9EKco3MEHeMV5jcFaLcrumqAtKR kuqcgDEA1sl8RL92Txu0Emvju4XtbTXHBSnw/mWHhCeoZXGARqnRiJkrSq5oGtlyVWY3 Q0TXyFKjzUHO2MHxeC9tdX1bFJ7Wpbaq2PRRGatX8URTZ8hRcOxyeB4oHaeFF+wqoVnb jTrg== 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=2e2BUYFjef4rp2b0d49SQd0DnS4Gv+7EH7iCUsitkOE=; fh=ikJSK2WVWLZPtKfyjzYjMbDKcRMYT5CY2x/iGdlGnWY=; b=rw3sCC3nbvmea1GqU9CGotMeHAeQL740Q7No5NwPXp2yHbcAef3awA8y9T1ijODOgt yHNS0PGaKnhhLtnLs9r63gwD1kaNDtL1Pad/albjFgvpH9gOL39RpU6KD3qXfX89s1I8 85qT7V9oMRhuuTqlEFHtIvwU+bBp871MUms9KuEgrI1QRUKq7FzMAzO3HQmAsR56S7K5 Oaa2WlI4Fein+W4ooYWATtH1yeLG8sR4NuZIK2UoKyI5eglkDhNX9o8nEqdpp7thQQPQ C3yxGuTfogFK9QCk/BmYWaUPMSRKxV0VHzdRuP/VKB/IbBjMWIkIrysAJJfV9xO10FQX g93Q== 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 j26-20020a05600c1c1a00b003fbadb66c39si7364185wms.8.2023.08.15.09.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 09:27:01 -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 B17A286797; Tue, 15 Aug 2023 18:26:52 +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 E7D3D869A5; Tue, 15 Aug 2023 18:26:51 +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 079378671F for ; Tue, 15 Aug 2023 18:26:50 +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 B427D1063; Tue, 15 Aug 2023 09:27:31 -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 343833F6C4; Tue, 15 Aug 2023 09:26:46 -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 1/5] scripts/Makefile.lib: Collate all dtsi files for inclusion Date: Tue, 15 Aug 2023 21:56:19 +0530 Message-Id: <20230815162623.1824357-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230815162623.1824357-1-sughosh.ganu@linaro.org> References: <20230815162623.1824357-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 --- Changes since RFC series: * s/include_files/dtsi_include_list 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 \