]> 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 9ef206aa0fdbedf6e0acec0acedbe9eede7ba138..a048884f6ce455c0129ff6bf6f08acb59e2989ba 100644 (file)
@@ -2,27 +2,11 @@
  * 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>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -57,8 +41,8 @@
 _vectors:
 
 .long  0x00000000              /* Flash offset is 0 until we setup CS0 */
-#if defined(CONFIG_M5282) && (TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
-.long  _start - TEXT_BASE
+#if defined(CONFIG_M5282) && (CONFIG_SYS_TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
+.long  _start - CONFIG_SYS_TEXT_BASE
 #else
 .long  _START
 #endif
@@ -106,7 +90,7 @@ _vectors:
 
 #if defined(CONFIG_SYS_INT_FLASH_BASE) && \
     (defined(CONFIG_M5282) || defined(CONFIG_M5281))
-       #if (TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
+       #if (CONFIG_SYS_TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
                .long   0x55AA55AA,0xAA55AA55 /* CFM Backdoorkey */
                .long   0xFFFFFFFF /* all sectors protected */
                .long   0x00000000 /* supervisor/User restriction */
@@ -150,7 +134,7 @@ _start:
        movec   %d0, %RAMBAR1
 
 #if defined(CONFIG_M5282)
-#if (TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
+#if (CONFIG_SYS_TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
        /* Setup code in SRAM to initialize FLASHBAR, if start from internal Flash */
 
        move.l #(_flashbar_setup-CONFIG_SYS_INT_FLASH_BASE), %a0
@@ -174,7 +158,7 @@ _after_flashbar_copy:
        /* Setup code to initialize FLASHBAR, if start from external Memory */
        move.l  #(CONFIG_SYS_INT_FLASH_BASE + CONFIG_SYS_INT_FLASH_ENABLE), %d0
        movec   %d0, %FLASHBAR
-#endif /* (TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE) */
+#endif /* (CONFIG_SYS_TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE) */
 
 #endif
 #endif
@@ -182,7 +166,7 @@ _after_flashbar_copy:
         * therefore no VBR to set
         */
 #if !defined(CONFIG_MONITOR_IS_IN_RAM)
-#if defined(CONFIG_M5282) && (TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
+#if defined(CONFIG_M5282) && (CONFIG_SYS_TEXT_BASE == CONFIG_SYS_INT_FLASH_BASE)
        move.l  #CONFIG_SYS_INT_FLASH_BASE, %d0
 #else
        move.l  #CONFIG_SYS_FLASH_BASE, %d0
@@ -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 */
 
@@ -297,7 +303,7 @@ clear_bss:
        /* set parameters for board_init_r */
        move.l %a0,-(%sp)               /* dest_addr */
        move.l %d0,-(%sp)               /* gd */
-#if defined(DEBUG) && (TEXT_BASE != CONFIG_SYS_INT_FLASH_BASE) && \
+#if defined(DEBUG) && (CONFIG_SYS_TEXT_BASE != CONFIG_SYS_INT_FLASH_BASE) && \
     defined(CONFIG_SYS_HALT_BEFOR_RAM_JUMP)
        halt
 #endif
@@ -307,7 +313,7 @@ clear_bss:
 /* exception code */
        .globl _fault
 _fault:
-       jmp _fault
+       bra _fault
 
        .globl  _exc_handler
 _exc_handler:
@@ -329,7 +335,5 @@ _int_handler:
 
        .globl  version_string
 version_string:
-       .ascii U_BOOT_VERSION
-       .ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-       .ascii CONFIG_IDENT_STRING, "\0"
+       .ascii U_BOOT_VERSION_STRING, "\0"
        .align 4