]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
ArmPlatformPkg: remove ArmPlatformInitializeSystemMemory
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmPlatformLibNull / ArmPlatformLibNull.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/ArmLib.h>
16 #include <Library/ArmPlatformLib.h>
17
18 #include <Ppi/ArmMpCoreInfo.h>
19
20
21 ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] = {
22 {
23 // Cluster 0, Core 0
24 0x0, 0x0,
25
26 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
27 (EFI_PHYSICAL_ADDRESS)0,
28 (EFI_PHYSICAL_ADDRESS)0,
29 (EFI_PHYSICAL_ADDRESS)0,
30 (UINT64)0xFFFFFFFF
31 },
32 {
33 // Cluster 0, Core 1
34 0x0, 0x1,
35
36 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
37 (EFI_PHYSICAL_ADDRESS)0,
38 (EFI_PHYSICAL_ADDRESS)0,
39 (EFI_PHYSICAL_ADDRESS)0,
40 (UINT64)0xFFFFFFFF
41 },
42 {
43 // Cluster 0, Core 2
44 0x0, 0x2,
45
46 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
47 (EFI_PHYSICAL_ADDRESS)0,
48 (EFI_PHYSICAL_ADDRESS)0,
49 (EFI_PHYSICAL_ADDRESS)0,
50 (UINT64)0xFFFFFFFF
51 },
52 {
53 // Cluster 0, Core 3
54 0x0, 0x3,
55
56 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
57 (EFI_PHYSICAL_ADDRESS)0,
58 (EFI_PHYSICAL_ADDRESS)0,
59 (EFI_PHYSICAL_ADDRESS)0,
60 (UINT64)0xFFFFFFFF
61 }
62 };
63
64 // This function should be better located into TimerLib implementation
65 RETURN_STATUS
66 EFIAPI
67 TimerConstructor (
68 VOID
69 )
70 {
71 return EFI_SUCCESS;
72 }
73
74 /**
75 Return the current Boot Mode
76
77 This function returns the boot reason on the platform
78
79 **/
80 EFI_BOOT_MODE
81 ArmPlatformGetBootMode (
82 VOID
83 )
84 {
85 return BOOT_WITH_FULL_CONFIGURATION;
86 }
87
88 /**
89 Initialize controllers that must setup in the normal world
90
91 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
92 in the PEI phase.
93
94 **/
95 RETURN_STATUS
96 ArmPlatformInitialize (
97 IN UINTN MpId
98 )
99 {
100 if (!ArmPlatformIsPrimaryCore (MpId)) {
101 return RETURN_SUCCESS;
102 }
103
104 //TODO: Implement me
105
106 return RETURN_SUCCESS;
107 }
108
109 EFI_STATUS
110 PrePeiCoreGetMpCoreInfo (
111 OUT UINTN *CoreCount,
112 OUT ARM_CORE_INFO **ArmCoreTable
113 )
114 {
115 if (ArmIsMpCore()) {
116 *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO);
117 *ArmCoreTable = mArmPlatformNullMpCoreInfoTable;
118 return EFI_SUCCESS;
119 } else {
120 return EFI_UNSUPPORTED;
121 }
122 }
123
124 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
125
126 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
127 {
128 EFI_PEI_PPI_DESCRIPTOR_PPI,
129 &gArmMpCoreInfoPpiGuid,
130 &mMpCoreInfoPpi
131 }
132 };
133
134 VOID
135 ArmPlatformGetPlatformPpiList (
136 OUT UINTN *PpiListSize,
137 OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
138 )
139 {
140 if (ArmIsMpCore()) {
141 *PpiListSize = sizeof(gPlatformPpiTable);
142 *PpiList = gPlatformPpiTable;
143 } else {
144 *PpiListSize = 0;
145 *PpiList = NULL;
146 }
147 }
148