]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PlatformPei: Generate a library from the PEI Module
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Jul 2011 11:45:32 +0000 (11:45 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Jul 2011 11:45:32 +0000 (11:45 +0000)
In the aim to reuse the Platform Pei features in a PrePi module (use to
skip the PEI Core), this module has been divided into two files:
- PlatformPeiLib: declare the platform HOBs
- PlatformPeim: PEIM wrapper for the library

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11951 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/PlatformPei/PlatformPei.c [deleted file]
ArmPlatformPkg/PlatformPei/PlatformPei.inf [deleted file]
ArmPlatformPkg/PlatformPei/PlatformPeiLib.c [new file with mode: 0755]
ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf [new file with mode: 0755]
ArmPlatformPkg/PlatformPei/PlatformPeim.c [new file with mode: 0755]
ArmPlatformPkg/PlatformPei/PlatformPeim.inf [new file with mode: 0755]

diff --git a/ArmPlatformPkg/PlatformPei/PlatformPei.c b/ArmPlatformPkg/PlatformPei/PlatformPei.c
deleted file mode 100644 (file)
index 3ccbbfd..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
-*  \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
-*  http://opensource.org/licenses/bsd-license.php                                            \r
-*\r
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-*\r
-**/\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/MasterBootMode.h>\r
-#include <Ppi/BootInRecoveryMode.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/ArmPlatformLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/HobLib.h>\r
-\r
-\r
-//\r
-// Module globals\r
-//\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiMasterBootModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiBootInRecoveryModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializePlatformPeim (\r
-  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  \r
-\r
-Arguments:\r
-\r
-  FileHandle  - Handle of the file being invoked.\r
-  PeiServices - Describes the list of possible PEI Services.\r
-    \r
-Returns:\r
-\r
-  Status -  EFI_SUCCESS if the boot mode could be set\r
-\r
---*/\r
-{\r
-  EFI_STATUS                    Status;\r
-  UINTN                         BootMode;\r
-\r
-  DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
-\r
-  // Initialize the platform specific controllers\r
-  ArmPlatformNormalInitialize ();\r
-\r
-  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
-  \r
-  BuildFvHob (PcdGet32(PcdNormalFvBaseAddress), PcdGet32(PcdNormalFvSize));\r
-  \r
-  BootMode  = ArmPlatformGetBootMode ();\r
-  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
-    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPei.inf b/ArmPlatformPkg/PlatformPei/PlatformPei.inf
deleted file mode 100644 (file)
index bbc5f1a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#/** @file\r
-#\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
-#  \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
-#  http://opensource.org/licenses/bsd-license.php                                            \r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-#\r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PlatformPei\r
-  FILE_GUID                      = 2ad0fc59-2314-4bf3-8633-13fa22a624a0\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializePlatformPeim\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  PlatformPei.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  EmbeddedPkg/EmbeddedPkg.dec\r
-  ArmPkg/ArmPkg.dec\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
-\r
-[LibraryClasses]\r
-  PeimEntryPoint\r
-  DebugLib\r
-  HobLib\r
-  ArmPlatformLib\r
-\r
-[Ppis]\r
-  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED\r
-  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED\r
-\r
-[FixedPcd]\r
-  gArmTokenSpaceGuid.PcdNormalFdBaseAddress\r
-  gArmTokenSpaceGuid.PcdNormalFdSize\r
-  \r
-  gArmTokenSpaceGuid.PcdNormalFvBaseAddress\r
-  gArmTokenSpaceGuid.PcdNormalFvSize\r
-  \r
-  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
-  gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize\r
-  \r
-[depex]\r
-  TRUE\r
-  \r
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeiLib.c b/ArmPlatformPkg/PlatformPei/PlatformPeiLib.c
new file mode 100755 (executable)
index 0000000..d4faa62
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+*\r
+*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*\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
+*  http://opensource.org/licenses/bsd-license.php\r
+*\r
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#include <PiPei.h>\r
+\r
+#include <Library/ArmPlatformLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/PcdLib.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformPeim (\r
+  VOID\r
+  )\r
+{\r
+  // Initialize the platform specific controllers\r
+  ArmPlatformNormalInitialize ();\r
+\r
+  BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
+\r
+  BuildFvHob (PcdGet32(PcdNormalFvBaseAddress), PcdGet32(PcdNormalFvSize));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf b/ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
new file mode 100755 (executable)
index 0000000..74fdcc8
--- /dev/null
@@ -0,0 +1,53 @@
+#/** @file
+#
+#  Copyright (c) 2011, ARM Limited. All rights reserved.
+#  
+#  This program and the accompanying materials                          
+#  are licensed and made available under the terms and conditions of the BSD License         
+#  which accompanies this distribution.  The full text of the license may be found at        
+#  http://opensource.org/licenses/bsd-license.php                                            
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+#
+#**/
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = ArmPlatformPeiLib
+  FILE_GUID                      = 49d37060-70b5-11e0-aa2d-0002a5d5c51b
+  MODULE_TYPE                    = SEC
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = PlatformPeiLib
+
+[Sources]
+  PlatformPeiLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+  DebugLib
+  HobLib
+  ArmPlatformLib
+
+[Ppis]
+  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED
+  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdNormalFdBaseAddress
+  gArmTokenSpaceGuid.PcdNormalFdSize
+  
+  gArmTokenSpaceGuid.PcdNormalFvBaseAddress
+  gArmTokenSpaceGuid.PcdNormalFvSize
+  
+  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize
+  gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize
+  
+[depex]
+  TRUE
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeim.c b/ArmPlatformPkg/PlatformPei/PlatformPeim.c
new file mode 100755 (executable)
index 0000000..9599a7a
--- /dev/null
@@ -0,0 +1,95 @@
+/** @file\r
+*\r
+*  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*  \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
+*  http://opensource.org/licenses/bsd-license.php                                            \r
+*\r
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+*\r
+**/\r
+\r
+#include <PiPei.h>\r
+\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Ppi/MasterBootMode.h>\r
+#include <Ppi/BootInRecoveryMode.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/PeimEntryPoint.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/ArmPlatformLib.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+InitializePlatformPeim (\r
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices\r
+  );\r
+\r
+//\r
+// Module globals\r
+//\r
+EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPeiMasterBootModePpiGuid,\r
+  NULL\r
+};\r
+\r
+EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPeiBootInRecoveryModePpiGuid,\r
+  NULL\r
+};\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  \r
+\r
+Arguments:\r
+\r
+  FileHandle  - Handle of the file being invoked.\r
+  PeiServices - Describes the list of possible PEI Services.\r
+    \r
+Returns:\r
+\r
+  Status -  EFI_SUCCESS if the boot mode could be set\r
+\r
+--*/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializePlatformPeim (\r
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices\r
+  )\r
+{\r
+  EFI_STATUS                    Status;\r
+  UINTN                         BootMode;\r
+\r
+  DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
+\r
+  PlatformPeim ();\r
+  \r
+  BootMode  = ArmPlatformGetBootMode ();\r
+  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
+    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
+  return Status;\r
+}\r
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeim.inf b/ArmPlatformPkg/PlatformPei/PlatformPeim.inf
new file mode 100755 (executable)
index 0000000..2a7c093
--- /dev/null
@@ -0,0 +1,63 @@
+#/** @file\r
+#\r
+#  Copyright (c) 2011, ARM Limited. All rights reserved.\r
+#  \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
+#  http://opensource.org/licenses/bsd-license.php                                            \r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PlatformPei\r
+  FILE_GUID                      = 2ad0fc59-2314-4bf3-8633-13fa22a624a0\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+\r
+  ENTRY_POINT                    = InitializePlatformPeim\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM\r
+#\r
+\r
+[Sources]\r
+  PlatformPeim.c\r
+  PlatformPeiLib.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
+  ArmPkg/ArmPkg.dec\r
+  ArmPlatformPkg/ArmPlatformPkg.dec\r
+\r
+[LibraryClasses]\r
+  PeimEntryPoint\r
+  DebugLib\r
+  HobLib\r
+  ArmPlatformLib\r
+\r
+[Ppis]\r
+  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED\r
+  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED\r
+\r
+[FixedPcd]\r
+  gArmTokenSpaceGuid.PcdNormalFdBaseAddress\r
+  gArmTokenSpaceGuid.PcdNormalFdSize\r
+  \r
+  gArmTokenSpaceGuid.PcdNormalFvBaseAddress\r
+  gArmTokenSpaceGuid.PcdNormalFvSize\r
+  \r
+  gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
+  gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize\r
+  \r
+[Depex]\r
+  TRUE\r
+  \r