public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Vijayenthiran Subramaniam" <vijayenthiran.subramaniam@arm.com>
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	[thread overview]
Message-ID: <1611841351-5039-2-git-send-email-vijayenthiran.subramaniam@arm.com> (raw)
In-Reply-To: <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 <vijayenthiran.subramaniam@arm.com>
---
 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


  reply	other threads:[~2021-01-28 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 13:42 [edk2-platforms] [PATCH v1 0/3] Add HMAT tables for RD multi-chip platforms Vijayenthiran Subramaniam
2021-01-28 13:42 ` Vijayenthiran Subramaniam [this message]
2021-01-28 13:42 ` [edk2-platforms] [PATCH v1 2/3] Platform/ARM/SgiPkg: Add HMAT ACPI table for RdN1EdgeX2 Vijayenthiran Subramaniam
2021-01-28 15:58   ` [edk2-devel] " Jonathan Cameron
     [not found]   ` <165E70A6BEEFF3E5.24597@groups.io>
2021-01-29  9:49     ` Jonathan Cameron
2021-01-29 17:11       ` Vijayenthiran Subramaniam
2021-02-01 11:16         ` Jonathan Cameron
2021-02-01 12:53           ` Vijayenthiran Subramaniam
2021-02-12 17:28   ` Sami Mujawar
2021-01-28 13:42 ` [edk2-platforms] [PATCH v1 3/3] Platform/ARM/SgiPkg: Add HMAT ACPI table for RD-V1-MC Vijayenthiran Subramaniam

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=1611841351-5039-2-git-send-email-vijayenthiran.subramaniam@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