Browse Source

refactor(morello): update SDS driver calls

Update SDS driver calls to align with recent
changes [1] of the SDS driver.

- The driver now requires us to explicitly pass
  the SDS region id to act on.
- Implement plat_sds_get_regions() platform function
  which is used by the driver to get SDS region
  information per platform.

[1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/24609/

Change-Id: I942599edb4d9734c0455f67c6b5673aace62e444
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: David Vincze <david.vincze@arm.com>
pull/1999/merge
Tamas Ban 2 years ago
committed by David Vincze
parent
commit
48d42ed5a4
  1. 6
      plat/arm/board/morello/include/platform_def.h
  2. 7
      plat/arm/board/morello/morello_bl2_setup.c
  3. 7
      plat/arm/board/morello/morello_bl31_setup.c
  4. 11
      plat/arm/board/morello/morello_image_load.c
  5. 17
      plat/arm/board/morello/morello_plat.c

6
plat/arm/board/morello/include/platform_def.h

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2023, Arm Limited. All rights reserved.
* Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -59,6 +59,10 @@
#if CSS_USE_SCMI_SDS_DRIVER
#define MORELLO_SCMI_PAYLOAD_BASE ULL(0x45400000)
/*
* Index of SDS region used in the communication with SCP
*/
#define SDS_SCP_AP_REGION_ID U(0)
#else
#define PLAT_CSS_SCP_COM_SHARED_MEM_BASE ULL(0x45400000)
#endif

7
plat/arm/board/morello/morello_bl2_setup.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, Arm Limited. All rights reserved.
* Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -155,13 +155,14 @@ void bl2_platform_setup(void)
int ret;
struct morello_plat_info plat_info;
ret = sds_init();
ret = sds_init(SDS_SCP_AP_REGION_ID);
if (ret != SDS_OK) {
ERROR("SDS initialization failed. ret:%d\n", ret);
panic();
}
ret = sds_struct_read(MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
ret = sds_struct_read(SDS_SCP_AP_REGION_ID,
MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
MORELLO_SDS_PLATFORM_INFO_OFFSET,
&plat_info,
MORELLO_SDS_PLATFORM_INFO_SIZE,

7
plat/arm/board/morello/morello_bl31_setup.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2023, Arm Limited. All rights reserved.
* Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -43,13 +43,14 @@ void bl31_platform_setup(void)
#ifdef TARGET_PLATFORM_SOC
int ret;
ret = sds_init();
ret = sds_init(SDS_SCP_AP_REGION_ID);
if (ret != SDS_OK) {
ERROR("SDS initialization failed. ret:%d\n", ret);
panic();
}
ret = sds_struct_read(MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
ret = sds_struct_read(SDS_SCP_AP_REGION_ID,
MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
MORELLO_SDS_PLATFORM_INFO_OFFSET,
&plat_info,
MORELLO_SDS_PLATFORM_INFO_SIZE,

11
plat/arm/board/morello/morello_image_load.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, Arm Limited. All rights reserved.
* Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -13,6 +13,7 @@
#include "morello_def.h"
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
#include <platform_def.h>
/* In client mode, a part of the DDR memory is reserved for Tag bits.
* Calculate the usable memory size after subtracting the Tag memory.
@ -167,13 +168,14 @@ bl_params_t *plat_get_next_bl_params(void)
struct morello_plat_info plat_info;
struct morello_firmware_version fw_version;
ret = sds_init();
ret = sds_init(SDS_SCP_AP_REGION_ID);
if (ret != SDS_OK) {
ERROR("SDS initialization failed. ret:%d\n", ret);
panic();
}
ret = sds_struct_read(MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
ret = sds_struct_read(SDS_SCP_AP_REGION_ID,
MORELLO_SDS_PLATFORM_INFO_STRUCT_ID,
MORELLO_SDS_PLATFORM_INFO_OFFSET,
&plat_info,
MORELLO_SDS_PLATFORM_INFO_SIZE,
@ -183,7 +185,8 @@ bl_params_t *plat_get_next_bl_params(void)
panic();
}
ret = sds_struct_read(MORELLO_SDS_FIRMWARE_VERSION_STRUCT_ID,
ret = sds_struct_read(SDS_SCP_AP_REGION_ID,
MORELLO_SDS_FIRMWARE_VERSION_STRUCT_ID,
MORELLO_SDS_FIRMWARE_VERSION_OFFSET,
&fw_version,
MORELLO_SDS_FIRMWARE_VERSION_SIZE,

17
plat/arm/board/morello/morello_plat.c

@ -1,12 +1,14 @@
/*
* Copyright (c) 2020-2023, Arm Limited. All rights reserved.
* Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <drivers/arm/css/sds.h>
#include <drivers/arm/sbsa.h>
#include <lib/utils_def.h>
#include <plat/arm/common/plat_arm.h>
#include "morello_def.h"
@ -68,3 +70,16 @@ void plat_arm_secure_wdt_stop(void)
{
sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE);
}
#if CSS_USE_SCMI_SDS_DRIVER
static sds_region_desc_t morello_sds_regions[] = {
{ .base = PLAT_ARM_SDS_MEM_BASE },
};
sds_region_desc_t *plat_sds_get_regions(unsigned int *region_count)
{
*region_count = ARRAY_SIZE(morello_sds_regions);
return morello_sds_regions;
}
#endif /* CSS_USE_SCMI_SDS_DRIVER */

Loading…
Cancel
Save