]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Include/Library/ArmPlatformLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPlatformPkg / Include / Library / ArmPlatformLib.h
1 /** @file
2 *
3 * Copyright (c) 2011-2013, ARM Limited. All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
6 *
7 **/
8
9 #ifndef _ARMPLATFORMLIB_H_
10 #define _ARMPLATFORMLIB_H_
11
12 //
13 // The package level header files this module uses
14 //
15 #include <PiPei.h>
16 //
17 // The protocols, PPI and GUID definitions for this module
18 //
19 #include <Ppi/MasterBootMode.h>
20 #include <Ppi/BootInRecoveryMode.h>
21
22 #include <Library/ArmLib.h>
23
24 /**
25 Return the core position from the value of its MpId register
26
27 This function returns the core position from the position 0 in the processor.
28 This function might be called from assembler before any stack is set.
29
30 @return Return the core position
31
32 **/
33 UINTN
34 ArmPlatformGetCorePosition (
35 IN UINTN MpId
36 );
37
38 /**
39 Return a non-zero value if the callee is the primary core
40
41 This function returns a non-zero value if the callee is the primary core.
42 The primary core is the core responsible to initialize the hardware and run UEFI.
43 This function might be called from assembler before any stack is set.
44
45 @return Return a non-zero value if the callee is the primary core.
46
47 **/
48 UINTN
49 ArmPlatformIsPrimaryCore (
50 IN UINTN MpId
51 );
52
53 /**
54 Return the MpId of the primary core
55
56 This function returns the MpId of the primary core.
57 This function might be called from assembler before any stack is set.
58
59 @return Return the MpId of the primary core
60
61 **/
62 UINTN
63 ArmPlatformGetPrimaryCoreMpId (
64 VOID
65 );
66
67 /**
68 Return the current Boot Mode
69
70 This function returns the boot reason on the platform
71
72 @return Return the current Boot Mode of the platform
73
74 **/
75 EFI_BOOT_MODE
76 ArmPlatformGetBootMode (
77 VOID
78 );
79
80 /**
81 First platform specific function to be called in the PEI phase
82
83 This function is actually the first function called by the PrePi
84 or PrePeiCore modules. It allows to retrieve arguments passed to
85 the UEFI firmware through the CPU registers.
86
87 This function might be written into assembler as no stack are set
88 when the function is invoked.
89
90 **/
91 VOID
92 ArmPlatformPeiBootAction (
93 VOID
94 );
95
96 /**
97 Initialize controllers that must setup in the normal world
98
99 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
100 in the PEI phase.
101
102 **/
103 RETURN_STATUS
104 ArmPlatformInitialize (
105 IN UINTN MpId
106 );
107
108 /**
109 Return the Virtual Memory Map of your platform
110
111 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
112
113 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
114 Virtual Memory mapping. This array must be ended by a zero-filled
115 entry
116
117 **/
118 VOID
119 ArmPlatformGetVirtualMemoryMap (
120 OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
121 );
122
123 /**
124 Return the Platform specific PPIs
125
126 This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed
127 to the PeiCore by PrePeiCore.
128
129 @param[out] PpiListSize Size in Bytes of the Platform PPI List
130 @param[out] PpiList Platform PPI List
131
132 **/
133 VOID
134 ArmPlatformGetPlatformPpiList (
135 OUT UINTN *PpiListSize,
136 OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
137 );
138
139 #endif