From patchwork Sat Oct 13 12:24:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiangfu Liu X-Patchwork-Id: 191297 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com 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 40C792C008B for ; Sat, 13 Oct 2012 23:25:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BA224A10A; Sat, 13 Oct 2012 14:25:17 +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 E-QmgoAXJBZK; Sat, 13 Oct 2012 14:25:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E5DAE4A0FB; Sat, 13 Oct 2012 14:25:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D25664A0FB for ; Sat, 13 Oct 2012 14:25:13 +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 IXXxyM81SSan for ; Sat, 13 Oct 2012 14:25:12 +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 mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by theia.denx.de (Postfix) with ESMTPS id 10C3D4A0EE for ; Sat, 13 Oct 2012 14:25:10 +0200 (CEST) Received: by mail-wi0-f174.google.com with SMTP id hq7so297327wib.9 for ; Sat, 13 Oct 2012 05:25:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:cc :subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=M3iN6srhGnO9D7dayT+VfOpESjvJkQHMZlVLg0aExcY=; b=n0PnzRdbNXRB4CfV9cRgugATKLtiX/jkH4e1eEDOgu0ysNm9FIdmFOicOsbs47QNGd 9RG/tl1HteTEFrON7CTH9rY37JbbZ4WV7UJUHuk5cn2TMMGrknDFQDrvWnPp2q56Rzcn 8ZOl0OqfCkkaTZnFGiN03lQ6/pPLYgtGDJcJQqcv6fN65U8OaqBEWf/0L5jvIQDaIbK9 U42C1of9MBNtZv391vbaivpCZrjCTjuDIBwdQ4FMkbQIOi09AOTu6KqCFkQ+rwxb6Y4L uJ7G3m3+ZP/m8aHV/eMjKOx0SAvFg7T1EmLWblm+mDCLm0hbvXiFiM2ZtuwtwSFrLM2d pICg== Received: by 10.216.195.133 with SMTP id p5mr4469838wen.1.1350131110112; Sat, 13 Oct 2012 05:25:10 -0700 (PDT) Received: from [10.8.0.6] (fidelio.qi-hardware.com. [213.239.211.82]) by mx.google.com with ESMTPS id b3sm2831904wie.0.2012.10.13.05.25.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 13 Oct 2012 05:25:09 -0700 (PDT) Message-ID: <50795D9A.9010908@openmobilefree.net> Date: Sat, 13 Oct 2012 20:24:58 +0800 From: Xiangfu Liu Organization: http://www.openmobilefree.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 References: <1350007160-16383-1-git-send-email-xiangfu@openmobilefree.net> <1350007160-16383-2-git-send-email-xiangfu@openmobilefree.net> <201210130459.47912.marex@denx.de> In-Reply-To: <201210130459.47912.marex@denx.de> X-Enigmail-Version: 1.4.4 X-Gm-Message-State: ALoCoQld+jxd1/gJCZPVFoOMipSGjUdmSssyXjoK0FxMoMAwjo8O0BiUoHaSYOcPcHhnPM/lRMqE Cc: Tom Rini , u-boot@lists.denx.de, marex@denx.de Subject: Re: [U-Boot] [PATCH v5 1/2] qi_lb60: add nand spl support 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 On 10/13/2012 10:59 AM, Marek Vasut wrote: >> From: Xiangfu >> > >> > The JZ4740 CPU can load 8KB from two different addresses: >> > 1. the normal area up to 8KB starting from NAND flash address 0x00000000 >> > 2. the backup area up to 8KB starting from NAND flash address 0x00002000 >> > >> > After create u-boot-spl.bin. it needs those 4 commands create final image >> > for jz4740 cpu. ~~~~ >> > dd if=spl/u-boot-spl.bin of=u-boot-nand.bin conv=sync bs=8192 count=1 >> > dd if=spl/u-boot-spl.bin of=u-boot-nand.bin conv=sync,notrunc >> > oflag=append bs=8192 count=1 tr '\0' '\377' < /dev/zero | dd >> > of=u-boot-nand.bin conv=sync,notrunc oflag=append bs=16384 count=1 cat >> > u-boot-nand.bin u-boot.bin > u-boot-nand-final.bin >> > ~~~~ > Can you not do this in the linker script? Or implement CPU-specific build target > that does this? Hi Marex Thanks for reply, I don't know how to do this in linker script. but I have plan to send out a patch on Makefile. Attachment is the patch. do you think it is ok for upstream? if it's ok. I will send out this patch in another email. Xiangfu diff --git a/Makefile b/Makefile index 34d9075..55fc72d 100644 --- a/Makefile +++ b/Makefile @@ -554,8 +554,16 @@ $(obj)u-boot.lds: $(LDSCRIPT) nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(MAKE) -C nand_spl/board/$(BOARDDIR) all +ifdef CONFIG_JZ4740 +$(obj)u-boot-nand.bin: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + dd if=$(obj)spl/u-boot-spl.bin of=$(obj)spl/u-boot-nand.bin conv=sync bs=8192 count=1 + dd if=$(obj)spl/u-boot-spl.bin of=$(obj)spl/u-boot-nand.bin conv=sync,notrunc oflag=append bs=8192 count=1 + tr '\0' '\377' < /dev/zero | dd of=$(obj)spl/u-boot-nand.bin conv=sync,notrunc oflag=append bs=16384 count=1 + cat $(obj)spl/u-boot-nand.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin +else $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin +endif $(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend $(MAKE) -C spl all