2 Sample to provide FSP wrapper platform sec related function.
4 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
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.
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.
17 #include <Ppi/SecPlatformInformation.h>
18 #include <Ppi/SecPerformance.h>
19 #include <Ppi/TemporaryRamSupport.h>
21 #include <Library/LocalApicLib.h>
24 This interface conveys state information out of the Security (SEC) phase into PEI.
26 @param[in] PeiServices Pointer to the PEI Services Table.
27 @param[in,out] StructureSize Pointer to the variable describing size of the input buffer.
28 @param[out] PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.
30 @retval EFI_SUCCESS The data was successfully returned.
31 @retval EFI_BUFFER_TOO_SMALL The buffer was too small.
36 SecPlatformInformation (
37 IN CONST EFI_PEI_SERVICES
**PeiServices
,
38 IN OUT UINT64
*StructureSize
,
39 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD
*PlatformInformationRecord
43 This interface conveys performance information out of the Security (SEC) phase into PEI.
45 This service is published by the SEC phase. The SEC phase handoff has an optional
46 EFI_PEI_PPI_DESCRIPTOR list as its final argument when control is passed from SEC into the
47 PEI Foundation. As such, if the platform supports collecting performance data in SEC,
48 this information is encapsulated into the data structure abstracted by this service.
49 This information is collected for the boot-strap processor (BSP) on IA-32.
51 @param[in] PeiServices The pointer to the PEI Services Table.
52 @param[in] This The pointer to this instance of the PEI_SEC_PERFORMANCE_PPI.
53 @param[out] Performance The pointer to performance data collected in SEC phase.
55 @retval EFI_SUCCESS The data was successfully returned.
61 IN CONST EFI_PEI_SERVICES
**PeiServices
,
62 IN PEI_SEC_PERFORMANCE_PPI
*This
,
63 OUT FIRMWARE_SEC_PERFORMANCE
*Performance
67 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
70 @param[in] PeiServices Pointer to the PEI Services Table.
71 @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
72 Temporary RAM contents.
73 @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
74 Temporary RAM contents.
75 @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.
77 @retval EFI_SUCCESS The data was successfully returned.
78 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
79 TemporaryMemoryBase > PermanentMemoryBase.
84 SecTemporaryRamSupport (
85 IN CONST EFI_PEI_SERVICES
**PeiServices
,
86 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
87 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
91 EFI_SEC_PLATFORM_INFORMATION_PPI mSecPlatformInformationPpi
= {
92 SecPlatformInformation
95 PEI_SEC_PERFORMANCE_PPI mSecPerformancePpi
= {
99 EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI gSecTemporaryRamSupportPpi
= {
100 SecTemporaryRamSupport
103 EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformPpi
[] = {
105 EFI_PEI_PPI_DESCRIPTOR_PPI
,
106 &gEfiSecPlatformInformationPpiGuid
,
107 &mSecPlatformInformationPpi
110 EFI_PEI_PPI_DESCRIPTOR_PPI
,
111 &gPeiSecPerformancePpiGuid
,
115 EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
,
116 &gEfiTemporaryRamSupportPpiGuid
,
117 &gSecTemporaryRamSupportPpi
122 A developer supplied function to perform platform specific operations.
124 It's a developer supplied function to perform any operations appropriate to a
125 given platform. It's invoked just before passing control to PEI core by SEC
126 core. Platform developer may modify the SecCoreData passed to PEI Core.
127 It returns a platform specific PPI list that platform wishes to pass to PEI core.
128 The Generic SEC core module will merge this list to join the final list passed to
131 @param[in,out] SecCoreData The same parameter as passing to PEI core. It
132 could be overridden by this function.
134 @return The platform specific PPI list to be passed to PEI core or
135 NULL if there is no need of such platform specific PPI list.
138 EFI_PEI_PPI_DESCRIPTOR
*
141 IN OUT EFI_SEC_PEI_HAND_OFF
*SecCoreData
144 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
146 InitializeApicTimer (0, (UINT32
) -1, TRUE
, 5);
148 PpiList
= &mPeiSecPlatformPpi
[0];