]>
Commit | Line | Data |
---|---|---|
12fcdcb8 | 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 | ||
12fcdcb8 | 74 | /** |
75 | Return the current Boot Mode | |
76 | ||
77 | This function returns the boot reason on the platform | |
78 | ||
79 | **/ | |
80 | EFI_BOOT_MODE | |
81 | ArmPlatformGetBootMode ( | |
82 | VOID | |
83 | ) | |
84 | { | |
85 | return BOOT_WITH_FULL_CONFIGURATION; | |
86 | } | |
87 | ||
88 | /** | |
89 | Initialize controllers that must setup in the normal world | |
90 | ||
91 | This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei | |
92 | in the PEI phase. | |
93 | ||
94 | **/ | |
95 | VOID | |
96 | ArmPlatformNormalInitialize ( | |
97 | VOID | |
98 | ) | |
99 | { | |
100 | //TODO: Implement me | |
101 | } | |
102 | ||
103 | /** | |
104 | Initialize the system (or sometimes called permanent) memory | |
105 | ||
106 | This memory is generally represented by the DRAM. | |
107 | ||
108 | **/ | |
109 | VOID | |
110 | ArmPlatformInitializeSystemMemory ( | |
111 | VOID | |
112 | ) | |
113 | { | |
114 | //TODO: Implement me | |
115 | } | |
116 | ||
117 | EFI_STATUS | |
118 | PrePeiCoreGetMpCoreInfo ( | |
119 | OUT UINTN *CoreCount, | |
120 | OUT ARM_CORE_INFO **ArmCoreTable | |
121 | ) | |
122 | { | |
123 | if (ArmIsMpCore()) { | |
124 | *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO); | |
125 | *ArmCoreTable = mArmPlatformNullMpCoreInfoTable; | |
126 | return EFI_SUCCESS; | |
127 | } else { | |
128 | return EFI_UNSUPPORTED; | |
129 | } | |
130 | } | |
131 | ||
132 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore | |
133 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID; | |
134 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo }; | |
135 | ||
136 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = { | |
137 | { | |
138 | EFI_PEI_PPI_DESCRIPTOR_PPI, | |
139 | &mArmMpCoreInfoPpiGuid, | |
140 | &mMpCoreInfoPpi | |
141 | } | |
142 | }; | |
143 | ||
144 | VOID | |
145 | ArmPlatformGetPlatformPpiList ( | |
146 | OUT UINTN *PpiListSize, | |
147 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList | |
148 | ) | |
149 | { | |
150 | if (ArmIsMpCore()) { | |
151 | *PpiListSize = sizeof(gPlatformPpiTable); | |
152 | *PpiList = gPlatformPpiTable; | |
153 | } else { | |
154 | *PpiListSize = 0; | |
155 | *PpiList = NULL; | |
156 | } | |
157 | } | |
158 |