From 0b9ce9064c9e27184ff1052d47c4fd0d9a07d521 Mon Sep 17 00:00:00 2001 From: Jeenu Viswambharan <jeenu.viswambharan@arm.com> Date: Tue, 6 Feb 2018 12:21:39 +0000 Subject: [PATCH] ARM Platforms: Support RAS - Assign 0x10 for RAS exceptions on ARM platforms, and install EHF priority descriptor. - Call the common RAS initialisation from ARM BL31 setup. - Add empty definitions for platform error records and RAS interrupts. Change-Id: I0675f299b7840be4c83a9c7a81073a95c605dc90 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com> --- include/plat/arm/common/arm_def.h | 1 + plat/arm/common/aarch64/arm_ehf.c | 7 ++++++- plat/arm/common/aarch64/arm_ras.c | 16 ++++++++++++++++ plat/arm/common/arm_bl31_setup.c | 5 +++++ plat/arm/common/arm_common.mk | 7 +++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 plat/arm/common/aarch64/arm_ras.c diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h index 95e986bf2..d10afaeb7 100644 --- a/include/plat/arm/common/arm_def.h +++ b/include/plat/arm/common/arm_def.h @@ -483,6 +483,7 @@ #define PLAT_PERCPU_BAKERY_LOCK_SIZE (1 * CACHE_WRITEBACK_GRANULE) /* Priority levels for ARM platforms */ +#define PLAT_RAS_PRI 0x10 #define PLAT_SDEI_CRITICAL_PRI 0x60 #define PLAT_SDEI_NORMAL_PRI 0x70 diff --git a/plat/arm/common/aarch64/arm_ehf.c b/plat/arm/common/aarch64/arm_ehf.c index 785b7bb54..665871b4a 100644 --- a/plat/arm/common/aarch64/arm_ehf.c +++ b/plat/arm/common/aarch64/arm_ehf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,6 +11,11 @@ * Enumeration of priority levels on ARM platforms. */ ehf_pri_desc_t arm_exceptions[] = { +#if RAS_EXTENSION + /* RAS Priority */ + EHF_PRI_DESC(ARM_PRI_BITS, PLAT_RAS_PRI), +#endif + #if SDEI_SUPPORT /* Critical priority SDEI */ EHF_PRI_DESC(ARM_PRI_BITS, PLAT_SDEI_CRITICAL_PRI), diff --git a/plat/arm/common/aarch64/arm_ras.c b/plat/arm/common/aarch64/arm_ras.c new file mode 100644 index 000000000..80dfaf1b7 --- /dev/null +++ b/plat/arm/common/aarch64/arm_ras.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <ras.h> + +struct ras_interrupt arm_ras_interrupts[] = { +}; + +struct err_record_info arm_err_records[] = { +}; + +REGISTER_ERR_RECORD_INFO(arm_err_records); +REGISTER_RAS_INTERRUPTS(arm_ras_interrupts); diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c index 963c4d2b4..16ab3d745 100644 --- a/plat/arm/common/arm_bl31_setup.c +++ b/plat/arm/common/arm_bl31_setup.c @@ -14,6 +14,7 @@ #include <mmio.h> #include <plat_arm.h> #include <platform.h> +#include <ras.h> #define BL31_END (uintptr_t)(&__BL31_END__) @@ -217,6 +218,10 @@ void arm_bl31_platform_setup(void) /* Initialize power controller before setting up topology */ plat_arm_pwrc_setup(); + +#if RAS_EXTENSION + ras_init(); +#endif } /******************************************************************************* diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk index 015e454a1..2a787308b 100644 --- a/plat/arm/common/arm_common.mk +++ b/plat/arm/common/arm_common.mk @@ -203,6 +203,13 @@ ifeq (${SDEI_SUPPORT},1) BL31_SOURCES += plat/arm/common/aarch64/arm_sdei.c endif +# RAS sources +ifeq (${RAS_EXTENSION},1) +BL31_SOURCES += lib/extensions/ras/std_err_record.c \ + lib/extensions/ras/ras_common.c \ + plat/arm/common/aarch64/arm_ras.c +endif + ifneq (${TRUSTED_BOARD_BOOT},0) # Include common TBB sources -- GitLab