xref: /arm-trusted-firmware/plat/arm/board/common/aarch64/board_arm_helpers.S (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu/*
2*91f16700Schasinglulu * Copyright (c) 2015, 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#include <platform_def.h>
10*91f16700Schasinglulu
11*91f16700Schasinglulu	.globl  plat_report_exception
12*91f16700Schasinglulu
13*91f16700Schasinglulu
14*91f16700Schasinglulu	/* ---------------------------------------------
15*91f16700Schasinglulu	 * void plat_report_exception(unsigned int type)
16*91f16700Schasinglulu	 * Function to report an unhandled exception
17*91f16700Schasinglulu	 * with platform-specific means.
18*91f16700Schasinglulu	 * On FVP platform, it updates the LEDs
19*91f16700Schasinglulu	 * to indicate where we are
20*91f16700Schasinglulu	 * ---------------------------------------------
21*91f16700Schasinglulu	 */
22*91f16700Schasinglulufunc plat_report_exception
23*91f16700Schasinglulu	mrs	x1, CurrentEl
24*91f16700Schasinglulu	lsr	x1, x1, #MODE_EL_SHIFT
25*91f16700Schasinglulu	lsl	x1, x1, #V2M_SYS_LED_EL_SHIFT
26*91f16700Schasinglulu	lsl	x0, x0, #V2M_SYS_LED_EC_SHIFT
27*91f16700Schasinglulu	mov	x2, #(SECURE << V2M_SYS_LED_SS_SHIFT)
28*91f16700Schasinglulu	orr	x0, x0, x2
29*91f16700Schasinglulu	orr	x0, x0, x1
30*91f16700Schasinglulu	mov	x1, #V2M_SYSREGS_BASE
31*91f16700Schasinglulu	add	x1, x1, #V2M_SYS_LED
32*91f16700Schasinglulu	str	w0, [x1]
33*91f16700Schasinglulu	ret
34*91f16700Schasingluluendfunc plat_report_exception
35