public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support
@ 2021-04-12 18:33 Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 1/6] Platform/Sgi: include SSDT table for RD-V1 platform Pranav Madhu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

Changes since V2:
- Rebase the patches on top of latest master branch
- Addressed comments from Sami

Changes since V1:
- Rebase the patches on top of latest master branch
- Add three more patches to the series
- Picked up Sami's R-b tags on applicable patches

This patch series contains assorted cleanups for the RD platforms. The
first patch in this series includes the SSDT table for both the RD-V1
single chip and multi-chip platform. The second and third patches in
this series cleanup the ACPI processor ID and MPIDR values for RD-V1 in
multichip configuration. The fourth patch in this series updates the
DSDT/SSDT table revision as per ACPI specification 6.3. The fifth patch
adds PCDs for timer interrupts as interrupt mapping is different RD-N2
platform. And the last patch in this series adds SMMU and timer entries
into memory description table to support Arm SystemReady SR SBSA tests.

Link to github branch with the patches in this series -
https://github.com/Pranav-Madhu/edk2-platforms/tree/topics/rd/rd-cleanup

Pranav Madhu (6):
  Platform/Sgi: include SSDT table for RD-V1 platform
  Platform/Sgi: fix the list of CPU devices on RD-V1-MC platform
  Platform/Sgi: fix CPU acpi-id for RD-V1-MC platform
  Platform/Sgi: update ACPI table revision
  Platform/Sgi: define PCD for timer interrupt numbers
  Platform/Sgi: add SMMU and timer entries to memory description table

 Platform/ARM/SgiPkg/SgiPlatform.dec           | 18 +++++++++++
 Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc      | 10 ++++++
 Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc     | 10 ++++++
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc       | 15 ++++++++-
 .../SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf  |  4 +++
 .../SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf  |  4 +++
 .../AcpiTables/RdN1EdgeX2AcpiTables.inf       |  4 +++
 .../ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf  |  4 +++
 .../ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf  |  5 +++
 .../SgiPkg/AcpiTables/RdV1McAcpiTables.inf    |  5 +++
 .../SgiPkg/AcpiTables/Sgi575AcpiTables.inf    |  4 +++
 .../Library/PlatformLib/PlatformLib.inf       | 11 +++++++
 Platform/ARM/SgiPkg/Include/SgiPlatform.h     |  4 ---
 .../Library/PlatformLib/PlatformLibMem.c      | 32 ++++++++++++++++---
 Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc      |  8 ++---
 .../ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl   |  4 +--
 .../ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl   |  4 +--
 Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl  |  4 +--
 Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl  |  4 +--
 .../ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl     | 10 ++----
 .../ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc    | 24 +++++++-------
 .../ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl     |  4 +--
 Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl       |  4 +--
 Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl    |  4 +--
 24 files changed, 153 insertions(+), 47 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 1/6] Platform/Sgi: include SSDT table for RD-V1 platform
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 2/6] Platform/Sgi: fix the list of CPU devices on RD-V1-MC platform Pranav Madhu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

Ssdt ACPI table in SgiPkg describes the PCIe controller and the root
complex resources. Include this table for RD-V1 and RD-V1-MC platforms.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf   | 1 +
 Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
index a5f936b8a758..583ffac70b71 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
@@ -24,6 +24,7 @@
   RdV1/Dsdt.asl
   RdV1/Madt.aslc
   Spcr.aslc
+  Ssdt.asl
 
 [Packages]
   ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
index 04edfc487738..d0d9473057a9 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
@@ -26,6 +26,7 @@
   RdV1Mc/Madt.aslc
   RdV1Mc/Srat.aslc
   Spcr.aslc
+  Ssdt.asl
 
 [Packages]
   ArmPkg/ArmPkg.dec
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 2/6] Platform/Sgi: fix the list of CPU devices on RD-V1-MC platform
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 1/6] Platform/Sgi: include SSDT table for RD-V1 platform Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 3/6] Platform/Sgi: fix CPU acpi-id for " Pranav Madhu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

RD-V1-MC platform has four CPUs in each of its four coherently connected
chips. So remove a incorrect CPU device entry in DSDT table that lists a
additional non-existent CPU.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
index aef6473857b0..9bf57d05a646 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
@@ -109,11 +109,5 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
       Name (_UID, 15)
       Name (_STA, 0xF)
     }
-
-    Device (CP16) { // Zeus core 16
-      Name (_HID, "ACPI0007")
-      Name (_UID, 16)
-      Name (_STA, 0xF)
-    }
   } // Scope(_SB)
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 3/6] Platform/Sgi: fix CPU acpi-id for RD-V1-MC platform
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 1/6] Platform/Sgi: include SSDT table for RD-V1 platform Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 2/6] Platform/Sgi: fix the list of CPU devices on RD-V1-MC platform Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 4/6] Platform/Sgi: update ACPI table revision Pranav Madhu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

Fix the incorrect ACPI _UID (Unique ID) object for CPU devices listed
for the RD-V1-MC platform.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc
index 0da56ed2a39b..9b3e4f2be370 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Madt.aslc
@@ -69,55 +69,55 @@ STATIC EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
 
     // Chip 1
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core0
-      0, 0, GET_MPID(0x01000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 4, GET_MPID(0x01000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core1
-      0, 1, GET_MPID(0x01000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 5, GET_MPID(0x01000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core2
-      0, 2, GET_MPID(0x01000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 6, GET_MPID(0x01000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core3
-      0, 3, GET_MPID(0x01000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 7, GET_MPID(0x01000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
 
     // Chip 2
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core0
-      0, 0, GET_MPID(0x02000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 8, GET_MPID(0x02000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core1
-      0, 1, GET_MPID(0x02000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 9, GET_MPID(0x02000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core2
-      0, 2, GET_MPID(0x02000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 10, GET_MPID(0x02000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core3
-      0, 3, GET_MPID(0x02000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 11, GET_MPID(0x02000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
 
     // Chip 3
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core0
-      0, 0, GET_MPID(0x03000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 12, GET_MPID(0x03000000ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core1
-      0, 1, GET_MPID(0x03000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 13, GET_MPID(0x03000100ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core2
-      0, 2, GET_MPID(0x03000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 14, GET_MPID(0x03000200ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
     EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core3
-      0, 3, GET_MPID(0x03000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
+      0, 15, GET_MPID(0x03000300ULL, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23,
       FixedPcdGet32 (PcdGicDistributorBase),
       0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */),
   },
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 4/6] Platform/Sgi: update ACPI table revision
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
                   ` (2 preceding siblings ...)
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 3/6] Platform/Sgi: fix CPU acpi-id for " Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 5/6] Platform/Sgi: define PCD for timer interrupt numbers Pranav Madhu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

Fix the ACPI DSDT/SSDT table version numbers. As per ACPI 6.3
specification, the DSDT/SSDT table should use version 2 instead of 1. In
addition to this, update 'PcdAcpiExposedTableVersions' to avoid building
RSDT table into ACPI firmware volume because the platforms supported
under SgiPkg are 64-bit systems only and require only the XSDT table.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc          | 5 ++++-
 Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl     | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl     | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl   | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl   | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl          | 4 ++--
 Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl       | 4 ++--
 9 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index ed7c7d6c4581..12a8f8884c89 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2018-2020, ARM Limited. All rights reserved.
+#  Copyright (c) 2018-2021, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -106,6 +106,9 @@
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000
   gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F000000
 
+  # ACPI Table Version
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
+
   #
   # PCIe
   #
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl
index d66c7cbf4183..04fd3bd0a1f8 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2018-2020, ARM Ltd. All rights reserved.
+*  Copyright (c) 2018-2021, ARM Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
     //
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl
index cb05eed35878..d9bac33898b1 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2018-2020, ARM Ltd. All rights reserved.
+*  Copyright (c) 2018-2021, ARM Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
 
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl
index 8688fd8d6b90..42cb8655b4fb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2020, Arm Ltd. All rights reserved.
+*  Copyright (c) 2020-2021, Arm Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
     Device (CP00) { // Neoverse N2 core 0
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl
index 7cc0614f4d60..f3e31e4085a3 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2020, Arm Ltd. All rights reserved.
+*  Copyright (c) 2020-2021, Arm Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
     Device (CP00) { // Neoverse V1 core 0
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
index 9bf57d05a646..b1e88587080c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2020, Arm Limited. All rights reserved.
+*  Copyright (c) 2020-2021, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
 
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index bf0c964b7ae2..fe0b92137bde 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Differentiated System Description Table Fields (DSDT)
 *
-*  Copyright (c) 2018, ARM Ltd. All rights reserved.
+*  Copyright (c) 2018 - 2021, ARM Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI", EFI_ACPI_ARM_OEM_REVISION) {
+DefinitionBlock("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI", EFI_ACPI_ARM_OEM_REVISION) {
   Scope(_SB) {
 
     Device(CP00) { // A75-0: Cluster 0, Cpu 0
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl b/Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl
index 49c630d53140..f02d5cea8b3c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Secondary System Description Table (SSDT)
 *
-*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*  Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -9,7 +9,7 @@
 
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARMSGI", EFI_ACPI_ARM_OEM_REVISION) {
+DefinitionBlock("SsdtPci.aml", "SSDT", 2, "ARMLTD", "ARMSGI", EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
     // PCI Root Complex
     Device (PCI0) {
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl b/Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl
index 785f426fc29b..6b36da23cf0b 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl
@@ -1,7 +1,7 @@
 /** @file
 *  Secondary System Description Table Fields (SSDT)
 *
-*  Copyright (c) 2020, Arm Ltd. All rights reserved.
+*  Copyright (c) 2020-2021, Arm Ltd. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -10,7 +10,7 @@
 #include "SgiPlatform.h"
 #include "SgiAcpiHeader.h"
 
-DefinitionBlock ("SsdtRosTable.aml", "SSDT", 1, "ARMLTD", "ARMSGI",
+DefinitionBlock ("SsdtRosTable.aml", "SSDT", 2, "ARMLTD", "ARMSGI",
                  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
     // UART PL011
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 5/6] Platform/Sgi: define PCD for timer interrupt numbers
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
                   ` (3 preceding siblings ...)
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 4/6] Platform/Sgi: update ACPI table revision Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 6/6] Platform/Sgi: add SMMU and timer entries to memory description table Pranav Madhu
  2021-04-13  9:17 ` [edk2-devel] [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Sami Mujawar
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

The generic timer and watchdog timer interrupt numbers on the RD-N2
platform is different than those on the other platforms supported by
SgiPkg. So in order to reuse the existing GTDT ACPI table for all the
supported platforms including RD-N2, introduce and use PCD to provide
the interrupt numbers for watchdog and generic timers.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/SgiPlatform.dec                     | 6 ++++++
 Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc                | 6 ++++++
 Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc               | 6 ++++++
 Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf   | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf   | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf       | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf       | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf     | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf     | 4 ++++
 Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc                | 8 ++++----
 11 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 3f0d38a013f2..86ead241a67c 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -57,5 +57,11 @@
   gArmSgiTokenSpaceGuid.PcdSysPeriphBase|0x00000000|UINT64|0x0000000E
   gArmSgiTokenSpaceGuid.PcdSysPeriphSysRegBase|0x0|UINT64|0x0000000F
 
+  # Timer & Watchdog interrupts
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|0|UINT32|0x00000011
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|0|UINT32|0x00000012
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|0|UINT32|0x00000013
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|0|UINT32|0x00000014
+
 [Ppis]
   gNtFwConfigDtInfoPpiGuid     = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
index e423a6b50c91..efbb013b0b60 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
@@ -44,3 +44,9 @@
   gArmTokenSpaceGuid.PcdPciMmio64Base|0x5000000000
   gArmTokenSpaceGuid.PcdPciMmio64Size|0x3000000000
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x60000000
+
+  # Timer & Watchdog interrupts
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|92
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|91
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|93
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|94
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
index 41291eddfe74..1167f1a6ff9d 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
@@ -44,3 +44,9 @@
   gArmTokenSpaceGuid.PcdPciMmio64Base|0x4000000000
   gArmTokenSpaceGuid.PcdPciMmio64Size|0x4000000000
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x1010000000
+
+  # Timer & Watchdog interrupts
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|109
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|108
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|110
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|111
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index 7ebd70b197a6..2dd2275665a2 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -50,11 +50,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index 2d4354f33018..22e33239070b 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -50,11 +50,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index db168c518e21..76886d1c6a17 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -59,11 +59,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 63fc249bb77b..2ec3e42473a9 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -50,11 +50,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
index 583ffac70b71..a21dcfafef1a 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
@@ -50,11 +50,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
index d0d9473057a9..c49546ec0b27 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
@@ -59,11 +59,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 466e0fb658eb..2121fd39f2f0 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -49,11 +49,15 @@
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
   gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize
   gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc b/Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc
index a8b587ba881d..b53cbb228f92 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc
@@ -23,11 +23,11 @@
 #define SGI_GT_BLOCK_CTL_BASE             0x2A810000
 #define SGI_GT_BLOCK_FRAME1_CTL_BASE      0x2A820000
 #define SGI_GT_BLOCK_FRAME1_CTL_EL0_BASE  0xFFFFFFFFFFFFFFFF
-#define SGI_GT_BLOCK_FRAME1_GSIV          0x5B
+#define SGI_GT_BLOCK_FRAME1_GSIV          FixedPcdGet32 (PcdGtFrame1Gsiv)
 
 #define SGI_GT_BLOCK_FRAME0_CTL_BASE      0x2A830000
 #define SGI_GT_BLOCK_FRAME0_CTL_EL0_BASE  0xFFFFFFFFFFFFFFFF
-#define SGI_GT_BLOCK_FRAME0_GSIV          0x5C
+#define SGI_GT_BLOCK_FRAME0_GSIV          FixedPcdGet32 (PcdGtFrame0Gsiv)
 
 #define SGI_GTX_TIMER_FLAGS               0
 #define GTX_TIMER_SECURE                  EFI_ACPI_6_2_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER
@@ -127,13 +127,13 @@ STATIC EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
     EFI_ACPI_6_2_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT (
       FixedPcdGet32 (PcdGenericWatchdogRefreshBase),
       FixedPcdGet32 (PcdGenericWatchdogControlBase),
-      93,
+      FixedPcdGet32 (PcdWdogWS0Gsiv),
       0
     ),
     EFI_ACPI_6_2_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT (
       FixedPcdGet32 (PcdGenericWatchdogRefreshBase),
       FixedPcdGet32 (PcdGenericWatchdogControlBase),
-      94,
+      FixedPcdGet32 (PcdWdogWS1Gsiv),
       EFI_ACPI_6_2_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER
     )
   }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [edk2-platforms][PATCH V3 6/6] Platform/Sgi: add SMMU and timer entries to memory description table
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
                   ` (4 preceding siblings ...)
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 5/6] Platform/Sgi: define PCD for timer interrupt numbers Pranav Madhu
@ 2021-04-12 18:33 ` Pranav Madhu
  2021-04-13  9:17 ` [edk2-devel] [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Sami Mujawar
  6 siblings, 0 replies; 8+ messages in thread
From: Pranav Madhu @ 2021-04-12 18:33 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Samer El-Haj-Mahmoud, Sami Mujawar

Add PCDs for base address and address space size for generic timer and
SMMU controllers. Use those PCDs to add platform memory map entries. The
ServerReady SBSA tests, when executed, accesses these controllers and so
the memory mapping for generic timer and SMMU controllers are required.

In addition to this, PCDs for watchdog timer controller base address and
size are introduced instead of using macros for the same. This allows
the base address and address space size for watchdog timer controller to
be specified by platform description files.

Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/SgiPkg/SgiPlatform.dec                      | 14 ++++++++-
 Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc                 |  4 +++
 Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc                |  4 +++
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc                  | 10 ++++++
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf  | 11 +++++++
 Platform/ARM/SgiPkg/Include/SgiPlatform.h                |  4 ---
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 32 +++++++++++++++++---
 7 files changed, 70 insertions(+), 9 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 86ead241a67c..3effd49592ea 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -57,11 +57,23 @@
   gArmSgiTokenSpaceGuid.PcdSysPeriphBase|0x00000000|UINT64|0x0000000E
   gArmSgiTokenSpaceGuid.PcdSysPeriphSysRegBase|0x0|UINT64|0x0000000F
 
-  # Timer & Watchdog interrupts
+  # Counter, Timer and Watchdog
   gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|0|UINT32|0x00000011
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|0|UINT32|0x00000012
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Base|0|UINT32|0x00000015
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Size|0|UINT32|0x00000016
+  gArmSgiTokenSpaceGuid.PcdTimerControlBase|0|UINT32|0x00000017
+  gArmSgiTokenSpaceGuid.PcdTimerControlSize|0|UINT32|0x00000018
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase|0|UINT32|0x00000019
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize|0|UINT32|0x0000001A
+  gArmSgiTokenSpaceGuid.PcdWdogBase|0|UINT32|0x0000001B
+  gArmSgiTokenSpaceGuid.PcdWdogSize|0|UINT32|0x0000001C
   gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|0|UINT32|0x00000013
   gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|0|UINT32|0x00000014
 
+  # SMMU
+  gArmSgiTokenSpaceGuid.PcdSmmuBase|0|UINT32|0x0000001D
+  gArmSgiTokenSpaceGuid.PcdSmmuSize|0|UINT32|0x0000001E
+
 [Ppis]
   gNtFwConfigDtInfoPpiGuid     = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
index efbb013b0b60..d3d650323891 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
@@ -50,3 +50,7 @@
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|91
   gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|93
   gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|94
+
+  # SMMU
+  gArmSgiTokenSpaceGuid.PcdSmmuBase|0x4F000000
+  gArmSgiTokenSpaceGuid.PcdSmmuSize|0x01000000
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
index 1167f1a6ff9d..c593156e17be 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
@@ -50,3 +50,7 @@
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|108
   gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|110
   gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|111
+
+  # SMMU
+  gArmSgiTokenSpaceGuid.PcdSmmuBase|0x40000000
+  gArmSgiTokenSpaceGuid.PcdSmmuSize|0x10000000
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 12a8f8884c89..42e3600d15f4 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -152,6 +152,16 @@
   # Ethernet / Virtio Network
   gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x10000
 
+  # Counter, Timer and Watchdog
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Base|0x2A830000
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Size|0x00010000
+  gArmSgiTokenSpaceGuid.PcdTimerControlBase|0x2A810000
+  gArmSgiTokenSpaceGuid.PcdTimerControlSize|0x00010000
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase|0x2A800000
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize|0x00010000
+  gArmSgiTokenSpaceGuid.PcdWdogBase|0x2A440000
+  gArmSgiTokenSpaceGuid.PcdWdogSize|0x00020000
+
   #
   # Set the base address and size of the buffer used
   # for communication between the Normal world edk2
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index 333247d0d808..22e247ea4fae 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -64,9 +64,20 @@
 
   gArmTokenSpaceGuid.PcdMmBufferBase
   gArmTokenSpaceGuid.PcdMmBufferSize
+
   gArmSgiTokenSpaceGuid.PcdSmcCs0Base
   gArmSgiTokenSpaceGuid.PcdSmcCs1Base
+  gArmSgiTokenSpaceGuid.PcdSmmuBase
+  gArmSgiTokenSpaceGuid.PcdSmmuSize
   gArmSgiTokenSpaceGuid.PcdSysPeriphBase
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Base
+  gArmSgiTokenSpaceGuid.PcdTimerBase0Size
+  gArmSgiTokenSpaceGuid.PcdTimerControlBase
+  gArmSgiTokenSpaceGuid.PcdTimerControlSize
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadBase
+  gArmSgiTokenSpaceGuid.PcdTimerCounterReadSize
+  gArmSgiTokenSpaceGuid.PcdWdogBase
+  gArmSgiTokenSpaceGuid.PcdWdogSize
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index d6ab585cce80..818879b5f81e 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -21,10 +21,6 @@
 #define SGI_SUBSYS_UART1_BASE                     0x2A410000
 #define SGI_SUBSYS_UART1_SZ                       0x00010000
 
-// Sub System Peripherals - Generic Watchdog
-#define SGI_SUBSYS_GENERIC_WDOG_BASE              0x2A440000
-#define SGI_SUBSYS_GENERIC_WDOG_SZ                SIZE_128KB
-
 // Register offsets into the System Registers Block
 #define SGI_SYSPH_SYS_REG_FLASH                   0x4C
 #define SGI_SYSPH_SYS_REG_FLASH_RWEN              0x1
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
index 9bdc63b9e3d4..8139b75d8ee4 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
@@ -17,7 +17,7 @@
 
 // Total number of descriptors, including the final "end-of-table" descriptor.
 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS                 \
-          (10 + (FixedPcdGet32 (PcdChipCount) * 2))
+          (14 + (FixedPcdGet32 (PcdChipCount) * 2))
 
 /**
   Returns the Virtual Memory Map of the platform.
@@ -124,9 +124,9 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
   // Sub System Peripherals - Generic Watchdog
-  VirtualMemoryTable[++Index].PhysicalBase  = SGI_SUBSYS_GENERIC_WDOG_BASE;
-  VirtualMemoryTable[Index].VirtualBase     = SGI_SUBSYS_GENERIC_WDOG_BASE;
-  VirtualMemoryTable[Index].Length          = SGI_SUBSYS_GENERIC_WDOG_SZ;
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdWdogBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdWdogBase);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet32 (PcdWdogSize);
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
   // Sub System Peripherals - GIC-600
@@ -135,6 +135,30 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Length          = FixedPcdGet64(PcdGicSize);
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
+  // Sub System Peripherals - Counter
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdTimerCounterReadBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdTimerCounterReadBase);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet32 (PcdTimerCounterReadSize);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+  // Sub System Peripherals - Timer Control
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdTimerControlBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdTimerControlBase);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet32 (PcdTimerControlSize);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+  // Sub System Peripherals - Timer Base0
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdTimerBase0Base);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdTimerBase0Base);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet32 (PcdTimerBase0Size);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
+  // Sub System Peripherals - SMMU
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdSmmuBase);
+  VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdSmmuBase);
+  VirtualMemoryTable[Index].Length          = FixedPcdGet32 (PcdSmmuSize);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+
   // Expansion AXI - Platform Peripherals - HDLCD1
   VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdArmHdLcdBase);
   VirtualMemoryTable[Index].VirtualBase     = FixedPcdGet32 (PcdArmHdLcdBase);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support
  2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
                   ` (5 preceding siblings ...)
  2021-04-12 18:33 ` [edk2-platforms][PATCH V3 6/6] Platform/Sgi: add SMMU and timer entries to memory description table Pranav Madhu
@ 2021-04-13  9:17 ` Sami Mujawar
  6 siblings, 0 replies; 8+ messages in thread
From: Sami Mujawar @ 2021-04-13  9:17 UTC (permalink / raw)
  To: Pranav Madhu, devel

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

Pushed as 7327e605d2e8..7545558886de

Thanks.

Regards,

Sami Mujawar

[-- Attachment #2: Type: text/html, Size: 101 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-13  9:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-12 18:33 [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 1/6] Platform/Sgi: include SSDT table for RD-V1 platform Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 2/6] Platform/Sgi: fix the list of CPU devices on RD-V1-MC platform Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 3/6] Platform/Sgi: fix CPU acpi-id for " Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 4/6] Platform/Sgi: update ACPI table revision Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 5/6] Platform/Sgi: define PCD for timer interrupt numbers Pranav Madhu
2021-04-12 18:33 ` [edk2-platforms][PATCH V3 6/6] Platform/Sgi: add SMMU and timer entries to memory description table Pranav Madhu
2021-04-13  9:17 ` [edk2-devel] [edk2-platforms][PATCH V3 0/6] Platform/Sgi: improvements in RD platform support Sami Mujawar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox