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.web09.24738.1611841379981629791 for ; Thu, 28 Jan 2021 05:43:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: vijayenthiran.subramaniam@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 93F4B13A1; Thu, 28 Jan 2021 05:42:59 -0800 (PST) Received: from usa.arm.com (a074939-lin.blr.arm.com [10.162.16.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AB77E3F719; Thu, 28 Jan 2021 05:42:57 -0800 (PST) From: "Vijayenthiran Subramaniam" To: devel@edk2.groups.io, leif@nuviainc.com, ardb+tianocore@kernel.org, sami.mujawar@arm.com Cc: thomas.abraham@arm.com Subject: [edk2-platforms] [PATCH v1 1/3] Platform/ARM/SgiPkg: Add helper macros for HMAT table Date: Thu, 28 Jan 2021 19:12:29 +0530 Message-Id: <1611841351-5039-2-git-send-email-vijayenthiran.subramaniam@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611841351-5039-1-git-send-email-vijayenthiran.subramaniam@arm.com> References: <1611841351-5039-1-git-send-email-vijayenthiran.subramaniam@arm.com> Add helper macros to create Memory Proximity Domain, System Locality Latency and Bandwidth Information, Memory Side Cache Information structures in the HMAT table. Signed-off-by: Vijayenthiran Subramaniam --- Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 110 ++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h index 8d715de173c9..181d9d771d1e 100644 --- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h +++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h @@ -119,4 +119,114 @@ ACPIProcessorUID, Flags, ClockDomain \ } +// +// HMAT related structures +// +// Memory Proximity Domain Attributes Structure +// Refer Section 5.2.27.3 in ACPI Specification, Version 6.3 +#define EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES_INIT( \ + Flags, ProximityDomainForAttachedIntiator, ProximityDomainForMemory) \ + { \ + 0, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES), \ + { \ + Flags, \ + 0 \ + }, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + ProximityDomainForAttachedIntiator, \ + ProximityDomainForMemory, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + } \ + } + +// System Locality Latency and Bandwidth Information Structure +// Refer Section 5.2.27.4 in ACPI Specification, Version 6.3 +#define EFI_ACPI_6_3_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO_INIT( \ + Flags, DataType, NumInitiatorProximityDomains, \ + NumTargetProximityDomains, EntryBaseUnit) \ + { \ + 1, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO) + \ + (4 * NumInitiatorProximityDomains) + (4 * NumTargetProximityDomains) + \ + (2 * NumInitiatorProximityDomains * NumTargetProximityDomains), \ + { \ + Flags, 0 \ + }, \ + DataType, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + NumInitiatorProximityDomains, \ + NumTargetProximityDomains, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + EntryBaseUnit \ + } + +// Memory Side Cache Information Structure +// Refer Section 5.2.27.5 in ACPI Specification, Version 6.3 +#define EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_INIT( \ + MemoryProximityDomain, MemorySideCacheSize, CacheAttributes, \ + NumberOfSmbiosHandles) \ + { \ + 2, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO) + \ + (NumberOfSmbiosHandles * 2), \ + MemoryProximityDomain, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + MemorySideCacheSize, \ + CacheAttributes, \ + { \ + EFI_ACPI_RESERVED_BYTE, \ + EFI_ACPI_RESERVED_BYTE \ + }, \ + NumberOfSmbiosHandles \ + } + #endif /* __SGI_ACPI_HEADER__ */ -- 2.17.1