From patchwork Mon May 10 06:58:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1476180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fCbyV8bX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FdsQC3s2Cz9sXS for ; Mon, 10 May 2021 17:00:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8118682EF8; Mon, 10 May 2021 08:59:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fCbyV8bX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D2F9882ECA; Mon, 10 May 2021 08:59:09 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 B492182ED6 for ; Mon, 10 May 2021 08:59:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-ej1-x632.google.com with SMTP id f24so22846318ejc.6 for ; Sun, 09 May 2021 23:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=vRkuh0+h6g9u18qN/5lNNAOHkoy+Bv+zoU53bqGT/p0=; b=fCbyV8bX2Eer0RBsbXnsM8miQ5nRyeI06PP+l0IFCz5q6Kg3gXj/KvF3n/O1LsbMCU xzdamb2K79/9aIS62XvzrVRTTHf3qSp0RVUrZUkPt8D7/3CKouhmcaMuAcOvHXbl0rbR eCrgvvdlSi7UhTaSZRMFgoHcYK4FcwlJm3wAe27GrJtidh2yPblWfwat84K5tELquBCS u+oyJFHfOqfoXcnOvuHA5cDMvEnN2GYHdsvHQ/vsZre3OeafpbHLJKpl6Pfv8ml4rQiS ArBao0raU+JqmkPtTTqMMFV2HUgY6Hg+hBJHpj+mDofJ7LwxWgibJhps96lTC2+bFgH8 j2Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vRkuh0+h6g9u18qN/5lNNAOHkoy+Bv+zoU53bqGT/p0=; b=d0OcL3ATyobG4HmBgYGBVkQdwJIakdqTS5nRr2iiBS2o0An1pPAZQUay7OWhPcs5WI FSDoc6EIgFQfcW2OOGwTejkisWa71AFGM5Tfbh21ayiMC5Lxe1e3kp2KhXl/CZ/sw5f3 vERHWuscYnZapIcgUYohNN1ynoQ7iZYD7ax/epu4HIYuVnDkjoAyx/yvpU8Tn7Evv76E HurRfIjl50Ai3lVOrA1kgDYLidkQj4vmclz9hQdQJdrk9dFGL4+yuk9LzE7izxdOGUL9 mfhKfYp3fCukwKaNHA+8S32I8cSMwiWigk/ZUYyUij8sA374lgAHKnmSGLZ1Hohl+lsY I4xw== X-Gm-Message-State: AOAM533ZWLL8urXhcHc84lxp72e/5UgI4n4j4FkRG1FB/t3LwqVDSsuQ SfnH9trh8UctvySf7ELO1FnAl9JK9NQ= X-Google-Smtp-Source: ABdhPJx+HQCOG5DywWvT9lKcx0e4G5HebYNUXOFn8p0zGDxONOEfUcFuyNtcS5wQBVA/+unabtYPoA== X-Received: by 2002:a17:906:d28e:: with SMTP id ay14mr24008544ejb.33.1620629945454; Sun, 09 May 2021 23:59:05 -0700 (PDT) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id c5sm4744944eds.94.2021.05.09.23.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 23:59:04 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , u-boot@lists.denx.de Subject: [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE Date: Mon, 10 May 2021 14:58:33 +0800 Message-Id: <20210510065837.2008556-10-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510065837.2008556-1-bmeng.cn@gmail.com> References: <20210510065837.2008556-1-bmeng.cn@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean For scenarios like OF_BOARD or OF_PRIOR_STAGE, no device tree blob is provided in the U-Boot build phase hence the binman node information is not available. In order to support such use case, a new Kconfig option BINMAN_STANDALONE_FDT is introduced, to tell the build system that a device tree blob containing binman node is explicitly required when using binman to package U-Boot. Signed-off-by: Bin Meng --- Changes in v4: - update the makefile dependency on u-boot.img instead of u-boot.bin Changes in v3: - rename the Kconfig option name to BINMAN_STANDALONE_FDT - make BINMAN_STANDALONE_FDT default y for OF_BOARD as well - reword the Kconfig option help message a little bit Changes in v2: - new patch: "binman: Support packaging U-Boot for scenarios like OF_PRIOR_STAGE" Makefile | 3 ++- dts/Kconfig | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d88559b67..1dbf0b0b8c 100644 --- a/Makefile +++ b/Makefile @@ -918,6 +918,7 @@ endif endif INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb +INPUTS-$(CONFIG_BINMAN_STANDALONE_FDT) += u-boot.dtb ifeq ($(CONFIG_SPL_FRAMEWORK),y) INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif @@ -1392,7 +1393,7 @@ u-boot-lzma.img: u-boot.bin.lzma FORCE u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \ $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \ - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE),dts/dt.dtb) \ + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \ ,$(UBOOT_BIN)) FORCE $(call if_changed,mkimage) $(BOARD_SIZE_CHECK) diff --git a/dts/Kconfig b/dts/Kconfig index 99ce75e1a2..dabe0080c1 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -19,6 +19,24 @@ config BINMAN bool select DTOC +config BINMAN_STANDALONE_FDT + bool + depends on BINMAN + default y if OF_BOARD || OF_PRIOR_STAGE + help + This option tells U-Boot build system that a standalone device tree + source is explicitly required when using binman to package U-Boot. + + This is not necessary in a common scenario where a device tree source + that contains the binman node is provided in the arch//dts + directory for a specific board. Such device tree sources are built for + OF_SEPARATE or OF_EMBED. However for a scenario like the board device + tree blob is not provided in the U-Boot build tree, but fed to U-Boot + in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by + a prior stage bootloader. For such scenario, a standalone device tree + blob containing binman node to describe how to package U-Boot should + be provided explicitly. + menu "Device Tree Control" depends on SUPPORT_OF_CONTROL