]>
Commit | Line | Data |
---|---|---|
1e57a462 | 1 | /** @file\r |
2 | *\r | |
3 | * Copyright (c) 2011-2012, 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/ArmPlatformLib.h>\r | |
16 | #include <Library/DebugLib.h>\r | |
17 | #include <Library/PcdLib.h>\r | |
18 | \r | |
19 | /**\r | |
20 | Initialize the Secure peripherals and memory regions\r | |
21 | \r | |
22 | If Trustzone is supported by your platform then this function makes the required initialization\r | |
23 | of the secure peripherals and memory regions.\r | |
24 | \r | |
25 | **/\r | |
26 | VOID\r | |
27 | ArmPlatformSecTrustzoneInit (\r | |
28 | IN UINTN MpId\r | |
29 | )\r | |
30 | {\r | |
31 | // Secondary cores might have to set the Secure SGIs into the GICD_IGROUPR0\r | |
bebda7ce | 32 | if (!ArmPlatformIsPrimaryCore (MpId)) {\r |
1e57a462 | 33 | return;\r |
34 | }\r | |
35 | \r | |
36 | ASSERT(FALSE);\r | |
37 | }\r | |
38 | \r | |
39 | /**\r | |
40 | Initialize controllers that must setup at the early stage\r | |
41 | \r | |
42 | Some peripherals must be initialized in Secure World.\r | |
43 | For example, some L2x0 requires to be initialized in Secure World\r | |
44 | \r | |
45 | **/\r | |
46 | RETURN_STATUS\r | |
47 | ArmPlatformSecInitialize (\r | |
48 | IN UINTN MpId\r | |
49 | )\r | |
50 | {\r | |
51 | // If it is not the primary core then there is nothing to do\r | |
bebda7ce | 52 | if (!ArmPlatformIsPrimaryCore (MpId)) {\r |
1e57a462 | 53 | return RETURN_SUCCESS;\r |
54 | }\r | |
55 | \r | |
56 | // Do nothing yet\r | |
57 | return RETURN_SUCCESS;\r | |
58 | }\r | |
59 | \r | |
60 | /**\r | |
61 | Call before jumping to Normal World\r | |
62 | \r | |
63 | This function allows the firmware platform to do extra actions before\r | |
64 | jumping to the Normal World\r | |
65 | \r | |
66 | **/\r | |
67 | VOID\r | |
68 | ArmPlatformSecExtraAction (\r | |
69 | IN UINTN MpId,\r | |
70 | OUT UINTN* JumpAddress\r | |
71 | )\r | |
72 | {\r | |
73 | *JumpAddress = PcdGet32(PcdFvBaseAddress);\r | |
74 | }\r |