plat_macros.S 1.19 KB
Newer Older
1
/*
2
 * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
 */
6
7
8
#ifndef __PLAT_MACROS_S__
#define __PLAT_MACROS_S__

9
#include <arm_macros.S>
10
#include <cci_macros.S>
11
#include <v2m_def.h>
12
#include "../fvp_def.h"
13
14

	/* ---------------------------------------------
15
	 * The below required platform porting macro
16
17
18
	 * prints out relevant GIC and CCI registers
	 * whenever an unhandled exception is taken in
	 * BL31.
19
	 * Clobbers: x0 - x10, x16, x17, sp
20
21
	 * ---------------------------------------------
	 */
22
	.macro plat_crash_print_regs
23
24
25
26
27
	/*
	 * Detect if we're using the base memory map or
	 * the legacy VE memory map
	 */
	mov_imm	x0, (V2M_SYSREGS_BASE + V2M_SYS_ID)
28
29
	ldr	w16, [x0]
	/* Extract BLD (12th - 15th bits) from the SYS_ID */
30
	ubfx	x16, x16, #V2M_SYS_ID_BLD_SHIFT, #4
31
32
33
	/* Check if VE mmap */
	cmp	w16, #BLD_GIC_VE_MMAP
	b.eq	use_ve_mmap
34
	/* Assume Base Cortex mmap */
35
36
	mov_imm	x17, BASE_GICC_BASE
	mov_imm	x16, BASE_GICD_BASE
37
	b	print_gic_regs
38
39
40
use_ve_mmap:
	mov_imm	x17, VE_GICC_BASE
	mov_imm	x16, VE_GICD_BASE
41
print_gic_regs:
42
	arm_print_gic_regs
43
#if FVP_INTERCONNECT_DRIVER == FVP_CCI
44
	print_cci_regs
45
#endif
46
	.endm
47
48

#endif /* __PLAT_MACROS_S__ */