Add memory regions for MmCommuncate buffers into the virtual memory
table.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu <[email protected]>
---
Platform/ARM/SgiPkg/SgiPlatform.dsc | 12 ++++++++++++
Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 4 ++++
Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 8 +++++++-
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 7995c7d132d6..f9e50f00b121 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -197,6 +197,18 @@ [PcdsFixedAtBuild.common]
gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x10000
gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|204
+ #
+ # Set the base address and size of the buffer used
+ # for communication between the Normal world edk2
+ # with StandaloneMm image at S-EL0 through MM_COMMUNICATE.
+ # This buffer gets allocated in ATF and since we do not have
+ # a mechanism currently to communicate the base address and
+ # size of this buffer from ATF, hard-code it here
+ #
+ ## MM Communicate
+ gArmTokenSpaceGuid.PcdMmBufferBase|0xFF600000
+ gArmTokenSpaceGuid.PcdMmBufferSize|0x10000
+
################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform
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
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel