aboutsummaryrefslogtreecommitdiff
path: root/product/sgi575
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2018-07-20 16:54:14 +0530
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2018-10-18 17:22:34 +0000
commit176d155fb99b35a223bd4a1ad3b434e73e530b92 (patch)
tree9d9770aec60031d398d7924a382e0dd156ff6a3c /product/sgi575
parent243c58a267cb61d4048b5fafe3550677598a6e6b (diff)
sgi575/src: Add core support functions
Change-Id: I2f4578450a838efaa5149460220a5976f174ede7 Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'product/sgi575')
-rw-r--r--product/sgi575/include/sgi575_core.h15
-rw-r--r--product/sgi575/src/sgi575_core.c31
2 files changed, 46 insertions, 0 deletions
diff --git a/product/sgi575/include/sgi575_core.h b/product/sgi575/include/sgi575_core.h
new file mode 100644
index 00000000..616dbd33
--- /dev/null
+++ b/product/sgi575/include/sgi575_core.h
@@ -0,0 +1,15 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef SGI575_CORE_H
+#define SGI575_CORE_H
+
+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);
+
+#endif /* SGI575_CORE_H */
diff --git a/product/sgi575/src/sgi575_core.c b/product/sgi575/src/sgi575_core.c
new file mode 100644
index 00000000..c1760923
--- /dev/null
+++ b/product/sgi575/src/sgi575_core.c
@@ -0,0 +1,31 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_assert.h>
+#include <sgi575_core.h>
+
+/* 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;
+}