2014-04-07 15:28:55 +01:00
|
|
|
/*
|
2017-07-19 16:06:27 +01:00
|
|
|
* Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
|
2014-04-07 15:28:55 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2014-04-07 15:28:55 +01:00
|
|
|
*/
|
2015-04-01 17:34:24 +01:00
|
|
|
#ifndef __PLAT_MACROS_S__
|
|
|
|
#define __PLAT_MACROS_S__
|
|
|
|
|
2015-03-19 19:17:53 +00:00
|
|
|
#include <arm_macros.S>
|
|
|
|
#include <v2m_def.h>
|
2014-08-04 16:11:15 +01:00
|
|
|
#include "../fvp_def.h"
|
2014-04-07 15:28:55 +01:00
|
|
|
|
|
|
|
/* ---------------------------------------------
|
2015-03-19 19:17:53 +00:00
|
|
|
* The below required platform porting macro
|
2017-07-19 16:06:27 +01:00
|
|
|
* prints out relevant GIC registers whenever an
|
|
|
|
* unhandled exception is taken in BL31.
|
2014-09-01 12:29:27 +01:00
|
|
|
* Clobbers: x0 - x10, x16, x17, sp
|
2014-04-07 15:28:55 +01:00
|
|
|
* ---------------------------------------------
|
|
|
|
*/
|
2015-11-26 14:47:53 +00:00
|
|
|
.macro plat_crash_print_regs
|
2015-03-19 19:17:53 +00:00
|
|
|
/*
|
|
|
|
* Detect if we're using the base memory map or
|
|
|
|
* the legacy VE memory map
|
|
|
|
*/
|
|
|
|
mov_imm x0, (V2M_SYSREGS_BASE + V2M_SYS_ID)
|
2014-09-01 12:29:27 +01:00
|
|
|
ldr w16, [x0]
|
|
|
|
/* Extract BLD (12th - 15th bits) from the SYS_ID */
|
2015-03-19 19:17:53 +00:00
|
|
|
ubfx x16, x16, #V2M_SYS_ID_BLD_SHIFT, #4
|
2014-09-01 12:29:27 +01:00
|
|
|
/* Check if VE mmap */
|
|
|
|
cmp w16, #BLD_GIC_VE_MMAP
|
|
|
|
b.eq use_ve_mmap
|
2015-10-26 14:01:53 +00:00
|
|
|
/* Assume Base Cortex mmap */
|
2014-09-01 12:29:27 +01:00
|
|
|
mov_imm x17, BASE_GICC_BASE
|
|
|
|
mov_imm x16, BASE_GICD_BASE
|
2015-10-26 14:01:53 +00:00
|
|
|
b print_gic_regs
|
2014-09-01 12:29:27 +01:00
|
|
|
use_ve_mmap:
|
|
|
|
mov_imm x17, VE_GICC_BASE
|
|
|
|
mov_imm x16, VE_GICD_BASE
|
2015-10-26 14:01:53 +00:00
|
|
|
print_gic_regs:
|
2015-03-19 19:17:53 +00:00
|
|
|
arm_print_gic_regs
|
2014-07-16 09:23:52 +01:00
|
|
|
.endm
|
2015-04-01 17:34:24 +01:00
|
|
|
|
|
|
|
#endif /* __PLAT_MACROS_S__ */
|