1 /** @file
2 *
3 *  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
4 *
5 *  This program and the accompanying materials
6 *  are licensed and made available under the terms and conditions of the BSD License
7 *  which accompanies this distribution.  The full text of the license may be found at
8 *  http://opensource.org/licenses/bsd-license.php
9 *
10 *  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 *  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14 
15 #ifndef _PREPI_H_
16 #define _PREPI_H_
17 
18 #include <PiPei.h>
19 
20 #include <Library/PcdLib.h>
21 #include <Library/ArmLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/IoLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/HobLib.h>
27 #include <Library/SerialPortLib.h>
28 #include <Library/ArmPlatformLib.h>
29 
30 #define SerialPrint(txt)  SerialPortWrite (txt, AsciiStrLen(txt)+1);
31 
32 extern UINT64 mSystemMemoryEnd;
33 
34 RETURN_STATUS
35 EFIAPI
36 TimerConstructor (
37   VOID
38   );
39 
40 VOID
41 PrePiMain (
42   IN  UINTN                     UefiMemoryBase,
43   IN  UINTN                     StacksBase,
44   IN  UINT64                    StartTimeStamp
45   );
46 
47 EFI_STATUS
48 EFIAPI
49 MemoryPeim (
50   IN EFI_PHYSICAL_ADDRESS       UefiMemoryBase,
51   IN UINT64                     UefiMemorySize
52   );
53 
54 EFI_STATUS
55 EFIAPI
56 PlatformPeim (
57   VOID
58   );
59 
60 VOID
61 PrimaryMain (
62   IN  UINTN                     UefiMemoryBase,
63   IN  UINTN                     StacksBase,
64   IN  UINT64                    StartTimeStamp
65   );
66 
67 VOID
68 SecondaryMain (
69   IN  UINTN                     MpId
70   );
71 
72 // Either implemented by PrePiLib or by MemoryInitPei
73 VOID
74 BuildMemoryTypeInformationHob (
75   VOID
76   );
77 
78 EFI_STATUS
79 GetPlatformPpi (
80   IN  EFI_GUID  *PpiGuid,
81   OUT VOID      **Ppi
82   );
83 
84 // Initialize the Architecture specific controllers
85 VOID
86 ArchInitialize (
87   VOID
88   );
89 
90 #endif /* _PREPI_H_ */
91