]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
ArmPlatformPkg/ArmPlatformLib: Renamed ArmPlatformInitialize into ArmPlatformSecIniti...
[mirror_edk2.git] / ArmPlatformPkg / ArmRealViewEbPkg / Library / ArmRealViewEbLibRTSM / ArmRealViewEb.c
CommitLineData
1d5d0ae9 1/** @file
2*
3* Copyright (c) 2011, 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/ArmPlatformLib.h>
17#include <Library/DebugLib.h>
18#include <Library/PcdLib.h>
19#include <Drivers/PL341Dmc.h>
20
21/**
22 Return if Trustzone is supported by your platform
23
24 A non-zero value must be returned if you want to support a Secure World on your platform.
25 ArmPlatformTrustzoneInit() will later set up the secure regions.
26 This function can return 0 even if Trustzone is supported by your processor. In this case,
27 the platform will continue to run in Secure World.
28
29 @return A non-zero value if Trustzone supported.
30
31**/
aa01abaa 32UINTN
33ArmPlatformTrustzoneSupported (
34 VOID
35 )
36{
1d5d0ae9 37 // There is no Trustzone controllers (TZPC & TZASC) and no Secure Memory on RTSM
aa01abaa 38 return FALSE;
1d5d0ae9 39}
40
41/**
42 Initialize the Secure peripherals and memory regions
43
44 If Trustzone is supported by your platform then this function makes the required initialization
45 of the secure peripherals and memory regions.
46
47**/
aa01abaa 48VOID
49ArmPlatformTrustzoneInit (
50 VOID
51 )
52{
53 ASSERT(FALSE);
1d5d0ae9 54}
55
56/**
57 Remap the memory at 0x0
58
59 Some platform requires or gives the ability to remap the memory at the address 0x0.
60 This function can do nothing if this feature is not relevant to your platform.
61
62**/
aa01abaa 63VOID
64ArmPlatformBootRemapping (
65 VOID
66 )
67{
1d5d0ae9 68 // Disable memory remapping and return to normal mapping
aa01abaa 69 MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
1d5d0ae9 70}
71
a534d714 72/**
73 Return the current Boot Mode
74
75 This function returns the boot reason on the platform
76
77**/
78EFI_BOOT_MODE
79ArmPlatformGetBootMode (
80 VOID
81 )
82{
83 return BOOT_WITH_FULL_CONFIGURATION;
84}
85
8e06b586 86/**
87 Initialize controllers that must setup at the early stage
88
89 Some peripherals must be initialized in Secure World.
90 For example, some L2x0 requires to be initialized in Secure World
91
92**/
93VOID
aa01abaa 94ArmPlatformSecInitialize (
8e06b586 95 VOID
96 ) {
97 // Do nothing yet
98}
99
aa01abaa 100/**
101 Initialize controllers that must setup in the normal world
102
103 This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
104 in the PEI phase.
105
106**/
107VOID
108ArmPlatformNormalInitialize (
109 VOID
110 )
111{
112 // Nothing to do here
113}
114
1d5d0ae9 115/**
116 Initialize the system (or sometimes called permanent) memory
117
118 This memory is generally represented by the DRAM.
119
120**/
aa01abaa 121VOID
122ArmPlatformInitializeSystemMemory (
123 VOID
124 )
125{
126 // We do not need to initialize the System Memory on RTSM
1d5d0ae9 127}