30 IN VOID *EfiMemoryBegin,
32 IN VOID *EfiFreeMemoryBottom,
33 IN VOID *EfiFreeMemoryTop
38extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid;
43extern EFI_GUID gEfiMmCpuDriverEpDescriptorGuid;
56 IN OUT PI_MM_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint,
74 HobStart = HobConstructor (
75 (VOID *)(
UINTN)PayloadBootInfo->SpMemBase,
76 (
UINTN)PayloadBootInfo->SpMemLimit - PayloadBootInfo->SpMemBase,
77 (VOID *)(
UINTN)PayloadBootInfo->SpHeapBase,
78 (VOID *)(
UINTN)(PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize)
82 ASSERT (HobStart == (VOID *)(
UINTN)PayloadBootInfo->SpHeapBase);
85 BuildFvHob (PayloadBootInfo->SpImageBase, PayloadBootInfo->SpImageSize);
90 EFI_RESOURCE_ATTRIBUTE_PRESENT |
91 EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
92 EFI_RESOURCE_ATTRIBUTE_TESTED |
93 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
94 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
95 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
96 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
100 EFI_RESOURCE_SYSTEM_MEMORY,
102 (
UINTN)PayloadBootInfo->SpMemBase,
103 PayloadBootInfo->SpMemLimit - PayloadBootInfo->SpMemBase
112 MpInformationHobData =
BuildGuidHob (&gMpInformationHobGuid, BufferSize);
116 MpInformationHobData->NumberOfProcessors = PayloadBootInfo->NumCpus;
117 MpInformationHobData->NumberOfEnabledProcessors = PayloadBootInfo->NumCpus;
118 ProcInfoBuffer = MpInformationHobData->ProcessorInfoBuffer;
119 CpuInfo = PayloadBootInfo->CpuInfo;
121 for (Index = 0; Index < PayloadBootInfo->NumCpus; Index++) {
122 ProcInfoBuffer[Index].
ProcessorId = CpuInfo[Index].Mpidr;
123 ProcInfoBuffer[Index].
Location.
Package = GET_CLUSTER_ID (CpuInfo[Index].Mpidr);
124 ProcInfoBuffer[Index].
Location.
Core = GET_CORE_ID (CpuInfo[Index].Mpidr);
125 ProcInfoBuffer[Index].
Location.
Thread = GET_CORE_ID (CpuInfo[Index].Mpidr);
128 if (CpuInfo[Index].Flags & CPU_INFO_FLAG_PRIMARY_CPU) {
138 &gEfiStandaloneMmNonSecureBufferGuid,
141 NsCommBufMmramRange->
PhysicalStart = PayloadBootInfo->SpNsCommBufBase;
142 NsCommBufMmramRange->
CpuStart = PayloadBootInfo->SpNsCommBufBase;
143 NsCommBufMmramRange->
PhysicalSize = PayloadBootInfo->SpNsCommBufSize;
144 NsCommBufMmramRange->
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
149 &gEfiMmCpuDriverEpDescriptorGuid,
153 *CpuDriverEntryPoint =
NULL;
154 CpuDriverEntryPointDesc->MmCpuDriverEpPtr = CpuDriverEntryPoint;
161 MmramRangesHob =
BuildGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, BufferSize);
170 MmramRanges[0].
CpuStart = PayloadBootInfo->SpImageBase;
171 MmramRanges[0].
PhysicalSize = PayloadBootInfo->SpImageSize;
172 MmramRanges[0].
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
175 MmramRanges[1].
PhysicalStart = PayloadBootInfo->SpSharedBufBase;
176 MmramRanges[1].
CpuStart = PayloadBootInfo->SpSharedBufBase;
177 MmramRanges[1].
PhysicalSize = PayloadBootInfo->SpSharedBufSize;
178 MmramRanges[1].
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
182 MmramRanges[2].
PhysicalStart = PayloadBootInfo->SpNsCommBufBase;
183 MmramRanges[2].
CpuStart = PayloadBootInfo->SpNsCommBufBase;
184 MmramRanges[2].
PhysicalSize = PayloadBootInfo->SpNsCommBufSize;
185 MmramRanges[2].
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
189 MmramRanges[3].
CpuStart = PayloadBootInfo->SpStackBase;
190 MmramRanges[3].
PhysicalSize = PayloadBootInfo->SpPcpuStackSize * PayloadBootInfo->NumCpus;
191 MmramRanges[3].
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
197 MmramRanges[4].
RegionState = EFI_CACHEABLE | EFI_ALLOCATED;
VOID EFIAPI BuildResourceDescriptorHob(IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 NumberOfBytes)
VOID EFIAPI BuildFvHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID * CreateHobListFromBootInfo(IN OUT PI_MM_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint, IN EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo)
#define PROCESSOR_HEALTH_STATUS_BIT
#define PROCESSOR_AS_BSP_BIT
#define PROCESSOR_ENABLED_BIT
UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE
UINT64 EFI_PHYSICAL_ADDRESS
EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop
EFI_PHYSICAL_ADDRESS CpuStart
EFI_PHYSICAL_ADDRESS PhysicalStart
UINT32 NumberOfMmReservedRegions
EFI_MMRAM_DESCRIPTOR Descriptor[1]
EFI_CPU_PHYSICAL_LOCATION Location