]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
3467016e4af7d500e4b997b1d48af7731594bbd3
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmPlatformLibNull / ArmPlatformLibNull.c
1 /** @file
2 *
3 * Copyright (c) 2011, 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 #include <Library/ArmLib.h>
16 #include <Library/ArmPlatformLib.h>
17
18 #include <Ppi/ArmMpCoreInfo.h>
19
20
21 ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] = {
22 {
23 // Cluster 0, Core 0
24 0x0, 0x0,
25
26 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
27 (EFI_PHYSICAL_ADDRESS)0,
28 (EFI_PHYSICAL_ADDRESS)0,
29 (EFI_PHYSICAL_ADDRESS)0,
30 (UINT64)0xFFFFFFFF
31 },
32 {
33 // Cluster 0, Core 1
34 0x0, 0x1,
35
36 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
37 (EFI_PHYSICAL_ADDRESS)0,
38 (EFI_PHYSICAL_ADDRESS)0,
39 (EFI_PHYSICAL_ADDRESS)0,
40 (UINT64)0xFFFFFFFF
41 },
42 {
43 // Cluster 0, Core 2
44 0x0, 0x2,
45
46 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
47 (EFI_PHYSICAL_ADDRESS)0,
48 (EFI_PHYSICAL_ADDRESS)0,
49 (EFI_PHYSICAL_ADDRESS)0,
50 (UINT64)0xFFFFFFFF
51 },
52 {
53 // Cluster 0, Core 3
54 0x0, 0x3,
55
56 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
57 (EFI_PHYSICAL_ADDRESS)0,
58 (EFI_PHYSICAL_ADDRESS)0,
59 (EFI_PHYSICAL_ADDRESS)0,
60 (UINT64)0xFFFFFFFF
61 }
62 };
63
64 // This function should be better located into TimerLib implementation
65 RETURN_STATUS
66 EFIAPI
67 TimerConstructor (
68 VOID
69 )
70 {
71 return EFI_SUCCESS;
72 }
73
74 /**
75 Remap the memory at 0x0
76
77 Some platform requires or gives the ability to remap the memory at the address 0x0.
78 This function can do nothing if this feature is not relevant to your platform.
79
80 **/
81 VOID
82 ArmPlatformBootRemapping (
83 VOID
84 )
85 {
86 // Disable memory remapping and return to normal mapping
87 }
88
89 /**
90 Return the current Boot Mode
91
92 This function returns the boot reason on the platform
93
94 **/
95 EFI_BOOT_MODE
96 ArmPlatformGetBootMode (
97 VOID
98 )
99 {
100 return BOOT_WITH_FULL_CONFIGURATION;
101 }
102
103 /**
104 Initialize controllers that must setup in the normal world
105
106 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
107 in the PEI phase.
108
109 **/
110 VOID
111 ArmPlatformNormalInitialize (
112 VOID
113 )
114 {
115 //TODO: Implement me
116 }
117
118 /**
119 Initialize the system (or sometimes called permanent) memory
120
121 This memory is generally represented by the DRAM.
122
123 **/
124 VOID
125 ArmPlatformInitializeSystemMemory (
126 VOID
127 )
128 {
129 //TODO: Implement me
130 }
131
132 EFI_STATUS
133 PrePeiCoreGetMpCoreInfo (
134 OUT UINTN *CoreCount,
135 OUT ARM_CORE_INFO **ArmCoreTable
136 )
137 {
138 if (ArmIsMpCore()) {
139 *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO);
140 *ArmCoreTable = mArmPlatformNullMpCoreInfoTable;
141 return EFI_SUCCESS;
142 } else {
143 return EFI_UNSUPPORTED;
144 }
145 }
146
147 // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
148 EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
149 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
150
151 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
152 {
153 EFI_PEI_PPI_DESCRIPTOR_PPI,
154 &mArmMpCoreInfoPpiGuid,
155 &mMpCoreInfoPpi
156 }
157 };
158
159 VOID
160 ArmPlatformGetPlatformPpiList (
161 OUT UINTN *PpiListSize,
162 OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
163 )
164 {
165 if (ArmIsMpCore()) {
166 *PpiListSize = sizeof(gPlatformPpiTable);
167 *PpiList = gPlatformPpiTable;
168 } else {
169 *PpiListSize = 0;
170 *PpiList = NULL;
171 }
172 }
173