From patchwork Wed Aug 14 18:25:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 267179 X-Patchwork-Delegate: albert.aribaud@free.fr 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 382E02C015D for ; Thu, 15 Aug 2013 04:27:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E704A4A1B9; Wed, 14 Aug 2013 20:27:05 +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 oMFwZQShwpxo; Wed, 14 Aug 2013 20:27:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EDA404A19A; Wed, 14 Aug 2013 20:26:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E9A454A185 for ; Wed, 14 Aug 2013 20:26:30 +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 1SqaAKjuPvhl for ; Wed, 14 Aug 2013 20:26:26 +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 smtp1.versatel.nl (smtp1.versatel.nl [62.58.50.88]) by theia.denx.de (Postfix) with ESMTPS id 577464A17C for ; Wed, 14 Aug 2013 20:26:13 +0200 (CEST) Received: (qmail 21311 invoked by uid 0); 14 Aug 2013 18:26:12 -0000 Received: from ip120-12-208-87.adsl2.static.versatel.nl (HELO router.myspectrum.nl) ([87.208.12.120]) (envelope-sender ) by smtp1.versatel.nl (qmail-ldap-1.03) with SMTP for < >; 14 Aug 2013 18:26:12 -0000 Received: from black (unknown [10.0.0.107]) by router.myspectrum.nl (Postfix) with ESMTP id 6830B1BE2A; Wed, 14 Aug 2013 20:26:12 +0200 (CEST) Received: by black (Postfix, from userid 1000) id 4F24B1D801BC; Wed, 14 Aug 2013 20:26:13 +0200 (CEST) From: Jeroen Hofstee To: u-boot@lists.denx.de Date: Wed, 14 Aug 2013 20:25:45 +0200 Message-Id: <1376504746-15173-4-git-send-email-jeroen@myspectrum.nl> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1376504746-15173-1-git-send-email-jeroen@myspectrum.nl> References: <1376254719-15594-1-git-send-email-jeroen@myspectrum.nl> <1376504746-15173-1-git-send-email-jeroen@myspectrum.nl> Cc: Jeroen Hofstee Subject: [U-Boot] [PATCH v2 3/4] ARM: use r9 for gd 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de To be more EABI compliant and as a preparation for building with clang, use the platform-specific r9 register for gd instead of r8. note: The FIQ is not updated since it is not used in u-boot, and under discussion for the time being. The following checkpatch warning is ignored: WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt cc: Albert ARIBAUD Signed-off-by: Jeroen Hofstee --- arch/arm/config.mk | 2 +- arch/arm/include/asm/global_data.h | 2 +- arch/arm/lib/crt0.S | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 5e382ab..5f6e032 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -99,4 +99,4 @@ ifneq ($(CONFIG_SPL_BUILD),y) ALL-y += checkarmreloc endif -OPTION_FIXED_GD=$(call cc-option, -ffixed-r8) +OPTION_FIXED_GD=$(call cc-option, -ffixed-r9) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 79a9597..e126436 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -47,6 +47,6 @@ struct arch_global_data { #include -#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8") +#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9") #endif /* __ASM_GBL_DATA_H */ diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 960d12e..ac54b93 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -69,7 +69,7 @@ ENTRY(_main) bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ sub sp, #GD_SIZE /* allocate one GD above SP */ bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ - mov r8, sp /* GD is above SP */ + mov r9, sp /* GD is above SP */ mov r0, #0 bl board_init_f @@ -81,15 +81,15 @@ ENTRY(_main) * 'here' but relocated. */ - ldr sp, [r8, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */ + ldr sp, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */ bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ - ldr r8, [r8, #GD_BD] /* r8 = gd->bd */ - sub r8, r8, #GD_SIZE /* new GD is below bd */ + ldr r9, [r9, #GD_BD] /* r9 = gd->bd */ + sub r9, r9, #GD_SIZE /* new GD is below bd */ adr lr, here - ldr r0, [r8, #GD_RELOC_OFF] /* r0 = gd->reloc_off */ + ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */ add lr, lr, r0 - ldr r0, [r8, #GD_RELOCADDR] /* r0 = gd->relocaddr */ + ldr r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */ b relocate_code here: @@ -111,8 +111,8 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */ bl red_led_on /* call board_init_r(gd_t *id, ulong dest_addr) */ - mov r0, r8 /* gd_t */ - ldr r1, [r8, #GD_RELOCADDR] /* dest_addr */ + mov r0, r9 /* gd_t */ + ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */ /* call board_init_r */ ldr pc, =board_init_r /* this is auto-relocated! */