From patchwork Thu Jul 7 21:38:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Renaud X-Patchwork-Id: 103732 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 D9A35B6F67 for ; Fri, 8 Jul 2011 07:39:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 95CD02808A; Thu, 7 Jul 2011 23:39:10 +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 eLYO+hoCPyhK; Thu, 7 Jul 2011 23:39:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86D122808B; Thu, 7 Jul 2011 23:39:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7103A2808B for ; Thu, 7 Jul 2011 23:39:06 +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 vfVGP5mEH3dG for ; Thu, 7 Jul 2011 23:39:04 +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 hayes.bluewaternz.com (mail.bluewatersys.com [202.124.120.130]) by theia.denx.de (Postfix) with ESMTPS id 4400C2808A for ; Thu, 7 Jul 2011 23:39:01 +0200 (CEST) Received: (qmail 2174 invoked by uid 89); 7 Jul 2011 21:38:57 -0000 Received: from unknown (HELO ?192.168.2.95?) (andre@192.168.2.95) by 0 with ESMTPA; 7 Jul 2011 21:38:57 -0000 Message-ID: <4E16276C.3080303@bluewatersys.com> Date: Fri, 08 Jul 2011 09:38:52 +1200 From: Andre Renaud User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: u-boot@lists.denx.de X-Enigmail-Version: 1.1.2 Subject: [U-Boot] cpu/arm926ejs/start.S question 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 Hello, I am working on an i.MX25 board, and would like to know the recommended mechanism for putting code in before the first instruction in the executable, but outside the *_spl system. Basically, the i.MX25 has a smart boot rom in the CPU, which will extract the first block, and interpret it (as data, rather than instructions). However, if I just use the linker script to put this block before start.S, then U-Boot relocation gets messed up, as _start is now not the beginning of the image, and a lot of the calculated offsets are wrong. At the moment I have this working with the following change in start.S: and I then #define CONFIG_PRE_START_INCLUDE to be the assembler for the i.MX25 specific boot code. Is there a nicer way to go about this? Regards, Andre --- cpu/arm926ejs/start.S (revision 36) +++ cpu/arm926ejs/start.S (working copy) @@ -53,6 +53,9 @@ .globl _start _start: +#ifdef CONFIG_PRE_START_INCLUDE +#include CONFIG_PRE_START_INCLUDE +#endif b reset #ifdef CONFIG_PRELOADER /* No exception handlers in preloader */