@@ -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
+
/*
*************************************************************************
*
@@ -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
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
@@ -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 */
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
@@ -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
+
/*
*************************************************************************
*
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@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 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(-)