[U-Boot] [PATCH v4 04/13] arm: Add start_call_board_init_r() to each start.S
Simon Glass
sjg at chromium.org
Tue Feb 21 02:32:46 CET 2012
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 <sjg at chromium.org>
---
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
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..e74d5f9 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 start_call_board_init_r
+start_call_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..7fc6a18 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 start_call_board_init_r
+start_call_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..cdbe751 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 start_call_board_init_r
+start_call_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..3257df6 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 start_call_board_init_r
+start_call_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..b9181bf 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 start_call_board_init_r
+start_call_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..2c8ff81 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 start_call_board_init_r
+start_call_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..469a141 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 start_call_board_init_r
+start_call_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..0e469e9 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 start_call_board_init_r
+start_call_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..5581387 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 start_call_board_init_r
+start_call_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..f00ad38 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 start_call_board_init_r
+start_call_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..48b8639 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 start_call_board_init_r
+start_call_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..30f15b6 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 start_call_board_init_r
+start_call_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..f470f10 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 start_call_board_init_r
+start_call_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..fce6f87 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 start_call_board_init_r
+start_call_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
+
/*
*************************************************************************
*
--
1.7.7.3
More information about the U-Boot
mailing list