mov x19, x30 // lr
/* ---------------------------------------------
- * As a bare minimal enable the SMP bit and the
- * I$ for all aarch64 processors. Also set the
- * exception vector to something sane.
+ * As a bare minimal enable the SMP bit.
* ---------------------------------------------
*/
- adr x0, early_exceptions
- bl write_vbar
-
bl read_midr
lsr x0, x0, #MIDR_PN_SHIFT
and x0, x0, #MIDR_PN_MASK
orr x0, x0, #CPUECTLR_SMP_BIT
bl write_cpuectlr
smp_setup_end:
- bl read_sctlr
- orr x0, x0, #SCTLR_I_BIT
- bl write_sctlr
-
ret x19
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <arch.h>
.globl reset_handler
*/
bl cpu_reset_handler
+ /* ---------------------------------------------
+ * Set the exception vector to something sane.
+ * ---------------------------------------------
+ */
+ adr x0, early_exceptions
+ msr vbar_el3, x0
+
+ /* ---------------------------------------------
+ * Enable the instruction cache.
+ * ---------------------------------------------
+ */
+ mrs x0, sctlr_el3
+ orr x0, x0, #SCTLR_I_BIT
+ msr sctlr_el3, x0
+
+ isb
+
_wait_for_entrypoint:
/* ---------------------------------------------
* Find the type of reset and jump to handler
*/
#include <bl_common.h>
+#include <arch.h>
.globl bl2_entrypoint
bl platform_is_primary_cpu
cbz x0, _panic
+ /* ---------------------------------------------
+ * Set the exception vector to something sane.
+ * ---------------------------------------------
+ */
+ adr x0, early_exceptions
+ msr vbar_el1, x0
+
+ /* ---------------------------------------------
+ * Enable the instruction cache.
+ * ---------------------------------------------
+ */
+ mrs x0, sctlr_el1
+ orr x0, x0, #SCTLR_I_BIT
+ msr sctlr_el1, x0
+
+ isb
+
/* --------------------------------------------
* Give ourselves a small coherent stack to
* ease the pain of initializing the MMU
#include <bl1.h>
#include <bl_common.h>
#include <platform.h>
+#include <arch.h>
.globl bl31_entrypoint
* indicating BL31 should be run, memory layout
* of the trusted SRAM available to BL31 and
* information about running the non-trusted
- * software already loaded by BL2. Check the
- * opcode out of paranoia.
+ * software already loaded by BL2.
+ * ---------------------------------------------
+ */
+
+ /* ---------------------------------------------
+ * Set the exception vector to something sane.
+ * ---------------------------------------------
+ */
+ adr x1, runtime_exceptions
+ msr vbar_el3, x1
+
+ /* ---------------------------------------------
+ * Enable the instruction cache.
+ * ---------------------------------------------
+ */
+ mrs x1, sctlr_el3
+ orr x1, x1, #SCTLR_I_BIT
+ msr sctlr_el3, x1
+
+ isb
+
+ /* ---------------------------------------------
+ * Check the opcodes out of paranoia.
* ---------------------------------------------
*/
mov x19, #RUN_IMAGE
******************************************************************************/
void bl2_plat_arch_setup()
{
- unsigned long sctlr;
-
- /* Enable instruction cache. */
- sctlr = read_sctlr();
- sctlr |= SCTLR_I_BIT;
- write_sctlr(sctlr);
-
- /*
- * Very simple exception vectors which assert if any exception other
- * than a single SMC call from BL2 to pass control to BL31 in EL3 is
- * received.
- */
- write_vbar((unsigned long) early_exceptions);
-
configure_mmu(&bl2_tzram_layout,
(unsigned long) &BL2_RO_BASE,
(unsigned long) &BL2_STACKS_BASE,
(unsigned long) &BL2_COHERENT_RAM_BASE,
(unsigned long) &BL2_RW_BASE);
- return;
}
******************************************************************************/
void bl31_plat_arch_setup()
{
- unsigned long sctlr;
-
- /* Enable instruction cache. */
- sctlr = read_sctlr();
- sctlr |= SCTLR_I_BIT;
- write_sctlr(sctlr);
-
- write_vbar((unsigned long) runtime_exceptions);
configure_mmu(&bl31_tzram_layout,
(unsigned long) &BL31_RO_BASE,
(unsigned long) &BL31_STACKS_BASE,