]> git.proxmox.com Git - mirror_edk2.git/blob - BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoard.c
BeagleBoardPkg: Implement ArmPlatformLib and the ARM PCDs to reuse ARM common compone...
[mirror_edk2.git] / BeagleBoardPkg / Library / BeagleBoardLib / BeagleBoard.c
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
20 VOID
21 PadConfiguration (
22 VOID
23 );
24
25 VOID
26 ClockInit (
27 VOID
28 );
29
30 /**
31 Return if Trustzone is supported by your platform
32
33 A non-zero value must be returned if you want to support a Secure World on your platform.
34 ArmPlatformTrustzoneInit() will later set up the secure regions.
35 This function can return 0 even if Trustzone is supported by your processor. In this case,
36 the platform will continue to run in Secure World.
37
38 @return A non-zero value if Trustzone supported.
39
40 **/
41 UINTN
42 ArmPlatformTrustzoneSupported (
43 VOID
44 )
45 {
46 // The BeagleBoard starts in Normal World (Non Secure World)
47 return FALSE;
48 }
49
50 /**
51 Initialize the Secure peripherals and memory regions
52
53 If Trustzone is supported by your platform then this function makes the required initialization
54 of the secure peripherals and memory regions.
55
56 **/
57 VOID
58 ArmPlatformTrustzoneInit (
59 VOID
60 )
61 {
62 ASSERT(FALSE);
63 }
64
65 /**
66 Remap the memory at 0x0
67
68 Some platform requires or gives the ability to remap the memory at the address 0x0.
69 This function can do nothing if this feature is not relevant to your platform.
70
71 **/
72 VOID
73 ArmPlatformBootRemapping (
74 VOID
75 )
76 {
77 // Do nothing for the BeagleBoard
78 }
79
80 /**
81 Return the current Boot Mode
82
83 This function returns the boot reason on the platform
84
85 **/
86 EFI_BOOT_MODE
87 ArmPlatformGetBootMode (
88 VOID
89 )
90 {
91 return BOOT_WITH_FULL_CONFIGURATION;
92 }
93
94 /**
95 Initialize controllers that must setup at the early stage
96
97 Some peripherals must be initialized in Secure World.
98 For example, some L2x0 requires to be initialized in Secure World
99
100 **/
101 VOID
102 ArmPlatformNormalInitialize (
103 VOID
104 ) {
105 //Set up Pin muxing.
106 PadConfiguration ();
107
108 // Set up system clocking
109 ClockInit ();
110 }
111
112 /**
113 Initialize the system (or sometimes called permanent) memory
114
115 This memory is generally represented by the DRAM.
116
117 **/
118 VOID
119 ArmPlatformInitializeSystemMemory (
120 VOID
121 )
122 {
123 // We do not need to initialize the System Memory on RTSM
124 }