From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38A43C433EF for ; Fri, 17 Dec 2021 04:05:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E23E837B6; Fri, 17 Dec 2021 05:03:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GYGdTZN7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16D3E8340A; Fri, 17 Dec 2021 05:01:11 +0100 (CET) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ECE8D833B8 for ; Fri, 17 Dec 2021 05:00:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x22f.google.com with SMTP id 7so1791767oip.12 for ; Thu, 16 Dec 2021 20:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+tVPkmm9v1JsNNBMa/YlaP0gOunSIewV2g4eOTQuL/8=; b=GYGdTZN7+lnPU04+SMZ6BC9wvdRz7k9va7qdUJh8xGZx26oFSO7SB5PoRQRF0LGfnT WQrZpVzlwDw8DMXnNHpooHdHB7vZTl7Ebo09corTSkOoLzogAqaputa8E8ZyRavYf1b9 suI48UNXKYNI0ZwqVZCIzQcOsmmIh/EkD+YSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+tVPkmm9v1JsNNBMa/YlaP0gOunSIewV2g4eOTQuL/8=; b=VthYZRA/t+1MfhcKD9g0dHMAVIanXtGa64D0u9m6cO5xoVjZJKYMubTdhvYdMgr2ee LknSkn86kwGsF2mpi2GIXfqVzbLof3RfR8rswHlkveBw1fZY+hZzozR5B+xfyWTUV4Jb 0mdZWON9EaJmeQ7GusbyCydpD/G/64pqsrDkXEHkyGF9rc5W8hGAgkQMLnCzob6d3ZiG Dy7i+LW4T0xyH7GdHpcO4sOENukUKeLSLLbGBK75v+zf86HFxrI6vOsBUCnt/TISA+3A efhuuwTk+FNz0WDPm5urq10bfHrn1pDfK9y5UqVFtX9W6260lxdshmRNfqwTiMwUe9yW XFmw== X-Gm-Message-State: AOAM530acewIufJNOffGGS8W666dLg3VRWpWlHMqmTnqa2QRtBBc3x26 i+lSb3NovPg7AQt2rRhjpBdjvQJ9zuOXjQ== X-Google-Smtp-Source: ABdhPJzKYegGP8PTVTLv7Vh5lXTpE8Xm7IDMQjMuWY0xQPGDLETGT6C0W/7ZsjsYvmnL6Dbl6ZwYxg== X-Received: by 2002:a05:6808:1285:: with SMTP id a5mr727180oiw.104.1639713631563; Thu, 16 Dec 2021 20:00:31 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id h14sm1431249ots.22.2021.12.16.20.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 20:00:31 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Sean Anderson , Heinrich Schuchardt , Tom Rini , Mark Kettenis , =?UTF-8?q?Fran=C3=A7ois=20Ozog?= , Simon Glass , Jerry Van Baren Subject: [PATCH v8 31/32] fdt: Avoid emitting an device tree when not needed Date: Thu, 16 Dec 2021 20:59:38 -0700 Message-Id: <20211217035939.670884-31-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.173.g76aa8bc2d0-goog In-Reply-To: <20211217035939.670884-1-sjg@chromium.org> References: <20211217035939.670884-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean U-Boot always needs some sort of a device tree in the build. Some boards never actually use this, at least in production systems, since a prior firmware stage sets one up and passes it to U-Boot. At present the only mechanism to do that is with custom function (OF_BOARD), but future work will include a standard way of doing this ('standard passage'). It can be confusing to see a device tree emitted from the U-Boot build in this situation. Add an option to drop it. Signed-off-by: Simon Glass --- Changes in v8: - Fix devicetree logic so that just u-boot.dtb is omitted Makefile | 6 ++++-- dts/Kconfig | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 98ef2642f68..dc391af29ca 100644 --- a/Makefile +++ b/Makefile @@ -952,7 +952,9 @@ INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.img endif endif INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin -INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb + +# Allow omitting the .dtb output if it is not normally used +INPUTS-$(CONFIG_OF_SEPARATE) += $(if $(CONFIG_OF_OMIT_DTB),dts/dt.dtb,u-boot.dtb) ifeq ($(CONFIG_SPL_FRAMEWORK),y) INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif @@ -1199,7 +1201,7 @@ u-boot.bin: u-boot-fit-dtb.bin FORCE u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE $(call if_changed,cat) -else ifeq ($(CONFIG_OF_SEPARATE),y) +else ifeq ($(CONFIG_OF_SEPARATE).$(CONFIG_OF_OMIT_DTB),y.) u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE $(call if_changed,cat) diff --git a/dts/Kconfig b/dts/Kconfig index e57ce84b98d..fb7df533f92 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -129,6 +129,16 @@ config OF_HAS_PRIOR_STAGE Note: This option must be set in Kconfig and cannot be enabled or disabled in the board's defconfig file. +config OF_OMIT_DTB + bool "Omit the device tree output when building" + default y if OF_HAS_PRIOR_STAGE && !BINMAN + help + As a special case, avoid writing a device tree file u-boot.dtb when + building. Also don't include that file in u-boot.bin + + This is used for boards which normally provide a devicetree via a + runtime mechanism (such as OF_BOARD), to avoid confusion. + config DEFAULT_DEVICE_TREE string "Default Device Tree for DT control" depends on OF_CONTROL -- 2.34.1.173.g76aa8bc2d0-goog