From patchwork Sat Oct 15 15:48:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 119981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 697D6B70FF for ; Sun, 16 Oct 2011 03:07:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 524A5289B1; Sat, 15 Oct 2011 18:07:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eU+HA5XOevGb; Sat, 15 Oct 2011 18:07:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C90F828A19; Sat, 15 Oct 2011 18:06:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E57B2867F for ; Sat, 15 Oct 2011 17:50:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zg4iDLTcOvhd for ; Sat, 15 Oct 2011 17:50:19 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by theia.denx.de (Postfix) with ESMTPS id A08DA2866C for ; Sat, 15 Oct 2011 17:50:18 +0200 (CEST) Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p9FFnwBa015201; Sat, 15 Oct 2011 08:49:58 -0700 Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by hpaq12.eem.corp.google.com with ESMTP id p9FFnucp022439; Sat, 15 Oct 2011 08:49:57 -0700 Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 5C1FE1409E5; Sat, 15 Oct 2011 08:49:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 15 Oct 2011 08:48:22 -0700 Message-Id: <1318693706-3381-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1318693706-3381-1-git-send-email-sjg@chromium.org> References: <1318693706-3381-1-git-send-email-sjg@chromium.org> X-System-Of-Record: true X-Mailman-Approved-At: Sat, 15 Oct 2011 18:06:52 +0200 Cc: Kumar Gala , Grant Likely , Tom Warren , Aaron Williams Subject: [U-Boot] [PATCH v4 3/6] fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This adds support for an FDT to be build as a separate binary file called u-boot.dtb. This can be concatenated with the U-Boot binary to provide a device tree located at run-time by U-Boot. The Makefile is modified to provide this file in u-boot-dtb.bin. Signed-off-by: Simon Glass --- Changes in v2: - Modify Makefile to create combined U-boot/fdt (u-boot-dtb.bin) .gitignore | 1 + Makefile | 8 ++++++++ README | 16 ++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0a9dc0c..a367082 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ /u-boot.dis /u-boot.lds /u-boot.ubl +/u-boot.dtb # # Generated files diff --git a/Makefile b/Makefile index 05f64b7..9a640e9 100644 --- a/Makefile +++ b/Makefile @@ -354,9 +354,17 @@ ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin +ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin all: $(ALL-y) +$(obj)u-boot.dtb: $(obj)u-boot + $(MAKE) -C dts binary + mv $(obj)dts/dt.dtb $@ + +$(obj)u-boot-dtb.bin: $(obj)u-boot.bin $(obj)u-boot.dtb + cat $^ >$@ + $(obj)u-boot.hex: $(obj)u-boot $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ diff --git a/README b/README index b5cdcb5..fc1cd00 100644 --- a/README +++ b/README @@ -819,8 +819,8 @@ The following options need to be configured: experimental and only available on a few boards. The device tree is available in the global data as gd->fdt_blob. - U-Boot needs to get its device tree from somewhere. At present - the only way is to embed it in the image with CONFIG_OF_EMBED. + U-Boot needs to get its device tree from somewhere. This can + be done using one of the two options below: CONFIG_OF_EMBED If this variable is defined, U-Boot will embed a device tree @@ -829,6 +829,18 @@ The following options need to be configured: is then picked up in board_init_f() and made available through the global data structure as gd->blob. + CONFIG_OF_SEPARATE + If this variable is defined, U-Boot will build a device tree + binary. It will be called u-boot.dtb. Architecture-specific + code will locate it at run-time. Generally this works by: + + cat u-boot.bin u-boot.dtb >image.bin + + and in fact, U-Boot does this for you, creating a file called + u-boot-dtb.bin which is useful in the common case. You can + still use the individual files if you need something more + exotic. + - Watchdog: CONFIG_WATCHDOG If this variable is defined, it enables watchdog