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.web12.7224.1588683835482520800 for ; Tue, 05 May 2020 06:03:55 -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 35A2D30E; Tue, 5 May 2020 06:03:55 -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 47B5B3F68F; Tue, 5 May 2020 06:03:53 -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 12/17] Platform/ARM/SgiPkg: Add SRAT table for RdN1Edge dual-chip platform Date: Tue, 5 May 2020 18:32:09 +0530 Message-Id: <20200505130214.25592-13-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 From: Vijayenthiran Subramaniam 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 --- 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/Platfo= rm/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 +#include +#include + +// +// 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 =3D { + // 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 =3D &Srat; diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Pl= atform/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 =20 @@ -39,6 +40,11 @@ [FixedPcd] gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase gArmPlatformTokenSpaceGuid.PL011UartInterrupt =20 + gArmTokenSpaceGuid.PcdSystemMemoryBase + gArmTokenSpaceGuid.PcdSystemMemorySize + gArmSgiTokenSpaceGuid.PcdDramBlock2Base + gArmSgiTokenSpaceGuid.PcdDramBlock2Size + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum gArmTokenSpaceGuid.PcdArmArchTimerIntrNum gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum --=20 2.17.1