]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7.c
ArmPlatformPkg/ArmVExpress-CTA15-A7: Added support for CoreTile Express A15x2_A7x3
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibCTA15-A7 / CTA15-A7.c
1 /** @file
2 *
3 * Copyright (c) 2012, 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/IoLib.h>
16 #include <Library/ArmPlatformLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
19
20 #include <Ppi/ArmMpCoreInfo.h>
21
22 #include <ArmPlatform.h>
23
24 ARM_CORE_INFO mVersatileExpressCTA15A7InfoTable[] = {
25 {
26 // Cluster 0, Core 0
27 0x0, 0x0,
28
29 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
30 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR0,
31 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR0,
32 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR0,
33 (UINT64)0
34 },
35 {
36 // Cluster 0, Core 1
37 0x0, 0x1,
38
39 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
40 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR1,
41 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR1,
42 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR1,
43 (UINT64)0
44 },
45 #ifndef ARM_BIGLITTLE_TC2
46 {
47 // Cluster 0, Core 2
48 0x0, 0x2,
49
50 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
51 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR2,
52 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR2,
53 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR2,
54 (UINT64)0
55 },
56 {
57 // Cluster 0, Core 3
58 0x0, 0x3,
59
60 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
61 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR3,
62 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR3,
63 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A15_BX_ADDR3,
64 (UINT64)0
65 },
66 #endif
67 {
68 // Cluster 1, Core 0
69 0x1, 0x0,
70
71 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
72 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR0,
73 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR0,
74 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR0,
75 (UINT64)0
76 },
77 {
78 // Cluster 1, Core 1
79 0x1, 0x1,
80
81 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
82 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR1,
83 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR1,
84 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR1,
85 (UINT64)0
86 },
87 {
88 // Cluster 1, Core 2
89 0x1, 0x2,
90
91 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
92 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR2,
93 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR2,
94 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR2,
95 (UINT64)0
96 }
97 #ifndef ARM_BIGLITTLE_TC2
98 ,{
99 // Cluster 1, Core 3
100 0x1, 0x3,
101
102 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
103 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR3,
104 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR3,
105 (EFI_PHYSICAL_ADDRESS)ARM_CTA15A7_SPC_A7_BX_ADDR3,
106 (UINT64)0
107 }
108 #endif
109 };
110
111 /**
112 Return the current Boot Mode
113
114 This function returns the boot reason on the platform
115
116 @return Return the current Boot Mode of the platform
117
118 **/
119 EFI_BOOT_MODE
120 ArmPlatformGetBootMode (
121 VOID
122 )
123 {
124 return BOOT_WITH_FULL_CONFIGURATION;
125 }
126
127 /**
128 Initialize controllers that must setup in the normal world
129
130 This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
131 in the PEI phase.
132
133 **/
134 RETURN_STATUS
135 ArmPlatformInitialize (
136 IN UINTN MpId
137 )
138 {
139 if (!IS_PRIMARY_CORE(MpId)) {
140 return RETURN_SUCCESS;
141 }
142
143 // Nothing to do here
144
145 return RETURN_SUCCESS;
146 }
147
148 /**
149 Initialize the system (or sometimes called permanent) memory
150
151 This memory is generally represented by the DRAM.
152
153 **/
154 VOID
155 ArmPlatformInitializeSystemMemory (
156 VOID
157 )
158 {
159 }
160
161 EFI_STATUS
162 PrePeiCoreGetMpCoreInfo (
163 OUT UINTN *CoreCount,
164 OUT ARM_CORE_INFO **ArmCoreTable
165 )
166 {
167 // Only support one cluster
168 *CoreCount = sizeof(mVersatileExpressCTA15A7InfoTable) / sizeof(ARM_CORE_INFO);
169 *ArmCoreTable = mVersatileExpressCTA15A7InfoTable;
170 return EFI_SUCCESS;
171 }
172
173 // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
174 EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
175 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
176
177 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
178 {
179 EFI_PEI_PPI_DESCRIPTOR_PPI,
180 &mArmMpCoreInfoPpiGuid,
181 &mMpCoreInfoPpi
182 }
183 };
184
185 VOID
186 ArmPlatformGetPlatformPpiList (
187 OUT UINTN *PpiListSize,
188 OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
189 )
190 {
191 *PpiListSize = sizeof(gPlatformPpiTable);
192 *PpiList = gPlatformPpiTable;
193 }