Re: [U-Boot] [PATCH v1] arm: move generic startup code in crt0.S

2012-11-04 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 1352001421-25913-2-git-send-email-albert.u.b...@aribaud.net you 
wrote:
 Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
 ---

Please move the patch description from the cover letter to this commit
message.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I wrote my name at the top of the page. I wrote down  the  number  of
the  question  ``1''.  After much reflection I put a bracket round it
thus ``(1)''. But thereafter I could not think of anything  connected
with it that was either relevant or true.
- Sir Winston Churchill _My Early Life_ ch. 2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1] arm: move generic startup code in crt0.S

2012-11-04 Thread Albert ARIBAUD
Hi Wolfgang,

On Sun, 04 Nov 2012 08:29:53 +0100, Wolfgang Denk w...@denx.de wrote:

 Dear Albert ARIBAUD,
 
 In message 1352001421-25913-2-git-send-email-albert.u.b...@aribaud.net you 
 wrote:
  Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
  ---
 
 Please move the patch description from the cover letter to this commit
 message.

Will do. Also, V2 will have a second patch for some start.S scrubbing
and will have fixes for a few targets.

 Best regards,
 
 Wolfgang Denk

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v1] arm: move generic startup code in crt0.S

2012-11-03 Thread Albert ARIBAUD
Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
 arch/arm/cpu/arm1136/start.S  |   62 ++
 arch/arm/cpu/arm1176/start.S  |   62 ++
 arch/arm/cpu/arm720t/start.S  |   53 ++---
 arch/arm/cpu/arm920t/start.S  |   61 ++
 arch/arm/cpu/arm925t/start.S  |   61 ++
 arch/arm/cpu/arm926ejs/start.S|   80 ++---
 arch/arm/cpu/arm946es/start.S |   56 ++---
 arch/arm/cpu/arm_intcm/start.S|   63 ++
 arch/arm/cpu/armv7/start.S|   58 +++---
 arch/arm/cpu/ixp/start.S  |   55 ++---
 arch/arm/cpu/pxa/start.S  |   63 ++
 arch/arm/cpu/s3c44b0/start.S  |   55 ++---
 arch/arm/cpu/sa1100/start.S   |   50 ++--
 arch/arm/lib/Makefile |2 +
 arch/arm/lib/board.c  |   11 --
 arch/arm/lib/crt0.S   |  179 +
 include/common.h  |2 +-
 lib/asm-offsets.c |   10 ++
 nand_spl/board/freescale/mx31pdk/Makefile |6 +-
 nand_spl/board/karo/tx25/Makefile |6 +-
 20 files changed, 322 insertions(+), 673 deletions(-)
 create mode 100644 arch/arm/lib/crt0.S

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 3752af9..fb1fcab 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -161,13 +161,7 @@ next:
bl  cpu_init_crit
 #endif
 
-/* Set stackpointer in internal RAM to call board_init_f */
-call_board_init_f:
-   ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
-   bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
-   ldr r0,=0x
-
-   bl  board_init_f
+   bl  _main
 
 
/*--*/
 
@@ -184,14 +178,10 @@ relocate_code:
mov r5, r1  /* save addr of gd */
mov r6, r2  /* save addr of destination */
 
-   /* Set up the stack */
-stack_setup:
-   mov sp, r4
-
adr r0, _start
cmp r0, r6
moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
-   beq clear_bss   /* skip relocation */
+   beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 - scratch for copy_loop */
ldr r3, _bss_start_ofs
add r2, r0, r3  /* r2 - source end address */
@@ -243,48 +233,9 @@ fixnext:
blo fixloop
 #endif
 
-clear_bss:
-#ifndef CONFIG_SPL_BUILD
-   ldr r0, _bss_start_ofs
-   ldr r1, _bss_end_ofs
-   mov r4, r6  /* reloc addr */
-   add r0, r0, r4
-   add r1, r1, r4
-   mov r2, #0x /* clear*/
-
-clbss_l:cmpr0, r1  /* clear loop... */
-   bhs clbss_e /* if reached end of bss, exit */
-   str r2, [r0]
-   add r0, r0, #4
-   b   clbss_l
-clbss_e:
-#endif /* #ifndef CONFIG_SPL_BUILD */
-
-/*
- * We are done. Do not return, instead branch to second part of board
- * initialization, now running from RAM.
- */
-#ifdef CONFIG_NAND_SPL
-   ldr r0, _nand_boot_ofs
-   mov pc, r0
+relocate_done:
 
-_nand_boot_ofs:
-   .word nand_boot
-#else
-jump_2_ram:
-   ldr r0, _board_init_r_ofs
-   ldr r1, _TEXT_BASE
-   add lr, r0, r1
-   add lr, lr, r9
-   /* setup parameters for board_init_r */
-   mov r0, r5  /* gd_t */
-   mov r1, r6  /* dest_addr */
-   /* jump to it ... */
-   mov pc, lr
-
-_board_init_r_ofs:
-   .word board_init_r - _start
-#endif
+   bx  lr
 
 _rel_dyn_start_ofs:
.word __rel_dyn_start - _start
@@ -293,6 +244,11 @@ _rel_dyn_end_ofs:
 _dynsym_start_ofs:
.word __dynsym_start - _start
 
+   .globl  c_runtime_cpu_setup
+c_runtime_cpu_setup:
+
+   bx  lr
+
 /*
  *
  *
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 667a0e0..40df4b1 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -224,12 +224,7 @@ skip_tcmdisable:
 */
bl  lowlevel_init   /* go setup pll,mux,memory */
 
-/* Set stackpointer in internal RAM to call board_init_f */
-call_board_init_f:
-   ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
-   bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
-   ldr r0,=0x
-   bl  board_init_f
+   bl  _main
 
 
/*--*/
 
@@ -246,14 +241,10 @@ relocate_code:
mov r5,