]>
Commit | Line | Data |
---|---|---|
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> | |
23792dea | 19 | |
1d5d0ae9 | 20 | #include <Drivers/PL341Dmc.h> |
23792dea | 21 | #include <Drivers/SP804Timer.h> |
1d5d0ae9 | 22 | |
5cc45b70 | 23 | #include <ArmPlatform.h> |
24 | ||
1d5d0ae9 | 25 | /** |
26 | Return if Trustzone is supported by your platform | |
27 | ||
28 | A non-zero value must be returned if you want to support a Secure World on your platform. | |
29 | ArmPlatformTrustzoneInit() will later set up the secure regions. | |
30 | This function can return 0 even if Trustzone is supported by your processor. In this case, | |
31 | the platform will continue to run in Secure World. | |
32 | ||
33 | @return A non-zero value if Trustzone supported. | |
34 | ||
35 | **/ | |
aa01abaa | 36 | UINTN |
37 | ArmPlatformTrustzoneSupported ( | |
38 | VOID | |
39 | ) | |
40 | { | |
1d5d0ae9 | 41 | // There is no Trustzone controllers (TZPC & TZASC) and no Secure Memory on RTSM |
aa01abaa | 42 | return FALSE; |
1d5d0ae9 | 43 | } |
44 | ||
1d5d0ae9 | 45 | /** |
46 | Remap the memory at 0x0 | |
47 | ||
48 | Some platform requires or gives the ability to remap the memory at the address 0x0. | |
49 | This function can do nothing if this feature is not relevant to your platform. | |
50 | ||
51 | **/ | |
aa01abaa | 52 | VOID |
53 | ArmPlatformBootRemapping ( | |
54 | VOID | |
55 | ) | |
56 | { | |
1d5d0ae9 | 57 | // Disable memory remapping and return to normal mapping |
aa01abaa | 58 | MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE |
1d5d0ae9 | 59 | } |
60 | ||
a534d714 | 61 | /** |
62 | Return the current Boot Mode | |
63 | ||
64 | This function returns the boot reason on the platform | |
65 | ||
66 | **/ | |
67 | EFI_BOOT_MODE | |
68 | ArmPlatformGetBootMode ( | |
69 | VOID | |
70 | ) | |
71 | { | |
72 | return BOOT_WITH_FULL_CONFIGURATION; | |
73 | } | |
74 | ||
aa01abaa | 75 | /** |
76 | Initialize controllers that must setup in the normal world | |
77 | ||
5cc45b70 | 78 | This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei |
aa01abaa | 79 | in the PEI phase. |
80 | ||
81 | **/ | |
82 | VOID | |
83 | ArmPlatformNormalInitialize ( | |
84 | VOID | |
85 | ) | |
86 | { | |
23792dea | 87 | // Configure periodic timer (TIMER0) for 1MHz operation |
88 | MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_TIMCLK); | |
89 | // Configure 1MHz clock | |
90 | MmioOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER1_TIMCLK); | |
91 | // configure SP810 to use 1MHz clock and disable | |
92 | MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER2_EN, SP810_SYS_CTRL_TIMER2_TIMCLK); | |
93 | // Configure SP810 to use 1MHz clock and disable | |
94 | MmioAndThenOr32 (SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER3_EN, SP810_SYS_CTRL_TIMER3_TIMCLK); | |
aa01abaa | 95 | } |
96 | ||
1d5d0ae9 | 97 | /** |
98 | Initialize the system (or sometimes called permanent) memory | |
99 | ||
100 | This memory is generally represented by the DRAM. | |
101 | ||
102 | **/ | |
aa01abaa | 103 | VOID |
104 | ArmPlatformInitializeSystemMemory ( | |
105 | VOID | |
106 | ) | |
107 | { | |
108 | // We do not need to initialize the System Memory on RTSM | |
1d5d0ae9 | 109 | } |
77de7e53 | 110 | VOID |
111 | ArmPlatformGetPlatformPpiList ( | |
112 | OUT UINTN *PpiListSize, | |
113 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList | |
114 | ) | |
115 | { | |
116 | *PpiListSize = 0; | |
117 | *PpiList = NULL; | |
118 | } | |
119 |