feat(morello): split platform_info sds struct

Different platform_info sds struct definition will be used
for fvp and soc.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I92f0e1b2d0d755ad0405ceebfeb78d6e4c67013d
This commit is contained in:
sah01 2021-12-02 06:37:04 +00:00 committed by Chandni Cherukuri
parent 4af5397753
commit 4a7a9dafbc
2 changed files with 28 additions and 7 deletions

View File

@ -15,23 +15,35 @@
#include "morello_def.h"
#include <platform_def.h>
#ifdef TARGET_PLATFORM_FVP
/*
* Platform information structure stored in SDS.
* This structure holds information about platform's DDR
* size
* - Local DDR size in bytes, DDR memory in main board
*/
struct morello_plat_info {
uint64_t local_ddr_size;
} __packed;
#else
/*
* Platform information structure stored in SDS.
* This structure holds information about platform's DDR
* size which is an information about multichip setup
* - Local DDR size in bytes, DDR memory in master board
* - Remote DDR size in bytes, DDR memory in slave board
* - slave_count
* - Local DDR size in bytes, DDR memory in main board
* - Remote DDR size in bytes, DDR memory in remote board
* - remote_chip_count
* - multichip mode
* - scc configuration
*/
struct morello_plat_info {
uint64_t local_ddr_size;
uint64_t remote_ddr_size;
uint8_t slave_count;
uint8_t remote_chip_count;
bool multichip_mode;
uint32_t scc_config;
} __packed;
#endif
/* Compile time assertion to ensure the size of structure is 18 bytes */
CASSERT(sizeof(struct morello_plat_info) == MORELLO_SDS_PLATFORM_INFO_SIZE,
@ -211,10 +223,15 @@ void bl31_platform_setup(void)
}
/* Validate plat_info SDS */
#ifdef TARGET_PLATFORM_FVP
if (plat_info.local_ddr_size == 0U) {
#else
if ((plat_info.local_ddr_size == 0U)
|| (plat_info.local_ddr_size > MORELLO_MAX_DDR_CAPACITY)
|| (plat_info.remote_ddr_size > MORELLO_MAX_DDR_CAPACITY)
|| (plat_info.slave_count > MORELLO_MAX_SLAVE_COUNT)) {
|| (plat_info.remote_chip_count > MORELLO_MAX_REMOTE_CHIP_COUNT)
) {
#endif
ERROR("platform info SDS is corrupted\n");
panic();
}

View File

@ -18,9 +18,13 @@
/* SDS Platform information defines */
#define MORELLO_SDS_PLATFORM_INFO_STRUCT_ID U(8)
#define MORELLO_SDS_PLATFORM_INFO_OFFSET U(0)
#define MORELLO_SDS_PLATFORM_INFO_SIZE U(22)
#ifdef TARGET_PLATFORM_FVP
# define MORELLO_SDS_PLATFORM_INFO_SIZE U(8)
#else
# define MORELLO_SDS_PLATFORM_INFO_SIZE U(22)
#endif
#define MORELLO_MAX_DDR_CAPACITY U(0x1000000000)
#define MORELLO_MAX_SLAVE_COUNT U(16)
#define MORELLO_MAX_REMOTE_CHIP_COUNT U(16)
#define MORELLO_SCC_SERVER_MODE U(0)
#define MORELLO_SCC_CLIENT_MODE_MASK U(1)