powerpc, mpc8xx: clear top of stack
authorChristophe Leroy <[email protected]>
Wed, 21 Nov 2018 08:51:41 +0000 (08:51 +0000)
committerTom Rini <[email protected]>
Mon, 3 Dec 2018 15:44:10 +0000 (10:44 -0500)
Reported-by: Joakim Tjernlund <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
Reviewed-by: Joakim Tjernlund <[email protected]>
arch/powerpc/cpu/mpc8xx/start.S

index 8dde4beeea1cc6ab87f8b76b7f4dcb3c2286fe97..b8bdaaec2fae783c52cb0b4ef6dec3e674492fb9 100644 (file)
@@ -144,9 +144,11 @@ in_flash:
        ori     r2, r2, CONFIG_SYS_DER@l
        mtspr   DER, r2
 
-       /* set up the stack in internal DPRAM */
+       /* set up the stack on top of 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
+       stw     r0, -4(r3)
+       stw     r0, -8(r3)
        addi    r1, r3, -8
 
        bl      board_init_f_alloc_reserve