From patchwork Thu Feb 23 13:03:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 142606 X-Patchwork-Delegate: trini@ti.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 0F0C5B6EEC for ; Fri, 24 Feb 2012 00:04:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 99E8E28081; Thu, 23 Feb 2012 14:04:30 +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 XZtqmAT4M7kt; Thu, 23 Feb 2012 14:04:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9AA3328088; Thu, 23 Feb 2012 14:04:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D99328078 for ; Thu, 23 Feb 2012 14:04:14 +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 fQ16vSvy3I82 for ; Thu, 23 Feb 2012 14:04:13 +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-bk0-f74.google.com (mail-bk0-f74.google.com [209.85.214.74]) by theia.denx.de (Postfix) with ESMTPS id 58AAA28077 for ; Thu, 23 Feb 2012 14:04:11 +0100 (CET) Received: by bkcjk13 with SMTP id jk13so41544bkc.3 for ; Thu, 23 Feb 2012 05:04:10 -0800 (PST) Received-SPF: pass (google.com: domain of sjg@google.com designates 10.14.137.137 as permitted sender) client-ip=10.14.137.137; Authentication-Results: mr.google.com; spf=pass (google.com: domain of sjg@google.com designates 10.14.137.137 as permitted sender) smtp.mail=sjg@google.com Received: from mr.google.com ([10.14.137.137]) by 10.14.137.137 with SMTP id y9mr848308eei.2.1330002250748 (num_hops = 1); Thu, 23 Feb 2012 05:04:10 -0800 (PST) Received: by 10.14.137.137 with SMTP id y9mr729665eei.2.1330002250692; Thu, 23 Feb 2012 05:04:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.137.137 with SMTP id y9mr729633eei.2.1330002250566; Thu, 23 Feb 2012 05:04:10 -0800 (PST) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id f9si1039541eea.2.2012.02.23.05.04.10 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 23 Feb 2012 05:04:10 -0800 (PST) Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 0D3295C0060; Thu, 23 Feb 2012 05:04:10 -0800 (PST) Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 6EDE31407B8; Thu, 23 Feb 2012 05:04:09 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 23 Feb 2012 05:03:39 -0800 Message-Id: <1330002228-29348-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1330002228-29348-4-git-send-email-sjg@chromium.org> References: <1330002228-29348-4-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQnL5tP3F60moO2XOkxFldFpVbE2tQG0QCxkNGmzBJNcMcnazZp96/4yAAOECpua3QCWiQIAUWouYQrXowi3/vZumxHpfjw958CMoCZodA5rpIdjFlBcnMHc+sL7kCcNSL1ZJr1JZQASA5COHulbifFr6DfkwkOIbi877wDNdJ1e/69uJa4= Cc: Tom Rini Subject: [U-Boot] [PATCH v5 05/14] arm: Add pivot_to_board_init_r() to each start.S 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 We don't want this in a common file, or at least not yet, so add this function to every start.S individually. The existing code tacked on the end of a long relocation function and does not suit our needs since it doesn't allow the address of board_init_r() to be passed in and cannot be called from C since it expects values in registers r4 and above. Signed-off-by: Simon Glass --- Changes in v4: - Put start_call_board_init_r() into each start.S, sadly - Split out start_call_board_init_r() addition into new patch Changes in v5: - Rename start_call_board_init_r() to pivot_to_board_init_r() arch/arm/cpu/arm1136/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm1176/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm720t/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm920t/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm925t/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm926ejs/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm946es/start.S | 19 +++++++++++++++++++ arch/arm/cpu/arm_intcm/start.S | 19 +++++++++++++++++++ arch/arm/cpu/armv7/start.S | 19 +++++++++++++++++++ arch/arm/cpu/ixp/start.S | 19 +++++++++++++++++++ arch/arm/cpu/lh7a40x/start.S | 19 +++++++++++++++++++ arch/arm/cpu/pxa/start.S | 20 ++++++++++++++++++++ arch/arm/cpu/s3c44b0/start.S | 19 +++++++++++++++++++ arch/arm/cpu/sa1100/start.S | 19 +++++++++++++++++++ 14 files changed, 267 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S index 28e059e..8cb145e 100644 --- a/arch/arm/cpu/arm1136/start.S +++ b/arch/arm/cpu/arm1136/start.S @@ -295,6 +295,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S index 0c749b4..f531f1b 100644 --- a/arch/arm/cpu/arm1176/start.S +++ b/arch/arm/cpu/arm1176/start.S @@ -397,6 +397,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + #ifdef CONFIG_ENABLE_MMU _mmu_table_base: .word mmu_table diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S index 80814d6..8d53b80 100644 --- a/arch/arm/cpu/arm720t/start.S +++ b/arch/arm/cpu/arm720t/start.S @@ -266,6 +266,25 @@ clbss_l:str r2, [r0] /* clear loop... */ _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S index 57b2b59..16da876 100644 --- a/arch/arm/cpu/arm920t/start.S +++ b/arch/arm/cpu/arm920t/start.S @@ -317,6 +317,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S index 5dafc11..a237e32 100644 --- a/arch/arm/cpu/arm925t/start.S +++ b/arch/arm/cpu/arm925t/start.S @@ -311,6 +311,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S index 6b8fdc5..b36dd41 100644 --- a/arch/arm/cpu/arm926ejs/start.S +++ b/arch/arm/cpu/arm926ejs/start.S @@ -350,6 +350,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S index 448979f..13ecbc9 100644 --- a/arch/arm/cpu/arm946es/start.S +++ b/arch/arm/cpu/arm946es/start.S @@ -277,6 +277,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S index 7a9dbd1..7d5120f 100644 --- a/arch/arm/cpu/arm_intcm/start.S +++ b/arch/arm/cpu/arm_intcm/start.S @@ -278,6 +278,25 @@ _board_init_r_ofs: .word board_init_r - _start #endif +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 8a616fa..90a1f61 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -298,6 +298,25 @@ jump_2_ram: _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /************************************************************************* * * cpu_init_cp15 diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S index 68d8029..54e1f41 100644 --- a/arch/arm/cpu/ixp/start.S +++ b/arch/arm/cpu/ixp/start.S @@ -372,6 +372,25 @@ clbss_l:str r2, [r0] /* clear loop... */ _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /****************************************************************************/ /* */ /* Interrupt handling */ diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S index 3274f43..a9b60d3 100644 --- a/arch/arm/cpu/lh7a40x/start.S +++ b/arch/arm/cpu/lh7a40x/start.S @@ -280,6 +280,25 @@ clbss_l:str r2, [r0] /* clear loop... */ _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S index 9de1a4a..203e98d 100644 --- a/arch/arm/cpu/pxa/start.S +++ b/arch/arm/cpu/pxa/start.S @@ -303,6 +303,26 @@ _board_init_r_ofs: #endif #endif + +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S index ffb3ebf..fc71774 100644 --- a/arch/arm/cpu/s3c44b0/start.S +++ b/arch/arm/cpu/s3c44b0/start.S @@ -255,6 +255,25 @@ clbss_l:str r2, [r0] /* clear loop... */ _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* * diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S index 168b11f..5527527 100644 --- a/arch/arm/cpu/sa1100/start.S +++ b/arch/arm/cpu/sa1100/start.S @@ -256,6 +256,25 @@ clbss_l:str r2, [r0] /* clear loop... */ _board_init_r_ofs: .word board_init_r - _start +/** + * Jump to board_init_r with a new stack pointer + * + * @param gd Pointer to global data + * @param dest_addr Destination address from global data + * @param func Address of board_init_r function (relocated) + * @param sp New stack pointer + */ +.globl pivot_to_board_init_r +pivot_to_board_init_r: +#ifndef CONFIG_SYS_ICACHE_OFF + mcr p15, 0, r0, c7, c5, 0 @ invalidate icache + mcr p15, 0, r0, c7, c10, 4 @ DSB + mcr p15, 0, r0, c7, c5, 4 @ ISB +#endif + mov sp, r3 + /* jump to it ... */ + mov pc, r2 + /* ************************************************************************* *