]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg VTdPmrPei: Add PcdVTdPeiDmaBufferSize(S3)
authorStar Zeng <star.zeng@intel.com>
Mon, 5 Mar 2018 14:10:16 +0000 (22:10 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 6 Mar 2018 14:31:49 +0000 (22:31 +0800)
Add PcdVTdPeiDmaBufferSize(S3) to replace the hard coded value
TOTAL_DMA_BUFFER_SIZE and TOTAL_DMA_BUFFER_SIZE_S3 in IntelVTdPmrPei.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
IntelSiliconPkg/IntelSiliconPkg.dec

index 2b2df1f425aef0041525d5aa90d8485ff02cda90..27847f43317bf8e85fa43b4e6d916e6dfa182576 100644 (file)
@@ -29,9 +29,6 @@
 \r
 #include "IntelVTdPmrPei.h"\r
 \r
-#define  TOTAL_DMA_BUFFER_SIZE    SIZE_4MB\r
-#define  TOTAL_DMA_BUFFER_SIZE_S3 SIZE_1MB\r
-\r
 EFI_GUID mVTdInfoGuid = {\r
   0x222f5e30, 0x5cd, 0x49c6, { 0x8a, 0xc, 0x36, 0xd6, 0x58, 0x41, 0xe0, 0x82 }\r
 };\r
@@ -798,9 +795,9 @@ IntelVTdPmrInitialize (
   PeiServicesGetBootMode (&BootMode);\r
 \r
   if (BootMode == BOOT_ON_S3_RESUME) {\r
-    DmaBufferInfo->DmaBufferSize = TOTAL_DMA_BUFFER_SIZE_S3;\r
+    DmaBufferInfo->DmaBufferSize = PcdGet32 (PcdVTdPeiDmaBufferSizeS3);\r
   } else {\r
-    DmaBufferInfo->DmaBufferSize = TOTAL_DMA_BUFFER_SIZE;\r
+    DmaBufferInfo->DmaBufferSize = PcdGet32 (PcdVTdPeiDmaBufferSize);\r
   }\r
 \r
   Status = PeiServicesNotifyPpi (&mVTdInfoNotifyDesc);\r
index e6d0323acc50d4c58303a785c4454b3efd2b7e67..5b688d5cbf9fda47fac61df1031d2d49359bb44a 100644 (file)
@@ -4,7 +4,7 @@
 # This driver initializes VTd engine based upon EDKII_VTD_INFO_PPI\r
 # and provide DMA protection in PEI.\r
 #\r
-# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -54,6 +54,8 @@
 \r
 [Pcd]\r
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize     ## CONSUMES\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3   ## CONSUMES\r
 \r
 [Depex]\r
   gEfiPeiMasterBootModePpiGuid AND\r
index a15d3dee392cd07377e3d7d0d58cd94e6eb7e654..c0cf58fa6cb59a56adae061001d3c9618f7f5f45 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # This package provides common open source Intel silicon modules.\r
 #\r
-# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License that accompanies this distribution.\r
 # The full text of the license may be found at\r
   # @Prompt The policy for VTd driver behavior.\r
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask|1|UINT8|0x00000002\r
 \r
+  ## Declares VTd PEI DMA buffer size.<BR><BR>\r
+  #  When this PCD value is referred by platform to calculate the required\r
+  #  memory size for PEI (InstallPeiMemory), the PMR alignment requirement\r
+  #  needs be considered to be added with this PCD value for alignment\r
+  #  adjustment need by AllocateAlignedPages.\r
+  # @Prompt The VTd PEI DMA buffer size.\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize|0x00400000|UINT32|0x00000003\r
+\r
+  ## Declares VTd PEI DMA buffer size for S3.<BR><BR>\r
+  #  When this PCD value is referred by platform to calculate the required\r
+  #  memory size for PEI S3 (InstallPeiMemory), the PMR alignment requirement\r
+  #  needs be considered to be added with this PCD value for alignment\r
+  #  adjustment need by AllocateAlignedPages.\r
+  # @Prompt The VTd PEI DMA buffer size for S3.\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3|0x00200000|UINT32|0x00000004\r
+\r