summaryrefslogtreecommitdiff
path: root/include/common/asm_macros.S
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2014-04-24 11:02:16 +0100
committerVikram Kanigiri <vikram.kanigiri@arm.com>2014-05-22 16:25:09 +0100
commitdbad1bacba0a7adfd3c7c559f0fd0805087aeddd (patch)
tree89884033b665aeca41682ddb79f76006d0429c85 /include/common/asm_macros.S
parent6871c5d3a227cb95008a25e90e358ec0ac615222 (diff)
Add support for BL3-1 as a reset vector
This change adds optional reset vector support to BL3-1 which means BL3-1 entry point can detect cold/warm boot, initialise primary cpu, set up cci and mail box. When using BL3-1 as a reset vector it is assumed that the BL3-1 platform code can determine the location of the BL3-2 images, or load them as there are no parameters that can be passed to BL3-1 at reset. It also fixes the incorrect initialisation of mailbox registers on the FVP platform This feature can be enabled by building the code with make variable RESET_TO_BL31 set as 1 Fixes ARM-software/TF-issues#133 Fixes ARM-software/TF-issues#20 Change-Id: I4e23939b1c518614b899f549f1e8d412538ee570
Diffstat (limited to 'include/common/asm_macros.S')
-rw-r--r--include/common/asm_macros.S35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/common/asm_macros.S b/include/common/asm_macros.S
index 3dbd9f2a..2bccf581 100644
--- a/include/common/asm_macros.S
+++ b/include/common/asm_macros.S
@@ -88,6 +88,41 @@
\_name:
.endm
+ /* ---------------------------------------------
+ * Find the type of reset and jump to handler
+ * if present. If the handler is null then it is
+ * a cold boot. The primary cpu will set up the
+ * platform while the secondaries wait for
+ * their turn to be woken up
+ * ---------------------------------------------
+ */
+ .macro wait_for_entrypoint
+wait_for_entrypoint:
+ mrs x0, mpidr_el1
+ bl platform_get_entrypoint
+ cbnz x0, do_warm_boot
+ mrs x0, mpidr_el1
+ bl platform_is_primary_cpu
+ cbnz x0, do_cold_boot
+
+ /* ---------------------------------------------
+ * Perform any platform specific secondary cpu
+ * actions
+ * ---------------------------------------------
+ */
+ bl plat_secondary_cold_boot_setup
+ b wait_for_entrypoint
+
+ do_warm_boot:
+ /* ---------------------------------------------
+ * Jump to BL31 for all warm boot init.
+ * ---------------------------------------------
+ */
+ blr x0
+
+ do_cold_boot:
+ .endm
+
/*
* This macro declares an array of 1 or more stacks, properly
* aligned and in the requested section