]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
Update IntelFspPkg according to FSP1.1.
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspPlatformLib / FspPlatformNotify.c
index d405233e41e208dd4262044b652ed981d98d2d5e..33b2ebfe12564e57e54cde629eda87628e15c7e4 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -98,26 +98,43 @@ FspInitDone (
   VOID\r
   )\r
 {\r
-  FSP_INIT_PARAMS           *FspInitParams;\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
+  FSP_INIT_PARAMS        *FspInitParams;\r
+\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
 \r
-  //\r
-  // Modify the return address to ContinuationFunc\r
-  //\r
-  SetFspApiReturnAddress((UINT32)FspInitParams->ContinuationFunc);\r
+    //\r
+    // This is the end of the FspSiliconInit API\r
+    // Give control back to the boot loader\r
+    //\r
+    DEBUG ((DEBUG_INFO | DEBUG_INIT, "FspSiliconInitApi() - End\n"));\r
+    SetFspApiReturnStatus (EFI_SUCCESS);\r
+  }\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
   Pei2LoaderSwitchStack();\r
 }\r
 \r
@@ -151,12 +168,14 @@ FspWaitForNotify (
       //\r
       // Notify code does not follow the predefined order\r
       //\r
+      DEBUG ((DEBUG_INFO, "Unsupported FSP Notification Value\n"));\r
       SetFspApiReturnStatus(EFI_UNSUPPORTED);\r
     } else {\r
       //\r
       // Process Notification and Give control back to the boot loader framework caller\r
       //\r
       Status = FspNotificationHandler (NotificationValue);\r
+      DEBUG ((DEBUG_INFO, "FSP Notification Handler Returns : 0x%08X\n", Status));\r
       SetFspApiReturnStatus(Status);\r
       if (!EFI_ERROR(Status)) {\r
         NotificationCount++;\r