public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sughosh Ganu <sughosh.ganu@arm.com>
To: edk2-devel@lists.01.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: [PATCH edk2-platforms v2 2/3] Platform/ARM/SgiPkg: Setup memory buffers for MmCommunicate
Date: Thu, 20 Dec 2018 11:17:57 +0530	[thread overview]
Message-ID: <1545284878-21417-3-git-send-email-sughosh.ganu@arm.com> (raw)
In-Reply-To: <1545284878-21417-1-git-send-email-sughosh.ganu@arm.com>

Add memory regions for MmCommuncate buffers into the virtual memory
table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf  | 4 ++++
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index 260be58fb38c..c0fcc8198201 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -25,6 +25,7 @@ [Packages]
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
   Platform/ARM/SgiPkg/SgiPlatform.dec
+  StandaloneMmPkg/StandaloneMmPkg.dec
 
 [LibraryClasses]
   ArmLib
@@ -62,6 +63,9 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciMmio64Base
   gArmTokenSpaceGuid.PcdPciMmio64Size
 
+  gArmTokenSpaceGuid.PcdMmBufferBase
+  gArmTokenSpaceGuid.PcdMmBufferSize
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
 
 [Guids]
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
index 6ec2e8a7096d..60729e3c7158 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
@@ -22,7 +22,7 @@
 #include <SgiPlatform.h>
 
 // Total number of descriptors, including the final "end-of-table" descriptor.
-#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS  12
+#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS  13
 
 /**
   Returns the Virtual Memory Map of the platform.
@@ -136,6 +136,12 @@ ArmPlatformGetVirtualMemoryMap (
                                                SIZE_1MB;
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
+ // MM Memory Space
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdMmBufferBase);
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdMmBufferBase);
+  VirtualMemoryTable[Index].Length          = PcdGet64 (PcdMmBufferSize);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
+
   // End of Table
   VirtualMemoryTable[++Index].PhysicalBase  = 0;
   VirtualMemoryTable[Index].VirtualBase     = 0;
-- 
2.7.4



  parent reply	other threads:[~2018-12-20  5:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20  5:47 [PATCH edk2-platforms v2 0/3] Platform/ARM/SgiPkg: Enable StandaloneMm on Sgi platforms Sughosh Ganu
2018-12-20  5:47 ` [PATCH edk2-platforms v2 1/3] Platform/ARM/SgiPkg: Build infrastructure for StandaloneMm image Sughosh Ganu
2018-12-20  8:46   ` Ard Biesheuvel
2018-12-20 10:04     ` Sughosh Ganu
2018-12-27  2:58     ` Sughosh Ganu
2018-12-20  5:47 ` Sughosh Ganu [this message]
2018-12-20  5:47 ` [PATCH edk2-platforms v2 3/3] Platform/ARM/SgiPkg: Enable MmCommunication module on the platform Sughosh Ganu
2018-12-20  8:52   ` Ard Biesheuvel
2018-12-20 10:09     ` Sughosh Ganu

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=1545284878-21417-3-git-send-email-sughosh.ganu@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