[FOSS_TLK]arm: start: new policy to get boot params from BL
Varun Wadekar [Tue, 28 Apr 2015 10:24:55 +0000 (15:24 +0530)]
The bootloader now uses a new policy to pass input parameters for the
monitor and Trusted OS. According to this policy, we use the following
CPU registers:

r0 = TZ-DRAM aperture size
r1 = NS entry point
r2 = boot args
r3 = magic value to indicate new policy

Change-Id: I2e59ffefaeb81d899c409262b360a68e4dbbc77d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/752889
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Inamdar Sharif <isharif@nvidia.com>

arch/arm/arm/start.S

index 48b0a81..c3c4e72 100644 (file)
@@ -44,9 +44,26 @@ _start:
        b       arm_fiq
 
 reset:
+       /*
+        * Check if the BL passes params using new approach. According
+        * to the new approach, we will use the following registers:
+        *
+        * r0 = Secure TZ-DRAM carveout size
+        * r1 = NS entry point
+        * r2 = Boot args
+        * r3 = Magic value indicating usage of new policy
+        *
+        */
+       ldr     r4, =0xCAFEBABE
+       cmp     r3, r4
+
+       /* old way; change registers before we boot */
+       movne   r2, r1          @ old policy: boot args
+       movne   r1, r14         @ old policy: ns entry point
+
 #if !defined(WITH_MONITOR_BIN)
        adr     r3, __jumpback_addr
-       str     r14, [r3]
+       str     r1, [r3]
 
        /* save boot params passed by the bootloader */
        adr     r3, __save_boot_regs
@@ -59,7 +76,7 @@ reset:
 #endif
 
        adr     r3, __bootarg_addr
-       str     r1, [r3]
+       str     r2, [r3]
 
 #if ARM_USE_MMU_RELOC
        /* save load address/size of image */