diff --git a/plat/arm/board/morello/morello_bl31_setup.c b/plat/arm/board/morello/morello_bl31_setup.c index 5a1abe729..bece52e6c 100644 --- a/plat/arm/board/morello/morello_bl31_setup.c +++ b/plat/arm/board/morello/morello_bl31_setup.c @@ -15,23 +15,35 @@ #include "morello_def.h" #include +#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(); } diff --git a/plat/arm/board/morello/morello_def.h b/plat/arm/board/morello/morello_def.h index 1ae69cee2..f154924d9 100644 --- a/plat/arm/board/morello/morello_def.h +++ b/plat/arm/board/morello/morello_def.h @@ -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)