blob: ba94f6cb1eea4175b1e3b0c4512eb167798eaaa3 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +01002 * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Jeenu Viswambharana7934d62014-02-07 15:53:18 +00007#include <asm_macros.S>
Yatharth Kochar6c0566c2015-10-02 17:56:48 +01008#include <bl_common.h>
Achin Gupta4f6ad662013-10-25 09:08:21 +01009
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010010/* -----------------------------------------------------------------------------
11 * Very simple stackless exception handlers used by BL2 and BL31 stages.
12 * BL31 uses them before stacks are setup. BL2 uses them throughout.
13 * -----------------------------------------------------------------------------
14 */
Achin Gupta4f6ad662013-10-25 09:08:21 +010015 .globl early_exceptions
Achin Gupta4f6ad662013-10-25 09:08:21 +010016
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010017vector_base early_exceptions
Achin Gupta4f6ad662013-10-25 09:08:21 +010018
19 /* -----------------------------------------------------
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010020 * Current EL with SP0 : 0x0 - 0x200
Achin Gupta4f6ad662013-10-25 09:08:21 +010021 * -----------------------------------------------------
22 */
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010023vector_entry SynchronousExceptionSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010024 mov x0, #SYNC_EXCEPTION_SP_EL0
25 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000026 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010027end_vector_entry SynchronousExceptionSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010028
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010029vector_entry IrqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010030 mov x0, #IRQ_SP_EL0
31 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000032 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010033end_vector_entry IrqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010034
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010035vector_entry FiqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010036 mov x0, #FIQ_SP_EL0
37 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000038 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010039end_vector_entry FiqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010040
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010041vector_entry SErrorSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010042 mov x0, #SERROR_SP_EL0
43 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000044 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010045end_vector_entry SErrorSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010046
47 /* -----------------------------------------------------
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010048 * Current EL with SPx: 0x200 - 0x400
Achin Gupta4f6ad662013-10-25 09:08:21 +010049 * -----------------------------------------------------
50 */
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010051vector_entry SynchronousExceptionSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010052 mov x0, #SYNC_EXCEPTION_SP_ELX
53 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000054 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010055end_vector_entry SynchronousExceptionSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010056
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010057vector_entry IrqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010058 mov x0, #IRQ_SP_ELX
59 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000060 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010061end_vector_entry IrqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010062
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010063vector_entry FiqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010064 mov x0, #FIQ_SP_ELX
65 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000066 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010067end_vector_entry FiqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010068
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010069vector_entry SErrorSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010070 mov x0, #SERROR_SP_ELX
71 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000072 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010073end_vector_entry SErrorSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010074
75 /* -----------------------------------------------------
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010076 * Lower EL using AArch64 : 0x400 - 0x600
Achin Gupta4f6ad662013-10-25 09:08:21 +010077 * -----------------------------------------------------
78 */
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010079vector_entry SynchronousExceptionA64
Sandrine Bailleux4d052752014-03-24 10:24:08 +000080 mov x0, #SYNC_EXCEPTION_AARCH64
81 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000082 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010083end_vector_entry SynchronousExceptionA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000084
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010085vector_entry IrqA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000086 mov x0, #IRQ_AARCH64
87 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000088 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010089end_vector_entry IrqA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000090
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010091vector_entry FiqA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000092 mov x0, #FIQ_AARCH64
93 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +000094 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +010095end_vector_entry FiqA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000096
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +010097vector_entry SErrorA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +000098 mov x0, #SERROR_AARCH64
99 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +0000100 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +0100101end_vector_entry SErrorA64
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000102
103 /* -----------------------------------------------------
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +0100104 * Lower EL using AArch32 : 0x600 - 0x800
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000105 * -----------------------------------------------------
106 */
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +0100107vector_entry SynchronousExceptionA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000108 mov x0, #SYNC_EXCEPTION_AARCH32
109 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +0000110 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +0100111end_vector_entry SynchronousExceptionA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000112
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +0100113vector_entry IrqA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000114 mov x0, #IRQ_AARCH32
115 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +0000116 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +0100117end_vector_entry IrqA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000118
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +0100119vector_entry FiqA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000120 mov x0, #FIQ_AARCH32
121 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +0000122 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +0100123end_vector_entry FiqA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000124
Sandrine Bailleux9e6ad6c2016-05-24 16:56:03 +0100125vector_entry SErrorA32
Jeenu Viswambharan65f07302014-02-07 15:50:57 +0000126 mov x0, #SERROR_AARCH32
127 bl plat_report_exception
Jeenu Viswambharan68aef102016-11-30 15:21:11 +0000128 no_ret plat_panic_handler
Roberto Vargas95f30ab2018-04-17 11:31:43 +0100129end_vector_entry SErrorA32