Skip to content

Commit

Permalink
Merge branch 'master' into hema_fixsleep
Browse files Browse the repository at this point in the history
  • Loading branch information
HemaAnmisha authored Dec 25, 2024
2 parents f0c88ea + f39b121 commit 797840d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 12 deletions.
22 changes: 11 additions & 11 deletions IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ PeiFspMemoryInit (
TimeStampCounterStart = AsmReadTsc ();
Status = CallFspMemoryInit (FspmUpdDataPtr, &FspHobListPtr);

//
// FspHobList is not complete at this moment.
// Save FspHobList pointer to hob, so that it can be got later
//
HobData = BuildGuidHob (
&gFspHobGuid,
sizeof (VOID *)
);
ASSERT (HobData != NULL);
CopyMem (HobData, &FspHobListPtr, sizeof (FspHobListPtr));

//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
Expand Down Expand Up @@ -167,17 +178,6 @@ PeiFspMemoryInit (

PostFspmHobProcess (FspHobListPtr);

//
// FspHobList is not complete at this moment.
// Save FspHobList pointer to hob, so that it can be got later
//
HobData = BuildGuidHob (
&gFspHobGuid,
sizeof (VOID *)
);
ASSERT (HobData != NULL);
CopyMem (HobData, &FspHobListPtr, sizeof (FspHobListPtr));

return Status;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@
FspWrapperPlatformLib
PeiServicesLib
FspWrapperPlatformMultiPhaseLib
BaseMemoryLib
HobLib

[Ppis]
gEfiPeiReadOnlyVariable2PpiGuid
gEdkiiPeiVariablePpiGuid

[Guids]
gFspHobGuid ## CONSUMES

[Pcd]
gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <Ppi/Variable.h>
#include <Library/PeiServicesLib.h>
#include <Library/FspWrapperPlatformMultiPhaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/HobLib.h>

/**
Execute 32-bit FSP API entry code.
Expand Down Expand Up @@ -156,6 +158,8 @@ FspWrapperVariableRequestHandler (
EDKII_PEI_VARIABLE_PPI *VariablePpi;
BOOLEAN WriteVariableSupport;
FSP_MULTI_PHASE_COMPLETE_VARIABLE_REQUEST_PARAMS CompleteVariableRequestParams;
VOID *GuidHob;
VOID *HobData;

WriteVariableSupport = TRUE;
Status = PeiServicesLocatePpi (
Expand Down Expand Up @@ -288,6 +292,16 @@ FspWrapperVariableRequestHandler (
}
}

//
// Refresh FspHobList pointer stored in HOB.
//
GuidHob = GetFirstGuidHob (&gFspHobGuid);
ASSERT (GuidHob != NULL);
if (GuidHob != NULL) {
HobData = GET_GUID_HOB_DATA (GuidHob);
CopyMem (HobData, FspHobListPtr, sizeof (*FspHobListPtr));
}

//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
Expand Down Expand Up @@ -321,6 +335,8 @@ FspWrapperMultiPhaseHandler (
FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS FspMultiPhaseGetNumber;
UINT32 Index;
UINT32 NumOfPhases;
VOID *GuidHob;
VOID *HobData;

//
// Query FSP for the number of phases supported.
Expand Down Expand Up @@ -352,6 +368,16 @@ FspWrapperMultiPhaseHandler (
FspMultiPhaseParams.MultiPhaseParamPtr = NULL;
Status = CallFspMultiPhaseEntry (&FspMultiPhaseParams, FspHobListPtr, ComponentIndex);

//
// Refresh FspHobList pointer stored in HOB.
//
GuidHob = GetFirstGuidHob (&gFspHobGuid);
ASSERT (GuidHob != NULL);
if (GuidHob != NULL) {
HobData = GET_GUID_HOB_DATA (GuidHob);
CopyMem (HobData, FspHobListPtr, sizeof (*FspHobListPtr));
}

if (Status == FSP_STATUS_VARIABLE_REQUEST) {
//
// call to Variable request handler
Expand Down
9 changes: 8 additions & 1 deletion UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ typedef enum {
EFI_PCI_IO_ATTRIBUTE_ISA_IO | \
EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO)

#define UPL_ALIGN_DOWN(Addr) ((UINT64)(Addr) & ~(UINT64)(EFI_PAGE_SIZE - 1))

extern VOID *mHobList;
UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *mPciRootBridgeInfo = NULL;
INT32 mNode[0x500] = { 0 };
Expand Down Expand Up @@ -289,7 +291,12 @@ ParseReservedMemory (
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiACPIMemoryNVS);
} else if (AsciiStrnCmp (TempStr, "acpi", AsciiStrLen ("acpi")) == 0) {
DEBUG ((DEBUG_INFO, " acpi, StartAddress:%x, NumberOfBytes:%x\n", StartAddress, NumberOfBytes));
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiBootServicesData);

BuildMemoryAllocationHob (
UPL_ALIGN_DOWN (StartAddress),
ALIGN_VALUE (NumberOfBytes, EFI_PAGE_SIZE),
EfiBootServicesData
);
PlatformAcpiTable = BuildGuidHob (&gUniversalPayloadAcpiTableGuid, sizeof (UNIVERSAL_PAYLOAD_ACPI_TABLE));
if (PlatformAcpiTable != NULL) {
DEBUG ((DEBUG_INFO, " build gUniversalPayloadAcpiTableGuid , NumberOfBytes:%x\n", NumberOfBytes));
Expand Down

0 comments on commit 797840d

Please sign in to comment.