]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
refactor(rdn2): reduce use of CSS_SGI_PLATFORM_VARIANT build flag
authorTony K Nadackal <tony.nadackal@arm.com>
Sat, 12 Nov 2022 23:21:20 +0000 (23:21 +0000)
committerTony K Nadackal <tony.nadackal@arm.com>
Thu, 12 Jan 2023 17:26:00 +0000 (17:26 +0000)
The core count is one of the significant difference between the various
RD-N2 platform variants. The PLAT_ARM_CLUSTER_COUNT macro defines the
number of core/cluster for a variant. In preparation to add another
variant of RD-N2 platform, replace the use of CSS_SGI_PLATFORM_VARIANT
build flag, where applicable, with the PLAT_ARM_CLUSTER_COUNT macro.
This helps to reduce the changes required to add support for a new
variant.

Signed-off-by: Tony K Nadackal <tony.nadackal@arm.com>
Change-Id: I89b168308d1b5f7edd402205dd25d6c3a355e100

plat/arm/board/rdn2/rdn2_topology.c

index 89300f88224fc37ab1cbea0772630f75a83f68e0..24acc4d8151ccf2980e8ac38b8c00d8cef15448e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020-2021, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2023, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -16,19 +16,22 @@ const unsigned char rd_n2_pd_tree_desc[] = {
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
-#if (CSS_SGI_PLATFORM_VARIANT != 2 || (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 1))
+#if (PLAT_ARM_CLUSTER_COUNT > 4 || \
+       (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 1))
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
 #endif
-#if (CSS_SGI_PLATFORM_VARIANT == 0 || (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 2))
+#if (PLAT_ARM_CLUSTER_COUNT > 8 || \
+       (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 2))
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
 #endif
-#if (CSS_SGI_PLATFORM_VARIANT == 0 || (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 3))
+#if (PLAT_ARM_CLUSTER_COUNT > 8 || \
+       (CSS_SGI_PLATFORM_VARIANT == 2 && CSS_SGI_CHIP_COUNT > 3))
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
        CSS_SGI_MAX_CPUS_PER_CLUSTER,
@@ -83,7 +86,7 @@ const uint32_t plat_css_core_pos_to_scmi_dmn_id_map[] = {
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x5)),
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x6)),
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x7)),
-#if (CSS_SGI_PLATFORM_VARIANT == 0)
+#if (PLAT_ARM_CLUSTER_COUNT > 8)
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x8)),
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x9)),
        (SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xA)),