From patchwork Mon Feb 25 18:19:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 222992 X-Patchwork-Delegate: sbabic@denx.de 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 CCBF12C0092 for ; Tue, 26 Feb 2013 05:20:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B76DB4A0FC; Mon, 25 Feb 2013 19:20:21 +0100 (CET) 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 RbiiKHe3ON3C; Mon, 25 Feb 2013 19:20:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE9B34A0F2; Mon, 25 Feb 2013 19:20:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0D7894A0F2 for ; Mon, 25 Feb 2013 19:20:18 +0100 (CET) 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 Q1FT-ASQ7qdZ for ; Mon, 25 Feb 2013 19:20:17 +0100 (CET) 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 mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id 2DE584A0F1 for ; Mon, 25 Feb 2013 19:20:15 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZFBKC04Dlz3hhxL; Mon, 25 Feb 2013 19:20:14 +0100 (CET) X-Auth-Info: V20UK4oWokvFSA9+sFUmdrt/o9q0lbPv/BM8qlomHKk= Received: from mashiro.lan (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3ZFBK069bWzbbfc; Mon, 25 Feb 2013 19:20:04 +0100 (CET) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 25 Feb 2013 19:19:54 +0100 Message-Id: <1361816397-8661-1-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Cc: Marek Vasut , Fabio Estevam Subject: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Implement u-boot.nand target that can be reused with a small amount of churn across all CPU models. The idea is to delegate the u-boot.nand target out of the main Makefile and into the CPU's Makefile (very similar to what u-boot.imx does now). The main Makefile shall only contain path to which the u-boot.nand target is delegated. Hopefully this will not produce too much bloat in the main Makefile. To demonstrate this implementation, add u-boot.nand target for i.MX53. Signed-off-by: Marek Vasut Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic --- Makefile | 18 ++++++++++++++++++ arch/arm/imx-common/Makefile | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/Makefile b/Makefile index 41054b7..8b1010a 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin $(obj)u-boot.imx: $(obj)u-boot.bin depend $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx +# +# Generic u-boot.nand target. +# +# Every CPU that needs u-boot.nand must add a path to an implementation of +# the actual u-boot.nand generator below. +# +ifdef CONFIG_MX53 +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common +endif + +$(obj)u-boot.nand: $(obj)u-boot.bin depend + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ + echo "This CPU does not support u-boot.nand target!" ; \ + exit 1 ; \ + fi + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand + $(obj)u-boot.kwb: $(obj)u-boot.bin $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ @@ -857,6 +874,7 @@ clobber: tidy @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.pbl @rm -f $(obj)u-boot.imx + @rm -f $(obj)u-boot.nand @rm -f $(obj)u-boot.ubl @rm -f $(obj)u-boot.ais @rm -f $(obj)u-boot.dtb diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 5d5c5b2..71ea36f 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.nand: $(obj)u-boot.imx + ( \ + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ; \ + dd if=/dev/zero bs=1015 count=1 2>/dev/null ) | \ + cat - $< > $@ + $(obj)SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ -e $(CONFIG_SPL_TEXT_BASE) -d $< $@