From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.7115.1588683813701529352 for ; Tue, 05 May 2020 06:03:33 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: aditya.angadi@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6372331B; Tue, 5 May 2020 06:03:33 -0700 (PDT) Received: from usa.arm.com (a073440-lin.blr.arm.com [10.162.16.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 751023F68F; Tue, 5 May 2020 06:03:31 -0700 (PDT) From: "Aditya Angadi" To: devel@edk2.groups.io Cc: thomas.abraham@arm.com, ard.biesheuvel@arm.com, vijayenthiran.subramaniam@arm.com, leif@nuviainc.com, Aditya Angadi 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 Message-Id: <20200505130214.25592-4-aditya.angadi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200505130214.25592-1-aditya.angadi@arm.com> References: <20200505130214.25592-1-aditya.angadi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- 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/Sgi= Pkg/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 =20 -// 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/Pl= atform/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] =20 gArmSgiTokenSpaceGuid.PcdDramBlock2Base gArmSgiTokenSpaceGuid.PcdDramBlock2Size + gArmSgiTokenSpaceGuid.PcdGicSize =20 gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/P= latform/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 =3D ARM_MEMORY_REGION_ATTRIB= UTE_DEVICE; =20 // Sub System Peripherals - GIC-600 - VirtualMemoryTable[++Index].PhysicalBase =3D SGI_SUBSYS_GENERIC_GIC_B= ASE; - VirtualMemoryTable[Index].VirtualBase =3D SGI_SUBSYS_GENERIC_GIC_B= ASE; - VirtualMemoryTable[Index].Length =3D SGI_SUBSYS_GENERIC_GIC_S= Z; + VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64(PcdGicDist= ributorBase); + VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64(PcdGicDist= ributorBase); + VirtualMemoryTable[Index].Length =3D FixedPcdGet64(PcdGicSize= ); VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIB= UTE_DEVICE; =20 // Expansion AXI - Platform Peripherals - HDLCD1 diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc b/Platform/ARM/Sgi= Pkg/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 =20 + # GIC Base Addresses + gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000 + gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 + gArmSgiTokenSpaceGuid.PcdGicSize|0x100000 + diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc b/Platform/ARM/Sgi= Pkg/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 =20 + # 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 =20 + # 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/Sg= iPlatform.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|0x000000= 09 =20 + # GIC + gArmSgiTokenSpaceGuid.PcdGicSize|0|UINT64|0x0000000A + [Ppis] gNtFwConfigDtInfoPpiGuid =3D { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8,= 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } } diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPk= g/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 =20 - # GIC Base Addresses - gArmTokenSpaceGuid.PcdGicDistributorBase|0x30000000 - gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 - # # PCIe # --=20 2.17.1