diff options
author | dp-arm <dimitris.papastamos@arm.com> | 2017-02-15 11:07:55 +0000 |
---|---|---|
committer | dp-arm <dimitris.papastamos@arm.com> | 2017-05-15 16:34:27 +0100 |
commit | a44090080308beefe64d302bcc76de70f0d1d280 (patch) | |
tree | 0edd9b32b2e24f34b9d72d25cf29a80e6a95d175 /bl1/aarch32/bl1_entrypoint.S | |
parent | b6285d64c12ae653c39ecdc3a4c47369aca9d7b0 (diff) |
AArch32: Add `TRUSTED_BOARD_BOOT` support
This patch adds `TRUSTED_BOARD_BOOT` support for AArch32 mode.
To build this patch the "mbedtls/include/mbedtls/bignum.h"
needs to be modified to remove `#define MBEDTLS_HAVE_UDBL`
when `MBEDTLS_HAVE_INT32` is defined. This is a workaround
for "https://github.com/ARMmbed/mbedtls/issues/708"
NOTE: TBBR support on Juno AArch32 is not currently supported.
Change-Id: I86d80e30b9139adc4d9663f112801ece42deafcf
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
Co-Authored-By: Yatharth Kochar <yatharth.kochar@arm.com>
Diffstat (limited to 'bl1/aarch32/bl1_entrypoint.S')
-rw-r--r-- | bl1/aarch32/bl1_entrypoint.S | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/bl1/aarch32/bl1_entrypoint.S b/bl1/aarch32/bl1_entrypoint.S index e3d915fb..39ebcf73 100644 --- a/bl1/aarch32/bl1_entrypoint.S +++ b/bl1/aarch32/bl1_entrypoint.S @@ -71,9 +71,21 @@ func bl1_entrypoint */ /* - * MMU needs to be disabled because both BL1 and BL2 execute + * Get the smc_context for next BL image, + * program the gp/system registers and save it in `r4`. + */ + bl smc_get_next_ctx + mov r4, r0 + + /* Only turn-off MMU if going to secure world */ + ldr r5, [r4, #SMC_CTX_SCR] + tst r5, #SCR_NS_BIT + bne skip_mmu_off + + /* + * MMU needs to be disabled because both BL1 and BL2/BL2U execute * in PL1, and therefore share the same address space. - * BL2 will initialize the address space according to its + * BL2/BL2U will initialize the address space according to its * own requirement. */ bl disable_mmu_icache_secure @@ -81,11 +93,8 @@ func bl1_entrypoint dsb sy isb - /* - * Get the smc_context for next BL image, - * program the gp/system registers and exit - * secure monitor mode - */ - bl smc_get_next_ctx +skip_mmu_off: + /* Restore smc_context from `r4` and exit secure monitor mode. */ + mov r0, r4 monitor_exit endfunc bl1_entrypoint |