]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc8xx/start.S
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / powerpc / cpu / mpc8xx / start.S
index 202ea81ae4986b14ab769d9fe67fb722bd9977af..8dde4beeea1cc6ab87f8b76b7f4dcb3c2286fe97 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
  *  Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
  *  Copyright (C) 2000,2001,2002 Wolfgang Denk <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*  U-Boot - Startup Code for PowerPC based Embedded Boards
@@ -130,12 +129,6 @@ in_flash:
        /* initialize some SPRs that are hard to access from C                  */
        /*----------------------------------------------------------------------*/
 
-       lis     r3, CONFIG_SYS_IMMR@h           /* pass IMMR as arg1 to C routine */
-       ori     r1, r3, CONFIG_SYS_INIT_SP_OFFSET /* set up the stack in internal DPRAM */
-       /* Note: R0 is still 0 here */
-       stwu    r0, -4(r1)              /* clear final stack frame so that      */
-       stwu    r0, -4(r1)              /* stack backtraces terminate cleanly   */
-
        /*
         * Disable serialized ifetch and show cycles
         * (i.e. set processor to normal mode).
@@ -151,6 +144,25 @@ in_flash:
        ori     r2, r2, CONFIG_SYS_DER@l
        mtspr   DER, r2
 
+       /* set up the stack in internal DPRAM */
+       lis     r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)@h
+       ori     r3, r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)@l
+       addi    r1, r3, -8
+
+       bl      board_init_f_alloc_reserve
+       addi    r1, r3, -8
+
+       /* Zeroise the CPM dpram */
+       lis     r4, CONFIG_SYS_IMMR@h
+       ori     r4, r4, (0x2000 - 4)
+       li      r0, (0x2000 / 4)
+       mtctr   r0
+       li      r0, 0
+1:     stwu    r0, 4(r4)
+       bdnz    1b
+
+       bl      board_init_f_init_reserve
+
        /* let the C-code set up the rest                                       */
        /*                                                                      */
        /* Be careful to keep code relocatable !                                */
@@ -158,7 +170,7 @@ in_flash:
 
        GET_GOT                 /* initialize GOT access                        */
 
-       /* r3: IMMR */
+       lis     r3, CONFIG_SYS_IMMR@h
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
 
        bl      board_init_f    /* run 1st part of board init code (from Flash) */