#include <FspGlobalData.h>\r
#include <FspEas.h>\r
#include <FspDataTable.h>\r
+#include <Library/FspSwitchStackLib.h>\r
\r
#pragma pack(1)\r
\r
}\r
\r
/**\r
- This function gets FSP CAR base.\r
+ This function updates the return status of the FSP API with requested reset type and returns to Boot Loader.\r
\r
-**/\r
-UINT32\r
-EFIAPI\r
-GetFspCarBase (\r
- VOID\r
- )\r
-{\r
- FSP_GLOBAL_DATA *FspData;\r
- UINT32 CarBase;\r
-\r
- FspData = GetFspGlobalDataPointer ();\r
- CarBase = FspData->PlatformData.CarBase;\r
- if (CarBase == 0) {\r
- CarBase = PcdGet32(PcdTemporaryRamBase);\r
- }\r
- return CarBase;\r
-}\r
-\r
-/**\r
- This function gets FSP CAR size.\r
+ @param[in] FspResetType Reset type that needs to returned as API return status\r
\r
**/\r
-UINT32\r
+VOID\r
EFIAPI\r
-GetFspCarSize (\r
- VOID\r
+FspApiReturnStatusReset (\r
+ IN UINT32 FspResetType\r
)\r
{\r
- FSP_GLOBAL_DATA *FspData;\r
- UINT32 CarSize;\r
-\r
- FspData = GetFspGlobalDataPointer ();\r
- CarSize = FspData->PlatformData.CarSize;\r
- if (FspData->PlatformData.CarBase == 0) {\r
- CarSize = PcdGet32(PcdTemporaryRamSize);\r
- }\r
- return CarSize;\r
+ volatile BOOLEAN LoopUntilReset;\r
+ \r
+ LoopUntilReset = TRUE;\r
+ DEBUG ((DEBUG_INFO, "FSP returning control to Bootloader with reset required return status %x\n",FspResetType));\r
+ ///\r
+ /// Below code is not an infinite loop.The control will go back to API calling function in BootLoader each time BootLoader\r
+ /// calls the FSP API without honoring the reset request by FSP\r
+ ///\r
+ do {\r
+ SetFspApiReturnStatus ((EFI_STATUS)FspResetType);\r
+ Pei2LoaderSwitchStack ();\r
+ DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n"));\r
+ DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honour the reset request from FSP\n"));\r
+ } while (LoopUntilReset);\r
}\r