Add legacy EF segment memory config (#904)

Current SBL code will build pointers in E/F segment for ACPI
and SMBIOS table. On some platforms, E/F segment is not supported.
So a new configuration ENABLE_LEGACY_EF_SEG is added.  When
it is enabled, SBL will not use legacy E/F segment memory.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma 2020-11-22 21:06:38 -08:00 committed by GitHub
parent 9cf145bf57
commit bd07c6504c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 4 deletions

View File

@ -202,3 +202,4 @@
gPlatformModuleTokenSpaceGuid.PcdAriSupport | FALSE | BOOLEAN | 0x20000211
gPlatformModuleTokenSpaceGuid.PcdSrIovSupport | FALSE | BOOLEAN | 0x20000212
gPlatformModuleTokenSpaceGuid.PcdEnableSetup | FALSE | BOOLEAN | 0x20000213
gPlatformModuleTokenSpaceGuid.PcdLegacyEfSegmentEnabled | TRUE | BOOLEAN | 0x20000214

View File

@ -310,6 +310,7 @@
gPlatformModuleTokenSpaceGuid.PcdLinuxPayloadEnabled | $(ENABLE_LINUX_PAYLOAD)
gPlatformCommonLibTokenSpaceGuid.PcdContainerBootEnabled| $(ENABLE_CONTAINER_BOOT)
gPayloadTokenSpaceGuid.PcdCsmeUpdateEnabled | $(ENABLE_CSME_UPDATE)
gPlatformModuleTokenSpaceGuid.PcdLegacyEfSegmentEnabled | $(ENABLE_LEGACY_EF_SEG)
gPlatformCommonLibTokenSpaceGuid.PcdEmmcHs400SupportEnabled | $(ENABLE_EMMC_HS400)
gPlatformCommonLibTokenSpaceGuid.PcdPreOsCheckerEnabled | $(ENABLE_PRE_OS_CHECKER)
gPlatformCommonLibTokenSpaceGuid.PcdDmaProtectionEnabled | $(ENABLE_DMA_PROTECTION)

View File

@ -676,11 +676,14 @@ AcpiInit (
Rsdp->ExtendedChecksum = CalculateCheckSum8 ((UINT8 *)Rsdp, Rsdp->Length);
*AcpiMemBase = (UINT32)(UINTN)Current;
Status = PcdSet32S (PcdAcpiTablesRsdp, (UINT32)(UINTN)Rsdp);
//
// Keep a copy at F segment so that non-UEFI OS will find ACPI tables
//
Status = PcdSet32S (PcdAcpiTablesRsdp, (UINT32)(UINTN)Rsdp);
CopyMem ((VOID *)0xFFF80, Rsdp, sizeof (RsdpTmp));
if (FeaturePcdGet (PcdLegacyEfSegmentEnabled)) {
CopyMem ((VOID *)0xFFF80, Rsdp, sizeof (RsdpTmp));
}
// Update ACPI update service so that payload can have opportunity to update ACPI tables
PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE);

View File

@ -56,3 +56,4 @@
gPlatformModuleTokenSpaceGuid.PcdAcpiGnvsAddress
gPlatformModuleTokenSpaceGuid.PcdLoaderAcpiReclaimSize
gPlatformCommonLibTokenSpaceGuid.PcdLowestSupportedFwVer
gPlatformModuleTokenSpaceGuid.PcdLegacyEfSegmentEnabled

View File

@ -186,7 +186,9 @@ FinalizeSmbios (
//
// Keep a copy in legacy F segment so that non-UEFI can locate it
//
CopyMem ((VOID *)0xFFF60, SmbiosEntry, sizeof (SMBIOS_TABLE_ENTRY_POINT));
if (FeaturePcdGet (PcdLegacyEfSegmentEnabled)) {
CopyMem ((VOID *)0xFFF60, SmbiosEntry, sizeof (SMBIOS_TABLE_ENTRY_POINT));
}
return Status;
}

View File

@ -42,6 +42,6 @@
gPlatformModuleTokenSpaceGuid.PcdSmbiosTablesSize
gPlatformModuleTokenSpaceGuid.PcdSmbiosStringsPtr
gPlatformModuleTokenSpaceGuid.PcdSmbiosStringsCnt
gPlatformModuleTokenSpaceGuid.PcdLegacyEfSegmentEnabled
[Pcd]

View File

@ -216,6 +216,7 @@ class BaseBoard(object):
self.ENABLE_SBL_SETUP = 0
self.ENABLE_PAYLOD_MODULE = 0
self.ENABLE_FAST_BOOT = 0
self.ENABLE_LEGACY_EF_SEG = 1
self.SUPPORT_ARI = 0
self.SUPPORT_SR_IOV = 0