diff options
author | Thomas Abraham <thomas.abraham@arm.com> | 2021-02-16 11:36:00 +0530 |
---|---|---|
committer | Thomas Abraham <thomas.abraham@arm.com> | 2021-03-29 18:52:34 +0530 |
commit | d306eb801ebbaa8cf3324465092ac939e6b2d28d (patch) | |
tree | 4ef344cd08368014c89005302d15f463d8351483 | |
parent | 513ba5c97372dafb7bca60659e494e211413eedc (diff) | |
download | trusted-firmware-a-d306eb801ebbaa8cf3324465092ac939e6b2d28d.tar.gz |
plat/sgi: improve macros defining cper buffer memory region
Remove the 'ARM_' prefix from the macros defining the CPER buffer memory
and replace it with 'CSS_SGI_' prefix. These macros are applicable only
for platforms supported within plat/sgi. In addition to this, ensure
that these macros are defined only if the RAS_EXTENSION build option is
enabled.
Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I44df42cded18d9d3a4cb13e5c990e9ab3194daee
-rw-r--r-- | plat/arm/css/sgi/include/sgi_base_platform_def.h | 44 | ||||
-rw-r--r-- | plat/arm/css/sgi/sgi_plat.c | 6 |
2 files changed, 30 insertions, 20 deletions
diff --git a/plat/arm/css/sgi/include/sgi_base_platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h index a38c811875..f6c56e8f01 100644 --- a/plat/arm/css/sgi/include/sgi_base_platform_def.h +++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h @@ -165,28 +165,36 @@ #define PLAT_SP_PRI PLAT_RAS_PRI -#if RAS_EXTENSION -/* Allocate 128KB for CPER buffers */ -#define PLAT_SP_BUF_BASE ULL(0x20000) - -#define PLAT_ARM_SP_IMAGE_STACK_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \ - PLAT_SP_IMAGE_NS_BUF_SIZE + \ - PLAT_SP_BUF_BASE) - -#define ARM_SP_CPER_BUF_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \ - PLAT_SP_IMAGE_NS_BUF_SIZE) -#define ARM_SP_CPER_BUF_SIZE ULL(0x20000) -#define ARM_SP_CPER_BUF_MMAP MAP_REGION2( \ - ARM_SP_CPER_BUF_BASE, \ - ARM_SP_CPER_BUF_BASE, \ - ARM_SP_CPER_BUF_SIZE, \ - MT_RW_DATA | MT_NS | MT_USER, \ +#if SPM_MM && RAS_EXTENSION +/* + * CPER buffer memory of 128KB is reserved and it is placed adjacent to the + * memory shared between EL3 and S-EL0. + */ +#define CSS_SGI_SP_CPER_BUF_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \ + PLAT_SP_IMAGE_NS_BUF_SIZE) +#define CSS_SGI_SP_CPER_BUF_SIZE ULL(0x20000) +#define CSS_SGI_SP_CPER_BUF_MMAP MAP_REGION2( \ + CSS_SGI_SP_CPER_BUF_BASE, \ + CSS_SGI_SP_CPER_BUF_BASE, \ + CSS_SGI_SP_CPER_BUF_SIZE, \ + MT_RW_DATA | MT_NS | MT_USER, \ PAGE_SIZE) -#else +/* + * Secure partition stack follows right after the memory space reserved for + * CPER buffer memory. + */ +#define PLAT_ARM_SP_IMAGE_STACK_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \ + PLAT_SP_IMAGE_NS_BUF_SIZE + \ + CSS_SGI_SP_CPER_BUF_SIZE) +#elif SPM_MM +/* + * Secure partition stack follows right after the memory region that is shared + * between EL3 and S-EL0. + */ #define PLAT_ARM_SP_IMAGE_STACK_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \ PLAT_SP_IMAGE_NS_BUF_SIZE) -#endif /* RAS_EXTENSION */ +#endif /* SPM_MM && RAS_EXTENSION */ /* Platform ID address */ #define SSC_VERSION (SSC_REG_BASE + SSC_VERSION_OFFSET) diff --git a/plat/arm/css/sgi/sgi_plat.c b/plat/arm/css/sgi/sgi_plat.c index 39eb89eb8d..118bd22610 100644 --- a/plat/arm/css/sgi/sgi_plat.c +++ b/plat/arm/css/sgi/sgi_plat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -81,7 +81,9 @@ const mmap_region_t plat_arm_secure_partition_mmap[] = { PLAT_ARM_SECURE_MAP_DEVICE, ARM_SP_IMAGE_MMAP, ARM_SP_IMAGE_NS_BUF_MMAP, - ARM_SP_CPER_BUF_MMAP, +#if RAS_EXTENSION + CSS_SGI_SP_CPER_BUF_MMAP, +#endif ARM_SP_IMAGE_RW_MMAP, ARM_SPM_BUF_EL0_MMAP, {0} |