blob: 19cc35d4ea8a942a88d744265fe3e710a355d0f6 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Sandrine Bailleuxe0ae9fa2016-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-arm82cb2c12017-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 Kocharbbf8f6f2015-10-02 17:56:48 +01008#include <bl_common.h>
Achin Gupta4f6ad662013-10-25 09:08:21 +01009
Sandrine Bailleuxe0ae9fa2016-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 Bailleuxe0ae9fa2016-05-24 16:56:03 +010017vector_base early_exceptions
Achin Gupta4f6ad662013-10-25 09:08:21 +010018
19 /* -----------------------------------------------------
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010020 * Current EL with SP0 : 0x0 - 0x200
Achin Gupta4f6ad662013-10-25 09:08:21 +010021 * -----------------------------------------------------
22 */
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000026 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000027 check_vector_size SynchronousExceptionSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010028
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000032 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000033 check_vector_size IrqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010034
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000038 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000039 check_vector_size FiqSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010040
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000044 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000045 check_vector_size SErrorSP0
Achin Gupta4f6ad662013-10-25 09:08:21 +010046
47 /* -----------------------------------------------------
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010048 * Current EL with SPx: 0x200 - 0x400
Achin Gupta4f6ad662013-10-25 09:08:21 +010049 * -----------------------------------------------------
50 */
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000054 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000055 check_vector_size SynchronousExceptionSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010056
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000060 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000061 check_vector_size IrqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010062
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000066 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000067 check_vector_size FiqSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010068
Sandrine Bailleuxe0ae9fa2016-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 Viswambharana806dad2016-11-30 15:21:11 +000072 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000073 check_vector_size SErrorSPx
Achin Gupta4f6ad662013-10-25 09:08:21 +010074
75 /* -----------------------------------------------------
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010076 * Lower EL using AArch64 : 0x400 - 0x600
Achin Gupta4f6ad662013-10-25 09:08:21 +010077 * -----------------------------------------------------
78 */
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010079vector_entry SynchronousExceptionA64
Sandrine Bailleux6c595b32014-03-24 10:24:08 +000080 mov x0, #SYNC_EXCEPTION_AARCH64
81 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +000082 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000083 check_vector_size SynchronousExceptionA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010084
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010085vector_entry IrqA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010086 mov x0, #IRQ_AARCH64
87 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +000088 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000089 check_vector_size IrqA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010090
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010091vector_entry FiqA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010092 mov x0, #FIQ_AARCH64
93 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +000094 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +000095 check_vector_size FiqA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010096
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +010097vector_entry SErrorA64
Achin Gupta4f6ad662013-10-25 09:08:21 +010098 mov x0, #SERROR_AARCH64
99 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +0000100 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +0000101 check_vector_size SErrorA64
Achin Gupta4f6ad662013-10-25 09:08:21 +0100102
103 /* -----------------------------------------------------
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +0100104 * Lower EL using AArch32 : 0x600 - 0x800
Achin Gupta4f6ad662013-10-25 09:08:21 +0100105 * -----------------------------------------------------
106 */
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +0100107vector_entry SynchronousExceptionA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100108 mov x0, #SYNC_EXCEPTION_AARCH32
109 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +0000110 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +0000111 check_vector_size SynchronousExceptionA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100112
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +0100113vector_entry IrqA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100114 mov x0, #IRQ_AARCH32
115 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +0000116 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +0000117 check_vector_size IrqA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100118
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +0100119vector_entry FiqA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100120 mov x0, #FIQ_AARCH32
121 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +0000122 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +0000123 check_vector_size FiqA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100124
Sandrine Bailleuxe0ae9fa2016-05-24 16:56:03 +0100125vector_entry SErrorA32
Achin Gupta4f6ad662013-10-25 09:08:21 +0100126 mov x0, #SERROR_AARCH32
127 bl plat_report_exception
Jeenu Viswambharana806dad2016-11-30 15:21:11 +0000128 no_ret plat_panic_handler
Jeenu Viswambharana7934d62014-02-07 15:53:18 +0000129 check_vector_size SErrorA32