Skip to content

Commit

Permalink
Fix provisioning backwards compatibility with AEP PMem modules.
Browse files Browse the repository at this point in the history
This fix allows provisioning AEP PMem modules with ipmctl 2.x version
as it is meant to be backwards compatible. This issue was seen as an
invalid revision was written into PCD partition #1 Config Header when
new goals were created using ipmctl 2.x version.

Fixes #149

Signed-off-by: Sandesh Shetty <[email protected]>
  • Loading branch information
sshetty1991 authored and StevenPontsler committed Sep 17, 2020
1 parent c613205 commit 9e3898c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion DcpmPkg/driver/Core/Dimm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5965,7 +5965,13 @@ GenerateOemPcdHeader (

pPlatformConfigData->Header.Signature = NVDIMM_CONFIGURATION_HEADER_SIG;
pPlatformConfigData->Header.Length = sizeof (*pPlatformConfigData);
pPlatformConfigData->Header.Revision.AsUint8 = gNvmDimmData->PMEMDev.pPcatHead->pPlatformConfigAttr->Header.Revision.AsUint8;
// For Purley platforms, only one revision (0x1) for PCD Config Header is supported
if (IS_ACPI_HEADER_REV_MAJ_0_MIN_VALID(gNvmDimmData->PMEMDev.pPcatHead->pPlatformConfigAttr)) {
pPlatformConfigData->Header.Revision.AsUint8 = NVDIMM_CONFIGURATION_TABLES_REVISION_1;
}
else {
pPlatformConfigData->Header.Revision.AsUint8 = gNvmDimmData->PMEMDev.pPcatHead->pPlatformConfigAttr->Header.Revision.AsUint8;
}
CopyMem_S(&pPlatformConfigData->Header.OemId, sizeof(pPlatformConfigData->Header.OemId), NVDIMM_CONFIGURATION_HEADER_OEM_ID, NVDIMM_CONFIGURATION_HEADER_OEM_ID_LEN);
pPlatformConfigData->Header.OemTableId = NVDIMM_CONFIGURATION_HEADER_OEM_TABLE_ID;
pPlatformConfigData->Header.OemRevision = NVDIMM_CONFIGURATION_HEADER_OEM_REVISION;
Expand Down
12 changes: 9 additions & 3 deletions DcpmPkg/driver/Core/Region.c
Original file line number Diff line number Diff line change
Expand Up @@ -3972,9 +3972,15 @@ SendConfigInputToDimm(
pNewConfHeader->ConfInputDataSize = pNewConfigInput->Header.Length;
CurrentOffset += pNewConfHeader->ConfInputDataSize;

/** Update Configuration Header Revision **/
CopyMem_S(&pNewConfHeader->Header.Revision, sizeof(ACPI_REVISION),
&pNewConfigInput->Header.Revision, sizeof(ACPI_REVISION));
/**
Update Configuration Header Revision
Not needed for Purley platforms, as only one
revision (0x1) is supported.
**/
if (!IS_ACPI_HEADER_REV_MAJ_0_MIN_VALID(pNewConfHeader)) {
CopyMem_S(&pNewConfHeader->Header.Revision, sizeof(ACPI_REVISION),
&pNewConfigInput->Header.Revision, sizeof(ACPI_REVISION));
}
} else {
pNewConfHeader->ConfInputStartOffset = 0;
pNewConfHeader->ConfInputDataSize = 0;
Expand Down

0 comments on commit 9e3898c

Please sign in to comment.