Commit 42ea8d67 authored by Manoj Kumar's avatar Manoj Kumar Committed by Chandni Cherukuri
Browse files

morello: Modify morello_plat_info structure



The structure has been modified to specify the memory
size in bytes instead of Gigabytes.
Signed-off-by: default avatarManoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: default avatarChandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I3384677d79af4f3cf55d3c353b6c20bb827b5ae7
parent 8098d544
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <drivers/arm/css/css_mhu_doorbell.h> #include <drivers/arm/css/css_mhu_doorbell.h>
#include <drivers/arm/css/scmi.h> #include <drivers/arm/css/scmi.h>
#include <drivers/arm/css/sds.h> #include <drivers/arm/css/sds.h>
#include <lib/cassert.h>
#include <plat/arm/common/plat_arm.h> #include <plat/arm/common/plat_arm.h>
#include "morello_def.h" #include "morello_def.h"
...@@ -17,18 +18,21 @@ ...@@ -17,18 +18,21 @@
* Platform information structure stored in SDS. * Platform information structure stored in SDS.
* This structure holds information about platform's DDR * This structure holds information about platform's DDR
* size which is an information about multichip setup * size which is an information about multichip setup
* - multichip mode * - Local DDR size in bytes, DDR memory in master board
* - Remote DDR size in bytes, DDR memory in slave board
* - slave_count * - slave_count
* - Local DDR size in GB, DDR memory in master board * - multichip mode
* - Remote DDR size in GB, DDR memory in slave board
*/ */
struct morello_plat_info { struct morello_plat_info {
bool multichip_mode; uint64_t local_ddr_size;
uint64_t remote_ddr_size;
uint8_t slave_count; uint8_t slave_count;
uint8_t local_ddr_size; bool multichip_mode;
uint8_t remote_ddr_size;
} __packed; } __packed;
/* Compile time assertion to ensure the size of structure is 18 bytes */
CASSERT(sizeof(struct morello_plat_info) == MORELLO_SDS_PLATFORM_INFO_SIZE,
assert_invalid_plat_info_size);
/* /*
* BL33 image information structure stored in SDS. * BL33 image information structure stored in SDS.
* This structure holds the source & destination addresses and * This structure holds the source & destination addresses and
...@@ -80,6 +84,7 @@ void bl31_platform_setup(void) ...@@ -80,6 +84,7 @@ void bl31_platform_setup(void)
int ret; int ret;
struct morello_plat_info plat_info; struct morello_plat_info plat_info;
struct morello_bl33_info bl33_info; struct morello_bl33_info bl33_info;
struct morello_plat_info *copy_dest;
ret = sds_init(); ret = sds_init();
if (ret != SDS_OK) { if (ret != SDS_OK) {
...@@ -99,8 +104,8 @@ void bl31_platform_setup(void) ...@@ -99,8 +104,8 @@ void bl31_platform_setup(void)
/* Validate plat_info SDS */ /* Validate plat_info SDS */
if ((plat_info.local_ddr_size == 0U) if ((plat_info.local_ddr_size == 0U)
|| (plat_info.local_ddr_size > MORELLO_MAX_DDR_CAPACITY_GB) || (plat_info.local_ddr_size > MORELLO_MAX_DDR_CAPACITY)
|| (plat_info.remote_ddr_size > MORELLO_MAX_DDR_CAPACITY_GB) || (plat_info.remote_ddr_size > MORELLO_MAX_DDR_CAPACITY)
|| (plat_info.slave_count > MORELLO_MAX_SLAVE_COUNT)) { || (plat_info.slave_count > MORELLO_MAX_SLAVE_COUNT)) {
ERROR("platform info SDS is corrupted\n"); ERROR("platform info SDS is corrupted\n");
panic(); panic();
...@@ -127,5 +132,6 @@ void bl31_platform_setup(void) ...@@ -127,5 +132,6 @@ void bl31_platform_setup(void)
* and platform information should be passed to BL33 using NT_FW_CONFIG * and platform information should be passed to BL33 using NT_FW_CONFIG
* passing mechanism. * passing mechanism.
*/ */
mmio_write_32(MORELLO_PLATFORM_INFO_BASE, *(uint32_t *)&plat_info); copy_dest = (struct morello_plat_info *)MORELLO_PLATFORM_INFO_BASE;
*copy_dest = plat_info;
} }
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
/* SDS Platform information defines */ /* SDS Platform information defines */
#define MORELLO_SDS_PLATFORM_INFO_STRUCT_ID U(8) #define MORELLO_SDS_PLATFORM_INFO_STRUCT_ID U(8)
#define MORELLO_SDS_PLATFORM_INFO_OFFSET U(0) #define MORELLO_SDS_PLATFORM_INFO_OFFSET U(0)
#define MORELLO_SDS_PLATFORM_INFO_SIZE U(4) #define MORELLO_SDS_PLATFORM_INFO_SIZE U(18)
#define MORELLO_MAX_DDR_CAPACITY_GB U(64) #define MORELLO_MAX_DDR_CAPACITY U(0x1000000000)
#define MORELLO_MAX_SLAVE_COUNT U(16) #define MORELLO_MAX_SLAVE_COUNT U(16)
/* SDS BL33 image information defines */ /* SDS BL33 image information defines */
...@@ -28,6 +28,6 @@ ...@@ -28,6 +28,6 @@
#define MORELLO_SDS_BL33_INFO_SIZE U(12) #define MORELLO_SDS_BL33_INFO_SIZE U(12)
/* Base address of non-secure SRAM where Platform information will be filled */ /* Base address of non-secure SRAM where Platform information will be filled */
#define MORELLO_PLATFORM_INFO_BASE UL(0x06008000) #define MORELLO_PLATFORM_INFO_BASE UL(0x06000000)
#endif /* MORELLO_DEF_H */ #endif /* MORELLO_DEF_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment