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: thomas.abraham@arm.com, ard.biesheuvel@arm.com,
	vijayenthiran.subramaniam@arm.com, leif@nuviainc.com,
	Aditya Angadi <aditya.angadi@arm.com>
Subject: [PATCH v5][edk2-platforms 03/17] Platform/ARM/SgiPkg: Let platforms define GIC related PCD values
Date: Tue,  5 May 2020 18:32:00 +0530	[thread overview]
Message-ID: <20200505130214.25592-4-aditya.angadi@arm.com> (raw)
In-Reply-To: <20200505130214.25592-1-aditya.angadi@arm.com>

Newer RD platforms have different base address for GIC redistributors.
The size of the address space that GIC occupies is also different. So
let each platform define the values of GIC related PCDs by moving the
existing PCDs related to GIC distributor and redistributor addresses
from the .dsc.inc include file to platform specific .dsc file.

In addition to this, add a new PCD "PcdGicSize" in ArmSgiTokenSpace to
let each platform define the size of the address space that the GIC
controller occupies.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h                | 7 +------
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf  | 3 ++-
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 8 ++++----
 Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc                | 5 +++++
 Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc                | 5 +++++
 Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc            | 5 +++++
 Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc                    | 6 ++++++
 Platform/ARM/SgiPkg/SgiPlatform.dec                      | 5 ++++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc                  | 4 ----
 9 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index e36a412155ff..d87fb2b5409f 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -45,11 +45,6 @@
 #define SGI_SUBSYS_GENERIC_WDOG_BASE              0x2A440000
 #define SGI_SUBSYS_GENERIC_WDOG_SZ                SIZE_128KB
 
-// Sub System Peripherals - GIC
-#define SGI_SUBSYS_GENERIC_GIC_BASE               0x30000000
-#define SGI_SUBSYS_GENERIC_GICR_BASE              0x300C0000
-#define SGI_SUBSYS_GENERIC_GIC_SZ                 SIZE_1MB
-
 // Expansion AXI - Platform Peripherals - HDLCD1
 #define SGI_EXP_PLAT_PERIPH_HDLCD1_BASE           0x7FF60000
 #define SGI_EXP_PLAT_PERIPH_HDLCD1_SZ             SIZE_64KB
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index 3db70e900d61..a918afef5fba 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -42,6 +42,7 @@ [FixedPcd]
 
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base
   gArmSgiTokenSpaceGuid.PcdDramBlock2Size
+  gArmSgiTokenSpaceGuid.PcdGicSize
 
   gArmTokenSpaceGuid.PcdSystemMemoryBase
   gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
index 845aeaf4dd49..8d0ad4ec9c84 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -93,9 +93,9 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
   // Sub System Peripherals - GIC-600
-  VirtualMemoryTable[++Index].PhysicalBase  = SGI_SUBSYS_GENERIC_GIC_BASE;
-  VirtualMemoryTable[Index].VirtualBase     = SGI_SUBSYS_GENERIC_GIC_BASE;
-  VirtualMemoryTable[Index].Length          = SGI_SUBSYS_GENERIC_GIC_SZ;
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet64(PcdGicDistributorBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet64(PcdGicDistributorBase);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet64(PcdGicSize);
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
   // Expansion AXI - Platform Peripherals - HDLCD1
diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
index e2677ba784ed..acb6b98837e2 100644
--- a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
@@ -35,3 +35,8 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCoreCount|16
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
 
+  # GIC Base Addresses
+  gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000
+  gArmSgiTokenSpaceGuid.PcdGicSize|0x100000
+
diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
index 5af7a2225c05..0737d910f666 100644
--- a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
@@ -35,3 +35,8 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCoreCount|4
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
 
+  # GIC Base Addresses
+  gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000
+  gArmSgiTokenSpaceGuid.PcdGicSize|0x100000
+
diff --git a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
index 33dd4001ad0b..27a7b3a231ba 100644
--- a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
+++ b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
@@ -35,3 +35,8 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCoreCount|4
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
 
+  # GIC Base Addresses
+  gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000
+  gArmSgiTokenSpaceGuid.PcdGicSize|0x100000
+
diff --git a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
index 04c2d5172bc8..90b3fe29b75f 100644
--- a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
+++ b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
@@ -34,3 +34,9 @@ [PcdsFixedAtBuild.common]
   # ARM Cores and Clusters
   gArmPlatformTokenSpaceGuid.PcdCoreCount|4
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
+
+  # GIC Base Addresses
+  gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000
+  gArmSgiTokenSpaceGuid.PcdGicSize|0x100000
+
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 9d70ec677776..4ac3dec91e3d 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -49,5 +49,8 @@ [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x00000000|UINT32|0x00000008
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|0x00000000|UINT32|0x00000009
 
+  # GIC
+  gArmSgiTokenSpaceGuid.PcdGicSize|0|UINT64|0x0000000A
+
 [Ppis]
   gNtFwConfigDtInfoPpiGuid     = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 0418d6b6d50f..ae5ef5a8d2ef 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -109,10 +109,6 @@ [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000
   gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F000000
 
-  # GIC Base Addresses
-  gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000
-  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000
-
   #
   # PCIe
   #
-- 
2.17.1


  parent reply	other threads:[~2020-05-05 13:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 13:01 [PATCH v5][edk2-platforms 00/17] Platform/Arm/Sgi: Add platform support for RD-Daniel Aditya Angadi
2020-05-05 13:01 ` [PATCH v5][edk2-platforms 01/17] Platform/ARM/SgiPkg: Create platform specific dsc files Aditya Angadi
2020-05-05 13:01 ` [PATCH v5][edk2-platforms 02/17] Platform/ARM/SgiPkg: Let platforms define core and cluster count Aditya Angadi
2020-05-05 13:02 ` Aditya Angadi [this message]
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 04/17] Platform/ARM/SgiPkg: Create platform specific fd include file Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 05/17] Platform/ARM/SgiPkg: Let platform specify the ACPI tables to include Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 06/17] Platform/ARM/SgiPkg: Obtain rd-e1-edge platform core count from PCD Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 07/17] Platform/ARM/SgiPkg: Refactor GIC related ACPI helper macros Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 08/17] Platform/ARM/SgiPkg: Update SGI-575 MADT table to ACPI 6.2 Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 09/17] Platform/ARM/SgiPkg: Move common platform description to SSDT Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 10/17] Platform/ARM/SgiPkg: Add helper macros for SRAT table Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 11/17] Platform/ARM/SgiPkg: Add support for remote numa memory nodes Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 12/17] Platform/ARM/SgiPkg: Add SRAT table for RdN1Edge dual-chip platform Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 13/17] Platform/ARM/SgiPkg: Use chip count constant on rdn1edgex2 platform Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 14/17] Platform/ARM/SgiPkg: Add ACPI tables for Rd-Daniel Config-M Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 15/17] Platform/ARM/SgiPkg: Add initial support for RD-Daniel Config-M platform Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 16/17] Platform/ARM/SgiPkg: Add ACPI tables for RD-Daniel Config-XLR Aditya Angadi
2020-05-05 13:02 ` [PATCH v5][edk2-platforms 17/17] Platform/ARM/SgiPkg: Add initial support for RD-Daniel Config-XLR platform Aditya Angadi
2020-05-05 18:18 ` [edk2-devel] [PATCH v5][edk2-platforms 00/17] Platform/Arm/Sgi: Add platform support for RD-Daniel Ard Biesheuvel

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=20200505130214.25592-4-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