]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CorebootModulePkg: Use PCD for memory type information initialization
authorMaurice Ma <maurice.ma@intel.com>
Wed, 18 May 2016 23:27:07 +0000 (16:27 -0700)
committerMaurice Ma <maurice.ma@intel.com>
Wed, 18 May 2016 23:30:18 +0000 (16:30 -0700)
CorebootModulePkg currently uses a hardcoded table for memory type
initialization. It might need to be adjusted by platform to reduce
the memory fragmentation. So changing to use PCDs rather than
constant values to facilitate the customization.

Cc: Prince Agyeman <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
CorebootModulePkg/CbSupportPei/CbSupportPei.c
CorebootModulePkg/CbSupportPei/CbSupportPei.inf
CorebootModulePkg/CorebootModulePkg.dec

index e58aa2d03d9d45ea6a67f637c9fed13a96b67c81..366682b32d117f83e5c5f43f48ac50170a2f372b 100755 (executable)
@@ -2,7 +2,7 @@
   This PEIM will parse coreboot table in memory and report resource information into pei core.\r
   This file contains the main entrypoint of the PEIM.\r
 \r
-Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2016, 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
@@ -18,11 +18,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1\r
 \r
 EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {\r
-  { EfiACPIReclaimMemory,   0x008 },\r
-  { EfiACPIMemoryNVS,       0x004 },\r
-  { EfiReservedMemoryType,  0x004 },\r
-  { EfiRuntimeServicesData, 0x080 },\r
-  { EfiRuntimeServicesCode, 0x080 },\r
+  { EfiACPIReclaimMemory,   FixedPcdGet32 (PcdMemoryTypeEfiACPIReclaimMemory) },\r
+  { EfiACPIMemoryNVS,       FixedPcdGet32 (PcdMemoryTypeEfiACPIMemoryNVS) },\r
+  { EfiReservedMemoryType,  FixedPcdGet32 (PcdMemoryTypeEfiReservedMemoryType) },\r
+  { EfiRuntimeServicesData, FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServicesData) },\r
+  { EfiRuntimeServicesCode, FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServicesCode) },\r
   { EfiMaxMemoryType,       0     }\r
 };\r
 \r
index b88b6f07ffe3089eafdd60f6cf0e49b73d46bd17..4905bdbd8ed26f8dae72a79b47be0c24bf3be52b 100644 (file)
@@ -4,7 +4,7 @@
 # Parses coreboot table in memory and report resource information into pei core. It will install\r
 # the memory as required.\r
 #\r
-#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
   gUefiAcpiBoardInfoGuid\r
 \r
 [Ppis]\r
-  gEfiPeiMasterBootModePpiGuid \r
+  gEfiPeiMasterBootModePpiGuid\r
 \r
 [Pcd]\r
   gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemBase\r
   gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemSize\r
-  gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer  \r
-  \r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer\r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory\r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS\r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType\r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData\r
+  gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode\r
+\r
 [Depex]\r
   TRUE
\ No newline at end of file
index 4b97f9f24948867e8e9b916b32e83cc0efe8263a..7f1309bdae61980899f5226f100a8aca1f3129db 100644 (file)
@@ -1,16 +1,16 @@
 ## @file\r
 # Coreboot Support Package\r
 #\r
-# Provides drivers and definitions to support coreboot in EDKII bios. \r
+# Provides drivers and definitions to support coreboot in EDKII bios.\r
 #\r
-# Copyright (c) 2014, 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
+# Copyright (c) 2014 - 2016, 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
-# http://opensource.org/licenses/bsd-license.php.                                                                          \r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.  \r
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 ##\r
 \r
   PACKAGE_NAME                   = CorebootModulePkg\r
   PACKAGE_GUID                   = DE1750CE-FEE7-4dd1-8E9C-B7B8BAEBCF4F\r
   PACKAGE_VERSION                = 0.1\r
-  \r
+\r
 [Includes]\r
   Include\r
-  \r
+\r
 [LibraryClasses]\r
   CbParseLib|Include/Library/CbParseLib.h\r
-  \r
+\r
 [Guids]\r
   #\r
   ## Defines the token space for the Coreboot Module Package PCDs.\r
 gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemBase|0|UINT32|0x10000001\r
 ## Provides the size of the payload binary in memory\r
 gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemSize|0|UINT32|0x10000002\r
+## Used to help reduce fragmentation in the EFI memory map\r
+gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x08|UINT32|0x10000012\r
+gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x04|UINT32|0x10000013\r
+gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x04|UINT32|0x00000014\r
+gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0xC0|UINT32|0x00000015\r
+gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x80|UINT32|0x00000016\r
 \r
 [PcdsDynamicEx]\r
 gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer|0|UINT32|0x10000003\r
\r
+\r