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