@ -176,72 +176,4 @@ void spm_sp_setup(sp_context_t *sp_ctx)
*/
write_ctx_reg ( get_sysregs_ctx ( ctx ) , CTX_CPACR_EL1 ,
CPACR_EL1_FPEN ( CPACR_EL1_FP_TRAP_NONE ) ) ;
/*
* Prepare information in buffer shared between EL3 and S - EL0
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
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 )
< = ( 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 =
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 ) ) ;
/* 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 ;
assert ( sp_mp_info ! = NULL ) ;
/*
* 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 ) ) ;
/*
* 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 ;
/*
* Copy the cpu information into the shared buffer area after the boot
* information .
*/
assert ( sp_boot_info - > num_cpus < = PLATFORM_CORE_COUNT ) ;
assert ( ( uintptr_t ) shared_buf_ptr
< = ( PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE -
( sp_boot_info - > num_cpus * sizeof ( * sp_mp_info ) ) ) ) ;
memcpy ( shared_buf_ptr , ( const void * ) sp_mp_info ,
sp_boot_info - > num_cpus * sizeof ( * sp_mp_info ) ) ;
/*
* 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 ;
for ( unsigned int index = 0 ; index < sp_boot_info - > num_cpus ; index + + ) {
u_register_t mpidr = sp_mp_info [ index ] . mpidr ;
sp_mp_info [ index ] . linear_id = plat_core_pos_by_mpidr ( mpidr ) ;
if ( plat_my_core_pos ( ) = = sp_mp_info [ index ] . linear_id )
sp_mp_info [ index ] . flags | = MP_INFO_FLAG_PRIMARY_CPU ;
}
}