1*91f16700Schasinglulu/* 2*91f16700Schasinglulu * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. 3*91f16700Schasinglulu * 4*91f16700Schasinglulu * SPDX-License-Identifier: BSD-3-Clause 5*91f16700Schasinglulu */ 6*91f16700Schasinglulu 7*91f16700Schasinglulu#include <asm_macros.S> 8*91f16700Schasinglulu#include <common/bl_common.h> 9*91f16700Schasinglulu 10*91f16700Schasinglulu/* ----------------------------------------------------------------------------- 11*91f16700Schasinglulu * Very simple stackless exception handlers used by BL2 and BL31 stages. 12*91f16700Schasinglulu * BL31 uses them before stacks are setup. BL2 uses them throughout. 13*91f16700Schasinglulu * ----------------------------------------------------------------------------- 14*91f16700Schasinglulu */ 15*91f16700Schasinglulu .globl early_exceptions 16*91f16700Schasinglulu 17*91f16700Schasingluluvector_base early_exceptions 18*91f16700Schasinglulu 19*91f16700Schasinglulu /* ----------------------------------------------------- 20*91f16700Schasinglulu * Current EL with SP0 : 0x0 - 0x200 21*91f16700Schasinglulu * ----------------------------------------------------- 22*91f16700Schasinglulu */ 23*91f16700Schasingluluvector_entry SynchronousExceptionSP0 24*91f16700Schasinglulu mov x0, #SYNC_EXCEPTION_SP_EL0 25*91f16700Schasinglulu bl plat_report_exception 26*91f16700Schasinglulu no_ret plat_panic_handler 27*91f16700Schasingluluend_vector_entry SynchronousExceptionSP0 28*91f16700Schasinglulu 29*91f16700Schasingluluvector_entry IrqSP0 30*91f16700Schasinglulu mov x0, #IRQ_SP_EL0 31*91f16700Schasinglulu bl plat_report_exception 32*91f16700Schasinglulu no_ret plat_panic_handler 33*91f16700Schasingluluend_vector_entry IrqSP0 34*91f16700Schasinglulu 35*91f16700Schasingluluvector_entry FiqSP0 36*91f16700Schasinglulu mov x0, #FIQ_SP_EL0 37*91f16700Schasinglulu bl plat_report_exception 38*91f16700Schasinglulu no_ret plat_panic_handler 39*91f16700Schasingluluend_vector_entry FiqSP0 40*91f16700Schasinglulu 41*91f16700Schasingluluvector_entry SErrorSP0 42*91f16700Schasinglulu mov x0, #SERROR_SP_EL0 43*91f16700Schasinglulu bl plat_report_exception 44*91f16700Schasinglulu no_ret plat_panic_handler 45*91f16700Schasingluluend_vector_entry SErrorSP0 46*91f16700Schasinglulu 47*91f16700Schasinglulu /* ----------------------------------------------------- 48*91f16700Schasinglulu * Current EL with SPx: 0x200 - 0x400 49*91f16700Schasinglulu * ----------------------------------------------------- 50*91f16700Schasinglulu */ 51*91f16700Schasingluluvector_entry SynchronousExceptionSPx 52*91f16700Schasinglulu mov x0, #SYNC_EXCEPTION_SP_ELX 53*91f16700Schasinglulu bl plat_report_exception 54*91f16700Schasinglulu no_ret plat_panic_handler 55*91f16700Schasingluluend_vector_entry SynchronousExceptionSPx 56*91f16700Schasinglulu 57*91f16700Schasingluluvector_entry IrqSPx 58*91f16700Schasinglulu mov x0, #IRQ_SP_ELX 59*91f16700Schasinglulu bl plat_report_exception 60*91f16700Schasinglulu no_ret plat_panic_handler 61*91f16700Schasingluluend_vector_entry IrqSPx 62*91f16700Schasinglulu 63*91f16700Schasingluluvector_entry FiqSPx 64*91f16700Schasinglulu mov x0, #FIQ_SP_ELX 65*91f16700Schasinglulu bl plat_report_exception 66*91f16700Schasinglulu no_ret plat_panic_handler 67*91f16700Schasingluluend_vector_entry FiqSPx 68*91f16700Schasinglulu 69*91f16700Schasingluluvector_entry SErrorSPx 70*91f16700Schasinglulu mov x0, #SERROR_SP_ELX 71*91f16700Schasinglulu bl plat_report_exception 72*91f16700Schasinglulu no_ret plat_panic_handler 73*91f16700Schasingluluend_vector_entry SErrorSPx 74*91f16700Schasinglulu 75*91f16700Schasinglulu /* ----------------------------------------------------- 76*91f16700Schasinglulu * Lower EL using AArch64 : 0x400 - 0x600 77*91f16700Schasinglulu * ----------------------------------------------------- 78*91f16700Schasinglulu */ 79*91f16700Schasingluluvector_entry SynchronousExceptionA64 80*91f16700Schasinglulu mov x0, #SYNC_EXCEPTION_AARCH64 81*91f16700Schasinglulu bl plat_report_exception 82*91f16700Schasinglulu no_ret plat_panic_handler 83*91f16700Schasingluluend_vector_entry SynchronousExceptionA64 84*91f16700Schasinglulu 85*91f16700Schasingluluvector_entry IrqA64 86*91f16700Schasinglulu mov x0, #IRQ_AARCH64 87*91f16700Schasinglulu bl plat_report_exception 88*91f16700Schasinglulu no_ret plat_panic_handler 89*91f16700Schasingluluend_vector_entry IrqA64 90*91f16700Schasinglulu 91*91f16700Schasingluluvector_entry FiqA64 92*91f16700Schasinglulu mov x0, #FIQ_AARCH64 93*91f16700Schasinglulu bl plat_report_exception 94*91f16700Schasinglulu no_ret plat_panic_handler 95*91f16700Schasingluluend_vector_entry FiqA64 96*91f16700Schasinglulu 97*91f16700Schasingluluvector_entry SErrorA64 98*91f16700Schasinglulu mov x0, #SERROR_AARCH64 99*91f16700Schasinglulu bl plat_report_exception 100*91f16700Schasinglulu no_ret plat_panic_handler 101*91f16700Schasingluluend_vector_entry SErrorA64 102*91f16700Schasinglulu 103*91f16700Schasinglulu /* ----------------------------------------------------- 104*91f16700Schasinglulu * Lower EL using AArch32 : 0x600 - 0x800 105*91f16700Schasinglulu * ----------------------------------------------------- 106*91f16700Schasinglulu */ 107*91f16700Schasingluluvector_entry SynchronousExceptionA32 108*91f16700Schasinglulu mov x0, #SYNC_EXCEPTION_AARCH32 109*91f16700Schasinglulu bl plat_report_exception 110*91f16700Schasinglulu no_ret plat_panic_handler 111*91f16700Schasingluluend_vector_entry SynchronousExceptionA32 112*91f16700Schasinglulu 113*91f16700Schasingluluvector_entry IrqA32 114*91f16700Schasinglulu mov x0, #IRQ_AARCH32 115*91f16700Schasinglulu bl plat_report_exception 116*91f16700Schasinglulu no_ret plat_panic_handler 117*91f16700Schasingluluend_vector_entry IrqA32 118*91f16700Schasinglulu 119*91f16700Schasingluluvector_entry FiqA32 120*91f16700Schasinglulu mov x0, #FIQ_AARCH32 121*91f16700Schasinglulu bl plat_report_exception 122*91f16700Schasinglulu no_ret plat_panic_handler 123*91f16700Schasingluluend_vector_entry FiqA32 124*91f16700Schasinglulu 125*91f16700Schasingluluvector_entry SErrorA32 126*91f16700Schasinglulu mov x0, #SERROR_AARCH32 127*91f16700Schasinglulu bl plat_report_exception 128*91f16700Schasinglulu no_ret plat_panic_handler 129*91f16700Schasingluluend_vector_entry SErrorA32 130