diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeim.c b/ArmPlatformPkg/PlatformPei/PlatformPeim.c index 62d1faf0c4..921371a3e5 100644 --- a/ArmPlatformPkg/PlatformPei/PlatformPeim.c +++ b/ArmPlatformPkg/PlatformPei/PlatformPeim.c @@ -24,6 +24,7 @@ #include #include #include +#include EFI_STATUS EFIAPI @@ -76,14 +77,30 @@ InitializePlatformPeim ( IN CONST EFI_PEI_SERVICES **PeiServices ) { - EFI_STATUS Status; - EFI_BOOT_MODE BootMode; + EFI_STATUS Status; + EFI_BOOT_MODE BootMode; + VOID *TransferListBase; + UINTN *TransferListHobData; + EFI_HOB_GUID_TYPE *GuidHob; DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Platform PEIM Loaded\n")); Status = PeiServicesSetBootMode (ArmPlatformGetBootMode ()); ASSERT_EFI_ERROR (Status); + // If TransferList PPI is present and TransferListHobGuid is not present, + // then create a TransferListHob with the TransferListBase address. + Status = PeiServicesLocatePpi (&gArmTransferListPpiGuid, 0, NULL, &TransferListBase); + if (!EFI_ERROR (Status)) { + GuidHob = GetFirstGuidHob (&gArmTransferListHobGuid); + if ((GuidHob == NULL) && (TransferListBase != NULL)) { + TransferListHobData = BuildGuidHob (&gArmTransferListHobGuid, sizeof (*TransferListHobData)); + ASSERT (TransferListHobData != NULL); + + *TransferListHobData = (UINTN)TransferListBase; + } + } + PlatformPeim (); Status = PeiServicesGetBootMode (&BootMode); diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeim.inf b/ArmPlatformPkg/PlatformPei/PlatformPeim.inf index f2b0e0f084..d9e8f32ac9 100644 --- a/ArmPlatformPkg/PlatformPei/PlatformPeim.inf +++ b/ArmPlatformPkg/PlatformPei/PlatformPeim.inf @@ -43,6 +43,7 @@ [Ppis] gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED + gArmTransferListPpiGuid # PPI SOMETIMES_CONSUMED [FixedPcd] gArmTokenSpaceGuid.PcdFdBaseAddress @@ -51,6 +52,9 @@ gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvSize +[Guids] + gArmTransferListHobGuid + [Depex] TRUE