From patchwork Sun Feb 6 12:03:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Lilja X-Patchwork-Id: 82038 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 8A9FDB711C for ; Sun, 6 Feb 2011 23:29:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DF2328117; Sun, 6 Feb 2011 13:29:48 +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 TioFoil-I26L; Sun, 6 Feb 2011 13:29:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA71A28094; Sun, 6 Feb 2011 13:29:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2DC52281CA for ; Sun, 6 Feb 2011 13:29:44 +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 GzQNHFM0mB4m for ; Sun, 6 Feb 2011 13:29:42 +0100 (CET) X-Greylist: delayed 1717 seconds by postgrey-1.27 at theia; Sun, 06 Feb 2011 13:29:40 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.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by theia.denx.de (Postfix) with ESMTPS id 06E4528180 for ; Sun, 6 Feb 2011 13:29:40 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 212F64001D; Sun, 6 Feb 2011 13:01:02 +0100 (CET) Received: from [192.168.10.91] (unknown [83.209.237.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTP id B965640005; Sun, 6 Feb 2011 13:01:01 +0100 (CET) Message-ID: <4D4E8E11.2010906@gmail.com> Date: Sun, 06 Feb 2011 13:03:29 +0100 From: Magnus Lilja User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Fabio Estevam References: <1294836544-24512-1-git-send-email-fabio.estevam@freescale.com> <4D2F004B.9090204@denx.de> <4D309716.4000905@freescale.com> In-Reply-To: <4D309716.4000905@freescale.com> X-Virus-Scanned: ClamAV using ClamSMTP Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [RFC] ARM: mx31pdk: Use the new relocation scheme 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hi all On 01/14/2011 07:33 PM, Fabio Estevam wrote: > Hi Stefano, > > On 1/13/2011 11:38 AM, Stefano Babic wrote: >> On 01/12/2011 01:49 PM, Fabio Estevam wrote: >>> Hi, >> >> Hi Fabio, >> >>> >>> I am trying to make the new relocation scheme to work on the mx31pdk board. >>> >>> With this patch applied the mx31pdk build works, but not able to get a U-boot prompt yet. >> >> I have tried to imagine some issues, but I cannot find a clear reason. >> Building with your patch I checked that nand_spl is still less than 2KB >> code, and that matches the NAND page, as required by i.MX31 - so it is >> not a problem. >> >> Have you tried to disable the relocation, just to check if the >> relocation is an issue with CONFIG_SKIP_RELOCATE_UBOOT ? This is not a >> solution, but only to check what happens. I've done some testing now and ended up comparing start.S for ARM1136 with ARM926EJS since the latter is used on the Karo TX25 board which seems to have been updated and also boots from NAND. The result is that applying the following patch on top of Fabios patch makes the i.MX31 PDK boot from NAND. Booting Linux from TFTP works nicely. However the first few lines of output from U-boot is missing, only the "NAND: 256 MB" line is shown. I haven't tried to understand how booting works nowadays and why these changes work, perhaps someone with more insight in the mechanisms can figure out the correct assembler code. I have no idea if this breaks other boards but at least it's start for further work. I tried it on the imx31 litekit (which boots from NOR) but that board doesn't seem to boot even before applying Fabios patch, I'll see if I can figure out why that board is broken now. Don't know when though. Regards, Magnus Lilja diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S index 12545c2..7d75ecf 100644 --- a/arch/arm/cpu/arm1136/start.S +++ b/arch/arm/cpu/arm1136/start.S @@ -163,6 +163,9 @@ call_board_init_f: bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ ldr r0,=0x00000000 +#if 1 + bl board_init_f +#else #ifdef CONFIG_NAND_SPL bl nand_boot #else @@ -172,6 +175,7 @@ call_board_init_f: bl board_init_f #endif /* CONFIG_ONENAND_IPL */ #endif /* CONFIG_NAND_SPL */ +#endif /*------------------------------------------------------------------------------*/ @@ -266,11 +270,19 @@ clbss_l:str r2, [r0] /* clear loop... */ * initialization, now running from RAM. */ #ifdef CONFIG_NAND_SPL +#if 1 + ldr r0, _nand_boot_ofs + mov pc, r0 + +_nand_boot_ofs: + .word nand_boot +#else ldr r0, _nand_boot_ofs adr r1, _start add pc, r0, r1 _nand_boot_ofs: .word nand_boot - _start +#endif #else jump_2_ram: ldr r0, _board_init_r_ofs