- //\r
- // Modify the parameters for ContinuationFunc\r
- //\r
- SetFspContinuationFuncParameter(EFI_SUCCESS, 0);\r
- SetFspContinuationFuncParameter((UINT32)GetHobList(), 1);\r
+ if (GetFspApiCallingMode() == 0) {\r
+ //\r
+ // FspInit API is used, so jump into the ContinuationFunc\r
+ //\r
+ FspInitParams = (FSP_INIT_PARAMS *)GetFspApiParameter ();\r
+ \r
+ //\r
+ // Modify the parameters for ContinuationFunc\r
+ //\r
+ SetFspContinuationFuncParameter(EFI_SUCCESS, 0);\r
+ SetFspContinuationFuncParameter((UINT32)GetHobList(), 1);\r
+ \r
+ //\r
+ // Modify the return address to ContinuationFunc\r
+ //\r
+ SetFspApiReturnAddress((UINT32)FspInitParams->ContinuationFunc);\r
+ \r
+ //\r
+ // Give control back to the boot loader framework caller after FspInit is done\r
+ // It is done throught the continuation function\r
+ //\r
+ SetFspMeasurePoint (FSP_PERF_ID_API_FSPINIT_EXIT);\r
+ } else {\r
+ //\r
+ // FspMemoryInit API is used, so return directly\r
+ //\r