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 12/17] Platform/ARM/SgiPkg: Add SRAT table for RdN1Edge dual-chip platform
Date: Tue,  5 May 2020 18:32:09 +0530	[thread overview]
Message-ID: <20200505130214.25592-13-aditya.angadi@arm.com> (raw)
In-Reply-To: <20200505130214.25592-1-aditya.angadi@arm.com>

From: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>

The RD-N1-Edge dual chip platform has an additional 8GB of memory
connected to the second chip. Add the SRAT ACPI table to describe
the proximity domain, base address and size of this memory.

Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
---
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Srat.aslc     | 95 ++++++++++++++++++++
 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf |  6 ++
 2 files changed, 101 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Srat.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Srat.aslc
new file mode 100644
index 000000000000..361db7506845
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Srat.aslc
@@ -0,0 +1,95 @@
+/** @file
+*  Static Resource Affinity Table (SRAT)
+*
+*  Copyright (c) 2020, ARM Limited. All rights reserved.
+*
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+**/
+
+#include "SgiAcpiHeader.h"
+#include "SgiPlatform.h"
+#include <IndustryStandard/Acpi.h>
+#include <Library/AcpiLib.h>
+#include <Library/ArmLib.h>
+
+//
+// Static Resource Affinity Table
+//
+#pragma pack (1)
+
+typedef struct {
+  EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER  Header;
+  EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE              Memory[4];
+  EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE                Gicc[16];
+} EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE;
+
+#pragma pack ()
+
+EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE Srat = {
+  // Header
+  {
+    ARM_ACPI_HEADER (
+      EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE,
+      EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE,
+      EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION
+    ),
+    0x00000001,
+    EFI_ACPI_RESERVED_QWORD
+  },
+  // Memory Affinity
+  {
+    // Chip 0 (2GB and 6GB)
+    EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE_INIT (
+      0x0, FixedPcdGet64 (PcdSystemMemoryBase),
+      FixedPcdGet64 (PcdSystemMemorySize), 0x00000001),
+    EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE_INIT (
+      0x0, FixedPcdGet64 (PcdDramBlock2Base),
+      FixedPcdGet64 (PcdDramBlock2Size), 0x00000001),
+
+    // Chip 1 (2GB and 6GB)
+    EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE_INIT (
+      0x1, SYSTEM_MEMORY_BASE_REMOTE(1),
+      FixedPcdGet64 (PcdSystemMemorySize), 0x00000001),
+    EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE_INIT (
+      0x1, DRAM_BLOCK2_BASE_REMOTE(1),
+      FixedPcdGet64 (PcdDramBlock2Size), 0x00000001),
+  },
+  // Processor Affinity
+  {
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000000, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000001, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000002, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000003, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000004, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000005, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000006, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x0, 0x00000007, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x00000008, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x00000009, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000A, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000B, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000C, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000D, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000E, 0x00000001, 0x00000000),
+    EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE_INIT (
+      0x1, 0x0000000F, 0x00000001, 0x00000000),
+  },
+};
+
+VOID* CONST ReferenceAcpiTable = &Srat;
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index 75f8e6dd6685..974d9db5438e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -23,6 +23,7 @@ [Sources]
   Mcfg.aslc
   RdN1Edge/Dsdt.asl
   RdN1EdgeX2/Madt.aslc
+  RdN1EdgeX2/Srat.aslc
   Spcr.aslc
   Ssdt.asl
 
@@ -39,6 +40,11 @@ [FixedPcd]
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
+  gArmTokenSpaceGuid.PcdSystemMemoryBase
+  gArmTokenSpaceGuid.PcdSystemMemorySize
+  gArmSgiTokenSpaceGuid.PcdDramBlock2Base
+  gArmSgiTokenSpaceGuid.PcdDramBlock2Size
+
   gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
   gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
   gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
-- 
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 ` [PATCH v5][edk2-platforms 03/17] Platform/ARM/SgiPkg: Let platforms define GIC related PCD values Aditya Angadi
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 ` Aditya Angadi [this message]
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-13-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