]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc83xx/start.S
powerpc, 8260: remove support for mpc8260
[u-boot] / arch / powerpc / cpu / mpc83xx / start.S
index 44a64b7acd9cda4ea674ce250e55f960b0551f4f..2fed4a1fec16669adcd457502034e76646c4dd52 100644 (file)
@@ -4,23 +4,7 @@
  * Copyright (C) 2000, 2001,2002 Wolfgang Denk <wd@denx.de>
  * Copyright Freescale Semiconductor, Inc. 2004, 2006, 2008.
  *
- * 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 <mpc83xx.h>
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
 #include <version.h>
 
 #define CONFIG_83XX    1               /* needed for Linux kernel header files*/
-#define _LINUX_CONFIG_H 1      /* avoid reading Linux autoconf.h file */
 
 #include <ppc_asm.tmpl>
 #include <ppc_defs.h>
@@ -76,7 +56,7 @@
        START_GOT
        GOT_ENTRY(_GOT2_TABLE_)
        GOT_ENTRY(__bss_start)
-       GOT_ENTRY(__bss_end__)
+       GOT_ENTRY(__bss_end)
 
 #ifndef MINIMAL_SPL
        GOT_ENTRY(_FIXUP_TABLE_)
@@ -136,6 +116,11 @@ disable_addr_trans:
        mtspr   SRR1, r3
        rfi
 
+       .globl get_svr
+get_svr:
+       mfspr   r3, SVR
+       blr
+
        .globl get_pvr
 get_pvr:
        mfspr   r3, PVR
@@ -155,7 +140,7 @@ ppcDWload:
 
 #ifndef CONFIG_DEFAULT_IMMR
 #error CONFIG_DEFAULT_IMMR must be defined
-#endif /* CONFIG_SYS_DEFAULT_IMMR */
+#endif /* CONFIG_DEFAULT_IMMR */
 #ifndef CONFIG_SYS_IMMR
 #define CONFIG_SYS_IMMR CONFIG_DEFAULT_IMMR
 #endif /* CONFIG_SYS_IMMR */
@@ -273,14 +258,40 @@ in_flash:
 #endif
 
        /* set up the stack pointer in our newly created
-        * cache-ram (r1) */
-       lis     r1, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@h
-       ori     r1, r1, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@l
+        * cache-ram; use r3 to keep the new SP for now to
+        * avoid overiding the SP it uselessly */
+       lis     r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@h
+       ori     r3, r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET)@l
+
+       /* r4 = end of GD area */
+       addi r4, r3, GENERATED_GBL_DATA_SIZE
+
+       /* Zero GD area */
+       li      r0, 0
+1:
+       subi    r4, r4, 1
+       stb     r0, 0(r4)
+       cmplw   r3, r4
+       bne     1b
 
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+
+#if CONFIG_SYS_MALLOC_F_LEN + GENERATED_GBL_DATA_SIZE > CONFIG_SYS_INIT_RAM_SIZE
+#error "CONFIG_SYS_MALLOC_F_LEN too large to fit into initial RAM."
+#endif
+
+       /* r3 = new stack pointer / pre-reloc malloc area */
+       subi    r3, r3, CONFIG_SYS_MALLOC_F_LEN
+
+       /* Set pointer to pre-reloc malloc area in GD */
+       stw     r3, GD_MALLOC_BASE(r4)
+#endif
        li      r0, 0           /* Make room for stack frame header and */
-       stwu    r0, -4(r1)      /* clear final stack frame so that      */
-       stwu    r0, -4(r1)      /* stack backtraces terminate cleanly   */
+       stwu    r0, -4(r3)      /* clear final stack frame so that      */
+       stwu    r0, -4(r3)      /* stack backtraces terminate cleanly   */
 
+       /* Finally, actually set SP */
+       mr      r1, r3
 
        /* let the C-code set up the rest                           */
        /*                                                          */
@@ -295,6 +306,7 @@ in_flash:
        bl      cpu_init_f
 
        /* run 1st part of board init code (in Flash)*/
+       li      r3, 0           /* clear boot_flag for calling board_init_f */
        bl      board_init_f
 
        /* NOTREACHED - board_init_f() does not return */
@@ -970,18 +982,7 @@ clear_bss:
         * Now clear BSS segment
         */
        lwz     r3,GOT(__bss_start)
-#if defined(CONFIG_HYMOD)
-       /*
-        * For HYMOD - the environment is the very last item in flash.
-        * The real .bss stops just before environment starts, so only
-        * clear up to that point.
-        *
-        * taken from mods for FADS board
-        */
-       lwz     r4,GOT(environment)
-#else
-       lwz     r4,GOT(__bss_end__)
-#endif
+       lwz     r4,GOT(__bss_end)
 
        cmplw   0, r3, r4
        beq     6f