diff --git a/docs/components/secure-partition-manager-design.rst b/docs/components/secure-partition-manager-design.rst index de0792d15ecc1243336d2994fc3a24a961846436..5c75bafdc7da8e3b550143fc36c7691c5c4d143c 100644 --- a/docs/components/secure-partition-manager-design.rst +++ b/docs/components/secure-partition-manager-design.rst @@ -160,7 +160,7 @@ are implemented. Partition. - ``plat_get_secure_partition_boot_info()`` returns a - ``secure_partition_boot_info_t`` struct that is populated by the platform + ``spm_mm_boot_info_t`` struct that is populated by the platform with information about the memory map of the Secure Partition. For an example of all the changes in context, you may refer to commit diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h index eeae62141c03396ef56ea90a6e35dd9c51cc599f..9efb2fd526a417c33b2897491170ab35f173917d 100644 --- a/include/plat/common/platform.h +++ b/include/plat/common/platform.h @@ -22,7 +22,7 @@ struct image_desc; struct bl_load_info; struct bl_params; struct mmap_region; -struct secure_partition_boot_info; +struct spm_mm_boot_info; struct sp_res_desc; /******************************************************************************* @@ -267,7 +267,7 @@ int get_mbedtls_heap_helper(void **heap_addr, size_t *heap_size); * Secure Partitions functions ******************************************************************************/ const struct mmap_region *plat_get_secure_partition_mmap(void *cookie); -const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( +const struct spm_mm_boot_info *plat_get_secure_partition_boot_info( void *cookie); int plat_spm_sp_rd_load(struct sp_res_desc *rd, const void *ptr, size_t size); int plat_spm_sp_get_next_address(void **sp_base, size_t *sp_size, diff --git a/include/services/secure_partition.h b/include/services/spm_mm_partition.h similarity index 70% rename from include/services/secure_partition.h rename to include/services/spm_mm_partition.h index 0510f80ece0bf4166bf5f343159216dba2ab42ca..ad5ceefbb5cb574d4e96044a8508430a37a3136f 100644 --- a/include/services/secure_partition.h +++ b/include/services/spm_mm_partition.h @@ -4,17 +4,15 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef SECURE_PARTITION_H -#define SECURE_PARTITION_H - -#if SPM_MM +#ifndef SPM_MM_PARTITION_H +#define SPM_MM_PARTITION_H #include #include /* - * Flags used by the secure_partition_mp_info structure to describe the + * Flags used by the spm_mm_mp_info structure to describe the * characteristics of a cpu. Only a single flag is defined at the moment to * indicate the primary cpu. */ @@ -24,13 +22,13 @@ * This structure is used to provide information required to initialise a S-EL0 * partition. */ -typedef struct secure_partition_mp_info { +typedef struct spm_mm_mp_info { uint64_t mpidr; uint32_t linear_id; uint32_t flags; -} secure_partition_mp_info_t; +} spm_mm_mp_info_t; -typedef struct secure_partition_boot_info { +typedef struct spm_mm_boot_info { param_header_t h; uint64_t sp_mem_base; uint64_t sp_mem_limit; @@ -46,9 +44,7 @@ typedef struct secure_partition_boot_info { uint64_t sp_shared_buf_size; uint32_t num_sp_mem_regions; uint32_t num_cpus; - secure_partition_mp_info_t *mp_info; -} secure_partition_boot_info_t; - -#endif /* SPM_MM */ + spm_mm_mp_info_t *mp_info; +} spm_mm_boot_info_t; -#endif /* SECURE_PARTITION_H */ +#endif /* SPM_MM_PARTITION_H */ diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c index 0b1b321021fc0e81d79b4bf5a6de4540b6d1284e..c36cd6f17738708942fe32cd4009b46894113b5c 100644 --- a/plat/arm/board/fvp/fvp_common.c +++ b/plat/arm/board/fvp/fvp_common.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "fvp_private.h" @@ -189,7 +189,7 @@ static unsigned int get_interconnect_master(void) * Boot information passed to a secure partition during initialisation. Linear * indices in MP information will be filled at runtime. */ -static secure_partition_mp_info_t sp_mp_info[] = { +static spm_mm_mp_info_t sp_mp_info[] = { [0] = {0x80000000, 0}, [1] = {0x80000001, 0}, [2] = {0x80000002, 0}, @@ -200,10 +200,10 @@ static secure_partition_mp_info_t sp_mp_info[] = { [7] = {0x80000103, 0}, }; -const secure_partition_boot_info_t plat_arm_secure_partition_boot_info = { +const spm_mm_boot_info_t plat_arm_secure_partition_boot_info = { .h.type = PARAM_SP_IMAGE_BOOT_INFO, .h.version = VERSION_1, - .h.size = sizeof(secure_partition_boot_info_t), + .h.size = sizeof(spm_mm_boot_info_t), .h.attr = 0, .sp_mem_base = ARM_SP_IMAGE_BASE, .sp_mem_limit = ARM_SP_IMAGE_LIMIT, @@ -227,7 +227,7 @@ const struct mmap_region *plat_get_secure_partition_mmap(void *cookie) return plat_arm_secure_partition_mmap; } -const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( +const struct spm_mm_boot_info *plat_get_secure_partition_boot_info( void *cookie) { return &plat_arm_secure_partition_boot_info; diff --git a/plat/arm/common/arm_common.c b/plat/arm/common/arm_common.c index bc0cf9a857b464f5d9d34e3d19808d348701c624..03d842a5116214b7264e7e9a24051cff83a08805 100644 --- a/plat/arm/common/arm_common.c +++ b/plat/arm/common/arm_common.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include /* Weak definitions may be overridden in specific ARM standard platform */ #pragma weak plat_get_ns_image_entrypoint diff --git a/plat/arm/css/sgi/sgi_plat.c b/plat/arm/css/sgi/sgi_plat.c index ef13cdcef83076b0a3ce9152738bc1c42580e576..b611eaff548d84093145b90a3e63f793de48b338 100644 --- a/plat/arm/css/sgi/sgi_plat.c +++ b/plat/arm/css/sgi/sgi_plat.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #define SGI_MAP_FLASH0_RO MAP_REGION_FLAT(V2M_FLASH0_BASE,\ V2M_FLASH0_SIZE, \ @@ -87,7 +87,7 @@ ARM_CASSERT_MMAP * Boot information passed to a secure partition during initialisation. Linear * indices in MP information will be filled at runtime. */ -static secure_partition_mp_info_t sp_mp_info[] = { +static spm_mm_mp_info_t sp_mp_info[] = { [0] = {0x81000000, 0}, [1] = {0x81000100, 0}, [2] = {0x81000200, 0}, @@ -98,10 +98,10 @@ static secure_partition_mp_info_t sp_mp_info[] = { [7] = {0x81010300, 0}, }; -const secure_partition_boot_info_t plat_arm_secure_partition_boot_info = { +const spm_mm_boot_info_t plat_arm_secure_partition_boot_info = { .h.type = PARAM_SP_IMAGE_BOOT_INFO, .h.version = VERSION_1, - .h.size = sizeof(secure_partition_boot_info_t), + .h.size = sizeof(spm_mm_boot_info_t), .h.attr = 0, .sp_mem_base = ARM_SP_IMAGE_BASE, .sp_mem_limit = ARM_SP_IMAGE_LIMIT, @@ -125,7 +125,7 @@ const struct mmap_region *plat_get_secure_partition_mmap(void *cookie) return plat_arm_secure_partition_mmap; } -const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( +const struct spm_mm_boot_info *plat_get_secure_partition_boot_info( void *cookie) { return &plat_arm_secure_partition_boot_info; diff --git a/plat/socionext/synquacer/sq_spm.c b/plat/socionext/synquacer/sq_spm.c index 01cce173992d24060fe03bd1d3e6e2a8702b09b0..7bea1114ecf9f75b03e70b0769f594060aa2fd7f 100644 --- a/plat/socionext/synquacer/sq_spm.c +++ b/plat/socionext/synquacer/sq_spm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -10,7 +10,7 @@ #include #include -#include +#include static const mmap_region_t plat_arm_secure_partition_mmap[] = { PLAT_SQ_FLASH_MMAP, @@ -27,7 +27,7 @@ static const mmap_region_t plat_arm_secure_partition_mmap[] = { * Boot information passed to a secure partition during initialisation. Linear * indices in MP information will be filled at runtime. */ -static secure_partition_mp_info_t sp_mp_info[] = { +static spm_mm_mp_info_t sp_mp_info[] = { {0x80000000, 0}, {0x80000001, 0}, {0x80000100, 0}, {0x80000101, 0}, {0x80000200, 0}, {0x80000201, 0}, {0x80000300, 0}, {0x80000301, 0}, {0x80000400, 0}, {0x80000401, 0}, {0x80000500, 0}, {0x80000501, 0}, @@ -36,10 +36,10 @@ static secure_partition_mp_info_t sp_mp_info[] = { {0x80000a00, 0}, {0x80000a01, 0}, {0x80000b00, 0}, {0x80000b01, 0}, }; -const secure_partition_boot_info_t plat_arm_secure_partition_boot_info = { +const spm_mm_boot_info_t plat_arm_secure_partition_boot_info = { .h.type = PARAM_SP_IMAGE_BOOT_INFO, .h.version = VERSION_1, - .h.size = sizeof(secure_partition_boot_info_t), + .h.size = sizeof(spm_mm_boot_info_t), .h.attr = 0, .sp_mem_base = BL32_BASE, .sp_mem_limit = BL32_LIMIT, @@ -63,7 +63,7 @@ const struct mmap_region *plat_get_secure_partition_mmap(void *cookie) return plat_arm_secure_partition_mmap; } -const struct secure_partition_boot_info *plat_get_secure_partition_boot_info( +const struct spm_mm_boot_info *plat_get_secure_partition_boot_info( void *cookie) { return &plat_arm_secure_partition_boot_info; diff --git a/services/std_svc/spm_mm/spm_main.c b/services/std_svc/spm_mm/spm_main.c index 706b69d9f83d1cb69cd92982072f35501db51467..b2f93a6362d670ba234f30bde1b510cf4e591afc 100644 --- a/services/std_svc/spm_mm/spm_main.c +++ b/services/std_svc/spm_mm/spm_main.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/services/std_svc/spm_mm/spm_setup.c b/services/std_svc/spm_mm/spm_setup.c index aae6cd5e2b4ba74b3db36920cff224f8ea4476d8..7d03eb588d1250e8acff07ea5e556801cdbfc4b9 100644 --- a/services/std_svc/spm_mm/spm_setup.c +++ b/services/std_svc/spm_mm/spm_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "spm_private.h" #include "spm_shim_private.h" @@ -192,22 +192,22 @@ void spm_sp_setup(sp_context_t *sp_ctx) void *shared_buf_ptr = (void *) PLAT_SPM_BUF_BASE; /* Copy the boot information into the shared buffer with the SP. */ - assert((uintptr_t)shared_buf_ptr + sizeof(secure_partition_boot_info_t) + assert((uintptr_t)shared_buf_ptr + sizeof(spm_mm_boot_info_t) <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE)); assert(PLAT_SPM_BUF_BASE <= (UINTPTR_MAX - PLAT_SPM_BUF_SIZE + 1)); - const secure_partition_boot_info_t *sp_boot_info = + const spm_mm_boot_info_t *sp_boot_info = plat_get_secure_partition_boot_info(NULL); assert(sp_boot_info != NULL); memcpy((void *) shared_buf_ptr, (const void *) sp_boot_info, - sizeof(secure_partition_boot_info_t)); + sizeof(spm_mm_boot_info_t)); /* Pointer to the MP information from the platform port. */ - secure_partition_mp_info_t *sp_mp_info = - ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info; + spm_mm_mp_info_t *sp_mp_info = + ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info; assert(sp_mp_info != NULL); @@ -215,15 +215,15 @@ void spm_sp_setup(sp_context_t *sp_ctx) * Point the shared buffer MP information pointer to where the info will * be populated, just after the boot info. */ - ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info = - (secure_partition_mp_info_t *) ((uintptr_t)shared_buf_ptr - + sizeof(secure_partition_boot_info_t)); + ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info = + (spm_mm_mp_info_t *) ((uintptr_t)shared_buf_ptr + + sizeof(spm_mm_boot_info_t)); /* * Update the shared buffer pointer to where the MP information for the * payload will be populated */ - shared_buf_ptr = ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info; + shared_buf_ptr = ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info; /* * Copy the cpu information into the shared buffer area after the boot @@ -242,7 +242,7 @@ void spm_sp_setup(sp_context_t *sp_ctx) * Calculate the linear indices of cores in boot information for the * secure partition and flag the primary CPU */ - sp_mp_info = (secure_partition_mp_info_t *) shared_buf_ptr; + sp_mp_info = (spm_mm_mp_info_t *) shared_buf_ptr; for (unsigned int index = 0; index < sp_boot_info->num_cpus; index++) { u_register_t mpidr = sp_mp_info[index].mpidr; diff --git a/services/std_svc/spm_mm/spm_xlat.c b/services/std_svc/spm_mm/spm_xlat.c index f54168e33416e778b9b8c1b35970cf87848cb2b9..a2df1afb0f735596d1a1ea3cc44c99a62786f426 100644 --- a/services/std_svc/spm_mm/spm_xlat.c +++ b/services/std_svc/spm_mm/spm_xlat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "spm_private.h"