Changeset 108794 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFsp2WrapperPkg/FspmWrapperPeim
- Timestamp:
- Mar 31, 2025 11:31:09 AM (5 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168237
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-164365 /vendor/edk2/current 103735-103757,103769-103776,129194-168232
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
r105670 r108794 4 4 notify to call FspSiliconInit API. 5 5 6 Copyright (c) 2014 - 202 2, Intel Corporation. All rights reserved.<BR>6 Copyright (c) 2014 - 2024, Intel Corporation. All rights reserved.<BR> 7 7 SPDX-License-Identifier: BSD-2-Clause-Patent 8 8 … … 39 39 #include <FspGlobalData.h> 40 40 #include <Library/FspCommonLib.h> 41 #include <Guid/MigratedFvInfo.h> 41 42 42 43 extern EFI_GUID gFspHobGuid; … … 125 126 126 127 // 127 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status128 //129 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {130 DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset %r\n", Status));131 CallFspWrapperResetSystem (Status);132 }133 134 if ((Status != FSP_STATUS_VARIABLE_REQUEST) && EFI_ERROR (Status)) {135 DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status));136 ASSERT_EFI_ERROR (Status);137 }138 139 DEBUG ((DEBUG_INFO, "FspMemoryInit status: %r\n", Status));140 if (Status == FSP_STATUS_VARIABLE_REQUEST) {141 //142 // call to Variable request handler143 //144 FspWrapperVariableRequestHandler (&FspHobListPtr, FspMultiPhaseMemInitApiIndex);145 }146 147 //148 // See if MultiPhase process is required or not149 //150 FspWrapperMultiPhaseHandler (&FspHobListPtr, FspMultiPhaseMemInitApiIndex); // FspM MultiPhase151 152 //153 // Create hobs after memory initialization and not in temp RAM. Hence passing the recorded timestamp here154 //155 PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, TimeStampCounterStart, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);156 PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);157 DEBUG ((DEBUG_INFO, "Total time spent executing FspMemoryInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000)));158 159 Status = TestFspMemoryInitApiOutput (FspmUpdDataPtr, &FspHobListPtr);160 if (EFI_ERROR (Status)) {161 DEBUG ((DEBUG_ERROR, "ERROR - TestFspMemoryInitApiOutput () fail, Status = %r\n", Status));162 }163 164 DEBUG ((DEBUG_INFO, " FspHobListPtr (returned) - 0x%x\n", FspHobListPtr));165 ASSERT (FspHobListPtr != NULL);166 167 PostFspmHobProcess (FspHobListPtr);168 169 //170 128 // FspHobList is not complete at this moment. 171 129 // Save FspHobList pointer to hob, so that it can be got later … … 177 135 ASSERT (HobData != NULL); 178 136 CopyMem (HobData, &FspHobListPtr, sizeof (FspHobListPtr)); 137 138 // 139 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status 140 // 141 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) { 142 DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset %r\n", Status)); 143 CallFspWrapperResetSystem (Status); 144 } 145 146 if ((Status != FSP_STATUS_VARIABLE_REQUEST) && EFI_ERROR (Status)) { 147 DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status)); 148 ASSERT_EFI_ERROR (Status); 149 } 150 151 DEBUG ((DEBUG_INFO, "FspMemoryInit status: %r\n", Status)); 152 if (Status == FSP_STATUS_VARIABLE_REQUEST) { 153 // 154 // call to Variable request handler 155 // 156 FspWrapperVariableRequestHandler (&FspHobListPtr, FspMultiPhaseMemInitApiIndex); 157 } 158 159 // 160 // See if MultiPhase process is required or not 161 // 162 FspWrapperMultiPhaseHandler (&FspHobListPtr, FspMultiPhaseMemInitApiIndex); // FspM MultiPhase 163 164 // 165 // Create hobs after memory initialization and not in temp RAM. Hence passing the recorded timestamp here 166 // 167 PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, TimeStampCounterStart, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY); 168 PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT); 169 DEBUG ((DEBUG_INFO, "Total time spent executing FspMemoryInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000))); 170 171 Status = TestFspMemoryInitApiOutput (FspmUpdDataPtr, &FspHobListPtr); 172 if (EFI_ERROR (Status)) { 173 DEBUG ((DEBUG_ERROR, "ERROR - TestFspMemoryInitApiOutput () fail, Status = %r\n", Status)); 174 } 175 176 DEBUG ((DEBUG_INFO, " FspHobListPtr (returned) - 0x%x\n", FspHobListPtr)); 177 ASSERT (FspHobListPtr != NULL); 178 179 PostFspmHobProcess (FspHobListPtr); 179 180 180 181 return Status; … … 279 280 ) 280 281 { 281 UINT32 FspMeasureMask; 282 UINT32 FspMeasureMask; 283 EFI_PHYSICAL_ADDRESS FsptBaseAddress; 284 EFI_PHYSICAL_ADDRESS FspmBaseAddress; 285 EDKII_MIGRATED_FV_INFO *MigratedFvInfo; 286 EFI_PEI_HOB_POINTERS Hob; 282 287 283 288 DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n")); 284 289 285 FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig); 290 FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig); 291 FsptBaseAddress = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFsptBaseAddress); 292 FspmBaseAddress = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFspmBaseAddress); 293 Hob.Raw = GetFirstGuidHob (&gEdkiiMigratedFvInfoGuid); 294 while (Hob.Raw != NULL) { 295 MigratedFvInfo = GET_GUID_HOB_DATA (Hob); 296 if ((MigratedFvInfo->FvOrgBase == PcdGet32 (PcdFsptBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) { 297 // 298 // Found the migrated FspT raw data 299 // 300 FsptBaseAddress = MigratedFvInfo->FvDataBase; 301 } 302 303 if ((MigratedFvInfo->FvOrgBase == PcdGet32 (PcdFspmBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) { 304 FspmBaseAddress = MigratedFvInfo->FvDataBase; 305 } 306 307 Hob.Raw = GET_NEXT_HOB (Hob); 308 Hob.Raw = GetNextGuidHob (&gEdkiiMigratedFvInfoGuid, Hob.Raw); 309 } 286 310 287 311 if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) { … … 289 313 0, 290 314 "FSPT", 291 PcdGet32 (PcdFsptBaseAddress),292 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN) PcdGet32 (PcdFsptBaseAddress))->FvLength315 FsptBaseAddress, 316 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FsptBaseAddress)->FvLength 293 317 ); 294 318 } … … 298 322 0, 299 323 "FSPM", 300 PcdGet32 (PcdFspmBaseAddress),301 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength324 FspmBaseAddress, 325 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FspmBaseAddress)->FvLength 302 326 ); 303 327 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
r101291 r108794 7 7 # notify to call FspSiliconInit API. 8 8 # 9 # Copyright (c) 2014 - 202 1, Intel Corporation. All rights reserved.<BR>9 # Copyright (c) 2014 - 2024, Intel Corporation. All rights reserved.<BR> 10 10 # 11 11 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 70 70 gFspHobGuid ## PRODUCES ## HOB 71 71 gFspApiPerformanceGuid ## SOMETIMES_CONSUMES ## GUID 72 gEdkiiMigratedFvInfoGuid ## SOMETIMES_CONSUMES ## HOB 72 73 73 74 [Ppis]
Note:
See TracChangeset
for help on using the changeset viewer.