]>
Commit | Line | Data |
---|---|---|
cd872e40 | 1 | /** @file\r |
2 | *\r | |
3 | * Copyright (c) 2011, 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 "PrePi.h"\r | |
16 | \r | |
17 | #include <Library/ArmMPCoreMailBoxLib.h>\r | |
18 | #include <Chipset/ArmV7.h>\r | |
19 | #include <Drivers/PL390Gic.h>\r | |
20 | \r | |
21 | VOID\r | |
22 | PrimaryMain (\r | |
23 | IN UINTN UefiMemoryBase,\r | |
24 | IN UINTN StackBase,\r | |
25 | IN UINT64 StartTimeStamp\r | |
26 | )\r | |
27 | {\r | |
28 | //Enable the GIC Distributor\r | |
29 | PL390GicEnableDistributor(PcdGet32(PcdGicDistributorBase));\r | |
30 | \r | |
31 | // If ArmVe has not been built as Standalone then we need to wake up the secondary cores\r | |
32 | if (!FixedPcdGet32(PcdStandalone)) {\r | |
33 | // Sending SGI to all the Secondary CPU interfaces\r | |
34 | PL390GicSendSgiTo (PcdGet32(PcdGicDistributorBase), GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r | |
35 | }\r | |
36 | \r | |
37 | PrePiMain (UefiMemoryBase, StackBase, StartTimeStamp);\r | |
38 | \r | |
39 | // We must never return\r | |
40 | ASSERT(FALSE);\r | |
41 | }\r | |
42 | \r | |
43 | VOID\r | |
44 | SecondaryMain (\r | |
45 | IN UINTN CoreId\r | |
46 | )\r | |
47 | {\r | |
48 | // Function pointer to Secondary Core entry point\r | |
49 | VOID (*secondary_start)(VOID);\r | |
50 | UINTN secondary_entry_addr=0;\r | |
51 | \r | |
52 | // Clear Secondary cores MailBox\r | |
53 | ArmClearMPCoreMailbox();\r | |
54 | \r | |
55 | while (secondary_entry_addr = ArmGetMPCoreMailbox(), secondary_entry_addr == 0) {\r | |
56 | ArmCallWFI();\r | |
57 | // Acknowledge the interrupt and send End of Interrupt signal.\r | |
58 | PL390GicAcknowledgeSgiFrom(PcdGet32(PcdGicInterruptInterfaceBase),0/*CoreId*/);\r | |
59 | }\r | |
60 | \r | |
61 | secondary_start = (VOID (*)())secondary_entry_addr;\r | |
62 | \r | |
63 | // Jump to secondary core entry point.\r | |
64 | secondary_start();\r | |
65 | \r | |
66 | // The secondaries shouldn't reach here\r | |
67 | ASSERT(FALSE);\r | |
68 | }\r |