MLK-21848-8 imx8: Jump from alias to OCRAM address at SPL init
authorYe Li <ye.li@nxp.com>
Fri, 26 Apr 2019 02:13:35 +0000 (19:13 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 10:38:55 +0000 (03:38 -0700)
When running SPL on iMX8, the A core starts at address 0
which is a alias to OCRAM 0x100000.
The alias only map first 96KB of OCRAM, so this require the
SPL size can't beyond 96KB. But when using SPL DM, the size increase
significantly and always beyonds 96KB.
So to fix the problem, we will change SPL linker address to OCRAM
address 0x100000. And then jump to the absolute address not the PC relative
address for entering OCRAM.

Signed-off-by: Ye Li <ye.li@nxp.com>
arch/arm/mach-imx/imx8/lowlevel_init.S

index 141b82d..00f6e51 100644 (file)
@@ -23,7 +23,18 @@ save_boot_params:
        stp     x3, x4, [x0], #16
 
        /* Returns */
-       b       save_boot_params_ret
+       /*
+        * We use absolute address not PC relative address for return.
+        * When running SPL on iMX8, the A core starts at address 0, a alias to OCRAM 0x100000,
+        * our linker address for SPL is from 0x100000. So using absolute address can jump to
+        * the OCRAM address from the alias.
+        * The alias only map first 96KB of OCRAM, so this require the SPL size can't beyond 96KB.
+        * But when using SPL DM, the size increase significantly and always beyonds 96KB.
+        * That's why we have to jump to OCRAM.
+        * Normal u-boot also runs into this codes, but there is no impact.
+        */
+       ldr     x1, =save_boot_params_ret
+       br      x1
 
 .global restore_boot_params
 restore_boot_params: