]> git.sur5r.net Git - u-boot/blobdiff - arch/m68k/cpu/mcf52x2/start.S
mx7dsabresd: Fix LCD_PWR_EN output setting
[u-boot] / arch / m68k / cpu / mcf52x2 / start.S
index ee17792cb391ca3a485a8e27834b180fb81965d7..a048884f6ce455c0129ff6bf6f08acb59e2989ba 100644 (file)
@@ -2,23 +2,7 @@
  * Copyright (C) 2003  Josef Baumgartner <josef.baumgartner@telex.de>
  * Based on code from Bernhard Kuhn <bkuhn@metrowerks.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm-offsets.h>
@@ -208,14 +192,36 @@ _after_flashbar_copy:
        move.l %d0, (%a1)
        move.l %d0, (%a2)
 
-       /* set stackpointer to end of internal ram to get some stackspace for the first c-code */
-       move.l  #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET), %sp
-       clr.l %sp@-
+       /* put relocation table address to a5 */
+       move.l #__got_start, %a5
 
-       move.l #__got_start, %a5                /* put relocation table address to a5 */
+       /* setup stack initially on top of internal static ram  */
+       move.l  #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp
 
-       bsr cpu_init_f                          /* run low-level CPU init code (from flash) */
-       bsr board_init_f                        /* run low-level board init code (from flash) */
+       /*
+        * if configured, malloc_f arena will be reserved first,
+        * then (and always) gd struct space will be reserved
+        */
+       move.l  %sp, -(%sp)
+       move.l  #board_init_f_alloc_reserve, %a1
+       jsr (%a1)
+
+       /* update stack and frame-pointers */
+       move.l  %d0, %sp
+       move.l  %sp, %fp
+
+       /* initialize reserved area */
+       move.l  %d0, -(%sp)
+       move.l  #board_init_f_init_reserve, %a1
+       jsr (%a1)
+
+       /* run low-level CPU init code (from flash) */
+       move.l #cpu_init_f, %a1
+       jsr (%a1)
+       /* run low-level board init code (from flash) */
+       clr.l   %sp@-
+       move.l #board_init_f, %a1
+       jsr (%a1)
 
        /* board_init_f() does not return */
 
@@ -307,7 +313,7 @@ clear_bss:
 /* exception code */
        .globl _fault
 _fault:
-       jmp _fault
+       bra _fault
 
        .globl  _exc_handler
 _exc_handler: