]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | *\r | |
3 | * Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r | |
4 | *\r | |
5 | * This program and the accompanying materials\r | |
6 | * are licensed and made available under the terms and conditions of the BSD License\r | |
7 | * which accompanies this distribution. The full text of the license may be found at\r | |
8 | * http://opensource.org/licenses/bsd-license.php\r | |
9 | *\r | |
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | *\r | |
13 | **/\r | |
14 | \r | |
15 | #include <Library/IoLib.h>\r | |
16 | #include <Library/ArmPlatformLib.h>\r | |
17 | #include <Library/DebugLib.h>\r | |
18 | #include <Library/PcdLib.h>\r | |
19 | \r | |
20 | #include <Ppi/ArmMpCoreInfo.h>\r | |
21 | \r | |
22 | #include <ArmPlatform.h>\r | |
23 | \r | |
24 | ARM_CORE_INFO mVersatileExpressMpCoreInfoTable[] = {\r | |
25 | {\r | |
26 | // Cluster 0, Core 0\r | |
27 | 0x0, 0x0,\r | |
28 | \r | |
29 | // NOTE:\r | |
30 | // The foundation model does not have the VE_SYS_REGS like all the other VE\r | |
31 | // platforms. We pick a spot in RAM that *should* be safe in the simple case\r | |
32 | // of no UEFI apps interfering (Only the Linux loader getting used). By the\r | |
33 | // time we come to load Linux we should have all the cores in a safe place.\r | |
34 | // The image expects to be loaded at 0xa0000000. We also place the mailboxes\r | |
35 | // here as it does not matter if we corrupt the image at this time.\r | |
36 | // NOTE also see: "ArmVExpressSecLibRTSM/AArch64/RTSMFoundationBoot.S"\r | |
37 | \r | |
38 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
39 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
40 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
41 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
42 | (UINT64)0x0\r | |
43 | \r | |
44 | },\r | |
45 | {\r | |
46 | // Cluster 0, Core 1\r | |
47 | 0x0, 0x1,\r | |
48 | \r | |
49 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
50 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
51 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
52 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
53 | (UINT64)0x0\r | |
54 | \r | |
55 | },\r | |
56 | {\r | |
57 | // Cluster 0, Core 2\r | |
58 | 0x0, 0x2,\r | |
59 | \r | |
60 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
61 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
62 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
63 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
64 | (UINT64)0x0\r | |
65 | },\r | |
66 | {\r | |
67 | // Cluster 0, Core 3\r | |
68 | 0x0, 0x3,\r | |
69 | \r | |
70 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
71 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
72 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
73 | (EFI_PHYSICAL_ADDRESS)0xa0000000,\r | |
74 | (UINT64)0x0\r | |
75 | }\r | |
76 | };\r | |
77 | \r | |
78 | /**\r | |
79 | Return the current Boot Mode\r | |
80 | \r | |
81 | This function returns the boot reason on the platform\r | |
82 | \r | |
83 | @return Return the current Boot Mode of the platform\r | |
84 | \r | |
85 | **/\r | |
86 | EFI_BOOT_MODE\r | |
87 | ArmPlatformGetBootMode (\r | |
88 | VOID\r | |
89 | )\r | |
90 | {\r | |
91 | return BOOT_WITH_FULL_CONFIGURATION;\r | |
92 | }\r | |
93 | \r | |
94 | /**\r | |
95 | Initialize controllers that must setup in the normal world\r | |
96 | \r | |
97 | This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim\r | |
98 | in the PEI phase.\r | |
99 | \r | |
100 | **/\r | |
101 | RETURN_STATUS\r | |
102 | ArmPlatformInitialize (\r | |
103 | IN UINTN MpId\r | |
104 | )\r | |
105 | {\r | |
106 | /* The Foundation model has no SP810 to initialise. */\r | |
107 | \r | |
108 | return RETURN_SUCCESS;\r | |
109 | }\r | |
110 | \r | |
111 | /**\r | |
112 | Initialize the system (or sometimes called permanent) memory\r | |
113 | \r | |
114 | This memory is generally represented by the DRAM.\r | |
115 | \r | |
116 | **/\r | |
117 | VOID\r | |
118 | ArmPlatformInitializeSystemMemory (\r | |
119 | VOID\r | |
120 | )\r | |
121 | {\r | |
122 | // Nothing to do here\r | |
123 | }\r | |
124 | \r | |
125 | EFI_STATUS\r | |
126 | PrePeiCoreGetMpCoreInfo (\r | |
127 | OUT UINTN *CoreCount,\r | |
128 | OUT ARM_CORE_INFO **ArmCoreTable\r | |
129 | )\r | |
130 | {\r | |
131 | // Foundation model has no VE_SYS_REGS\r | |
132 | // Only support one cluster\r | |
133 | *CoreCount = ArmGetCpuCountPerCluster ();\r | |
134 | *ArmCoreTable = mVersatileExpressMpCoreInfoTable;\r | |
135 | \r | |
136 | return EFI_SUCCESS;\r | |
137 | }\r | |
138 | \r | |
139 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the context of PrePeiCore\r | |
140 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;\r | |
141 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };\r | |
142 | \r | |
143 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {\r | |
144 | {\r | |
145 | EFI_PEI_PPI_DESCRIPTOR_PPI,\r | |
146 | &mArmMpCoreInfoPpiGuid,\r | |
147 | &mMpCoreInfoPpi\r | |
148 | }\r | |
149 | };\r | |
150 | \r | |
151 | VOID\r | |
152 | ArmPlatformGetPlatformPpiList (\r | |
153 | OUT UINTN *PpiListSize,\r | |
154 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList\r | |
155 | )\r | |
156 | {\r | |
157 | *PpiListSize = sizeof(gPlatformPpiTable);\r | |
158 | *PpiList = gPlatformPpiTable;\r | |
159 | }\r |