diff --git a/product/sgi575/include/sgi575_core.h b/product/sgi575/include/sgi575_core.h index 2a61dcf927409fb9bc1252cbfc1cc074b4e33009..afe2ae090295562b326d70fcad298f0df362501e 100644 --- a/product/sgi575/include/sgi575_core.h +++ b/product/sgi575/include/sgi575_core.h @@ -8,11 +8,29 @@ #ifndef SGI575_CORE_H #define SGI575_CORE_H -#define SGI575_CORE_PER_CLUSTER0_MAX 4 -#define SGI575_CORE_PER_CLUSTER1_MAX 4 +#include -unsigned int sgi575_core_get_core_per_cluster_count(unsigned int cluster); -unsigned int sgi575_core_get_core_count(void); -unsigned int sgi575_core_get_cluster_count(void); +/* SGI575 only has one configuration, hence the constant values */ + +#define SGI575_CLUSTERS_MAX 2 +#define SGI575_CORES_PER_CLUSTER_MAX 4 + +static inline unsigned int sgi575_core_get_cluster_count(void) +{ + return SGI575_CLUSTERS_MAX; +} + +static inline unsigned int sgi575_core_get_core_per_cluster_count( + unsigned int cluster) +{ + fwk_assert(cluster < sgi575_core_get_cluster_count()); + + return SGI575_CORES_PER_CLUSTER_MAX; +} + +static inline unsigned int sgi575_core_get_core_count(void) +{ + return SGI575_CLUSTERS_MAX * SGI575_CORES_PER_CLUSTER_MAX; +} #endif /* SGI575_CORE_H */ diff --git a/product/sgi575/scp_ramfw/config_scmi_apcore.c b/product/sgi575/scp_ramfw/config_scmi_apcore.c index 62883dfdf2422da223505b5dbf13d0174814cdc3..072ae4253926865645df01465312b52bfd428bed 100644 --- a/product/sgi575/scp_ramfw/config_scmi_apcore.c +++ b/product/sgi575/scp_ramfw/config_scmi_apcore.c @@ -18,7 +18,7 @@ static const struct mod_scmi_apcore_reset_register_group .base_register = (uintptr_t)&PIK_CLUSTER(0)->STATIC_CONFIG[0].RVBARADDR_LW, .register_count = - (SGI575_CORE_PER_CLUSTER0_MAX + SGI575_CORE_PER_CLUSTER1_MAX), + (SGI575_CORES_PER_CLUSTER_MAX * SGI575_CLUSTERS_MAX), }, }; diff --git a/product/sgi575/scp_ramfw/firmware.mk b/product/sgi575/scp_ramfw/firmware.mk index a094b90a9333978612cd29fd396745d2561561d5..ebc4b668a033ff409fb0f944cf2d14392fcb7c0c 100644 --- a/product/sgi575/scp_ramfw/firmware.mk +++ b/product/sgi575/scp_ramfw/firmware.mk @@ -46,7 +46,6 @@ BS_FIRMWARE_MODULES := \ BS_FIRMWARE_SOURCES := \ rtx_config.c \ - sgi575_core.c \ config_armv7m_mpu.c \ config_log.c \ config_cmn600.c \ diff --git a/product/sgi575/src/sgi575_core.c b/product/sgi575/src/sgi575_core.c deleted file mode 100644 index c1760923fed9f548cc6b68a6310983c584dded5f..0000000000000000000000000000000000000000 --- a/product/sgi575/src/sgi575_core.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Arm SCP/MCP Software - * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include - -/* SGI575 only has one configuration, hence the constant values */ - -#define CORES_PER_CLUSTER 4 -#define NUMBER_OF_CLUSTERS 2 - -unsigned int sgi575_core_get_core_per_cluster_count(unsigned int cluster) -{ - assert(cluster < sgi575_core_get_cluster_count()); - - return CORES_PER_CLUSTER; -} - -unsigned int sgi575_core_get_core_count(void) -{ - return NUMBER_OF_CLUSTERS * CORES_PER_CLUSTER; -} - -unsigned int sgi575_core_get_cluster_count(void) -{ - return NUMBER_OF_CLUSTERS; -}