qemu/qemu_sbsa: spm_mm supports 512 cores

sbsa-ref in QEMU may create up to 512 cores.
This commit prepares the MP information to support 512 cores.
The number of xlat tables for spm_mm is also increased.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: I2788eaf6d14e188e9b5d1102d359b2899e02df7c
This commit is contained in:
Masahisa Kojima 2021-02-02 16:00:27 +09:00
parent 6630681458
commit cf952b0fb5
2 changed files with 24 additions and 15 deletions

View File

@ -29,20 +29,8 @@ mmap_region_t plat_qemu_secure_partition_mmap[] = {
{0}
};
/*
* Boot information passed to a secure partition during initialisation.
* Linear indices in MP information will be filled at runtime.
*/
static spm_mm_mp_info_t sp_mp_info[] = {
[0] = {0x80000000, 0},
[1] = {0x80000001, 0},
[2] = {0x80000002, 0},
[3] = {0x80000003, 0},
[4] = {0x80000004, 0},
[5] = {0x80000005, 0},
[6] = {0x80000006, 0},
[7] = {0x80000007, 0}
};
/* Boot information passed to a secure partition during initialisation. */
static spm_mm_mp_info_t sp_mp_info[PLATFORM_CORE_COUNT];
spm_mm_boot_info_t plat_qemu_secure_partition_boot_info = {
.h.type = PARAM_SP_IMAGE_BOOT_INFO,
@ -71,6 +59,25 @@ ehf_pri_desc_t qemu_exceptions[] = {
EHF_PRI_DESC(QEMU_PRI_BITS, PLAT_SP_PRI)
};
static void qemu_initialize_mp_info(spm_mm_mp_info_t *mp_info)
{
unsigned int i, j;
spm_mm_mp_info_t *tmp = mp_info;
for (i = 0; i < PLATFORM_CLUSTER_COUNT; i++) {
for (j = 0; j < PLATFORM_MAX_CPUS_PER_CLUSTER; j++) {
tmp->mpidr = (0x80000000 | (i << MPIDR_AFF1_SHIFT)) + j;
/*
* Linear indices and flags will be filled
* in the spm_mm service.
*/
tmp->linear_id = 0;
tmp->flags = 0;
tmp++;
}
}
}
int dt_add_ns_buf_node(uintptr_t *base)
{
uintptr_t addr;
@ -134,5 +141,7 @@ const mmap_region_t *plat_get_secure_partition_mmap(void *cookie)
const spm_mm_boot_info_t *
plat_get_secure_partition_boot_info(void *cookie)
{
qemu_initialize_mp_info(sp_mp_info);
return &plat_qemu_secure_partition_boot_info;
}

View File

@ -171,7 +171,7 @@
#if SPM_MM && defined(IMAGE_BL31)
# define PLAT_SP_IMAGE_MMAP_REGIONS 30
# define PLAT_SP_IMAGE_MAX_XLAT_TABLES 20
# define PLAT_SP_IMAGE_MAX_XLAT_TABLES 50
#endif
/*