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