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