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