public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Aditya Angadi" <aditya.angadi@arm.com>
To: devel@edk2.groups.io
Cc: leif@nuviainc.com, michael.d.kinney@intel.com,
	vijayenthiran.subramaniam@arm.com, thomas.abraham@arm.com
Subject: [edk2-platforms][PATCH 4/8] Platform/ARM/SgiPkg: remove PcdCoreCount and PcdClusterCount
Date: Thu, 12 Mar 2020 20:05:16 +0530	[thread overview]
Message-ID: <20200312143520.16918-5-aditya.angadi@arm.com> (raw)
In-Reply-To: <20200312143520.16918-1-aditya.angadi@arm.com>

The number of CPUs depend on the SGI/RD platform. So instead of
defining a Fixed PCD to specify the value of core and cluster count,
let each platform define these values.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc    |  7 ++++++-
 .../ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf     |  2 --
 Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc    |  7 ++++---
 .../ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf     |  2 --
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc  | 12 ++++++------
 .../ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf   |  2 --
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc      |  9 +++++----
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf  |  4 +---
 .../ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf   |  3 ---
 Platform/ARM/SgiPkg/SgiPlatform.dsc                  |  4 ----
 10 files changed, 22 insertions(+), 30 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
index 9872549285..a9540f2e03 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Madt.aslc
@@ -14,12 +14,17 @@
 #include <Library/PcdLib.h>
 #include <IndustryStandard/Acpi.h>
 
+#define CLUSTER_COUNT                 2
+#define CORES_PER_CLUSTER             8
+#define THREADS_PER_CORE              2
+#define CORE_COUNT                    (CLUSTER_COUNT * CORES_PER_CLUSTER * THREADS_PER_CORE)
+
 // Multiple APIC Description Table
 #pragma pack (1)
 
 typedef struct {
   EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
-  EFI_ACPI_6_2_GIC_STRUCTURE                            GicInterfaces[32];
+  EFI_ACPI_6_2_GIC_STRUCTURE                            GicInterfaces[CORE_COUNT];
   EFI_ACPI_6_2_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
   EFI_ACPI_6_2_GICR_STRUCTURE                           GicRedistributor;
   EFI_ACPI_6_2_GIC_ITS_STRUCTURE                        GicIts;
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index b08d7c2df5..742ca9e683 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -34,8 +34,6 @@
   Platform/ARM/SgiPkg/SgiPlatform.dec
 
 [FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
index 05eb78c561..d8ec0ce421 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Madt.aslc
@@ -14,15 +14,16 @@
 #include <Library/PcdLib.h>
 #include <IndustryStandard/Acpi.h>
 
-#define CORE_CNT   (FixedPcdGet32 (PcdClusterCount) * \
-                    FixedPcdGet32 (PcdCoreCount))
+#define CLUSTER_COUNT                 2
+#define CORES_PER_CLUSTER             4
+#define CORE_COUNT                    (CLUSTER_COUNT * CORES_PER_CLUSTER)
 
 // Multiple APIC Description Table
 #pragma pack (1)
 
 typedef struct {
   EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
-  EFI_ACPI_6_2_GIC_STRUCTURE                            GicInterfaces[CORE_CNT];
+  EFI_ACPI_6_2_GIC_STRUCTURE                            GicInterfaces[CORE_COUNT];
   EFI_ACPI_6_2_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
   EFI_ACPI_6_2_GICR_STRUCTURE                           GicRedistributor;
   EFI_ACPI_6_2_GIC_ITS_STRUCTURE                        GicIts;
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index 61b07bffcc..206479f942 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -34,8 +34,6 @@
   Platform/ARM/SgiPkg/SgiPlatform.dec
 
 [FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
index 47368931e3..add9724374 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Madt.aslc
@@ -14,19 +14,19 @@
 #include <Library/PcdLib.h>
 #include <IndustryStandard/Acpi.h>
 
-#define CORE_CNT   (FixedPcdGet32 (PcdClusterCount) * \
-                    FixedPcdGet32 (PcdCoreCount))
-
-#define CHIP_CNT   2
+#define CLUSTER_COUNT                 2
+#define CORES_PER_CLUSTER             4
+#define CORE_COUNT                    (CLUSTER_COUNT * CORES_PER_CLUSTER)
+#define CHIP_COUNT   2
 
 // Multiple APIC Description Table
 #pragma pack (1)
 
 typedef struct {
   EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER  Header;
-  EFI_ACPI_6_2_GIC_STRUCTURE                           GicInterfaces[CORE_CNT * CHIP_CNT];
+  EFI_ACPI_6_2_GIC_STRUCTURE                           GicInterfaces[CORE_COUNT * CHIP_COUNT];
   EFI_ACPI_6_2_GIC_DISTRIBUTOR_STRUCTURE               GicDistributor;
-  EFI_ACPI_6_2_GICR_STRUCTURE                          GicRedistributor[CHIP_CNT];
+  EFI_ACPI_6_2_GICR_STRUCTURE                          GicRedistributor[CHIP_COUNT];
 } EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE;
 
 #pragma pack ()
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index a4d5904f67..8aec5e094e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -34,8 +34,6 @@
   Platform/ARM/SgiPkg/SgiPlatform.dec
 
 [FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
index dedabaaecd..ca25924778 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc
@@ -1,7 +1,7 @@
 /** @file
 *  Multiple APIC Description Table (MADT)
 *
-*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -14,8 +14,9 @@
 #include <Library/PcdLib.h>
 #include <IndustryStandard/Acpi.h>
 
-#define CORES   (FixedPcdGet32 (PcdClusterCount) * \
-                 FixedPcdGet32 (PcdCoreCount))
+#define CLUSTER_COUNT                     2
+#define CORES_PER_CLUSTER                 4
+#define CORE_COUNT                        (CLUSTER_COUNT * CORES_PER_CLUSTER)
 
 // EFI_ACPI_6_1_GIC_STRUCTURE
 #define EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags,      \
@@ -90,7 +91,7 @@
 
 typedef struct {
   EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
-  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[CORES];
+  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[CORE_COUNT];
   EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
   EFI_ACPI_6_1_GICR_STRUCTURE                           GicRedistributor;
   EFI_ACPI_6_1_GIC_ITS_STRUCTURE                        GicIts;
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 097ef854df..df390c1526 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -1,7 +1,7 @@
 ## @file
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2018, ARM Ltd. All rights reserved.
+#  Copyright (c) 2018-2020, ARM Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -33,8 +33,6 @@
   Platform/ARM/SgiPkg/SgiPlatform.dec
 
 [FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index a918afef5f..fe96f5385d 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -37,9 +37,6 @@
   AArch64/Helper.S | GCC
 
 [FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base
   gArmSgiTokenSpaceGuid.PcdDramBlock2Size
   gArmSgiTokenSpaceGuid.PcdGicSize
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 4e1fcefb14..7b95acb9db 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -156,10 +156,6 @@
   gEmbeddedTokenSpaceGuid.PcdMetronomeTickPeriod|1000
   gEmbeddedTokenSpaceGuid.PcdTimerPeriod|1000
 
-  # ARM Cores and Clusters
-  gArmPlatformTokenSpaceGuid.PcdCoreCount|4
-  gArmPlatformTokenSpaceGuid.PcdClusterCount|2
-
   # Virtio Disk
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c130000
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x10000
-- 
2.17.1


  parent reply	other threads:[~2020-03-12 14:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 14:35 [edk2-platforms][PATCH 0/8] Add platform support for RD-Daniel Aditya Angadi
2020-03-12 14:35 ` [edk2-platforms][PATCH 1/8] Platform/ARM/SgiPkg: Create individual Platform Description File Aditya Angadi
2020-03-16 17:15   ` [edk2-devel] " Thomas Abraham
2020-03-19 19:16   ` Leif Lindholm
2020-03-12 14:35 ` [edk2-platforms][PATCH 2/8] Platform/ARM/SgiPkg: move the GIC related ACPI helper macros Aditya Angadi
2020-03-16 17:17   ` [edk2-devel] " Thomas Abraham
2020-03-12 14:35 ` [edk2-platforms][PATCH 3/8] Platform/ARM/SgiPkg: move common platform description to SSDT Aditya Angadi
2020-03-16 17:21   ` [edk2-devel] " Thomas Abraham
2020-03-12 14:35 ` Aditya Angadi [this message]
2020-03-16 17:23   ` [edk2-devel] [edk2-platforms][PATCH 4/8] Platform/ARM/SgiPkg: remove PcdCoreCount and PcdClusterCount Thomas Abraham
2020-03-12 14:35 ` [edk2-platforms][PATCH 5/8] Platform/ARM/SgiPkg: Add ACPI tables for Rd-Daniel Config-M Aditya Angadi
2020-03-12 14:35 ` [edk2-platforms][PATCH 6/8] Platform/ARM/Sgi: Add initial support for RD-Daniel Config-M platform Aditya Angadi
2020-03-16 17:29   ` [edk2-devel] " Thomas Abraham
2020-03-12 14:35 ` [edk2-platforms][PATCH 7/8] Platform/ARM/SgiPkg: add ACPI tables for RD-Daniel Config-XLR Aditya Angadi
2020-03-16 17:31   ` [edk2-devel] " Thomas Abraham
2020-03-12 14:35 ` [edk2-platforms][PATCH 8/8] Platform/ARM/Sgi: Add initial support for RD-Daniel Config-XLR platform Aditya Angadi
2020-03-16 17:32   ` [edk2-devel] " Thomas Abraham
  -- strict thread matches above, loose matches on Subject: below --
2020-03-12 12:43 [edk2-platforms][PATCH 0/8] Add platform support for RD-Daniel aditya.angadi
2020-03-12 12:43 ` [edk2-platforms][PATCH 4/8] Platform/ARM/SgiPkg: remove PcdCoreCount and PcdClusterCount Aditya Angadi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312143520.16918-5-aditya.angadi@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox