Compare commits
216 Commits
system76-s
...
edk2-stabl
Author | SHA1 | Date | |
---|---|---|---|
|
ba0e0e4c6a | ||
|
39ff9769ca | ||
|
166c49c212 | ||
|
722e03bc2e | ||
|
0ede7cad73 | ||
|
4d83ee04f4 | ||
|
dfdba857a6 | ||
|
f2bf043aaa | ||
|
eebef1b3b7 | ||
|
938430741f | ||
|
c15c9fa420 | ||
|
2bb0020675 | ||
|
d5fd86f256 | ||
|
e2ac68a23b | ||
|
68bf712d4f | ||
|
35d167ef3c | ||
|
9102518d29 | ||
|
64a20bea97 | ||
|
3f282f4510 | ||
|
b94836b224 | ||
|
30d62f5e31 | ||
|
2812668bfc | ||
|
809b5a3d2a | ||
|
a2b61de2f6 | ||
|
803ed060ee | ||
|
62391b4ce9 | ||
|
7b4754904e | ||
|
83d5871184 | ||
|
74f44d920a | ||
|
bd06717863 | ||
|
e76496530c | ||
|
e9e2ecab2d | ||
|
927113c83b | ||
|
9f53fd4ba7 | ||
|
f4c845e46b | ||
|
c16f02f776 | ||
|
9cb8974f06 | ||
|
13a0471bfd | ||
|
bf334513b3 | ||
|
f336e30ba1 | ||
|
75e3c2435c | ||
|
f1688ec9da | ||
|
9a24c3546e | ||
|
0f7bccf584 | ||
|
1da2012d93 | ||
|
57faeb782a | ||
|
21200d9fe6 | ||
|
9f197e44b1 | ||
|
1ee1622817 | ||
|
cf02322c98 | ||
|
d241a09afb | ||
|
f5f8c08db9 | ||
|
a0a03b5154 | ||
|
3e599bbc10 | ||
|
a8f59e2eb4 | ||
|
86757f0b47 | ||
|
444260d45e | ||
|
79aab22fca | ||
|
d219119721 | ||
|
0dc9b78a46 | ||
|
a551de0d93 | ||
|
19cbfaa431 | ||
|
6f4e10d6db | ||
|
e9150618ec | ||
|
de200b7e2c | ||
|
cd67efa1b2 | ||
|
4c55f6394f | ||
|
238f903e8d | ||
|
f5cea604a6 | ||
|
65c4f3f2be | ||
|
8a210b9ac0 | ||
|
0d0bfcb457 | ||
|
3eca64f157 | ||
|
0e7add1d75 | ||
|
1774a44ad9 | ||
|
57783adfb5 | ||
|
f26b70cb9f | ||
|
2677286307 | ||
|
e3d468acb9 | ||
|
b68d566439 | ||
|
7f1c89f167 | ||
|
a8c4fe23c4 | ||
|
69f76d0f72 | ||
|
a47241f133 | ||
|
8a5782d704 | ||
|
fca5de51e1 | ||
|
c0b7679aac | ||
|
8ee26529d1 | ||
|
d32a84b5ad | ||
|
6964b5c48c | ||
|
bf1ff540d9 | ||
|
5a3641bfcd | ||
|
c8af26627a | ||
|
343f37b5c0 | ||
|
494f333aba | ||
|
7ef91af84c | ||
|
3b8cee1781 | ||
|
4824924377 | ||
|
24eac4caf3 | ||
|
140446cd59 | ||
|
671b0cea51 | ||
|
19a8768365 | ||
|
9ac155bf0b | ||
|
6cda306da1 | ||
|
f0064ac3af | ||
|
e21b203911 | ||
|
e18a5f813c | ||
|
586b4a104b | ||
|
c966204049 | ||
|
792ebb6374 | ||
|
fc4a132c0e | ||
|
039bdb4d3e | ||
|
176016387f | ||
|
07c8e5e59b | ||
|
0d23c447d6 | ||
|
470206ba7f | ||
|
9ab389c01b | ||
|
12dd064a18 | ||
|
f6f3cc7ead | ||
|
c8e30482fd | ||
|
86a0f84470 | ||
|
e93bc6309b | ||
|
5496c763aa | ||
|
31d3eeb103 | ||
|
9ab18fec82 | ||
|
f193b945ea | ||
|
152e37cc5a | ||
|
dbc4e3675f | ||
|
5678ebb42b | ||
|
d2a0f379d5 | ||
|
fe73e9cd89 | ||
|
6eb4079475 | ||
|
6de7c084db | ||
|
56c717aafa | ||
|
d6bee54c45 | ||
|
134fbd552c | ||
|
e1eef3a8b0 | ||
|
7861b24dc9 | ||
|
70586d4e3a | ||
|
f966093f5b | ||
|
8d0564deaf | ||
|
21e6ef7522 | ||
|
c13377153f | ||
|
5914128871 | ||
|
7f4eca4cc2 | ||
|
b600f253b3 | ||
|
15b25045e6 | ||
|
8f0722434b | ||
|
2aee08c0b6 | ||
|
4bfd668e5e | ||
|
f304308e1c | ||
|
3f5b1b9132 | ||
|
3497fd5c26 | ||
|
a1bd79c514 | ||
|
2b1a5b8c61 | ||
|
6c9f218bc0 | ||
|
aa1bce0e5e | ||
|
3930d1791a | ||
|
b97243dea3 | ||
|
cfe165140a | ||
|
e8034b534a | ||
|
cc2db6ebfb | ||
|
92ab049719 | ||
|
05e57cc9ce | ||
|
16d97fa601 | ||
|
6676162f64 | ||
|
e2ae0bed29 | ||
|
92288f4334 | ||
|
b09ada6edc | ||
|
f0b97e165e | ||
|
ccc269756f | ||
|
283ab9437a | ||
|
b4d7b9d2b5 | ||
|
76323c3145 | ||
|
54aeed7e00 | ||
|
e7abb94d1f | ||
|
2a09527ebc | ||
|
2fbc5ff0a5 | ||
|
34d505123e | ||
|
21a9b605b8 | ||
|
ff36b2550f | ||
|
a81a650da1 | ||
|
ff0ffe5999 | ||
|
2818fda9bc | ||
|
4f89e4b3e8 | ||
|
0b36dea3f8 | ||
|
0a4019ec9d | ||
|
57a6ee3461 | ||
|
f8264e1303 | ||
|
ac03c339de | ||
|
4b0a622635 | ||
|
a708536dce | ||
|
dc443e4437 | ||
|
b1567b2e15 | ||
|
72c5afd0b4 | ||
|
bf25f27e00 | ||
|
3129ed374c | ||
|
43f3cfce19 | ||
|
5c9f151e0c | ||
|
632574ced1 | ||
|
bd10d4e201 | ||
|
ad3bafa7d5 | ||
|
47f44097eb | ||
|
b57911c84c | ||
|
0223898f3e | ||
|
81ab97b7b9 | ||
|
64706ef761 | ||
|
54cd0d9b2f | ||
|
62044aa99b | ||
|
df1c7e91b4 | ||
|
11d8abcba2 | ||
|
fa2b212d61 | ||
|
3ca7326b37 | ||
|
dac2fc8146 | ||
|
b4be5f05dd | ||
|
7f0890776e |
@@ -290,7 +290,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
|||||||
# This information is only used for reporting (not used here) and
|
# This information is only used for reporting (not used here) and
|
||||||
# the ignore lines are being passed directly as they are given to
|
# the ignore lines are being passed directly as they are given to
|
||||||
# this plugin.
|
# this plugin.
|
||||||
return parse_gitignore_lines(ignored_files, "Package configuration file", self._abs_workspace_path)
|
return parse_gitignore_lines(ignored_files, "Package configuration file", self._abs_package_path)
|
||||||
|
|
||||||
def _get_git_ignored_paths(self) -> List[str]:
|
def _get_git_ignored_paths(self) -> List[str]:
|
||||||
""""
|
""""
|
||||||
|
@@ -366,10 +366,9 @@ ArmGicIsInterruptEnabled (
|
|||||||
FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||
|
FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||
|
||||||
SourceIsSpi (Source))
|
SourceIsSpi (Source))
|
||||||
{
|
{
|
||||||
Interrupts = ((MmioRead32 (
|
Interrupts = MmioRead32 (
|
||||||
GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
|
GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
|
||||||
)
|
);
|
||||||
& (1 << RegShift)) != 0);
|
|
||||||
} else {
|
} else {
|
||||||
GicCpuRedistributorBase = GicGetCpuRedistributorBase (
|
GicCpuRedistributorBase = GicGetCpuRedistributorBase (
|
||||||
GicRedistributorBase,
|
GicRedistributorBase,
|
||||||
|
@@ -256,12 +256,6 @@ CpuDxeInitialize (
|
|||||||
SyncCacheConfig (&mCpu);
|
SyncCacheConfig (&mCpu);
|
||||||
mIsFlushingGCD = FALSE;
|
mIsFlushingGCD = FALSE;
|
||||||
|
|
||||||
// If the platform is a MPCore system then install the Configuration Table describing the
|
|
||||||
// secondary core states
|
|
||||||
if (ArmIsMpCore ()) {
|
|
||||||
PublishArmProcessorTable ();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup a callback for idle events
|
// Setup a callback for idle events
|
||||||
//
|
//
|
||||||
|
@@ -104,21 +104,6 @@ SyncCacheConfig (
|
|||||||
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* Publish ARM Processor Data table in UEFI SYSTEM Table.
|
|
||||||
* @param HobStart Pointer to the beginning of the HOB List from PEI.
|
|
||||||
*
|
|
||||||
* Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.
|
|
||||||
* If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory
|
|
||||||
* and a pointer is assigned to it in ARM processor table. Then the ARM processor table is
|
|
||||||
* installed in EFI configuration table.
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
PublishArmProcessorTable (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
// The ARM Attributes might be defined on 64-bit (case of the long format description table)
|
// The ARM Attributes might be defined on 64-bit (case of the long format description table)
|
||||||
UINT64
|
UINT64
|
||||||
EfiAttributeToArmAttribute (
|
EfiAttributeToArmAttribute (
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
[Sources.Common]
|
[Sources.Common]
|
||||||
CpuDxe.c
|
CpuDxe.c
|
||||||
CpuDxe.h
|
CpuDxe.h
|
||||||
CpuMpCore.c
|
|
||||||
CpuMmuCommon.c
|
CpuMmuCommon.c
|
||||||
Exception.c
|
Exception.c
|
||||||
|
|
||||||
|
@@ -1,98 +0,0 @@
|
|||||||
/** @file
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
#include <Library/HobLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
|
|
||||||
#include <Guid/ArmMpCoreInfo.h>
|
|
||||||
|
|
||||||
ARM_PROCESSOR_TABLE mArmProcessorTableTemplate = {
|
|
||||||
{
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_SIGNATURE,
|
|
||||||
0,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_REVISION,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_OEM_ID,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_OEM_TABLE_ID,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_OEM_REVISION,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_CREATOR_ID,
|
|
||||||
EFI_ARM_PROCESSOR_TABLE_CREATOR_REVISION,
|
|
||||||
{ 0 },
|
|
||||||
0
|
|
||||||
}, // ARM Processor table header
|
|
||||||
0, // Number of entries in ARM processor Table
|
|
||||||
NULL // ARM Processor Table
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Publish ARM Processor Data table in UEFI SYSTEM Table.
|
|
||||||
* @param HobStart Pointer to the beginning of the HOB List from PEI.
|
|
||||||
*
|
|
||||||
* Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.
|
|
||||||
* If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory
|
|
||||||
* and a pointer is assigned to it in ARM processor table. Then the ARM processor table is
|
|
||||||
* installed in EFI configuration table.
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
PublishArmProcessorTable (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_PEI_HOB_POINTERS Hob;
|
|
||||||
|
|
||||||
Hob.Raw = GetHobList ();
|
|
||||||
|
|
||||||
// Iterate through the HOBs and find if there is ARM PROCESSOR ENTRY HOB
|
|
||||||
for ( ; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
|
|
||||||
// Check for Correct HOB type
|
|
||||||
if ((GET_HOB_TYPE (Hob)) == EFI_HOB_TYPE_GUID_EXTENSION) {
|
|
||||||
// Check for correct GUID type
|
|
||||||
if (CompareGuid (&(Hob.Guid->Name), &gArmMpCoreInfoGuid)) {
|
|
||||||
ARM_PROCESSOR_TABLE *ArmProcessorTable;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
// Allocate Runtime memory for ARM processor table
|
|
||||||
ArmProcessorTable = (ARM_PROCESSOR_TABLE *)AllocateRuntimePool (sizeof (ARM_PROCESSOR_TABLE));
|
|
||||||
|
|
||||||
// Check if the memory allocation is successful or not
|
|
||||||
ASSERT (NULL != ArmProcessorTable);
|
|
||||||
|
|
||||||
// Set ARM processor table to default values
|
|
||||||
CopyMem (ArmProcessorTable, &mArmProcessorTableTemplate, sizeof (ARM_PROCESSOR_TABLE));
|
|
||||||
|
|
||||||
// Fill in Length fields of ARM processor table
|
|
||||||
ArmProcessorTable->Header.Length = sizeof (ARM_PROCESSOR_TABLE);
|
|
||||||
ArmProcessorTable->Header.DataLen = GET_GUID_HOB_DATA_SIZE (Hob);
|
|
||||||
|
|
||||||
// Fill in Identifier(ARM processor table GUID)
|
|
||||||
ArmProcessorTable->Header.Identifier = gArmMpCoreInfoGuid;
|
|
||||||
|
|
||||||
// Set Number of ARM core entries in the Table
|
|
||||||
ArmProcessorTable->NumberOfEntries = GET_GUID_HOB_DATA_SIZE (Hob)/sizeof (ARM_CORE_INFO);
|
|
||||||
|
|
||||||
// Allocate runtime memory for ARM processor Table entries
|
|
||||||
ArmProcessorTable->ArmCpus = (ARM_CORE_INFO *)AllocateRuntimePool (
|
|
||||||
ArmProcessorTable->NumberOfEntries * sizeof (ARM_CORE_INFO)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check if the memory allocation is successful or not
|
|
||||||
ASSERT (NULL != ArmProcessorTable->ArmCpus);
|
|
||||||
|
|
||||||
// Copy ARM Processor Table data from HOB list to newly allocated memory
|
|
||||||
CopyMem (ArmProcessorTable->ArmCpus, GET_GUID_HOB_DATA (Hob), ArmProcessorTable->Header.DataLen);
|
|
||||||
|
|
||||||
// Install the ARM Processor table into EFI system configuration table
|
|
||||||
Status = gBS->InstallConfigurationTable (&gArmMpCoreInfoGuid, ArmProcessorTable);
|
|
||||||
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -23,36 +23,9 @@ typedef struct {
|
|||||||
UINT64 MailboxClearValue;
|
UINT64 MailboxClearValue;
|
||||||
} ARM_CORE_INFO;
|
} ARM_CORE_INFO;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
UINT64 Signature;
|
|
||||||
UINT32 Length;
|
|
||||||
UINT32 Revision;
|
|
||||||
UINT64 OemId;
|
|
||||||
UINT64 OemTableId;
|
|
||||||
UINTN OemRevision;
|
|
||||||
UINTN CreatorId;
|
|
||||||
UINTN CreatorRevision;
|
|
||||||
EFI_GUID Identifier;
|
|
||||||
UINTN DataLen;
|
|
||||||
} ARM_PROCESSOR_TABLE_HEADER;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ARM_PROCESSOR_TABLE_HEADER Header;
|
|
||||||
UINTN NumberOfEntries;
|
|
||||||
ARM_CORE_INFO *ArmCpus;
|
|
||||||
} ARM_PROCESSOR_TABLE;
|
|
||||||
|
|
||||||
#define ARM_MP_CORE_INFO_GUID \
|
#define ARM_MP_CORE_INFO_GUID \
|
||||||
{ 0xa4ee0728, 0xe5d7, 0x4ac5, {0xb2, 0x1e, 0x65, 0x8e, 0xd8, 0x57, 0xe8, 0x34} }
|
{ 0xa4ee0728, 0xe5d7, 0x4ac5, {0xb2, 0x1e, 0x65, 0x8e, 0xd8, 0x57, 0xe8, 0x34} }
|
||||||
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_SIGNATURE SIGNATURE_64 ('C', 'P', 'U', 'T', 'A', 'B', 'L', 'E')
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_REVISION 0x00010000// 1.0
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_OEM_ID SIGNATURE_64('A','R','M',' ', 'L', 't', 'd', ' ')
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_OEM_TABLE_ID SIGNATURE_64('V', 'E', 'R', 'S', 'A', 'T', 'I', 'L')
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_OEM_REVISION 0x00000001
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_CREATOR_ID 0xA5A5A5A5
|
|
||||||
#define EFI_ARM_PROCESSOR_TABLE_CREATOR_REVISION 0x01000001
|
|
||||||
|
|
||||||
extern EFI_GUID gArmMpCoreInfoGuid;
|
extern EFI_GUID gArmMpCoreInfoGuid;
|
||||||
|
|
||||||
#endif /* ARM_MP_CORE_INFO_GUID_H_ */
|
#endif /* ARM_MP_CORE_INFO_GUID_H_ */
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||||
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||||
* Copyright (c) 2016 HP Development Company, L.P.
|
* Copyright (c) 2016 HP Development Company, L.P.
|
||||||
|
* Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -194,32 +195,6 @@ CopyExceptionHandlers (
|
|||||||
return RETURN_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers.
|
|
||||||
|
|
||||||
Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
|
|
||||||
persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
|
|
||||||
If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
|
|
||||||
If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
|
|
||||||
|
|
||||||
@param[in] VectorInfo Pointer to reserved vector list.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized
|
|
||||||
with default interrupt/exception handlers.
|
|
||||||
@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
|
|
||||||
@retval EFI_UNSUPPORTED This function is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
InitializeCpuInterruptHandlers (
|
|
||||||
IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// not needed, this is what the CPU driver is for
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Registers a function to be called from the processor exception handler. (On ARM/AArch64 this only
|
Registers a function to be called from the processor exception handler. (On ARM/AArch64 this only
|
||||||
provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt
|
provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt
|
||||||
@@ -229,8 +204,8 @@ This function registers and enables the handler specified by ExceptionHandler fo
|
|||||||
interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the
|
interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the
|
||||||
handler for the processor interrupt or exception type specified by ExceptionType is uninstalled.
|
handler for the processor interrupt or exception type specified by ExceptionType is uninstalled.
|
||||||
The installed handler is called once for each processor interrupt or exception.
|
The installed handler is called once for each processor interrupt or exception.
|
||||||
NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
|
NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,
|
||||||
InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.
|
otherwise EFI_UNSUPPORTED returned.
|
||||||
|
|
||||||
@param[in] ExceptionType Defines which interrupt or exception to hook.
|
@param[in] ExceptionType Defines which interrupt or exception to hook.
|
||||||
@param[in] ExceptionHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
|
@param[in] ExceptionHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
|
||||||
@@ -312,33 +287,25 @@ CommonCExceptionHandler (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes all CPU exceptions entries with optional extra initializations.
|
Setup separate stacks for certain exception handlers.
|
||||||
|
If the input Buffer and BufferSize are both NULL, use global variable if possible.
|
||||||
|
|
||||||
By default, this method should include all functionalities implemented by
|
@param[in] Buffer Point to buffer used to separate exception stack.
|
||||||
InitializeCpuExceptionHandlers(), plus extra initialization works, if any.
|
@param[in, out] BufferSize On input, it indicates the byte size of Buffer.
|
||||||
This could be done by calling InitializeCpuExceptionHandlers() directly
|
If the size is not enough, the return status will
|
||||||
in this method besides the extra works.
|
be EFI_BUFFER_TOO_SMALL, and output BufferSize
|
||||||
|
will be the size it needs.
|
||||||
InitData is optional and its use and content are processor arch dependent.
|
|
||||||
The typical usage of it is to convey resources which have to be reserved
|
|
||||||
elsewhere and are necessary for the extra initializations of exception.
|
|
||||||
|
|
||||||
@param[in] VectorInfo Pointer to reserved vector list.
|
|
||||||
@param[in] InitData Pointer to data optional for extra initializations
|
|
||||||
of exception.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The exceptions have been successfully
|
|
||||||
initialized.
|
|
||||||
@retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid
|
|
||||||
content.
|
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The stacks are assigned successfully.
|
||||||
|
@retval EFI_UNSUPPORTED This function is not supported.
|
||||||
|
@retval EFI_BUFFER_TOO_SMALL This BufferSize is too small.
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InitializeCpuExceptionHandlersEx (
|
InitializeSeparateExceptionStacks (
|
||||||
IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,
|
IN VOID *Buffer,
|
||||||
IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL
|
IN OUT UINTN *BufferSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return InitializeCpuExceptionHandlers (VectorInfo);
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -94,6 +94,7 @@
|
|||||||
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x00000000|UINT64|0x00000030
|
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x00000000|UINT64|0x00000030
|
||||||
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|0x00000000|UINT64|0x00000031
|
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|0x00000000|UINT64|0x00000031
|
||||||
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|0x00000000|UINT32|0x00000032
|
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|0x00000000|UINT32|0x00000032
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt|0x00000000|UINT32|0x00000041
|
||||||
|
|
||||||
## PL061 GPIO
|
## PL061 GPIO
|
||||||
gArmPlatformTokenSpaceGuid.PcdPL061GpioBase|0x0|UINT32|0x00000025
|
gArmPlatformTokenSpaceGuid.PcdPL061GpioBase|0x0|UINT32|0x00000025
|
||||||
|
@@ -815,18 +815,6 @@ LcdGraphicsBlt (
|
|||||||
HorizontalResolution = This->Mode->Info->HorizontalResolution;
|
HorizontalResolution = This->Mode->Info->HorizontalResolution;
|
||||||
VerticalResolution = This->Mode->Info->VerticalResolution;
|
VerticalResolution = This->Mode->Info->VerticalResolution;
|
||||||
|
|
||||||
DEBUG ((
|
|
||||||
DEBUG_INFO,
|
|
||||||
"LcdGraphicsBlt (BltOperation:%d,DestX:%d,DestY:%d,Width:%d,Height:%d) res(%d,%d)\n",
|
|
||||||
BltOperation,
|
|
||||||
DestinationX,
|
|
||||||
DestinationY,
|
|
||||||
Width,
|
|
||||||
Height,
|
|
||||||
HorizontalResolution,
|
|
||||||
VerticalResolution
|
|
||||||
));
|
|
||||||
|
|
||||||
// Check we have reasonable parameters
|
// Check we have reasonable parameters
|
||||||
if ((Width == 0) || (Height == 0)) {
|
if ((Width == 0) || (Height == 0)) {
|
||||||
DEBUG ((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid dimension: Zero size area.\n"));
|
DEBUG ((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid dimension: Zero size area.\n"));
|
||||||
|
@@ -144,6 +144,7 @@
|
|||||||
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
|
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
|
||||||
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
|
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
|
||||||
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
|
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
|
||||||
|
DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
|
||||||
|
|
||||||
# USB Libraries
|
# USB Libraries
|
||||||
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
|
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
|
||||||
@@ -169,6 +170,7 @@
|
|||||||
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
|
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
|
||||||
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
|
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
|
||||||
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
|
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
|
||||||
|
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
|
||||||
|
|
||||||
# re-use the UserPhysicalPresent() dummy implementation from the ovmf tree
|
# re-use the UserPhysicalPresent() dummy implementation from the ovmf tree
|
||||||
PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
|
PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
|
||||||
|
@@ -81,6 +81,7 @@
|
|||||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||||
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||||
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
|
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
|
||||||
|
PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
|
||||||
|
|
||||||
!if $(TPM2_ENABLE) == TRUE
|
!if $(TPM2_ENABLE) == TRUE
|
||||||
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
|
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
|
||||||
|
@@ -128,7 +128,7 @@ EDKII_PLATFORM_REPOSITORY_INFO mKvmtoolPlatRepositoryInfo = {
|
|||||||
//
|
//
|
||||||
{
|
{
|
||||||
EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
|
EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
|
||||||
EFI_ACPI_IO_REMAPPING_TABLE_REVISION,
|
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
|
||||||
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
|
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
|
1
BaseTools/.gitignore
vendored
1
BaseTools/.gitignore
vendored
@@ -18,3 +18,4 @@ Source/C/bin/
|
|||||||
Source/C/libs/
|
Source/C/libs/
|
||||||
Bin/Win32
|
Bin/Win32
|
||||||
Lib
|
Lib
|
||||||
|
BaseToolsBuild/
|
@@ -16,10 +16,12 @@ include $(MAKEROOT)/Makefiles/app.makefile
|
|||||||
GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
|
GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
|
||||||
ifneq ("$(GCCVERSION)", "5")
|
ifneq ("$(GCCVERSION)", "5")
|
||||||
ifneq ($(CXX), llvm)
|
ifneq ($(CXX), llvm)
|
||||||
|
ifneq ($(DARWIN),Darwin)
|
||||||
# gcc 12 trips over device path handling
|
# gcc 12 trips over device path handling
|
||||||
BUILD_CFLAGS += -Wno-error=stringop-overflow
|
BUILD_CFLAGS += -Wno-error=stringop-overflow
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
LIBS = -lCommon
|
LIBS = -lCommon
|
||||||
ifeq ($(CYGWIN), CYGWIN)
|
ifeq ($(CYGWIN), CYGWIN)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Elf64 convert solution
|
Elf64 convert solution
|
||||||
|
|
||||||
Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
|
||||||
Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
|
Portions copyright (c) 2013-2022, ARM Ltd. All rights reserved.<BR>
|
||||||
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
|
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -186,8 +186,8 @@ InitializeElf64 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mExportFlag) {
|
if (mExportFlag) {
|
||||||
if (mEhdr->e_machine != EM_X86_64) {
|
if ((mEhdr->e_machine != EM_X86_64) && (mEhdr->e_machine != EM_AARCH64)) {
|
||||||
Error (NULL, 0, 3000, "Unsupported", "--prm option currently only supports X64 arch.");
|
Error (NULL, 0, 3000, "Unsupported", "--prm option currently only supports X64 and AArch64 archs.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -191,7 +191,7 @@ Returns:
|
|||||||
as 0, tool get alignment value from SectionFile. It is\n\
|
as 0, tool get alignment value from SectionFile. It is\n\
|
||||||
specified in same order that the section file is input.\n");
|
specified in same order that the section file is input.\n");
|
||||||
fprintf (stdout, " --dummy dummyfile\n\
|
fprintf (stdout, " --dummy dummyfile\n\
|
||||||
compare dummpyfile with input_file to decide whether\n\
|
compare dummyfile with input_file to decide whether\n\
|
||||||
need to set PROCESSING_REQUIRED attribute.\n");
|
need to set PROCESSING_REQUIRED attribute.\n");
|
||||||
fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
|
fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
|
||||||
fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
|
fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
|
||||||
@@ -988,6 +988,155 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
GenSectionSubtypeGuidSection (
|
||||||
|
CHAR8 **InputFileName,
|
||||||
|
UINT32 *InputFileAlign,
|
||||||
|
UINT32 InputFileNum,
|
||||||
|
EFI_GUID *SubTypeGuid,
|
||||||
|
UINT8 **OutFileBuffer
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
Generate a section of type EFI_SECTION_FREEFORM_SUBTYPE_GUID
|
||||||
|
The function won't validate the input file contents.
|
||||||
|
The utility will add section header to the file.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
InputFileName - Name of the input file.
|
||||||
|
|
||||||
|
InputFileAlign - Alignment required by the input file data.
|
||||||
|
|
||||||
|
InputFileNum - Number of input files. Should be 1 for this section.
|
||||||
|
|
||||||
|
SubTypeGuid - Specify vendor guid value.
|
||||||
|
|
||||||
|
OutFileBuffer - Buffer pointer to Output file contents
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
EFI_SUCCESS on successful return
|
||||||
|
EFI_INVALID_PARAMETER if InputFileNum is less than 1
|
||||||
|
EFI_ABORTED if unable to open input file.
|
||||||
|
EFI_OUT_OF_RESOURCES No resource to complete the operation.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
UINT32 TotalLength;
|
||||||
|
UINT32 InputLength;
|
||||||
|
UINT32 Offset;
|
||||||
|
UINT8 *FileBuffer;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_FREEFORM_SUBTYPE_GUID_SECTION *SubtypeGuidSect;
|
||||||
|
EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *SubtypeGuidSect2;
|
||||||
|
|
||||||
|
|
||||||
|
InputLength = 0;
|
||||||
|
Offset = 0;
|
||||||
|
FileBuffer = NULL;
|
||||||
|
TotalLength = 0;
|
||||||
|
|
||||||
|
if (InputFileNum > 1) {
|
||||||
|
Error (NULL, 0, 2000, "Invalid parameter", "more than one input file specified");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
} else if (InputFileNum < 1) {
|
||||||
|
Error (NULL, 0, 2000, "Invalid parameter", "no input file specified");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// read all input file contents into a buffer
|
||||||
|
// first get the size of all file contents
|
||||||
|
//
|
||||||
|
Status = GetSectionContents (
|
||||||
|
InputFileName,
|
||||||
|
InputFileAlign,
|
||||||
|
InputFileNum,
|
||||||
|
FileBuffer,
|
||||||
|
&InputLength
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
|
Offset = sizeof (EFI_FREEFORM_SUBTYPE_GUID_SECTION);
|
||||||
|
if (InputLength + Offset >= MAX_SECTION_SIZE) {
|
||||||
|
Offset = sizeof (EFI_FREEFORM_SUBTYPE_GUID_SECTION2);
|
||||||
|
}
|
||||||
|
TotalLength = InputLength + Offset;
|
||||||
|
|
||||||
|
FileBuffer = (UINT8 *) malloc (InputLength + Offset);
|
||||||
|
if (FileBuffer == NULL) {
|
||||||
|
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated");
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// read all input file contents into a buffer
|
||||||
|
//
|
||||||
|
Status = GetSectionContents (
|
||||||
|
InputFileName,
|
||||||
|
InputFileAlign,
|
||||||
|
InputFileNum,
|
||||||
|
FileBuffer + Offset,
|
||||||
|
&InputLength
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
if (FileBuffer != NULL) {
|
||||||
|
free (FileBuffer);
|
||||||
|
}
|
||||||
|
Error (NULL, 0, 0001, "Error opening file for reading", InputFileName[0]);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (InputLength == 0) {
|
||||||
|
if (FileBuffer != NULL) {
|
||||||
|
free (FileBuffer);
|
||||||
|
}
|
||||||
|
Error (NULL, 0, 2000, "Invalid parameter", "the size of input file %s can't be zero", InputFileName);
|
||||||
|
return EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// InputLength != 0, but FileBuffer == NULL means out of resources.
|
||||||
|
//
|
||||||
|
if (FileBuffer == NULL) {
|
||||||
|
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated");
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Now data is in FileBuffer + Offset
|
||||||
|
//
|
||||||
|
if (TotalLength >= MAX_SECTION_SIZE) {
|
||||||
|
SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;
|
||||||
|
SubtypeGuidSect2->CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID;
|
||||||
|
SubtypeGuidSect2->CommonHeader.Size[0] = (UINT8) 0xff;
|
||||||
|
SubtypeGuidSect2->CommonHeader.Size[1] = (UINT8) 0xff;
|
||||||
|
SubtypeGuidSect2->CommonHeader.Size[2] = (UINT8) 0xff;
|
||||||
|
SubtypeGuidSect2->CommonHeader.ExtendedSize = InputLength + sizeof (EFI_FREEFORM_SUBTYPE_GUID_SECTION2);
|
||||||
|
memcpy (&(SubtypeGuidSect2->SubTypeGuid), SubTypeGuid, sizeof (EFI_GUID));
|
||||||
|
} else {
|
||||||
|
SubtypeGuidSect = (EFI_FREEFORM_SUBTYPE_GUID_SECTION *) FileBuffer;
|
||||||
|
SubtypeGuidSect->CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID;
|
||||||
|
SubtypeGuidSect->CommonHeader.Size[0] = (UINT8) (TotalLength & 0xff);
|
||||||
|
SubtypeGuidSect->CommonHeader.Size[1] = (UINT8) ((TotalLength & 0xff00) >> 8);
|
||||||
|
SubtypeGuidSect->CommonHeader.Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);
|
||||||
|
memcpy (&(SubtypeGuidSect->SubTypeGuid), SubTypeGuid, sizeof (EFI_GUID));
|
||||||
|
}
|
||||||
|
|
||||||
|
VerboseMsg ("the size of the created section file is %u bytes", (unsigned) TotalLength);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set OutFileBuffer
|
||||||
|
//
|
||||||
|
*OutFileBuffer = FileBuffer;
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
FfsRebaseImageRead (
|
FfsRebaseImageRead (
|
||||||
IN VOID *FileHandle,
|
IN VOID *FileHandle,
|
||||||
@@ -1591,14 +1740,22 @@ Returns:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// GuidValue is only required by Guided section.
|
// GuidValue is only required by Guided section and SubtypeGuid section.
|
||||||
//
|
//
|
||||||
if ((SectType != EFI_SECTION_GUID_DEFINED) &&
|
if ((SectType != EFI_SECTION_GUID_DEFINED) && (SectType != EFI_SECTION_FREEFORM_SUBTYPE_GUID) &&
|
||||||
(SectionName != NULL) &&
|
(SectionName != NULL) &&
|
||||||
(CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
|
(CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
|
||||||
fprintf (stdout, "Warning: the input guid value is not required for this section type %s\n", SectionName);
|
fprintf (stdout, "Warning: the input guid value is not required for this section type %s\n", SectionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check whether there is GUID for the SubtypeGuid section
|
||||||
|
//
|
||||||
|
if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
|
||||||
|
Error (NULL, 0, 1001, "Missing options", "GUID");
|
||||||
|
goto Finish;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check whether there is input file
|
// Check whether there is input file
|
||||||
//
|
//
|
||||||
@@ -1667,6 +1824,16 @@ Returns:
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
|
||||||
|
Status = GenSectionSubtypeGuidSection (
|
||||||
|
InputFileName,
|
||||||
|
InputFileAlign,
|
||||||
|
InputFileNum,
|
||||||
|
&VendorGuid,
|
||||||
|
&OutFileBuffer
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_VERSION:
|
case EFI_SECTION_VERSION:
|
||||||
Index = sizeof (EFI_COMMON_SECTION_HEADER);
|
Index = sizeof (EFI_COMMON_SECTION_HEADER);
|
||||||
//
|
//
|
||||||
|
@@ -911,140 +911,134 @@ Returns:
|
|||||||
printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
|
printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1) {
|
switch (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT) {
|
||||||
|
case EFI_FVB2_ALIGNMENT_1:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_1\n");
|
printf (" EFI_FVB2_ALIGNMENT_1\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {
|
case EFI_FVB2_ALIGNMENT_2:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_2\n");
|
printf (" EFI_FVB2_ALIGNMENT_2\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4) {
|
case EFI_FVB2_ALIGNMENT_4:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_4\n");
|
printf (" EFI_FVB2_ALIGNMENT_4\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {
|
case EFI_FVB2_ALIGNMENT_8:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_8\n");
|
printf (" EFI_FVB2_ALIGNMENT_8\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16) {
|
case EFI_FVB2_ALIGNMENT_16:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_16\n");
|
printf (" EFI_FVB2_ALIGNMENT_16\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {
|
case EFI_FVB2_ALIGNMENT_32:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_32\n");
|
printf (" EFI_FVB2_ALIGNMENT_32\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64) {
|
case EFI_FVB2_ALIGNMENT_64:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_64\n");
|
printf (" EFI_FVB2_ALIGNMENT_64\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {
|
case EFI_FVB2_ALIGNMENT_128:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_128\n");
|
printf (" EFI_FVB2_ALIGNMENT_128\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {
|
case EFI_FVB2_ALIGNMENT_256:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_256\n");
|
printf (" EFI_FVB2_ALIGNMENT_256\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512) {
|
case EFI_FVB2_ALIGNMENT_512:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_512\n");
|
printf (" EFI_FVB2_ALIGNMENT_512\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1K) {
|
case EFI_FVB2_ALIGNMENT_1K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_1K\n");
|
printf (" EFI_FVB2_ALIGNMENT_1K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {
|
case EFI_FVB2_ALIGNMENT_2K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_2K\n");
|
printf (" EFI_FVB2_ALIGNMENT_2K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {
|
case EFI_FVB2_ALIGNMENT_4K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_4K\n");
|
printf (" EFI_FVB2_ALIGNMENT_4K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8K) {
|
case EFI_FVB2_ALIGNMENT_8K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_8K\n");
|
printf (" EFI_FVB2_ALIGNMENT_8K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {
|
case EFI_FVB2_ALIGNMENT_16K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_16K\n");
|
printf (" EFI_FVB2_ALIGNMENT_16K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {
|
case EFI_FVB2_ALIGNMENT_32K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_32K\n");
|
printf (" EFI_FVB2_ALIGNMENT_32K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64K) {
|
case EFI_FVB2_ALIGNMENT_64K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_64K\n");
|
printf (" EFI_FVB2_ALIGNMENT_64K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128K) {
|
case EFI_FVB2_ALIGNMENT_128K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_128K\n");
|
printf (" EFI_FVB2_ALIGNMENT_128K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256K) {
|
case EFI_FVB2_ALIGNMENT_256K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_256K\n");
|
printf (" EFI_FVB2_ALIGNMENT_256K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
|
case EFI_FVB2_ALIGNMENT_512K:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_512K\n");
|
printf (" EFI_FVB2_ALIGNMENT_512K\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {
|
case EFI_FVB2_ALIGNMENT_1M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_1M\n");
|
printf (" EFI_FVB2_ALIGNMENT_1M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2M) {
|
case EFI_FVB2_ALIGNMENT_2M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_2M\n");
|
printf (" EFI_FVB2_ALIGNMENT_2M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4M) {
|
case EFI_FVB2_ALIGNMENT_4M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_4M\n");
|
printf (" EFI_FVB2_ALIGNMENT_4M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8M) {
|
case EFI_FVB2_ALIGNMENT_8M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_8M\n");
|
printf (" EFI_FVB2_ALIGNMENT_8M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16M) {
|
case EFI_FVB2_ALIGNMENT_16M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_16M\n");
|
printf (" EFI_FVB2_ALIGNMENT_16M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32M) {
|
case EFI_FVB2_ALIGNMENT_32M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_32M\n");
|
printf (" EFI_FVB2_ALIGNMENT_32M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
|
case EFI_FVB2_ALIGNMENT_64M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_64M\n");
|
printf (" EFI_FVB2_ALIGNMENT_64M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
|
case EFI_FVB2_ALIGNMENT_128M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_128M\n");
|
printf (" EFI_FVB2_ALIGNMENT_128M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
|
case EFI_FVB2_ALIGNMENT_256M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_64M\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
|
|
||||||
printf (" EFI_FVB2_ALIGNMENT_128M\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256M) {
|
|
||||||
printf (" EFI_FVB2_ALIGNMENT_256M\n");
|
printf (" EFI_FVB2_ALIGNMENT_256M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512M) {
|
case EFI_FVB2_ALIGNMENT_512M:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_512M\n");
|
printf (" EFI_FVB2_ALIGNMENT_512M\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1G) {
|
case EFI_FVB2_ALIGNMENT_1G:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_1G\n");
|
printf (" EFI_FVB2_ALIGNMENT_1G\n");
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2G) {
|
case EFI_FVB2_ALIGNMENT_2G:
|
||||||
printf (" EFI_FVB2_ALIGNMENT_2G\n");
|
printf (" EFI_FVB2_ALIGNMENT_2G\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1682,6 +1676,7 @@ Returns:
|
|||||||
CHAR8 *ToolInputFileName;
|
CHAR8 *ToolInputFileName;
|
||||||
CHAR8 *ToolOutputFileName;
|
CHAR8 *ToolOutputFileName;
|
||||||
CHAR8 *UIFileName;
|
CHAR8 *UIFileName;
|
||||||
|
CHAR8 *VersionString;
|
||||||
|
|
||||||
ParsedLength = 0;
|
ParsedLength = 0;
|
||||||
ToolInputFileName = NULL;
|
ToolInputFileName = NULL;
|
||||||
@@ -1801,20 +1796,30 @@ Returns:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
|
case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
|
||||||
|
printf ("/------------ Firmware Volume section start ---------------\\\n");
|
||||||
Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE);
|
Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
Error (NULL, 0, 0003, "printing of FV section contents failed", NULL);
|
Error (NULL, 0, 0003, "printing of FV section contents failed", NULL);
|
||||||
return EFI_SECTION_ERROR;
|
return EFI_SECTION_ERROR;
|
||||||
}
|
}
|
||||||
|
printf ("\\------------ Firmware Volume section end -----------------/\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_COMPATIBILITY16:
|
case EFI_SECTION_COMPATIBILITY16:
|
||||||
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
|
|
||||||
//
|
//
|
||||||
// Section does not contain any further header information.
|
// Section does not contain any further header information.
|
||||||
//
|
//
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
|
||||||
|
printf (" Guid: ");
|
||||||
|
if (SectionHeaderLen == sizeof (EFI_COMMON_SECTION_HEADER))
|
||||||
|
PrintGuid (&((EFI_FREEFORM_SUBTYPE_GUID_SECTION *)Ptr)->SubTypeGuid);
|
||||||
|
else
|
||||||
|
PrintGuid (&((EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *)Ptr)->SubTypeGuid);
|
||||||
|
printf ("\n");
|
||||||
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_PEI_DEPEX:
|
case EFI_SECTION_PEI_DEPEX:
|
||||||
case EFI_SECTION_DXE_DEPEX:
|
case EFI_SECTION_DXE_DEPEX:
|
||||||
case EFI_SECTION_SMM_DEPEX:
|
case EFI_SECTION_SMM_DEPEX:
|
||||||
@@ -1822,8 +1827,14 @@ Returns:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_VERSION:
|
case EFI_SECTION_VERSION:
|
||||||
printf (" Build Number: 0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));
|
printf (" Build Number: 0x%04X\n", *(UINT16 *)(Ptr + SectionHeaderLen));
|
||||||
printf (" Version Strg: %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));
|
VersionString = (CHAR8 *) malloc (UnicodeStrLen (((EFI_VERSION_SECTION *) Ptr)->VersionString) + 1);
|
||||||
|
if (VersionString == NULL) {
|
||||||
|
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
Unicode2AsciiString (((EFI_VERSION_SECTION *) Ptr)->VersionString, VersionString);
|
||||||
|
printf (" Version String: %s\n", VersionString);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_SECTION_COMPRESSION:
|
case EFI_SECTION_COMPRESSION:
|
||||||
@@ -1902,7 +1913,9 @@ Returns:
|
|||||||
return EFI_SECTION_ERROR;
|
return EFI_SECTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf ("/------------ Encapsulation section start -----------------\\\n");
|
||||||
Status = ParseSection (UncompressedBuffer, UncompressedLength);
|
Status = ParseSection (UncompressedBuffer, UncompressedLength);
|
||||||
|
printf ("\\------------ Encapsulation section end -------------------/\n");
|
||||||
|
|
||||||
if (CompressionType == EFI_STANDARD_COMPRESSION) {
|
if (CompressionType == EFI_STANDARD_COMPRESSION) {
|
||||||
//
|
//
|
||||||
@@ -2021,6 +2034,7 @@ Returns:
|
|||||||
return EFI_SECTION_ERROR;
|
return EFI_SECTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf ("/------------ Encapsulation section start -----------------\\\n");
|
||||||
Status = ParseSection (
|
Status = ParseSection (
|
||||||
ToolOutputBuffer,
|
ToolOutputBuffer,
|
||||||
ToolOutputLength
|
ToolOutputLength
|
||||||
@@ -2029,6 +2043,7 @@ Returns:
|
|||||||
Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL);
|
Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL);
|
||||||
return EFI_SECTION_ERROR;
|
return EFI_SECTION_ERROR;
|
||||||
}
|
}
|
||||||
|
printf ("\\------------ Encapsulation section end -------------------/\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check for CRC32 sections which we can handle internally if needed.
|
// Check for CRC32 sections which we can handle internally if needed.
|
||||||
@@ -2041,6 +2056,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
// CRC32 guided section
|
// CRC32 guided section
|
||||||
//
|
//
|
||||||
|
printf ("/------------ Encapsulation section start -----------------\\\n");
|
||||||
Status = ParseSection (
|
Status = ParseSection (
|
||||||
SectionBuffer + DataOffset,
|
SectionBuffer + DataOffset,
|
||||||
BufferLength - DataOffset
|
BufferLength - DataOffset
|
||||||
@@ -2049,6 +2065,7 @@ Returns:
|
|||||||
Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
|
Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
|
||||||
return EFI_SECTION_ERROR;
|
return EFI_SECTION_ERROR;
|
||||||
}
|
}
|
||||||
|
printf ("\\------------ Encapsulation section end -------------------/\n");
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// We don't know how to parse it now.
|
// We don't know how to parse it now.
|
||||||
|
@@ -22,8 +22,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#define EFI_DEP_END 0x08
|
#define EFI_DEP_END 0x08
|
||||||
#define EFI_DEP_SOR 0x09
|
#define EFI_DEP_SOR 0x09
|
||||||
|
|
||||||
#define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B
|
#define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1C
|
||||||
#define EFI_SECTION_LAST_SECTION_TYPE 0x1B
|
#define EFI_SECTION_LAST_SECTION_TYPE 0x1C
|
||||||
|
|
||||||
#define OPENSSL_COMMAND_FORMAT_STRING "%s sha1 -out %s %s"
|
#define OPENSSL_COMMAND_FORMAT_STRING "%s sha1 -out %s %s"
|
||||||
#define EXTRACT_COMMAND_FORMAT_STRING "%s -d -o %s %s"
|
#define EXTRACT_COMMAND_FORMAT_STRING "%s -d -o %s %s"
|
||||||
|
@@ -120,7 +120,7 @@ class BuildFile(object):
|
|||||||
},
|
},
|
||||||
|
|
||||||
POSIX_PLATFORM : {
|
POSIX_PLATFORM : {
|
||||||
"CP" : "cp -f",
|
"CP" : "cp -p -f",
|
||||||
"MV" : "mv -f",
|
"MV" : "mv -f",
|
||||||
"RM" : "rm -f",
|
"RM" : "rm -f",
|
||||||
"MD" : "mkdir -p",
|
"MD" : "mkdir -p",
|
||||||
@@ -1110,7 +1110,8 @@ cleanlib:
|
|||||||
CmdTargetDict[CmdSign].append(SingleCommandList[-1])
|
CmdTargetDict[CmdSign].append(SingleCommandList[-1])
|
||||||
Index = CommandList.index(Item)
|
Index = CommandList.index(Item)
|
||||||
CommandList.pop(Index)
|
CommandList.pop(Index)
|
||||||
if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
|
BaseName = SingleCommandList[-1].rsplit('.',1)[0]
|
||||||
|
if BaseName.endswith("%s%s" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
|
||||||
Cpplist = CmdCppDict[T.Target.SubDir]
|
Cpplist = CmdCppDict[T.Target.SubDir]
|
||||||
Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
|
Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
|
||||||
source_files = CmdTargetDict[CmdSign][1:]
|
source_files = CmdTargetDict[CmdSign][1:]
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
# keep the tool as simple as possible, it has the following limitations:
|
# keep the tool as simple as possible, it has the following limitations:
|
||||||
# * Do not support vendor code bytes in a capsule.
|
# * Do not support vendor code bytes in a capsule.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2018 - 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass
|
|||||||
# Globals for help information
|
# Globals for help information
|
||||||
#
|
#
|
||||||
__prog__ = 'GenerateCapsule'
|
__prog__ = 'GenerateCapsule'
|
||||||
__version__ = '0.9'
|
__version__ = '0.10'
|
||||||
__copyright__ = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
|
__copyright__ = 'Copyright (c) 2022, Intel Corporation. All rights reserved.'
|
||||||
__description__ = 'Generate a capsule.\n'
|
__description__ = 'Generate a capsule.\n'
|
||||||
|
|
||||||
def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
|
def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = False):
|
||||||
#
|
#
|
||||||
# Create a temporary directory
|
# Create a temporary directory
|
||||||
#
|
#
|
||||||
@@ -72,7 +72,10 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
|
|||||||
Command = Command + '"{Path}" '.format (Path = os.path.join (ToolPath, 'signtool.exe'))
|
Command = Command + '"{Path}" '.format (Path = os.path.join (ToolPath, 'signtool.exe'))
|
||||||
Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData /p7co 1.2.840.113549.1.7.2 '
|
Command = Command + 'sign /fd sha256 /p7ce DetachedSignedData /p7co 1.2.840.113549.1.7.2 '
|
||||||
Command = Command + '/p7 {TempDir} '.format (TempDir = TempDirectoryName)
|
Command = Command + '/p7 {TempDir} '.format (TempDir = TempDirectoryName)
|
||||||
|
if PfxFile is not None:
|
||||||
Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
|
Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
|
||||||
|
if SubjectName is not None:
|
||||||
|
Command = Command + '/n {SubjectName} '.format (SubjectName = SubjectName)
|
||||||
Command = Command + TempFileName
|
Command = Command + TempFileName
|
||||||
if Verbose:
|
if Verbose:
|
||||||
print (Command)
|
print (Command)
|
||||||
@@ -105,7 +108,7 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
|
|||||||
shutil.rmtree (TempDirectoryName)
|
shutil.rmtree (TempDirectoryName)
|
||||||
return Signature
|
return Signature
|
||||||
|
|
||||||
def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, Verbose = False):
|
def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, SubjectName, Verbose = False):
|
||||||
print ('signtool verify is not supported.')
|
print ('signtool verify is not supported.')
|
||||||
raise ValueError ('GenerateCapsule: error: signtool verify is not supported.')
|
raise ValueError ('GenerateCapsule: error: signtool verify is not supported.')
|
||||||
|
|
||||||
@@ -249,6 +252,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance = ConvertJsonValue (Config, 'HardwareInstance', ValidateUnsignedInteger, Required = False, Default = 0)
|
HardwareInstance = ConvertJsonValue (Config, 'HardwareInstance', ValidateUnsignedInteger, Required = False, Default = 0)
|
||||||
MonotonicCount = ConvertJsonValue (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
|
MonotonicCount = ConvertJsonValue (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
|
||||||
SignToolPfxFile = ConvertJsonValue (Config, 'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
SignToolPfxFile = ConvertJsonValue (Config, 'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
|
SignToolSubjectName = ConvertJsonValue (Config, 'SignToolSubjectName', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
@@ -264,6 +268,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance,
|
HardwareInstance,
|
||||||
UpdateImageIndex,
|
UpdateImageIndex,
|
||||||
SignToolPfxFile,
|
SignToolPfxFile,
|
||||||
|
SignToolSubjectName,
|
||||||
OpenSslSignerPrivateCertFile,
|
OpenSslSignerPrivateCertFile,
|
||||||
OpenSslOtherPublicCertFile,
|
OpenSslOtherPublicCertFile,
|
||||||
OpenSslTrustedPublicCertFile,
|
OpenSslTrustedPublicCertFile,
|
||||||
@@ -303,6 +308,7 @@ if __name__ == '__main__':
|
|||||||
UpdateImageIndex = ConvertJsonValue (Config, 'UpdateImageIndex', ValidateUnsignedInteger, Required = False, Default = 1)
|
UpdateImageIndex = ConvertJsonValue (Config, 'UpdateImageIndex', ValidateUnsignedInteger, Required = False, Default = 1)
|
||||||
MonotonicCount = ConvertJsonValue (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
|
MonotonicCount = ConvertJsonValue (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
|
||||||
SignToolPfxFile = ConvertJsonValue (Config, 'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
SignToolPfxFile = ConvertJsonValue (Config, 'SignToolPfxFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
|
SignToolSubjectName = ConvertJsonValue (Config, 'SignToolSubjectName', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslSignerPrivateCertFile = ConvertJsonValue (Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
@@ -329,6 +335,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance,
|
HardwareInstance,
|
||||||
UpdateImageIndex,
|
UpdateImageIndex,
|
||||||
SignToolPfxFile,
|
SignToolPfxFile,
|
||||||
|
SignToolSubjectName,
|
||||||
OpenSslSignerPrivateCertFile,
|
OpenSslSignerPrivateCertFile,
|
||||||
OpenSslOtherPublicCertFile,
|
OpenSslOtherPublicCertFile,
|
||||||
OpenSslTrustedPublicCertFile,
|
OpenSslTrustedPublicCertFile,
|
||||||
@@ -348,6 +355,7 @@ if __name__ == '__main__':
|
|||||||
"HardwareInstance": str(PayloadDescriptor.HardwareInstance),
|
"HardwareInstance": str(PayloadDescriptor.HardwareInstance),
|
||||||
"UpdateImageIndex": str(PayloadDescriptor.UpdateImageIndex),
|
"UpdateImageIndex": str(PayloadDescriptor.UpdateImageIndex),
|
||||||
"SignToolPfxFile": str(PayloadDescriptor.SignToolPfxFile),
|
"SignToolPfxFile": str(PayloadDescriptor.SignToolPfxFile),
|
||||||
|
"SignToolSubjectName": str(PayloadDescriptor.SignToolSubjectName),
|
||||||
"OpenSslSignerPrivateCertFile": str(PayloadDescriptor.OpenSslSignerPrivateCertFile),
|
"OpenSslSignerPrivateCertFile": str(PayloadDescriptor.OpenSslSignerPrivateCertFile),
|
||||||
"OpenSslOtherPublicCertFile": str(PayloadDescriptor.OpenSslOtherPublicCertFile),
|
"OpenSslOtherPublicCertFile": str(PayloadDescriptor.OpenSslOtherPublicCertFile),
|
||||||
"OpenSslTrustedPublicCertFile": str(PayloadDescriptor.OpenSslTrustedPublicCertFile),
|
"OpenSslTrustedPublicCertFile": str(PayloadDescriptor.OpenSslTrustedPublicCertFile),
|
||||||
@@ -363,6 +371,8 @@ if __name__ == '__main__':
|
|||||||
for PayloadField in PayloadSection:
|
for PayloadField in PayloadSection:
|
||||||
if PayloadJsonDescriptorList[Index].SignToolPfxFile is None:
|
if PayloadJsonDescriptorList[Index].SignToolPfxFile is None:
|
||||||
del PayloadField ['SignToolPfxFile']
|
del PayloadField ['SignToolPfxFile']
|
||||||
|
if PayloadJsonDescriptorList[Index].SignToolSubjectName is None:
|
||||||
|
del PayloadField ['SignToolSubjectName']
|
||||||
if PayloadJsonDescriptorList[Index].OpenSslSignerPrivateCertFile is None:
|
if PayloadJsonDescriptorList[Index].OpenSslSignerPrivateCertFile is None:
|
||||||
del PayloadField ['OpenSslSignerPrivateCertFile']
|
del PayloadField ['OpenSslSignerPrivateCertFile']
|
||||||
if PayloadJsonDescriptorList[Index].OpenSslOtherPublicCertFile is None:
|
if PayloadJsonDescriptorList[Index].OpenSslOtherPublicCertFile is None:
|
||||||
@@ -402,6 +412,9 @@ if __name__ == '__main__':
|
|||||||
if args.SignToolPfxFile:
|
if args.SignToolPfxFile:
|
||||||
print ('GenerateCapsule: error: Argument --pfx-file conflicts with Argument -j')
|
print ('GenerateCapsule: error: Argument --pfx-file conflicts with Argument -j')
|
||||||
sys.exit (1)
|
sys.exit (1)
|
||||||
|
if args.SignToolSubjectName:
|
||||||
|
print ('GenerateCapsule: error: Argument --SubjectName conflicts with Argument -j')
|
||||||
|
sys.exit (1)
|
||||||
if args.OpenSslSignerPrivateCertFile:
|
if args.OpenSslSignerPrivateCertFile:
|
||||||
print ('GenerateCapsule: error: Argument --signer-private-cert conflicts with Argument -j')
|
print ('GenerateCapsule: error: Argument --signer-private-cert conflicts with Argument -j')
|
||||||
sys.exit (1)
|
sys.exit (1)
|
||||||
@@ -425,6 +438,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance = 0,
|
HardwareInstance = 0,
|
||||||
UpdateImageIndex = 1,
|
UpdateImageIndex = 1,
|
||||||
SignToolPfxFile = None,
|
SignToolPfxFile = None,
|
||||||
|
SignToolSubjectName = None,
|
||||||
OpenSslSignerPrivateCertFile = None,
|
OpenSslSignerPrivateCertFile = None,
|
||||||
OpenSslOtherPublicCertFile = None,
|
OpenSslOtherPublicCertFile = None,
|
||||||
OpenSslTrustedPublicCertFile = None,
|
OpenSslTrustedPublicCertFile = None,
|
||||||
@@ -439,13 +453,15 @@ if __name__ == '__main__':
|
|||||||
self.HardwareInstance = HardwareInstance
|
self.HardwareInstance = HardwareInstance
|
||||||
self.UpdateImageIndex = UpdateImageIndex
|
self.UpdateImageIndex = UpdateImageIndex
|
||||||
self.SignToolPfxFile = SignToolPfxFile
|
self.SignToolPfxFile = SignToolPfxFile
|
||||||
|
self.SignToolSubjectName = SignToolSubjectName
|
||||||
self.OpenSslSignerPrivateCertFile = OpenSslSignerPrivateCertFile
|
self.OpenSslSignerPrivateCertFile = OpenSslSignerPrivateCertFile
|
||||||
self.OpenSslOtherPublicCertFile = OpenSslOtherPublicCertFile
|
self.OpenSslOtherPublicCertFile = OpenSslOtherPublicCertFile
|
||||||
self.OpenSslTrustedPublicCertFile = OpenSslTrustedPublicCertFile
|
self.OpenSslTrustedPublicCertFile = OpenSslTrustedPublicCertFile
|
||||||
self.SigningToolPath = SigningToolPath
|
self.SigningToolPath = SigningToolPath
|
||||||
self.DepexExp = DepexExp
|
self.DepexExp = DepexExp
|
||||||
|
|
||||||
self.UseSignTool = self.SignToolPfxFile is not None
|
self.UseSignTool = (self.SignToolPfxFile is not None or
|
||||||
|
self.SignToolSubjectName is not None)
|
||||||
self.UseOpenSsl = (self.OpenSslSignerPrivateCertFile is not None and
|
self.UseOpenSsl = (self.OpenSslSignerPrivateCertFile is not None and
|
||||||
self.OpenSslOtherPublicCertFile is not None and
|
self.OpenSslOtherPublicCertFile is not None and
|
||||||
self.OpenSslTrustedPublicCertFile is not None)
|
self.OpenSslTrustedPublicCertFile is not None)
|
||||||
@@ -504,6 +520,7 @@ if __name__ == '__main__':
|
|||||||
raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x0..0xff')
|
raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x0..0xff')
|
||||||
|
|
||||||
if self.UseSignTool:
|
if self.UseSignTool:
|
||||||
|
if self.SignToolPfxFile is not None:
|
||||||
self.SignToolPfxFile.close()
|
self.SignToolPfxFile.close()
|
||||||
self.SignToolPfxFile = self.SignToolPfxFile.name
|
self.SignToolPfxFile = self.SignToolPfxFile.name
|
||||||
if self.UseOpenSsl:
|
if self.UseOpenSsl:
|
||||||
@@ -548,6 +565,7 @@ if __name__ == '__main__':
|
|||||||
args.HardwareInstance,
|
args.HardwareInstance,
|
||||||
args.UpdateImageIndex,
|
args.UpdateImageIndex,
|
||||||
args.SignToolPfxFile,
|
args.SignToolPfxFile,
|
||||||
|
args.SignToolSubjectName,
|
||||||
args.OpenSslSignerPrivateCertFile,
|
args.OpenSslSignerPrivateCertFile,
|
||||||
args.OpenSslOtherPublicCertFile,
|
args.OpenSslOtherPublicCertFile,
|
||||||
args.OpenSslTrustedPublicCertFile,
|
args.OpenSslTrustedPublicCertFile,
|
||||||
@@ -590,6 +608,7 @@ if __name__ == '__main__':
|
|||||||
Result + struct.pack ('<Q', SinglePayloadDescriptor.MonotonicCount),
|
Result + struct.pack ('<Q', SinglePayloadDescriptor.MonotonicCount),
|
||||||
SinglePayloadDescriptor.SigningToolPath,
|
SinglePayloadDescriptor.SigningToolPath,
|
||||||
SinglePayloadDescriptor.SignToolPfxFile,
|
SinglePayloadDescriptor.SignToolPfxFile,
|
||||||
|
SinglePayloadDescriptor.SignToolSubjectName,
|
||||||
Verbose = args.Verbose
|
Verbose = args.Verbose
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -671,6 +690,7 @@ if __name__ == '__main__':
|
|||||||
args.HardwareInstance,
|
args.HardwareInstance,
|
||||||
args.UpdateImageIndex,
|
args.UpdateImageIndex,
|
||||||
args.SignToolPfxFile,
|
args.SignToolPfxFile,
|
||||||
|
args.SignSubjectName,
|
||||||
args.OpenSslSignerPrivateCertFile,
|
args.OpenSslSignerPrivateCertFile,
|
||||||
args.OpenSslOtherPublicCertFile,
|
args.OpenSslOtherPublicCertFile,
|
||||||
args.OpenSslTrustedPublicCertFile,
|
args.OpenSslTrustedPublicCertFile,
|
||||||
@@ -715,6 +735,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance,
|
HardwareInstance,
|
||||||
UpdateImageIndex,
|
UpdateImageIndex,
|
||||||
PayloadDescriptorList[Index].SignToolPfxFile,
|
PayloadDescriptorList[Index].SignToolPfxFile,
|
||||||
|
PayloadDescriptorList[Index].SignToolSubjectName,
|
||||||
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
||||||
@@ -753,6 +774,7 @@ if __name__ == '__main__':
|
|||||||
HardwareInstance,
|
HardwareInstance,
|
||||||
UpdateImageIndex,
|
UpdateImageIndex,
|
||||||
PayloadDescriptorList[Index].SignToolPfxFile,
|
PayloadDescriptorList[Index].SignToolPfxFile,
|
||||||
|
PayloadDescriptorList[Index].SignToolSubjectName,
|
||||||
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
||||||
@@ -785,6 +807,7 @@ if __name__ == '__main__':
|
|||||||
FmpAuthHeader.CertData,
|
FmpAuthHeader.CertData,
|
||||||
SinglePayloadDescriptor.SigningToolPath,
|
SinglePayloadDescriptor.SigningToolPath,
|
||||||
SinglePayloadDescriptor.SignToolPfxFile,
|
SinglePayloadDescriptor.SignToolPfxFile,
|
||||||
|
SinglePayloadDescriptor.SignToolSubjectName,
|
||||||
Verbose = args.Verbose
|
Verbose = args.Verbose
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -968,6 +991,8 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
parser.add_argument ("--pfx-file", dest='SignToolPfxFile', type=argparse.FileType('rb'),
|
parser.add_argument ("--pfx-file", dest='SignToolPfxFile', type=argparse.FileType('rb'),
|
||||||
help="signtool PFX certificate filename.")
|
help="signtool PFX certificate filename.")
|
||||||
|
parser.add_argument ("--subject-name", dest='SignToolSubjectName',
|
||||||
|
help="signtool certificate subject name.")
|
||||||
|
|
||||||
parser.add_argument ("--signer-private-cert", dest='OpenSslSignerPrivateCertFile', type=argparse.FileType('rb'),
|
parser.add_argument ("--signer-private-cert", dest='OpenSslSignerPrivateCertFile', type=argparse.FileType('rb'),
|
||||||
help="OpenSSL signer private certificate filename.")
|
help="OpenSSL signer private certificate filename.")
|
||||||
|
@@ -2612,8 +2612,8 @@ def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, Fu
|
|||||||
|
|
||||||
|
|
||||||
if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':
|
if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':
|
||||||
ErrorMsgList.append('Line %d : in Comment, <%s> does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))
|
ErrorMsgList.append('Line %d : in Comment, <%s> is NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))
|
||||||
PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
|
PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> is NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
|
||||||
Index += 1
|
Index += 1
|
||||||
|
|
||||||
if Index < ParamNumber:
|
if Index < ParamNumber:
|
||||||
|
@@ -97,7 +97,8 @@ PcdMakefileEnd = '''
|
|||||||
|
|
||||||
AppTarget = '''
|
AppTarget = '''
|
||||||
all: $(APPFILE)
|
all: $(APPFILE)
|
||||||
$(APPFILE): $(OBJECTS)
|
$(APPLICATION): $(OBJECTS)
|
||||||
|
$(APPFILE): $(APPLICATION)
|
||||||
%s
|
%s
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@@ -2931,7 +2932,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
MakeApp = MakeApp + PcdMakefileEnd
|
MakeApp = MakeApp + PcdMakefileEnd
|
||||||
MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """)
|
MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """)
|
||||||
else:
|
else:
|
||||||
MakeApp = MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(APPFILE) """)
|
MakeApp = MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) $(APPFILE) """)
|
||||||
MakeApp = MakeApp + '\n'
|
MakeApp = MakeApp + '\n'
|
||||||
IncludeFileFullPaths = []
|
IncludeFileFullPaths = []
|
||||||
for includefile in IncludeFiles:
|
for includefile in IncludeFiles:
|
||||||
@@ -2954,7 +2955,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
else:
|
else:
|
||||||
PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c"))
|
PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c"))
|
||||||
MakeApp = MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)
|
MakeApp = MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)
|
||||||
MakeApp = MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath)
|
MakeApp = MakeApp + '\tcp -p -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath)
|
||||||
MakeFileName = os.path.join(self.OutputPath, 'Makefile')
|
MakeFileName = os.path.join(self.OutputPath, 'Makefile')
|
||||||
MakeApp += "$(OBJECTS) : %s\n" % MakeFileName
|
MakeApp += "$(OBJECTS) : %s\n" % MakeFileName
|
||||||
SaveFileOnChange(MakeFileName, MakeApp, False)
|
SaveFileOnChange(MakeFileName, MakeApp, False)
|
||||||
|
@@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject):
|
|||||||
else:
|
else:
|
||||||
for Name, Guid in self.Pcds:
|
for Name, Guid in self.Pcds:
|
||||||
if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
|
if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
|
||||||
Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name, Guid)].DefaultValue
|
PcdFullName = '%s.%s' % (Guid, Name);
|
||||||
|
if not PcdFullName in Pcds:
|
||||||
|
Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue
|
||||||
try:
|
try:
|
||||||
Value = ValueExpression(Instance, Pcds)()
|
Value = ValueExpression(Instance, Pcds)()
|
||||||
if Value == True:
|
if Value == True:
|
||||||
|
@@ -150,7 +150,9 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
|
|||||||
EdkLogger.error("build", OPTION_MISSING,
|
EdkLogger.error("build", OPTION_MISSING,
|
||||||
"Module type [%s] is not supported by library instance [%s]" \
|
"Module type [%s] is not supported by library instance [%s]" \
|
||||||
% (ModuleType, LibraryPath), File=FileName,
|
% (ModuleType, LibraryPath), File=FileName,
|
||||||
ExtraData="consumed by [%s]" % str(Module))
|
ExtraData="consumed by library instance [%s] which is consumed by module [%s]" \
|
||||||
|
% (str(M), str(Module))
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@@ -109,6 +109,9 @@
|
|||||||
[LibraryClasses.ARM]
|
[LibraryClasses.ARM]
|
||||||
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
|
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
|
||||||
|
|
||||||
|
[LibraryClasses.common.SEC]
|
||||||
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.PEIM]
|
[LibraryClasses.common.PEIM]
|
||||||
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
|
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
|
||||||
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
|
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
|
||||||
@@ -236,6 +239,7 @@
|
|||||||
!if $(CRYPTO_SERVICES) == PACKAGE
|
!if $(CRYPTO_SERVICES) == PACKAGE
|
||||||
[Components]
|
[Components]
|
||||||
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
||||||
|
CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
|
||||||
|
163
CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5Null.c
Normal file
163
CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5Null.c
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
/** @file
|
||||||
|
|
||||||
|
MD5 Digest Wrapper Null Implementation.
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
|
||||||
|
|
||||||
|
@return The size, in bytes, of the context buffer required for MD5 hash operations.
|
||||||
|
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
Md5GetContextSize (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes user-supplied memory pointed by Md5Context as MD5 hash context for
|
||||||
|
subsequent use.
|
||||||
|
|
||||||
|
If Md5Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[out] Md5Context Pointer to MD5 context being initialized.
|
||||||
|
|
||||||
|
@retval TRUE MD5 context initialization succeeded.
|
||||||
|
@retval FALSE MD5 context initialization failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Md5Init (
|
||||||
|
OUT VOID *Md5Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes a copy of an existing MD5 context.
|
||||||
|
|
||||||
|
If Md5Context is NULL, then return FALSE.
|
||||||
|
If NewMd5Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Md5Context Pointer to MD5 context being copied.
|
||||||
|
@param[out] NewMd5Context Pointer to new MD5 context.
|
||||||
|
|
||||||
|
@retval TRUE MD5 context copy succeeded.
|
||||||
|
@retval FALSE MD5 context copy failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Md5Duplicate (
|
||||||
|
IN CONST VOID *Md5Context,
|
||||||
|
OUT VOID *NewMd5Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Digests the input data and updates MD5 context.
|
||||||
|
|
||||||
|
This function performs MD5 digest on a data buffer of the specified size.
|
||||||
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
|
MD5 context should be already correctly intialized by Md5Init(), and should not be finalized
|
||||||
|
by Md5Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
|
If Md5Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Md5Context Pointer to the MD5 context.
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
|
||||||
|
@retval TRUE MD5 data digest succeeded.
|
||||||
|
@retval FALSE MD5 data digest failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Md5Update (
|
||||||
|
IN OUT VOID *Md5Context,
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Completes computation of the MD5 digest value.
|
||||||
|
|
||||||
|
This function completes MD5 hash computation and retrieves the digest value into
|
||||||
|
the specified memory. After this function has been called, the MD5 context cannot
|
||||||
|
be used again.
|
||||||
|
MD5 context should be already correctly intialized by Md5Init(), and should not be
|
||||||
|
finalized by Md5Final(). Behavior with invalid MD5 context is undefined.
|
||||||
|
|
||||||
|
If Md5Context is NULL, then return FALSE.
|
||||||
|
If HashValue is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Md5Context Pointer to the MD5 context.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the MD5 digest
|
||||||
|
value (16 bytes).
|
||||||
|
|
||||||
|
@retval TRUE MD5 digest computation succeeded.
|
||||||
|
@retval FALSE MD5 digest computation failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Md5Final (
|
||||||
|
IN OUT VOID *Md5Context,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes the MD5 message digest of a input data buffer.
|
||||||
|
|
||||||
|
This function performs the MD5 message digest of a given data buffer, and places
|
||||||
|
the digest value into the specified memory.
|
||||||
|
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the MD5 digest
|
||||||
|
value (16 bytes).
|
||||||
|
|
||||||
|
@retval TRUE MD5 digest computation succeeded.
|
||||||
|
@retval FALSE MD5 digest computation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Md5HashAll (
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
166
CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1Null.c
Normal file
166
CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1Null.c
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
/** @file
|
||||||
|
SHA-1 Digest Wrapper Null Implementation.
|
||||||
|
|
||||||
|
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
|
||||||
|
|
||||||
|
@return The size, in bytes, of the context buffer required for SHA-1 hash operations.
|
||||||
|
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
Sha1GetContextSize (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Retrieves SHA Context Size
|
||||||
|
//
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for
|
||||||
|
subsequent use.
|
||||||
|
|
||||||
|
If Sha1Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[out] Sha1Context Pointer to SHA-1 context being initialized.
|
||||||
|
|
||||||
|
@retval TRUE SHA-1 context initialization succeeded.
|
||||||
|
@retval FALSE SHA-1 context initialization failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha1Init (
|
||||||
|
OUT VOID *Sha1Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes a copy of an existing SHA-1 context.
|
||||||
|
|
||||||
|
If Sha1Context is NULL, then return FALSE.
|
||||||
|
If NewSha1Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Sha1Context Pointer to SHA-1 context being copied.
|
||||||
|
@param[out] NewSha1Context Pointer to new SHA-1 context.
|
||||||
|
|
||||||
|
@retval TRUE SHA-1 context copy succeeded.
|
||||||
|
@retval FALSE SHA-1 context copy failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha1Duplicate (
|
||||||
|
IN CONST VOID *Sha1Context,
|
||||||
|
OUT VOID *NewSha1Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Digests the input data and updates SHA-1 context.
|
||||||
|
|
||||||
|
This function performs SHA-1 digest on a data buffer of the specified size.
|
||||||
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
|
SHA-1 context should be already correctly initialized by Sha1Init(), and should not be finalized
|
||||||
|
by Sha1Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
|
If Sha1Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sha1Context Pointer to the SHA-1 context.
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
|
||||||
|
@retval TRUE SHA-1 data digest succeeded.
|
||||||
|
@retval FALSE SHA-1 data digest failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha1Update (
|
||||||
|
IN OUT VOID *Sha1Context,
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Completes computation of the SHA-1 digest value.
|
||||||
|
|
||||||
|
This function completes SHA-1 hash computation and retrieves the digest value into
|
||||||
|
the specified memory. After this function has been called, the SHA-1 context cannot
|
||||||
|
be used again.
|
||||||
|
SHA-1 context should be already correctly initialized by Sha1Init(), and should not be
|
||||||
|
finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.
|
||||||
|
|
||||||
|
If Sha1Context is NULL, then return FALSE.
|
||||||
|
If HashValue is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sha1Context Pointer to the SHA-1 context.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
|
||||||
|
value (20 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SHA-1 digest computation succeeded.
|
||||||
|
@retval FALSE SHA-1 digest computation failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha1Final (
|
||||||
|
IN OUT VOID *Sha1Context,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes the SHA-1 message digest of a input data buffer.
|
||||||
|
|
||||||
|
This function performs the SHA-1 message digest of a given data buffer, and places
|
||||||
|
the digest value into the specified memory.
|
||||||
|
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
|
||||||
|
value (20 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SHA-1 digest computation succeeded.
|
||||||
|
@retval FALSE SHA-1 digest computation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha1HashAll (
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
162
CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256Null.c
Normal file
162
CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256Null.c
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/** @file
|
||||||
|
SHA-256 Digest Wrapper Null Implementation.
|
||||||
|
|
||||||
|
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the size, in bytes, of the context buffer required for SHA-256 hash operations.
|
||||||
|
|
||||||
|
@return The size, in bytes, of the context buffer required for SHA-256 hash operations.
|
||||||
|
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
Sha256GetContextSize (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for
|
||||||
|
subsequent use.
|
||||||
|
|
||||||
|
If Sha256Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[out] Sha256Context Pointer to SHA-256 context being initialized.
|
||||||
|
|
||||||
|
@retval TRUE SHA-256 context initialization succeeded.
|
||||||
|
@retval FALSE SHA-256 context initialization failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha256Init (
|
||||||
|
OUT VOID *Sha256Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes a copy of an existing SHA-256 context.
|
||||||
|
|
||||||
|
If Sha256Context is NULL, then return FALSE.
|
||||||
|
If NewSha256Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Sha256Context Pointer to SHA-256 context being copied.
|
||||||
|
@param[out] NewSha256Context Pointer to new SHA-256 context.
|
||||||
|
|
||||||
|
@retval TRUE SHA-256 context copy succeeded.
|
||||||
|
@retval FALSE SHA-256 context copy failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha256Duplicate (
|
||||||
|
IN CONST VOID *Sha256Context,
|
||||||
|
OUT VOID *NewSha256Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Digests the input data and updates SHA-256 context.
|
||||||
|
|
||||||
|
This function performs SHA-256 digest on a data buffer of the specified size.
|
||||||
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
|
SHA-256 context should be already correctly initialized by Sha256Init(), and should not be finalized
|
||||||
|
by Sha256Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
|
If Sha256Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sha256Context Pointer to the SHA-256 context.
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
|
||||||
|
@retval TRUE SHA-256 data digest succeeded.
|
||||||
|
@retval FALSE SHA-256 data digest failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha256Update (
|
||||||
|
IN OUT VOID *Sha256Context,
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Completes computation of the SHA-256 digest value.
|
||||||
|
|
||||||
|
This function completes SHA-256 hash computation and retrieves the digest value into
|
||||||
|
the specified memory. After this function has been called, the SHA-256 context cannot
|
||||||
|
be used again.
|
||||||
|
SHA-256 context should be already correctly initialized by Sha256Init(), and should not be
|
||||||
|
finalized by Sha256Final(). Behavior with invalid SHA-256 context is undefined.
|
||||||
|
|
||||||
|
If Sha256Context is NULL, then return FALSE.
|
||||||
|
If HashValue is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sha256Context Pointer to the SHA-256 context.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SHA-256 digest
|
||||||
|
value (32 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SHA-256 digest computation succeeded.
|
||||||
|
@retval FALSE SHA-256 digest computation failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha256Final (
|
||||||
|
IN OUT VOID *Sha256Context,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes the SHA-256 message digest of a input data buffer.
|
||||||
|
|
||||||
|
This function performs the SHA-256 message digest of a given data buffer, and places
|
||||||
|
the digest value into the specified memory.
|
||||||
|
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SHA-256 digest
|
||||||
|
value (32 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SHA-256 digest computation succeeded.
|
||||||
|
@retval FALSE SHA-256 digest computation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sha256HashAll (
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
164
CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3Null.c
Normal file
164
CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3Null.c
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
/** @file
|
||||||
|
SM3 Digest Wrapper Null Implementation.
|
||||||
|
|
||||||
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the size, in bytes, of the context buffer required for SM3 hash operations.
|
||||||
|
|
||||||
|
@return The size, in bytes, of the context buffer required for SM3 hash operations.
|
||||||
|
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
Sm3GetContextSize (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes user-supplied memory pointed by Sm3Context as SM3 hash context for
|
||||||
|
subsequent use.
|
||||||
|
|
||||||
|
If Sm3Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[out] Sm3Context Pointer to SM3 context being initialized.
|
||||||
|
|
||||||
|
@retval TRUE SM3 context initialization succeeded.
|
||||||
|
@retval FALSE SM3 context initialization failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sm3Init (
|
||||||
|
OUT VOID *Sm3Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes a copy of an existing SM3 context.
|
||||||
|
|
||||||
|
If Sm3Context is NULL, then return FALSE.
|
||||||
|
If NewSm3Context is NULL, then return FALSE.
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Sm3Context Pointer to SM3 context being copied.
|
||||||
|
@param[out] NewSm3Context Pointer to new SM3 context.
|
||||||
|
|
||||||
|
@retval TRUE SM3 context copy succeeded.
|
||||||
|
@retval FALSE SM3 context copy failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sm3Duplicate (
|
||||||
|
IN CONST VOID *Sm3Context,
|
||||||
|
OUT VOID *NewSm3Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Digests the input data and updates SM3 context.
|
||||||
|
|
||||||
|
This function performs SM3 digest on a data buffer of the specified size.
|
||||||
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
|
SM3 context should be already correctly initialized by Sm3Init(), and should not be finalized
|
||||||
|
by Sm3Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
|
If Sm3Context is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sm3Context Pointer to the SM3 context.
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
|
||||||
|
@retval TRUE SM3 data digest succeeded.
|
||||||
|
@retval FALSE SM3 data digest failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sm3Update (
|
||||||
|
IN OUT VOID *Sm3Context,
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Completes computation of the SM3 digest value.
|
||||||
|
|
||||||
|
This function completes SM3 hash computation and retrieves the digest value into
|
||||||
|
the specified memory. After this function has been called, the SM3 context cannot
|
||||||
|
be used again.
|
||||||
|
SM3 context should be already correctly initialized by Sm3Init(), and should not be
|
||||||
|
finalized by Sm3Final(). Behavior with invalid SM3 context is undefined.
|
||||||
|
|
||||||
|
If Sm3Context is NULL, then return FALSE.
|
||||||
|
If HashValue is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] Sm3Context Pointer to the SM3 context.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SM3 digest
|
||||||
|
value (32 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SM3 digest computation succeeded.
|
||||||
|
@retval FALSE SM3 digest computation failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sm3Final (
|
||||||
|
IN OUT VOID *Sm3Context,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes the SM3 message digest of a input data buffer.
|
||||||
|
|
||||||
|
This function performs the SM3 message digest of a given data buffer, and places
|
||||||
|
the digest value into the specified memory.
|
||||||
|
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] Data Pointer to the buffer containing the data to be hashed.
|
||||||
|
@param[in] DataSize Size of Data buffer in bytes.
|
||||||
|
@param[out] HashValue Pointer to a buffer that receives the SM3 digest
|
||||||
|
value (32 bytes).
|
||||||
|
|
||||||
|
@retval TRUE SM3 digest computation succeeded.
|
||||||
|
@retval FALSE SM3 digest computation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
Sm3HashAll (
|
||||||
|
IN CONST VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT8 *HashValue
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
152
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEkuNull.c
Normal file
152
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEkuNull.c
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
/** @file
|
||||||
|
PKCS7 Verify Null implementation.
|
||||||
|
|
||||||
|
Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||||
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function will return the leaf signer certificate in a chain. This is
|
||||||
|
required because certificate chains are not guaranteed to have the
|
||||||
|
certificates in the order that they were issued.
|
||||||
|
|
||||||
|
A typical certificate chain looks like this:
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
| Root |
|
||||||
|
----------------------------
|
||||||
|
^
|
||||||
|
|
|
||||||
|
----------------------------
|
||||||
|
| Policy CA | <-- Typical Trust Anchor.
|
||||||
|
----------------------------
|
||||||
|
^
|
||||||
|
|
|
||||||
|
----------------------------
|
||||||
|
| Issuing CA |
|
||||||
|
----------------------------
|
||||||
|
^
|
||||||
|
|
|
||||||
|
-----------------------------
|
||||||
|
/ End-Entity (leaf) signer / <-- Bottom certificate.
|
||||||
|
----------------------------- EKU: "1.3.6.1.4.1.311.76.9.21.1"
|
||||||
|
(Firmware Signing)
|
||||||
|
|
||||||
|
|
||||||
|
@param[in] CertChain Certificate chain.
|
||||||
|
|
||||||
|
@param[out] SignerCert Last certificate in the chain. For PKCS7 signatures,
|
||||||
|
this will be the end-entity (leaf) signer cert.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The required EKUs were found in the signature.
|
||||||
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||||
|
@retval EFI_NOT_FOUND The number of signers found was not 1.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
GetSignerCertificate (
|
||||||
|
IN CONST VOID *CertChain,
|
||||||
|
OUT VOID **SignerCert
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return EFI_NOT_READY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Determines if the specified EKU represented in ASN1 form is present
|
||||||
|
in a given certificate.
|
||||||
|
|
||||||
|
@param[in] Cert The certificate to check.
|
||||||
|
|
||||||
|
@param[in] Asn1ToFind The EKU to look for.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS We successfully identified the signing type.
|
||||||
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||||
|
@retval EFI_NOT_FOUND One or more EKU's were not found in the signature.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
IsEkuInCertificate (
|
||||||
|
IN CONST VOID *Cert,
|
||||||
|
IN VOID *Asn1ToFind
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return EFI_NOT_READY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Determines if the specified EKUs are present in a signing certificate.
|
||||||
|
|
||||||
|
@param[in] SignerCert The certificate to check.
|
||||||
|
@param[in] RequiredEKUs The EKUs to look for.
|
||||||
|
@param[in] RequiredEKUsSize The number of EKUs
|
||||||
|
@param[in] RequireAllPresent If TRUE, then all the specified EKUs
|
||||||
|
must be present in the certificate.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS We successfully identified the signing type.
|
||||||
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||||
|
@retval EFI_NOT_FOUND One or more EKU's were not found in the signature.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
CheckEKUs (
|
||||||
|
IN CONST VOID *SignerCert,
|
||||||
|
IN CONST CHAR8 *RequiredEKUs[],
|
||||||
|
IN CONST UINT32 RequiredEKUsSize,
|
||||||
|
IN BOOLEAN RequireAllPresent
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return EFI_NOT_READY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function receives a PKCS#7 formatted signature blob,
|
||||||
|
looks for the EKU SEQUENCE blob, and if found then looks
|
||||||
|
for all the required EKUs. This function was created so that
|
||||||
|
the Surface team can cut down on the number of Certificate
|
||||||
|
Authorities (CA's) by checking EKU's on leaf signers for
|
||||||
|
a specific product. This prevents one product's certificate
|
||||||
|
from signing another product's firmware or unlock blobs.
|
||||||
|
|
||||||
|
Note that this function does not validate the certificate chain.
|
||||||
|
That needs to be done before using this function.
|
||||||
|
|
||||||
|
@param[in] Pkcs7Signature The PKCS#7 signed information content block. An array
|
||||||
|
containing the content block with both the signature,
|
||||||
|
the signer's certificate, and any necessary intermediate
|
||||||
|
certificates.
|
||||||
|
@param[in] Pkcs7SignatureSize Number of bytes in Pkcs7Signature.
|
||||||
|
@param[in] RequiredEKUs Array of null-terminated strings listing OIDs of
|
||||||
|
required EKUs that must be present in the signature.
|
||||||
|
@param[in] RequiredEKUsSize Number of elements in the RequiredEKUs string array.
|
||||||
|
@param[in] RequireAllPresent If this is TRUE, then all of the specified EKU's
|
||||||
|
must be present in the leaf signer. If it is
|
||||||
|
FALSE, then we will succeed if we find any
|
||||||
|
of the specified EKU's.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The required EKUs were found in the signature.
|
||||||
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||||
|
@retval EFI_NOT_FOUND One or more EKU's were not found in the signature.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
VerifyEKUsInPkcs7Signature (
|
||||||
|
IN CONST UINT8 *Pkcs7Signature,
|
||||||
|
IN CONST UINT32 SignatureSize,
|
||||||
|
IN CONST CHAR8 *RequiredEKUs[],
|
||||||
|
IN CONST UINT32 RequiredEKUsSize,
|
||||||
|
IN BOOLEAN RequireAllPresent
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return EFI_NOT_READY;
|
||||||
|
}
|
121
CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasicNull.c
Normal file
121
CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasicNull.c
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/** @file
|
||||||
|
RSA Asymmetric Cipher Wrapper Null Implementation.
|
||||||
|
|
||||||
|
This file implements following APIs which provide basic capabilities for RSA:
|
||||||
|
1) RsaNew
|
||||||
|
2) RsaFree
|
||||||
|
3) RsaSetKey
|
||||||
|
4) RsaPkcs1Verify
|
||||||
|
|
||||||
|
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocates and initializes one RSA context for subsequent use.
|
||||||
|
|
||||||
|
@return Pointer to the RSA context that has been initialized.
|
||||||
|
If the allocations fails, RsaNew() returns NULL.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID *
|
||||||
|
EFIAPI
|
||||||
|
RsaNew (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Allocates & Initializes RSA Context
|
||||||
|
//
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Release the specified RSA context.
|
||||||
|
|
||||||
|
@param[in] RsaContext Pointer to the RSA context to be released.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
RsaFree (
|
||||||
|
IN VOID *RsaContext
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Free RSA Context
|
||||||
|
//
|
||||||
|
ASSERT (FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the tag-designated key component into the established RSA context.
|
||||||
|
|
||||||
|
This function sets the tag-designated RSA key component into the established
|
||||||
|
RSA context from the user-specified non-negative integer (octet string format
|
||||||
|
represented in RSA PKCS#1).
|
||||||
|
If BigNumber is NULL, then the specified key component in RSA context is cleared.
|
||||||
|
|
||||||
|
If RsaContext is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] RsaContext Pointer to RSA context being set.
|
||||||
|
@param[in] KeyTag Tag of RSA key component being set.
|
||||||
|
@param[in] BigNumber Pointer to octet integer buffer.
|
||||||
|
If NULL, then the specified key component in RSA
|
||||||
|
context is cleared.
|
||||||
|
@param[in] BnSize Size of big number buffer in bytes.
|
||||||
|
If BigNumber is NULL, then it is ignored.
|
||||||
|
|
||||||
|
@retval TRUE RSA key component was set successfully.
|
||||||
|
@retval FALSE Invalid RSA key component tag.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
RsaSetKey (
|
||||||
|
IN OUT VOID *RsaContext,
|
||||||
|
IN RSA_KEY_TAG KeyTag,
|
||||||
|
IN CONST UINT8 *BigNumber,
|
||||||
|
IN UINTN BnSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in
|
||||||
|
RSA PKCS#1.
|
||||||
|
|
||||||
|
If RsaContext is NULL, then return FALSE.
|
||||||
|
If MessageHash is NULL, then return FALSE.
|
||||||
|
If Signature is NULL, then return FALSE.
|
||||||
|
If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
|
||||||
|
|
||||||
|
@param[in] RsaContext Pointer to RSA context for signature verification.
|
||||||
|
@param[in] MessageHash Pointer to octet message hash to be checked.
|
||||||
|
@param[in] HashSize Size of the message hash in bytes.
|
||||||
|
@param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified.
|
||||||
|
@param[in] SigSize Size of signature in bytes.
|
||||||
|
|
||||||
|
@retval TRUE Valid signature encoded in PKCS1-v1_5.
|
||||||
|
@retval FALSE Invalid signature or invalid RSA context.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
RsaPkcs1Verify (
|
||||||
|
IN VOID *RsaContext,
|
||||||
|
IN CONST UINT8 *MessageHash,
|
||||||
|
IN UINTN HashSize,
|
||||||
|
IN CONST UINT8 *Signature,
|
||||||
|
IN UINTN SigSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
91
CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
Normal file
91
CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
## @file
|
||||||
|
# Cryptographic Library Instance for SEC.
|
||||||
|
#
|
||||||
|
# Caution: This module requires additional review when modified.
|
||||||
|
# This library will have external input - signature.
|
||||||
|
# This external input must be validated carefully to avoid security issues such as
|
||||||
|
# buffer overflow or integer overflow.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x00010005
|
||||||
|
BASE_NAME = SecCryptLib
|
||||||
|
FILE_GUID = 3689D343-0D32-4284-8053-BF10537990E8
|
||||||
|
MODULE_TYPE = BASE
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
LIBRARY_CLASS = BaseCryptLib|SEC
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
InternalCryptLib.h
|
||||||
|
Hash/CryptSha512.c
|
||||||
|
|
||||||
|
Hash/CryptMd5Null.c
|
||||||
|
Hash/CryptSha1Null.c
|
||||||
|
Hash/CryptSha256Null.c
|
||||||
|
Hash/CryptSm3Null.c
|
||||||
|
Hash/CryptParallelHashNull.c
|
||||||
|
Hmac/CryptHmacSha256Null.c
|
||||||
|
Kdf/CryptHkdfNull.c
|
||||||
|
Cipher/CryptAesNull.c
|
||||||
|
Pk/CryptRsaBasicNull.c
|
||||||
|
Pk/CryptRsaExtNull.c
|
||||||
|
Pk/CryptPkcs1OaepNull.c
|
||||||
|
Pk/CryptPkcs5Pbkdf2Null.c
|
||||||
|
Pk/CryptPkcs7SignNull.c
|
||||||
|
Pk/CryptPkcs7VerifyNull.c
|
||||||
|
Pk/CryptPkcs7VerifyEkuNull.c
|
||||||
|
Pk/CryptDhNull.c
|
||||||
|
Pk/CryptX509Null.c
|
||||||
|
Pk/CryptAuthenticodeNull.c
|
||||||
|
Pk/CryptTsNull.c
|
||||||
|
Pem/CryptPemNull.c
|
||||||
|
Rand/CryptRandNull.c
|
||||||
|
Pk/CryptRsaPssNull.c
|
||||||
|
Pk/CryptRsaPssSignNull.c
|
||||||
|
|
||||||
|
SysCall/CrtWrapper.c
|
||||||
|
SysCall/ConstantTimeClock.c
|
||||||
|
SysCall/BaseMemAllocation.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
CryptoPkg/CryptoPkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
BaseLib
|
||||||
|
BaseMemoryLib
|
||||||
|
MemoryAllocationLib
|
||||||
|
DebugLib
|
||||||
|
OpensslLib
|
||||||
|
IntrinsicLib
|
||||||
|
|
||||||
|
#
|
||||||
|
# Remove these [BuildOptions] after this library is cleaned up
|
||||||
|
#
|
||||||
|
[BuildOptions]
|
||||||
|
#
|
||||||
|
# suppress the following warnings so we do not break the build with warnings-as-errors:
|
||||||
|
# C4090: 'function' : different 'const' qualifiers
|
||||||
|
# C4718: 'function call' : recursive call has no side effects, deleting
|
||||||
|
#
|
||||||
|
MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718
|
||||||
|
|
||||||
|
# -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
|
||||||
|
# --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
|
||||||
|
RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
|
||||||
|
|
||||||
|
GCC:*_CLANG35_*_CC_FLAGS = -std=c99
|
||||||
|
GCC:*_CLANG38_*_CC_FLAGS = -std=c99
|
||||||
|
GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
|
||||||
|
|
||||||
|
XCODE:*_*_*_CC_FLAGS = -std=c99
|
@@ -15,6 +15,7 @@
|
|||||||
[LibraryClasses.common]
|
[LibraryClasses.common]
|
||||||
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
||||||
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
||||||
|
SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
|
||||||
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
||||||
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
||||||
|
|
||||||
|
@@ -108,6 +108,7 @@
|
|||||||
"lgreater",
|
"lgreater",
|
||||||
"lless",
|
"lless",
|
||||||
"MPIDR",
|
"MPIDR",
|
||||||
|
"PASID",
|
||||||
"PERIPHBASE",
|
"PERIPHBASE",
|
||||||
"phandle",
|
"phandle",
|
||||||
"pytool",
|
"pytool",
|
||||||
|
@@ -30,6 +30,9 @@
|
|||||||
## @libraryclass Defines a set of APIs to a hardware information parser.
|
## @libraryclass Defines a set of APIs to a hardware information parser.
|
||||||
HwInfoParserLib|Include/Library/HwInfoParserLib.h
|
HwInfoParserLib|Include/Library/HwInfoParserLib.h
|
||||||
|
|
||||||
|
## @libraryclass Defines functions for customizing the generation of _OSC and slot info.
|
||||||
|
SsdtPcieSupportLib|Include/Library/SsdtPcieSupportLib.h
|
||||||
|
|
||||||
## @libraryclass Defines a set of methods for fixing up a SSDT Serial Port.
|
## @libraryclass Defines a set of methods for fixing up a SSDT Serial Port.
|
||||||
SsdtSerialPortFixupLib|Include/Library/SsdtSerialPortFixupLib.h
|
SsdtSerialPortFixupLib|Include/Library/SsdtSerialPortFixupLib.h
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
[Components.common]
|
[Components.common]
|
||||||
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
||||||
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
||||||
|
DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
|
||||||
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
||||||
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
||||||
DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
|
DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -61,6 +61,8 @@ typedef enum ArmObjectID {
|
|||||||
EArmObjLpiInfo, ///< 37 - Lpi Info
|
EArmObjLpiInfo, ///< 37 - Lpi Info
|
||||||
EArmObjPciAddressMapInfo, ///< 38 - Pci Address Map Info
|
EArmObjPciAddressMapInfo, ///< 38 - Pci Address Map Info
|
||||||
EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info
|
EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info
|
||||||
|
EArmObjRmr, ///< 40 - Reserved Memory Range Node
|
||||||
|
EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor
|
||||||
EArmObjMax
|
EArmObjMax
|
||||||
} EARM_OBJECT_ID;
|
} EARM_OBJECT_ID;
|
||||||
|
|
||||||
@@ -477,6 +479,9 @@ typedef struct CmArmItsGroupNode {
|
|||||||
UINT32 ItsIdCount;
|
UINT32 ItsIdCount;
|
||||||
/// Reference token for the ITS identifier array
|
/// Reference token for the ITS identifier array
|
||||||
CM_OBJECT_TOKEN ItsIdToken;
|
CM_OBJECT_TOKEN ItsIdToken;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_ITS_GROUP_NODE;
|
} CM_ARM_ITS_GROUP_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -509,6 +514,9 @@ typedef struct CmArmNamedComponentNode {
|
|||||||
the entry in the namespace for this object.
|
the entry in the namespace for this object.
|
||||||
*/
|
*/
|
||||||
CHAR8 *ObjectName;
|
CHAR8 *ObjectName;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_NAMED_COMPONENT_NODE;
|
} CM_ARM_NAMED_COMPONENT_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -537,6 +545,13 @@ typedef struct CmArmRootComplexNode {
|
|||||||
UINT32 PciSegmentNumber;
|
UINT32 PciSegmentNumber;
|
||||||
/// Memory address size limit
|
/// Memory address size limit
|
||||||
UINT8 MemoryAddressSize;
|
UINT8 MemoryAddressSize;
|
||||||
|
/// PASID capabilities
|
||||||
|
UINT16 PasidCapabilities;
|
||||||
|
/// Flags
|
||||||
|
UINT32 Flags;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_ROOT_COMPLEX_NODE;
|
} CM_ARM_ROOT_COMPLEX_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -579,6 +594,9 @@ typedef struct CmArmSmmuV1SmmuV2Node {
|
|||||||
UINT32 SMMU_NSgCfgIrpt;
|
UINT32 SMMU_NSgCfgIrpt;
|
||||||
/// SMMU_NSgCfgIrpt interrupt flags
|
/// SMMU_NSgCfgIrpt interrupt flags
|
||||||
UINT32 SMMU_NSgCfgIrptFlags;
|
UINT32 SMMU_NSgCfgIrptFlags;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_SMMUV1_SMMUV2_NODE;
|
} CM_ARM_SMMUV1_SMMUV2_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -615,6 +633,9 @@ typedef struct CmArmSmmuV3Node {
|
|||||||
UINT32 ProximityDomain;
|
UINT32 ProximityDomain;
|
||||||
/// Index into the array of ID mapping
|
/// Index into the array of ID mapping
|
||||||
UINT32 DeviceIdMappingIndex;
|
UINT32 DeviceIdMappingIndex;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_SMMUV3_NODE;
|
} CM_ARM_SMMUV3_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -639,6 +660,9 @@ typedef struct CmArmPmcgNode {
|
|||||||
|
|
||||||
/// Reference token for the IORT node associated with this node
|
/// Reference token for the IORT node associated with this node
|
||||||
CM_OBJECT_TOKEN ReferenceToken;
|
CM_OBJECT_TOKEN ReferenceToken;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
} CM_ARM_PMCG_NODE;
|
} CM_ARM_PMCG_NODE;
|
||||||
|
|
||||||
/** A structure that describes the
|
/** A structure that describes the
|
||||||
@@ -1006,6 +1030,46 @@ typedef struct CmArmPciInterruptMapInfo {
|
|||||||
CM_ARM_GENERIC_INTERRUPT IntcInterrupt;
|
CM_ARM_GENERIC_INTERRUPT IntcInterrupt;
|
||||||
} CM_ARM_PCI_INTERRUPT_MAP_INFO;
|
} CM_ARM_PCI_INTERRUPT_MAP_INFO;
|
||||||
|
|
||||||
|
/** A structure that describes the
|
||||||
|
RMR node for the Platform.
|
||||||
|
|
||||||
|
ID: EArmObjRmr
|
||||||
|
*/
|
||||||
|
typedef struct CmArmRmrNode {
|
||||||
|
/// An unique token used to identify this object
|
||||||
|
CM_OBJECT_TOKEN Token;
|
||||||
|
/// Number of ID mappings
|
||||||
|
UINT32 IdMappingCount;
|
||||||
|
/// Reference token for the ID mapping array
|
||||||
|
CM_OBJECT_TOKEN IdMappingToken;
|
||||||
|
|
||||||
|
/// Unique identifier for this node.
|
||||||
|
UINT32 Identifier;
|
||||||
|
|
||||||
|
/// Reserved Memory Range flags.
|
||||||
|
UINT32 Flags;
|
||||||
|
|
||||||
|
/// Memory range descriptor count.
|
||||||
|
UINT32 MemRangeDescCount;
|
||||||
|
/// Reference token for the Memory Range descriptor array
|
||||||
|
CM_OBJECT_TOKEN MemRangeDescToken;
|
||||||
|
} CM_ARM_RMR_NODE;
|
||||||
|
|
||||||
|
/** A structure that describes the
|
||||||
|
Memory Range descriptor.
|
||||||
|
|
||||||
|
ID: EArmObjMemoryRangeDescriptor
|
||||||
|
*/
|
||||||
|
typedef struct CmArmRmrDescriptor {
|
||||||
|
/// Base address of Reserved Memory Range,
|
||||||
|
/// aligned to a page size of 64K.
|
||||||
|
UINT64 BaseAddress;
|
||||||
|
|
||||||
|
/// Length of the Reserved Memory range.
|
||||||
|
/// Must be a multiple of the page size of 64K.
|
||||||
|
UINT64 Length;
|
||||||
|
} CM_ARM_MEMORY_RANGE_DESCRIPTOR;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#endif // ARM_NAMESPACE_OBJECTS_H_
|
#endif // ARM_NAMESPACE_OBJECTS_H_
|
||||||
|
73
DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h
Normal file
73
DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/** @file
|
||||||
|
Ssdt PCIe Support Library
|
||||||
|
|
||||||
|
Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef SSDT_PCIE_SUPPORT_LIB_H_
|
||||||
|
#define SSDT_PCIE_SUPPORT_LIB_H_
|
||||||
|
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
|
/** Structure used to map integer to an index.
|
||||||
|
*/
|
||||||
|
typedef struct MappingTable {
|
||||||
|
/// Mapping table.
|
||||||
|
/// Contains the Index <-> integer mapping
|
||||||
|
UINT32 *Table;
|
||||||
|
|
||||||
|
/// Last used index of the Table.
|
||||||
|
/// Bound by MaxIndex.
|
||||||
|
UINT32 LastIndex;
|
||||||
|
|
||||||
|
/// Number of entries in the Table.
|
||||||
|
UINT32 MaxIndex;
|
||||||
|
} MAPPING_TABLE;
|
||||||
|
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
|
/** Add an _OSC template method to the PciNode.
|
||||||
|
|
||||||
|
The _OSC method is provided as an AML blob. The blob is
|
||||||
|
parsed and attached at the end of the PciNode list of variable elements.
|
||||||
|
|
||||||
|
@param [in] PciInfo Pci device information.
|
||||||
|
@param [in, out] PciNode Pci node to amend.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Could not allocate memory.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
AddOscMethod (
|
||||||
|
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
|
||||||
|
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Generate Pci slots devices.
|
||||||
|
|
||||||
|
PCI Firmware Specification - Revision 3.3,
|
||||||
|
s4.8 "Generic ACPI PCI Slot Description" requests to describe the PCI slot
|
||||||
|
used. It should be possible to enumerate them, but this is additional
|
||||||
|
information.
|
||||||
|
|
||||||
|
@param [in] PciInfo Pci device information.
|
||||||
|
@param [in] MappingTable The mapping table structure.
|
||||||
|
@param [in, out] PciNode Pci node to amend.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Success.
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GeneratePciSlots (
|
||||||
|
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
|
||||||
|
IN CONST MAPPING_TABLE *MappingTable,
|
||||||
|
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif // SSDT_PCIE_SUPPORT_LIB_H_
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
|
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -105,6 +105,14 @@ typedef struct CmAStdObjAcpiTableInfo {
|
|||||||
/// Generators shall populate this information using the revision of the
|
/// Generators shall populate this information using the revision of the
|
||||||
/// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
|
/// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
|
||||||
UINT32 OemRevision;
|
UINT32 OemRevision;
|
||||||
|
|
||||||
|
/// The minor revision of an ACPI table if required by the table.
|
||||||
|
/// Note: If this field is not populated (has value of Zero), then the
|
||||||
|
/// Generators shall populate this information based on the latest minor
|
||||||
|
/// revision of the table that is supported by the generator.
|
||||||
|
/// e.g. This field can be used to specify the minor revision to be set
|
||||||
|
/// for the FADT table.
|
||||||
|
UINT8 MinorRevision;
|
||||||
} CM_STD_OBJ_ACPI_TABLE_INFO;
|
} CM_STD_OBJ_ACPI_TABLE_INFO;
|
||||||
|
|
||||||
/** A structure used to describe the SMBIOS table generators to be invoked.
|
/** A structure used to describe the SMBIOS table generators to be invoked.
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
FADT Table Generator
|
FADT Table Generator
|
||||||
|
|
||||||
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
|
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@par Reference(s):
|
@par Reference(s):
|
||||||
@@ -167,7 +167,7 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
|
|||||||
// UINT16 ArmBootArch
|
// UINT16 ArmBootArch
|
||||||
EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
|
EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
|
||||||
// UINT8 MinorRevision
|
// UINT8 MinorRevision
|
||||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
|
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template}
|
||||||
// UINT64 XFirmwareCtrl
|
// UINT64 XFirmwareCtrl
|
||||||
0,
|
0,
|
||||||
// UINT64 XDsdt
|
// UINT64 XDsdt
|
||||||
@@ -546,6 +546,31 @@ BuildFadtTable (
|
|||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the MinorRevision for the FADT table if it has been specified
|
||||||
|
// otherwise default to the latest FADT minor revision supported.
|
||||||
|
// Note:
|
||||||
|
// Bits 0-3 - The low order bits correspond to the minor version of the
|
||||||
|
// specification version.
|
||||||
|
// Bits 4-7 - The high order bits correspond to the version of the ACPI
|
||||||
|
// specification errata.
|
||||||
|
if (AcpiTableInfo->MinorRevision != 0) {
|
||||||
|
if (((AcpiTableInfo->MinorRevision & 0xF) >=
|
||||||
|
EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION) &&
|
||||||
|
((AcpiTableInfo->MinorRevision & 0xF) <=
|
||||||
|
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION))
|
||||||
|
{
|
||||||
|
AcpiFadt.MinorVersion = AcpiTableInfo->MinorRevision;
|
||||||
|
} else {
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_WARN,
|
||||||
|
"WARNING: FADT: Unsupported FADT Minor Revision 0x%x specified, " \
|
||||||
|
"defaulting to FADT Minor Revision 0x%x\n",
|
||||||
|
AcpiTableInfo->MinorRevision,
|
||||||
|
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update PmProfile Info
|
// Update PmProfile Info
|
||||||
Status = FadtAddPmProfileInfo (CfgMgrProtocol);
|
Status = FadtAddPmProfileInfo (CfgMgrProtocol);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2018, ARM Limited. All rights reserved.
|
Copyright (c) 2018 - 2022, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -25,6 +25,9 @@ typedef struct IortNodeIndexer {
|
|||||||
VOID *Object;
|
VOID *Object;
|
||||||
/// Node offset from the start of the IORT table
|
/// Node offset from the start of the IORT table
|
||||||
UINT32 Offset;
|
UINT32 Offset;
|
||||||
|
|
||||||
|
/// Unique identifier for the Node
|
||||||
|
UINT32 Identifier;
|
||||||
} IORT_NODE_INDEXER;
|
} IORT_NODE_INDEXER;
|
||||||
|
|
||||||
typedef struct AcpiIortGenerator {
|
typedef struct AcpiIortGenerator {
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include <Library/AcpiHelperLib.h>
|
#include <Library/AcpiHelperLib.h>
|
||||||
#include <Library/TableHelperLib.h>
|
#include <Library/TableHelperLib.h>
|
||||||
#include <Library/AmlLib/AmlLib.h>
|
#include <Library/AmlLib/AmlLib.h>
|
||||||
|
#include <Library/SsdtPcieSupportLib.h>
|
||||||
#include <Protocol/ConfigurationManagerProtocol.h>
|
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||||
|
|
||||||
#include "SsdtPcieGenerator.h"
|
#include "SsdtPcieGenerator.h"
|
||||||
@@ -280,86 +281,6 @@ GeneratePciDeviceInfo (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate Pci slots devices.
|
|
||||||
|
|
||||||
PCI Firmware Specification - Revision 3.3,
|
|
||||||
s4.8 "Generic ACPI PCI Slot Description" requests to describe the PCI slot
|
|
||||||
used. It should be possible to enumerate them, but this is additional
|
|
||||||
information.
|
|
||||||
|
|
||||||
@param [in] MappingTable The mapping table structure.
|
|
||||||
@param [in, out] PciNode Pci node to amend.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Success.
|
|
||||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
|
||||||
**/
|
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
GeneratePciSlots (
|
|
||||||
IN CONST MAPPING_TABLE *MappingTable,
|
|
||||||
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
UINT32 Index;
|
|
||||||
UINT32 LastIndex;
|
|
||||||
UINT32 DeviceId;
|
|
||||||
CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
|
|
||||||
AML_OBJECT_NODE_HANDLE DeviceNode;
|
|
||||||
|
|
||||||
ASSERT (MappingTable != NULL);
|
|
||||||
ASSERT (PciNode != NULL);
|
|
||||||
|
|
||||||
// Generic device name is "Dxx".
|
|
||||||
CopyMem (AslName, "Dxx_", AML_NAME_SEG_SIZE + 1);
|
|
||||||
|
|
||||||
LastIndex = MappingTable->LastIndex;
|
|
||||||
|
|
||||||
// There are at most 32 devices on a Pci bus.
|
|
||||||
if (LastIndex >= 32) {
|
|
||||||
ASSERT (0);
|
|
||||||
return EFI_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < LastIndex; Index++) {
|
|
||||||
DeviceId = MappingTable->Table[Index];
|
|
||||||
AslName[AML_NAME_SEG_SIZE - 3] = AsciiFromHex (DeviceId & 0xF);
|
|
||||||
AslName[AML_NAME_SEG_SIZE - 2] = AsciiFromHex ((DeviceId >> 4) & 0xF);
|
|
||||||
|
|
||||||
// ASL:
|
|
||||||
// Device (Dxx) {
|
|
||||||
// Name (_ADR, <address value>)
|
|
||||||
// }
|
|
||||||
Status = AmlCodeGenDevice (AslName, PciNode, &DeviceNode);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
ASSERT (0);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ACPI 6.4 specification, Table 6.2: "ADR Object Address Encodings"
|
|
||||||
High word-Device #, Low word-Function #. (for example, device 3,
|
|
||||||
function 2 is 0x00030002). To refer to all the functions on a device #,
|
|
||||||
use a function number of FFFF).
|
|
||||||
*/
|
|
||||||
Status = AmlCodeGenNameInteger (
|
|
||||||
"_ADR",
|
|
||||||
(DeviceId << 16) | 0xFFFF,
|
|
||||||
DeviceNode,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
ASSERT (0);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
// _SUN object is not generated as we don't know which slot will be used.
|
|
||||||
}
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Generate a _PRT object (Pci Routing Table) for the Pci device.
|
/** Generate a _PRT object (Pci Routing Table) for the Pci device.
|
||||||
|
|
||||||
Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
|
Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
|
||||||
@@ -449,7 +370,7 @@ GeneratePrt (
|
|||||||
if ((Index > 0) &&
|
if ((Index > 0) &&
|
||||||
(IrqMapInfo->IntcInterrupt.Interrupt >= 32) &&
|
(IrqMapInfo->IntcInterrupt.Interrupt >= 32) &&
|
||||||
(IrqMapInfo->IntcInterrupt.Interrupt < 1020) &&
|
(IrqMapInfo->IntcInterrupt.Interrupt < 1020) &&
|
||||||
((IrqMapInfo->IntcInterrupt.Flags & 0x3) != BIT0))
|
((IrqMapInfo->IntcInterrupt.Flags & 0xB) != 0))
|
||||||
{
|
{
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
@@ -495,7 +416,7 @@ GeneratePrt (
|
|||||||
PrtNode = NULL;
|
PrtNode = NULL;
|
||||||
|
|
||||||
// Generate the Pci slots once all the device have been added.
|
// Generate the Pci slots once all the device have been added.
|
||||||
Status = GeneratePciSlots (&Generator->DeviceTable, PciNode);
|
Status = GeneratePciSlots (PciInfo, &Generator->DeviceTable, PciNode);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
ASSERT (0);
|
ASSERT (0);
|
||||||
goto exit_handler;
|
goto exit_handler;
|
||||||
@@ -540,6 +461,7 @@ GeneratePciCrs (
|
|||||||
UINT32 RefCount;
|
UINT32 RefCount;
|
||||||
CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;
|
CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;
|
||||||
AML_OBJECT_NODE_HANDLE CrsNode;
|
AML_OBJECT_NODE_HANDLE CrsNode;
|
||||||
|
BOOLEAN IsPosDecode;
|
||||||
|
|
||||||
ASSERT (Generator != NULL);
|
ASSERT (Generator != NULL);
|
||||||
ASSERT (CfgMgrProtocol != NULL);
|
ASSERT (CfgMgrProtocol != NULL);
|
||||||
@@ -609,6 +531,11 @@ GeneratePciCrs (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Translation = (AddrMapInfo->CpuAddress != AddrMapInfo->PciAddress);
|
Translation = (AddrMapInfo->CpuAddress != AddrMapInfo->PciAddress);
|
||||||
|
if (AddrMapInfo->CpuAddress >= AddrMapInfo->PciAddress) {
|
||||||
|
IsPosDecode = TRUE;
|
||||||
|
} else {
|
||||||
|
IsPosDecode = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (AddrMapInfo->SpaceCode) {
|
switch (AddrMapInfo->SpaceCode) {
|
||||||
case PCI_SS_IO:
|
case PCI_SS_IO:
|
||||||
@@ -616,12 +543,12 @@ GeneratePciCrs (
|
|||||||
FALSE,
|
FALSE,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
IsPosDecode,
|
||||||
3,
|
3,
|
||||||
0,
|
0,
|
||||||
AddrMapInfo->PciAddress,
|
AddrMapInfo->PciAddress,
|
||||||
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
||||||
Translation ? AddrMapInfo->CpuAddress : 0,
|
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
|
||||||
AddrMapInfo->AddressSize,
|
AddrMapInfo->AddressSize,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -635,7 +562,7 @@ GeneratePciCrs (
|
|||||||
case PCI_SS_M32:
|
case PCI_SS_M32:
|
||||||
Status = AmlCodeGenRdDWordMemory (
|
Status = AmlCodeGenRdDWordMemory (
|
||||||
FALSE,
|
FALSE,
|
||||||
TRUE,
|
IsPosDecode,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
@@ -643,7 +570,7 @@ GeneratePciCrs (
|
|||||||
0,
|
0,
|
||||||
AddrMapInfo->PciAddress,
|
AddrMapInfo->PciAddress,
|
||||||
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
||||||
Translation ? AddrMapInfo->CpuAddress : 0,
|
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
|
||||||
AddrMapInfo->AddressSize,
|
AddrMapInfo->AddressSize,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -657,7 +584,7 @@ GeneratePciCrs (
|
|||||||
case PCI_SS_M64:
|
case PCI_SS_M64:
|
||||||
Status = AmlCodeGenRdQWordMemory (
|
Status = AmlCodeGenRdQWordMemory (
|
||||||
FALSE,
|
FALSE,
|
||||||
TRUE,
|
IsPosDecode,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
@@ -665,7 +592,7 @@ GeneratePciCrs (
|
|||||||
0,
|
0,
|
||||||
AddrMapInfo->PciAddress,
|
AddrMapInfo->PciAddress,
|
||||||
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
|
||||||
Translation ? AddrMapInfo->CpuAddress : 0,
|
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
|
||||||
AddrMapInfo->AddressSize,
|
AddrMapInfo->AddressSize,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -689,89 +616,6 @@ GeneratePciCrs (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add an _OSC template method to the PciNode.
|
|
||||||
|
|
||||||
The _OSC method is provided as an AML blob. The blob is
|
|
||||||
parsed and attached at the end of the PciNode list of variable elements.
|
|
||||||
|
|
||||||
@param [in, out] PciNode Pci node to amend.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
|
||||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Could not allocate memory.
|
|
||||||
**/
|
|
||||||
STATIC
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
AddOscMethod (
|
|
||||||
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
EFI_STATUS Status1;
|
|
||||||
EFI_ACPI_DESCRIPTION_HEADER *SsdtPcieOscTemplate;
|
|
||||||
AML_ROOT_NODE_HANDLE OscTemplateRoot;
|
|
||||||
AML_OBJECT_NODE_HANDLE OscNode;
|
|
||||||
|
|
||||||
ASSERT (PciNode != NULL);
|
|
||||||
|
|
||||||
// Parse the Ssdt Pci Osc Template.
|
|
||||||
SsdtPcieOscTemplate = (EFI_ACPI_DESCRIPTION_HEADER *)
|
|
||||||
ssdtpcieosctemplate_aml_code;
|
|
||||||
|
|
||||||
OscNode = NULL;
|
|
||||||
OscTemplateRoot = NULL;
|
|
||||||
Status = AmlParseDefinitionBlock (
|
|
||||||
SsdtPcieOscTemplate,
|
|
||||||
&OscTemplateRoot
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
DEBUG ((
|
|
||||||
DEBUG_ERROR,
|
|
||||||
"ERROR: SSDT-PCI-OSC: Failed to parse SSDT PCI OSC Template."
|
|
||||||
" Status = %r\n",
|
|
||||||
Status
|
|
||||||
));
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = AmlFindNode (OscTemplateRoot, "\\_OSC", &OscNode);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
goto error_handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = AmlDetachNode (OscNode);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
goto error_handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = AmlAttachNode (PciNode, OscNode);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
// Free the detached node.
|
|
||||||
AmlDeleteTree (OscNode);
|
|
||||||
goto error_handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_handler:
|
|
||||||
// Cleanup
|
|
||||||
Status1 = AmlDeleteTree (OscTemplateRoot);
|
|
||||||
if (EFI_ERROR (Status1)) {
|
|
||||||
DEBUG ((
|
|
||||||
DEBUG_ERROR,
|
|
||||||
"ERROR: SSDT-PCI-OSC: Failed to cleanup AML tree."
|
|
||||||
" Status = %r\n",
|
|
||||||
Status1
|
|
||||||
));
|
|
||||||
// If Status was success but we failed to delete the AML Tree
|
|
||||||
// return Status1 else return the original error code, i.e. Status.
|
|
||||||
if (!EFI_ERROR (Status)) {
|
|
||||||
return Status1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Generate a Pci device.
|
/** Generate a Pci device.
|
||||||
|
|
||||||
@param [in] Generator The SSDT Pci generator.
|
@param [in] Generator The SSDT Pci generator.
|
||||||
@@ -818,7 +662,10 @@ GeneratePciDevice (
|
|||||||
|
|
||||||
// Write the name of the PCI device.
|
// Write the name of the PCI device.
|
||||||
CopyMem (AslName, "PCIx", AML_NAME_SEG_SIZE + 1);
|
CopyMem (AslName, "PCIx", AML_NAME_SEG_SIZE + 1);
|
||||||
AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid);
|
AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid & 0xF);
|
||||||
|
if (Uid > 0xF) {
|
||||||
|
AslName[AML_NAME_SEG_SIZE - 2] = AsciiFromHex ((Uid >> 4) & 0xF);
|
||||||
|
}
|
||||||
|
|
||||||
// ASL: Device (PCIx) {}
|
// ASL: Device (PCIx) {}
|
||||||
Status = AmlCodeGenDevice (AslName, ScopeNode, &PciNode);
|
Status = AmlCodeGenDevice (AslName, ScopeNode, &PciNode);
|
||||||
@@ -856,7 +703,7 @@ GeneratePciDevice (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the template _OSC method.
|
// Add the template _OSC method.
|
||||||
Status = AddOscMethod (PciNode);
|
Status = AddOscMethod (PciInfo, PciNode);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@@ -31,34 +31,13 @@
|
|||||||
Corresponding changes would be needed to support the Name and
|
Corresponding changes would be needed to support the Name and
|
||||||
UID fields describing the Pci root complexes.
|
UID fields describing the Pci root complexes.
|
||||||
*/
|
*/
|
||||||
#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 16
|
#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 256
|
||||||
|
|
||||||
// _SB scope of the AML namespace.
|
// _SB scope of the AML namespace.
|
||||||
#define SB_SCOPE "\\_SB_"
|
#define SB_SCOPE "\\_SB_"
|
||||||
|
|
||||||
/** C array containing the compiled AML template.
|
|
||||||
This symbol is defined in the auto generated C file
|
|
||||||
containing the AML bytecode array.
|
|
||||||
*/
|
|
||||||
extern CHAR8 ssdtpcieosctemplate_aml_code[];
|
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
/** Structure used to map integer to an index.
|
|
||||||
*/
|
|
||||||
typedef struct MappingTable {
|
|
||||||
/// Mapping table.
|
|
||||||
/// Contains the Index <-> integer mapping
|
|
||||||
UINT32 *Table;
|
|
||||||
|
|
||||||
/// Last used index of the Table.
|
|
||||||
/// Bound by MaxIndex.
|
|
||||||
UINT32 LastIndex;
|
|
||||||
|
|
||||||
/// Number of entries in the Table.
|
|
||||||
UINT32 MaxIndex;
|
|
||||||
} MAPPING_TABLE;
|
|
||||||
|
|
||||||
/** A structure holding the Pcie generator and additional private data.
|
/** A structure holding the Pcie generator and additional private data.
|
||||||
*/
|
*/
|
||||||
typedef struct AcpiPcieGenerator {
|
typedef struct AcpiPcieGenerator {
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
[Sources]
|
[Sources]
|
||||||
SsdtPcieGenerator.c
|
SsdtPcieGenerator.c
|
||||||
SsdtPcieGenerator.h
|
SsdtPcieGenerator.h
|
||||||
SsdtPcieOscTemplate.asl
|
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||||
@@ -30,3 +29,4 @@
|
|||||||
AcpiHelperLib
|
AcpiHelperLib
|
||||||
AmlLib
|
AmlLib
|
||||||
BaseLib
|
BaseLib
|
||||||
|
SsdtPcieSupportLib
|
||||||
|
@@ -0,0 +1,200 @@
|
|||||||
|
/** @file
|
||||||
|
SSDT PCIe Support Library.
|
||||||
|
|
||||||
|
Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
@par Reference(s):
|
||||||
|
- PCI Firmware Specification - Revision 3.0
|
||||||
|
- ACPI 6.4 specification:
|
||||||
|
- s6.2.13 "_PRT (PCI Routing Table)"
|
||||||
|
- s6.1.1 "_ADR (Address)"
|
||||||
|
- linux kernel code
|
||||||
|
- Arm Base Boot Requirements v1.0
|
||||||
|
- Arm Base System Architecture v1.0
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <Library/AcpiLib.h>
|
||||||
|
#include <Library/BaseLib.h>
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
#include <Protocol/AcpiTable.h>
|
||||||
|
|
||||||
|
// Module specific include files.
|
||||||
|
#include <AcpiTableGenerator.h>
|
||||||
|
#include <ConfigurationManagerObject.h>
|
||||||
|
#include <ConfigurationManagerHelper.h>
|
||||||
|
#include <Library/AcpiHelperLib.h>
|
||||||
|
#include <Library/TableHelperLib.h>
|
||||||
|
#include <Library/AmlLib/AmlLib.h>
|
||||||
|
#include <Library/SsdtPcieSupportLib.h>
|
||||||
|
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||||
|
|
||||||
|
#include "SsdtPcieSupportLibPrivate.h"
|
||||||
|
|
||||||
|
/** Generate Pci slots devices.
|
||||||
|
|
||||||
|
PCI Firmware Specification - Revision 3.3,
|
||||||
|
s4.8 "Generic ACPI PCI Slot Description" requests to describe the PCI slot
|
||||||
|
used. It should be possible to enumerate them, but this is additional
|
||||||
|
information.
|
||||||
|
|
||||||
|
@param [in] PciInfo Pci device information.
|
||||||
|
@param [in] MappingTable The mapping table structure.
|
||||||
|
@param [in, out] PciNode Pci node to amend.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Success.
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GeneratePciSlots (
|
||||||
|
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
|
||||||
|
IN CONST MAPPING_TABLE *MappingTable,
|
||||||
|
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINT32 Index;
|
||||||
|
UINT32 LastIndex;
|
||||||
|
UINT32 DeviceId;
|
||||||
|
CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
|
||||||
|
AML_OBJECT_NODE_HANDLE DeviceNode;
|
||||||
|
|
||||||
|
ASSERT (MappingTable != NULL);
|
||||||
|
ASSERT (PciNode != NULL);
|
||||||
|
|
||||||
|
// Generic device name is "Dxx".
|
||||||
|
CopyMem (AslName, "Dxx_", AML_NAME_SEG_SIZE + 1);
|
||||||
|
|
||||||
|
LastIndex = MappingTable->LastIndex;
|
||||||
|
|
||||||
|
// There are at most 32 devices on a Pci bus.
|
||||||
|
if (LastIndex >= 32) {
|
||||||
|
ASSERT (0);
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Index = 0; Index < LastIndex; Index++) {
|
||||||
|
DeviceId = MappingTable->Table[Index];
|
||||||
|
AslName[AML_NAME_SEG_SIZE - 3] = AsciiFromHex (DeviceId & 0xF);
|
||||||
|
AslName[AML_NAME_SEG_SIZE - 2] = AsciiFromHex ((DeviceId >> 4) & 0xF);
|
||||||
|
|
||||||
|
// ASL:
|
||||||
|
// Device (Dxx) {
|
||||||
|
// Name (_ADR, <address value>)
|
||||||
|
// }
|
||||||
|
Status = AmlCodeGenDevice (AslName, PciNode, &DeviceNode);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ASSERT (0);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ACPI 6.4 specification, Table 6.2: "ADR Object Address Encodings"
|
||||||
|
High word-Device #, Low word-Function #. (for example, device 3,
|
||||||
|
function 2 is 0x00030002). To refer to all the functions on a device #,
|
||||||
|
use a function number of FFFF).
|
||||||
|
*/
|
||||||
|
Status = AmlCodeGenNameInteger (
|
||||||
|
"_ADR",
|
||||||
|
(DeviceId << 16) | 0xFFFF,
|
||||||
|
DeviceNode,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ASSERT (0);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
// _SUN object is not generated as we don't know which slot will be used.
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Add an _OSC template method to the PciNode.
|
||||||
|
|
||||||
|
The _OSC method is provided as an AML blob. The blob is
|
||||||
|
parsed and attached at the end of the PciNode list of variable elements.
|
||||||
|
|
||||||
|
@param [in] PciInfo Pci device information.
|
||||||
|
@param [in, out] PciNode Pci node to amend.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Could not allocate memory.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
AddOscMethod (
|
||||||
|
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
|
||||||
|
IN OUT AML_OBJECT_NODE_HANDLE PciNode
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_STATUS Status1;
|
||||||
|
EFI_ACPI_DESCRIPTION_HEADER *SsdtPcieOscTemplate;
|
||||||
|
AML_ROOT_NODE_HANDLE OscTemplateRoot;
|
||||||
|
AML_OBJECT_NODE_HANDLE OscNode;
|
||||||
|
|
||||||
|
ASSERT (PciNode != NULL);
|
||||||
|
|
||||||
|
// Parse the Ssdt Pci Osc Template.
|
||||||
|
SsdtPcieOscTemplate = (EFI_ACPI_DESCRIPTION_HEADER *)
|
||||||
|
ssdtpcieosctemplate_aml_code;
|
||||||
|
|
||||||
|
OscNode = NULL;
|
||||||
|
OscTemplateRoot = NULL;
|
||||||
|
Status = AmlParseDefinitionBlock (
|
||||||
|
SsdtPcieOscTemplate,
|
||||||
|
&OscTemplateRoot
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_ERROR,
|
||||||
|
"ERROR: SSDT-PCI-OSC: Failed to parse SSDT PCI OSC Template."
|
||||||
|
" Status = %r\n",
|
||||||
|
Status
|
||||||
|
));
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = AmlFindNode (OscTemplateRoot, "\\_OSC", &OscNode);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto error_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = AmlDetachNode (OscNode);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto error_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = AmlAttachNode (PciNode, OscNode);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
// Free the detached node.
|
||||||
|
AmlDeleteTree (OscNode);
|
||||||
|
goto error_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_handler:
|
||||||
|
// Cleanup
|
||||||
|
Status1 = AmlDeleteTree (OscTemplateRoot);
|
||||||
|
if (EFI_ERROR (Status1)) {
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_ERROR,
|
||||||
|
"ERROR: SSDT-PCI-OSC: Failed to cleanup AML tree."
|
||||||
|
" Status = %r\n",
|
||||||
|
Status1
|
||||||
|
));
|
||||||
|
// If Status was success but we failed to delete the AML Tree
|
||||||
|
// return Status1 else return the original error code, i.e. Status.
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
return Status1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
## @file
|
||||||
|
# Ssdt PCIe Support Library.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x0001001B
|
||||||
|
BASE_NAME = SsdtPcieSupportLib
|
||||||
|
FILE_GUID = 510451a0-60b2-446c-b6bf-59cbe4a41782
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
MODULE_TYPE = DXE_DRIVER
|
||||||
|
LIBRARY_CLASS = SsdtPcieSupportLib
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
SsdtPcieSupportLib.c
|
||||||
|
SsdtPcieSupportLibPrivate.h
|
||||||
|
SsdtPcieOscTemplate.asl
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||||
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
AcpiHelperLib
|
||||||
|
AmlLib
|
||||||
|
BaseLib
|
@@ -0,0 +1,25 @@
|
|||||||
|
/** @file
|
||||||
|
SSDT PCIe Support Library private data.
|
||||||
|
|
||||||
|
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
@par Reference(s):
|
||||||
|
- PCI Firmware Specification - Revision 3.0
|
||||||
|
- ACPI 6.4 specification:
|
||||||
|
- s6.2.13 "_PRT (PCI Routing Table)"
|
||||||
|
- s6.1.1 "_ADR (Address)"
|
||||||
|
- linux kernel code
|
||||||
|
- Arm Base Boot Requirements v1.0
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef SSDT_PCIE_SUPPORT_LIB_PRIVATE_H_
|
||||||
|
#define SSDT_PCIE_SUPPORT_LIB_PRIVATE_H_
|
||||||
|
|
||||||
|
/** C array containing the compiled AML template.
|
||||||
|
This symbol is defined in the auto generated C file
|
||||||
|
containing the AML bytecode array.
|
||||||
|
*/
|
||||||
|
extern CHAR8 ssdtpcieosctemplate_aml_code[];
|
||||||
|
|
||||||
|
#endif // SSDT_PCIE_SUPPORT_LIB_PRIVATE_H_
|
@@ -8,6 +8,7 @@
|
|||||||
@par Reference(s):
|
@par Reference(s):
|
||||||
- Arm Server Base Boot Requirements (SBBR), s4.2.1.8 "SPCR".
|
- Arm Server Base Boot Requirements (SBBR), s4.2.1.8 "SPCR".
|
||||||
- Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
|
- Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
|
||||||
|
- ACPI for Arm Components 1.0 - 2020
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <IndustryStandard/DebugPort2Table.h>
|
#include <IndustryStandard/DebugPort2Table.h>
|
||||||
@@ -176,7 +177,7 @@ FixupIds (
|
|||||||
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART:
|
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART:
|
||||||
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X:
|
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X:
|
||||||
{
|
{
|
||||||
HidString = "ARMH0011";
|
HidString = "ARMHB000";
|
||||||
CidString = "";
|
CidString = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
#define SPI_OFFSET (32U)
|
#define SPI_OFFSET (32U)
|
||||||
#define DT_PPI_IRQ (1U)
|
#define DT_PPI_IRQ (1U)
|
||||||
#define DT_SPI_IRQ (0U)
|
#define DT_SPI_IRQ (0U)
|
||||||
#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT2)) != 0))
|
#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT1)) != 0))
|
||||||
#define DT_IRQ_IS_ACTIVE_LOW(x) ((((x) & (BIT1 | BIT3)) != 0))
|
#define DT_IRQ_IS_ACTIVE_LOW(x) ((((x) & (BIT1 | BIT3)) != 0))
|
||||||
#define IRQ_TYPE_OFFSET (0U)
|
#define IRQ_TYPE_OFFSET (0U)
|
||||||
#define IRQ_NUMBER_OFFSET (1U)
|
#define IRQ_NUMBER_OFFSET (1U)
|
||||||
|
@@ -134,6 +134,7 @@
|
|||||||
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
|
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
|
||||||
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
|
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
|
||||||
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
|
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
|
||||||
|
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
|
||||||
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
|
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
|
||||||
!else
|
!else
|
||||||
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
|
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
|
||||||
|
@@ -1187,7 +1187,7 @@ PosixFileSetInfo (
|
|||||||
}
|
}
|
||||||
|
|
||||||
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
|
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
|
||||||
if (OldFileInfo == NULL) {
|
if (OldFileName == NULL) {
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,47 +0,0 @@
|
|||||||
Licensing for the filesystem drivers is complex. Three different licenses
|
|
||||||
apply to various parts of the code:
|
|
||||||
|
|
||||||
* Christoph Pfisterer's original file system wrapper (FSW) code is covered
|
|
||||||
by a BSD-style license. Many of the source files with names that take the
|
|
||||||
form fsw_*.[ch] are so licensed, but this is NOT generally true of
|
|
||||||
filesystem-specific files (e.g., fsw_ext2.c or fsw_btrfs.c).
|
|
||||||
|
|
||||||
* Certain filesystem drivers are licensed under the GPLv2, either because
|
|
||||||
they borrow code from the Linux kernel or because a developer (typically
|
|
||||||
Oracle) applied the GPLv2 license to them. This is true of the ext2fs,
|
|
||||||
ext4fs, ReiserFS, HFS+, and ISO-9660 drivers.
|
|
||||||
|
|
||||||
* At least one filesystem driver (Btrfs) uses code taken from GRUB, and so
|
|
||||||
uses the GPLv3 (or later) license.
|
|
||||||
|
|
||||||
Note that the GPLv2 and GPLv3 are, ironically, not compatible licenses.
|
|
||||||
Thus, code from GPLv2 and GPLv3 projects should not be mixed. The BSD
|
|
||||||
license used by Pfisterer's original code is compatible with both versions
|
|
||||||
of the GPL, so the fact that both GPLv2 and GPLv3 drivers is built upon it
|
|
||||||
is OK. If you intend to contribute to this project's drivers or use the
|
|
||||||
code yourself, please keep this fact in mind.
|
|
||||||
|
|
||||||
The below was written by Christoph Pfisterer with respect to his original
|
|
||||||
code:
|
|
||||||
|
|
||||||
File System Wrapper License
|
|
||||||
=============================
|
|
||||||
|
|
||||||
The various parts of the File System Wrapper source code come from
|
|
||||||
different sources and may carry different licenses. Here's a quick
|
|
||||||
account of the situation:
|
|
||||||
|
|
||||||
* The core code was written from scratch and is covered by a
|
|
||||||
BSD-style license.
|
|
||||||
|
|
||||||
* The EFI host driver was written from scratch, possibly using code
|
|
||||||
from the TianoCore project and Intel's EFI Application Toolkit. It
|
|
||||||
is covered by a BSD-style license.
|
|
||||||
|
|
||||||
* The ext2 and reiserfs file system drivers use definitions from the
|
|
||||||
Linux kernel source. The actual code was written from scratch,
|
|
||||||
using multiple sources for reference. These drivers are covered by
|
|
||||||
the GNU GPL.
|
|
||||||
|
|
||||||
For more details, see each file's boilerplate comment. The full text
|
|
||||||
of the GNU GPL is in the file LICENSE_GPL.txt.
|
|
@@ -1,340 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
|
||||||
when it starts in an interactive mode:
|
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,47 +0,0 @@
|
|||||||
Licensing for the filesystem drivers is complex. Three different licenses
|
|
||||||
apply to various parts of the code:
|
|
||||||
|
|
||||||
* Christoph Pfisterer's original file system wrapper (FSW) code is covered
|
|
||||||
by a BSD-style license. Many of the source files with names that take the
|
|
||||||
form fsw_*.[ch] are so licensed, but this is NOT generally true of
|
|
||||||
filesystem-specific files (e.g., fsw_ext2.c or fsw_btrfs.c).
|
|
||||||
|
|
||||||
* Certain filesystem drivers are licensed under the GPLv2, either because
|
|
||||||
they borrow code from the Linux kernel or because a developer (typically
|
|
||||||
Oracle) applied the GPLv2 license to them. This is true of the ext2fs,
|
|
||||||
ext4fs, ReiserFS, HFS+, and ISO-9660 drivers.
|
|
||||||
|
|
||||||
* At least one filesystem driver (Btrfs) uses code taken from GRUB, and so
|
|
||||||
uses the GPLv3 (or later) license.
|
|
||||||
|
|
||||||
Note that the GPLv2 and GPLv3 are, ironically, not compatible licenses.
|
|
||||||
Thus, code from GPLv2 and GPLv3 projects should not be mixed. The BSD
|
|
||||||
license used by Pfisterer's original code is compatible with both versions
|
|
||||||
of the GPL, so the fact that both GPLv2 and GPLv3 drivers is built upon it
|
|
||||||
is OK. If you intend to contribute to this project's drivers or use the
|
|
||||||
code yourself, please keep this fact in mind.
|
|
||||||
|
|
||||||
The below was written by Christoph Pfisterer with respect to his original
|
|
||||||
code:
|
|
||||||
|
|
||||||
File System Wrapper License
|
|
||||||
=============================
|
|
||||||
|
|
||||||
The various parts of the File System Wrapper source code come from
|
|
||||||
different sources and may carry different licenses. Here's a quick
|
|
||||||
account of the situation:
|
|
||||||
|
|
||||||
* The core code was written from scratch and is covered by a
|
|
||||||
BSD-style license.
|
|
||||||
|
|
||||||
* The EFI host driver was written from scratch, possibly using code
|
|
||||||
from the TianoCore project and Intel's EFI Application Toolkit. It
|
|
||||||
is covered by a BSD-style license.
|
|
||||||
|
|
||||||
* The ext2 and reiserfs file system drivers use definitions from the
|
|
||||||
Linux kernel source. The actual code was written from scratch,
|
|
||||||
using multiple sources for reference. These drivers are covered by
|
|
||||||
the GNU GPL.
|
|
||||||
|
|
||||||
For more details, see each file's boilerplate comment. The full text
|
|
||||||
of the GNU GPL is in the file LICENSE_GPL.txt.
|
|
@@ -1,340 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
|
||||||
when it starts in an interactive mode:
|
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Library General
|
|
||||||
Public License instead of this License.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,27 +0,0 @@
|
|||||||
# ReadOnly exFAT filesystem driver
|
|
||||||
# From https://efi.akeo.ie/ v1.5
|
|
||||||
##
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = exfat
|
|
||||||
FILE_GUID = CB683001-379F-48C7-B7B6-707D29454BF5
|
|
||||||
MODULE_TYPE = UEFI_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# The following information is for reference only and not required by the build tools.
|
|
||||||
#
|
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
|
||||||
#
|
|
||||||
|
|
||||||
VALID_ARCHITECTURES = X64 IA32
|
|
||||||
|
|
||||||
[Binaries.X64]
|
|
||||||
PE32|X64/exfat_x64.efi|*
|
|
||||||
|
|
||||||
[Binaries.IA32]
|
|
||||||
PE32|IA32/exfat_ia32.efi|*
|
|
||||||
|
|
||||||
|
|
@@ -1,25 +0,0 @@
|
|||||||
# EXT2 filesystem driver. See */LICENSE.txt for details.
|
|
||||||
# https://www.rodsbooks.com/refind/ v0.12
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = ext2
|
|
||||||
FILE_GUID = 8EC49C43-D1C4-4E6C-98BF-232CA5D89A1B
|
|
||||||
MODULE_TYPE = UEFI_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# The following information is for reference only and not required by the build tools.
|
|
||||||
#
|
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
|
||||||
#
|
|
||||||
|
|
||||||
VALID_ARCHITECTURES = X64 IA32
|
|
||||||
|
|
||||||
[Binaries.X64]
|
|
||||||
PE32|X64/ext2_x64.efi|*
|
|
||||||
|
|
||||||
[Binaries.IA32]
|
|
||||||
PE32|IA32/ext2_ia32.efi|*
|
|
||||||
|
|
@@ -1,25 +0,0 @@
|
|||||||
# EXT4 filesystem driver. See */LICENSE.txt for details.
|
|
||||||
# https://www.rodsbooks.com/refind/ v0.12
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = ext4
|
|
||||||
FILE_GUID = 9d380387-a15a-4053-ae19-ff3495b6d0d5
|
|
||||||
MODULE_TYPE = UEFI_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# The following information is for reference only and not required by the build tools.
|
|
||||||
#
|
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
|
||||||
#
|
|
||||||
|
|
||||||
VALID_ARCHITECTURES = X64 IA32
|
|
||||||
|
|
||||||
[Binaries.X64]
|
|
||||||
PE32|X64/ext4_x64.efi|*
|
|
||||||
|
|
||||||
[Binaries.IA32]
|
|
||||||
PE32|IA32/ext4_ia32.efi|*
|
|
||||||
|
|
@@ -1,27 +0,0 @@
|
|||||||
# ReadOnly NTFS filesystem driver
|
|
||||||
# From https://efi.akeo.ie/ v1.5
|
|
||||||
##
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = ntfs
|
|
||||||
FILE_GUID = 2282efd0-678b-4753-8d06-200d5940285d
|
|
||||||
MODULE_TYPE = UEFI_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# The following information is for reference only and not required by the build tools.
|
|
||||||
#
|
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
|
||||||
#
|
|
||||||
|
|
||||||
VALID_ARCHITECTURES = X64 IA32
|
|
||||||
|
|
||||||
[Binaries.X64]
|
|
||||||
PE32|X64/ntfs_x64.efi|*
|
|
||||||
|
|
||||||
[Binaries.IA32]
|
|
||||||
PE32|IA32/ntfs_ia32.efi|*
|
|
||||||
|
|
||||||
|
|
54
IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
Normal file
54
IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
## @file
|
||||||
|
# Sec Core for FSP
|
||||||
|
#
|
||||||
|
# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x00010005
|
||||||
|
BASE_NAME = FspSecCoreI
|
||||||
|
FILE_GUID = 558782b5-782d-415e-ab9e-0ceb79dc3425
|
||||||
|
MODULE_TYPE = SEC
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
SecFspApiChk.c
|
||||||
|
SecFsp.h
|
||||||
|
|
||||||
|
[Sources.X64]
|
||||||
|
X64/FspApiEntryI.nasm
|
||||||
|
X64/FspApiEntryCommon.nasm
|
||||||
|
X64/FspHelper.nasm
|
||||||
|
|
||||||
|
[Sources.IA32]
|
||||||
|
Ia32/FspApiEntryI.nasm
|
||||||
|
Ia32/FspApiEntryCommon.nasm
|
||||||
|
Ia32/FspHelper.nasm
|
||||||
|
|
||||||
|
[Binaries.Ia32]
|
||||||
|
RAW|Vtf0/Bin/ResetVec.ia32.raw |GCC
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
IntelFsp2Pkg/IntelFsp2Pkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
BaseMemoryLib
|
||||||
|
DebugLib
|
||||||
|
BaseLib
|
||||||
|
PciCf8Lib
|
||||||
|
SerialPortLib
|
||||||
|
FspSwitchStackLib
|
||||||
|
FspCommonLib
|
||||||
|
FspSecPlatformLib
|
||||||
|
|
||||||
|
|
44
IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm
Normal file
44
IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
;; @file
|
||||||
|
; Provide FSP API entry points.
|
||||||
|
;
|
||||||
|
; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
|
; SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
;;
|
||||||
|
|
||||||
|
SECTION .text
|
||||||
|
|
||||||
|
;
|
||||||
|
; Following functions will be provided in C
|
||||||
|
;
|
||||||
|
extern ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; FspApiCommonContinue API
|
||||||
|
;
|
||||||
|
; This is the FSP API common entry point to resume the FSP execution
|
||||||
|
;
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(FspApiCommonContinue)
|
||||||
|
ASM_PFX(FspApiCommonContinue):
|
||||||
|
jmp $
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; FspSmmInit API
|
||||||
|
;
|
||||||
|
; This FSP API will notify the FSP about the different phases in the boot
|
||||||
|
; process
|
||||||
|
;
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(FspSmmInitApi)
|
||||||
|
ASM_PFX(FspSmmInitApi):
|
||||||
|
mov eax, 7 ; FSP_API_INDEX.FspSmmInitApiIndex
|
||||||
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; Module Entrypoint API
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(_ModuleEntryPoint)
|
||||||
|
ASM_PFX(_ModuleEntryPoint):
|
||||||
|
jmp $
|
||||||
|
; Add reference to APIs so that it will not be optimized by compiler
|
||||||
|
jmp ASM_PFX(FspSmmInitApi)
|
@@ -40,12 +40,13 @@ struc FSPM_UPD_COMMON_FSP24
|
|||||||
.Revision: resb 1
|
.Revision: resb 1
|
||||||
.Reserved: resb 3
|
.Reserved: resb 3
|
||||||
.Length resd 1
|
.Length resd 1
|
||||||
|
.NvsBufferPtr resq 1
|
||||||
.StackBase: resq 1
|
.StackBase: resq 1
|
||||||
.StackSize: resq 1
|
.StackSize: resq 1
|
||||||
.BootLoaderTolumSize: resd 1
|
.BootLoaderTolumSize: resd 1
|
||||||
.BootMode: resd 1
|
.BootMode: resd 1
|
||||||
.FspEventHandler resq 1
|
.FspEventHandler resq 1
|
||||||
.Reserved1: resb 24
|
.Reserved1: resb 16
|
||||||
; }
|
; }
|
||||||
.size:
|
.size:
|
||||||
endstruc
|
endstruc
|
||||||
|
@@ -16,19 +16,20 @@
|
|||||||
@return FSP specific IDT gate descriptor.
|
@return FSP specific IDT gate descriptor.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
IA32_IDT_GATE_DESCRIPTOR
|
||||||
FspGetExceptionHandler (
|
FspGetExceptionHandler (
|
||||||
IN UINT64 IdtEntryTemplate
|
IN UINT64 IdtEntryTemplate
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 Entry;
|
UINT32 Entry;
|
||||||
UINT64 ExceptionHandler;
|
IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;
|
||||||
IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;
|
IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;
|
||||||
FSP_INFO_HEADER *FspInfoHeader;
|
FSP_INFO_HEADER *FspInfoHeader;
|
||||||
|
|
||||||
|
ZeroMem ((VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR));
|
||||||
FspInfoHeader = (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader ();
|
FspInfoHeader = (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader ();
|
||||||
ExceptionHandler = IdtEntryTemplate;
|
*(UINT64 *) &ExceptionHandler = IdtEntryTemplate;
|
||||||
IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;
|
IdtGateDescriptor = &ExceptionHandler;
|
||||||
Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;
|
Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;
|
||||||
Entry = FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1);
|
Entry = FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1);
|
||||||
IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16);
|
IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16);
|
||||||
@@ -200,10 +201,10 @@ FspGlobalDataInit (
|
|||||||
(PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \
|
(PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \
|
||||||
(PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \
|
(PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \
|
||||||
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
|
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
|
||||||
(((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) :\
|
(((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) : \
|
||||||
((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \
|
((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \
|
||||||
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
|
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
|
||||||
((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)): \
|
((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)) : \
|
||||||
(PeiFspData->FspInfoHeader->ImageRevision & 0xFF)
|
(PeiFspData->FspInfoHeader->ImageRevision & 0xFF)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
@return FSP specific IDT gate descriptor.
|
@return FSP specific IDT gate descriptor.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT64
|
IA32_IDT_GATE_DESCRIPTOR
|
||||||
FspGetExceptionHandler (
|
FspGetExceptionHandler (
|
||||||
IN UINT64 IdtEntryTemplate
|
IN UINT64 IdtEntryTemplate
|
||||||
);
|
);
|
||||||
|
@@ -71,6 +71,19 @@ FspApiCallingCheck (
|
|||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (ApiIdx == FspSmmInitApiIndex) {
|
||||||
|
//
|
||||||
|
// FspSmmInitApiIndex check
|
||||||
|
//
|
||||||
|
if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
|
||||||
|
Status = EFI_UNSUPPORTED;
|
||||||
|
} else {
|
||||||
|
if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
|
||||||
|
Status = EFI_UNSUPPORTED;
|
||||||
|
} else if (EFI_ERROR (FspUpdSignatureCheck (FspSmmInitApiIndex, ApiParam))) {
|
||||||
|
Status = EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
@@ -63,7 +63,7 @@ SecStartup (
|
|||||||
SEC_IDT_TABLE IdtTableInStack;
|
SEC_IDT_TABLE IdtTableInStack;
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
FSP_GLOBAL_DATA PeiFspData;
|
FSP_GLOBAL_DATA PeiFspData;
|
||||||
UINT64 ExceptionHandler;
|
IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;
|
||||||
UINTN IdtSize;
|
UINTN IdtSize;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -119,7 +119,7 @@ SecStartup (
|
|||||||
if (IdtDescriptor.Base == 0) {
|
if (IdtDescriptor.Base == 0) {
|
||||||
ExceptionHandler = FspGetExceptionHandler (mIdtEntryTemplate);
|
ExceptionHandler = FspGetExceptionHandler (mIdtEntryTemplate);
|
||||||
for (Index = 0; Index < FixedPcdGet8 (PcdFspMaxInterruptSupported); Index++) {
|
for (Index = 0; Index < FixedPcdGet8 (PcdFspMaxInterruptSupported); Index++) {
|
||||||
CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&ExceptionHandler, sizeof (UINT64));
|
CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
IdtSize = sizeof (IdtTableInStack.IdtTable);
|
IdtSize = sizeof (IdtTableInStack.IdtTable);
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
typedef
|
typedef
|
||||||
VOID
|
VOID
|
||||||
(EFIAPI *PEI_CORE_ENTRY) (
|
(EFIAPI *PEI_CORE_ENTRY)(
|
||||||
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
|
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
|
||||||
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
|
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
|
||||||
);
|
);
|
||||||
@@ -39,7 +39,7 @@ typedef struct _SEC_IDT_TABLE {
|
|||||||
// EFI_PEI_SERVICES**
|
// EFI_PEI_SERVICES**
|
||||||
//
|
//
|
||||||
UINT64 PeiService;
|
UINT64 PeiService;
|
||||||
UINT64 IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];
|
IA32_IDT_GATE_DESCRIPTOR IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];
|
||||||
} SEC_IDT_TABLE;
|
} SEC_IDT_TABLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -24,7 +24,7 @@ STACK_SAVED_RAX_OFFSET EQU 8 * 7 ; size of a general purpose register *
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(NotifyPhaseApi)
|
global ASM_PFX(NotifyPhaseApi)
|
||||||
ASM_PFX(NotifyPhaseApi):
|
ASM_PFX(NotifyPhaseApi):
|
||||||
mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
|
mov rax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@@ -36,7 +36,7 @@ ASM_PFX(NotifyPhaseApi):
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(FspSiliconInitApi)
|
global ASM_PFX(FspSiliconInitApi)
|
||||||
ASM_PFX(FspSiliconInitApi):
|
ASM_PFX(FspSiliconInitApi):
|
||||||
mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
|
mov rax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@@ -54,7 +54,7 @@ ASM_PFX(FspSiliconInitApi):
|
|||||||
|
|
||||||
global ASM_PFX(FspMultiPhaseSiInitApi)
|
global ASM_PFX(FspMultiPhaseSiInitApi)
|
||||||
ASM_PFX(FspMultiPhaseSiInitApi):
|
ASM_PFX(FspMultiPhaseSiInitApi):
|
||||||
mov eax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
|
mov rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@@ -68,7 +68,7 @@ ASM_PFX(FspApiCommonContinue):
|
|||||||
;
|
;
|
||||||
; Handle FspMultiPhaseSiInitApiIndex API
|
; Handle FspMultiPhaseSiInitApiIndex API
|
||||||
;
|
;
|
||||||
cmp eax, 6
|
cmp rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
|
||||||
jnz NotMultiPhaseSiInitApi
|
jnz NotMultiPhaseSiInitApi
|
||||||
|
|
||||||
PUSHA_64
|
PUSHA_64
|
||||||
|
44
IntelFsp2Pkg/FspSecCore/X64/FspApiEntryI.nasm
Normal file
44
IntelFsp2Pkg/FspSecCore/X64/FspApiEntryI.nasm
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
;; @file
|
||||||
|
; Provide FSP API entry points.
|
||||||
|
;
|
||||||
|
; Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
|
; SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
;;
|
||||||
|
|
||||||
|
SECTION .text
|
||||||
|
|
||||||
|
;
|
||||||
|
; Following functions will be provided in C
|
||||||
|
;
|
||||||
|
extern ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; FspApiCommonContinue API
|
||||||
|
;
|
||||||
|
; This is the FSP API common entry point to resume the FSP execution
|
||||||
|
;
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(FspApiCommonContinue)
|
||||||
|
ASM_PFX(FspApiCommonContinue):
|
||||||
|
jmp $
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; FspSmmInit API
|
||||||
|
;
|
||||||
|
; This FSP API will notify the FSP about the different phases in the boot
|
||||||
|
; process
|
||||||
|
;
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(FspSmmInitApi)
|
||||||
|
ASM_PFX(FspSmmInitApi):
|
||||||
|
mov rax, 7 ; FSP_API_INDEX.FspSmmInitApiIndex
|
||||||
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
; Module Entrypoint API
|
||||||
|
;----------------------------------------------------------------------------
|
||||||
|
global ASM_PFX(_ModuleEntryPoint)
|
||||||
|
ASM_PFX(_ModuleEntryPoint):
|
||||||
|
jmp $
|
||||||
|
; Add reference to APIs so that it will not be optimized by compiler
|
||||||
|
jmp ASM_PFX(FspSmmInitApi)
|
@@ -22,12 +22,13 @@ struc FSPM_UPD_COMMON_FSP24
|
|||||||
.Revision: resb 1
|
.Revision: resb 1
|
||||||
.Reserved: resb 3
|
.Reserved: resb 3
|
||||||
.Length resd 1
|
.Length resd 1
|
||||||
|
.NvsBufferPtr resq 1
|
||||||
.StackBase: resq 1
|
.StackBase: resq 1
|
||||||
.StackSize: resq 1
|
.StackSize: resq 1
|
||||||
.BootLoaderTolumSize: resd 1
|
.BootLoaderTolumSize: resd 1
|
||||||
.BootMode: resd 1
|
.BootMode: resd 1
|
||||||
.FspEventHandler resq 1
|
.FspEventHandler resq 1
|
||||||
.Reserved1: resb 24
|
.Reserved1: resb 16
|
||||||
; }
|
; }
|
||||||
.size:
|
.size:
|
||||||
endstruc
|
endstruc
|
||||||
@@ -55,7 +56,7 @@ FSP_HEADER_CFGREG_OFFSET EQU 24h
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(FspMemoryInitApi)
|
global ASM_PFX(FspMemoryInitApi)
|
||||||
ASM_PFX(FspMemoryInitApi):
|
ASM_PFX(FspMemoryInitApi):
|
||||||
mov eax, 3 ; FSP_API_INDEX.FspMemoryInitApiIndex
|
mov rax, 3 ; FSP_API_INDEX.FspMemoryInitApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@@ -66,7 +67,7 @@ ASM_PFX(FspMemoryInitApi):
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(TempRamExitApi)
|
global ASM_PFX(TempRamExitApi)
|
||||||
ASM_PFX(TempRamExitApi):
|
ASM_PFX(TempRamExitApi):
|
||||||
mov eax, 4 ; FSP_API_INDEX.TempRamExitApiIndex
|
mov rax, 4 ; FSP_API_INDEX.TempRamExitApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
@@ -21,7 +21,7 @@ extern ASM_PFX(FspApiCommon)
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(NotifyPhaseApi)
|
global ASM_PFX(NotifyPhaseApi)
|
||||||
ASM_PFX(NotifyPhaseApi):
|
ASM_PFX(NotifyPhaseApi):
|
||||||
mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
|
mov rax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
@@ -33,7 +33,7 @@ ASM_PFX(NotifyPhaseApi):
|
|||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
global ASM_PFX(FspSiliconInitApi)
|
global ASM_PFX(FspSiliconInitApi)
|
||||||
ASM_PFX(FspSiliconInitApi):
|
ASM_PFX(FspSiliconInitApi):
|
||||||
mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
|
mov rax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
|
||||||
jmp ASM_PFX(FspApiCommon)
|
jmp ASM_PFX(FspApiCommon)
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
@@ -114,7 +114,7 @@ endstruc
|
|||||||
global ASM_PFX(LoadMicrocodeDefault)
|
global ASM_PFX(LoadMicrocodeDefault)
|
||||||
ASM_PFX(LoadMicrocodeDefault):
|
ASM_PFX(LoadMicrocodeDefault):
|
||||||
; Inputs:
|
; Inputs:
|
||||||
; rsp -> LoadMicrocodeParams pointer
|
; rcx -> LoadMicrocodeParams pointer
|
||||||
; Register Usage:
|
; Register Usage:
|
||||||
; rsp Preserved
|
; rsp Preserved
|
||||||
; All others destroyed
|
; All others destroyed
|
||||||
@@ -130,10 +130,9 @@ ASM_PFX(LoadMicrocodeDefault):
|
|||||||
|
|
||||||
cmp rsp, 0
|
cmp rsp, 0
|
||||||
jz ParamError
|
jz ParamError
|
||||||
mov eax, dword [rsp + 8] ; Parameter pointer
|
cmp rcx, 0
|
||||||
cmp eax, 0
|
|
||||||
jz ParamError
|
jz ParamError
|
||||||
mov esp, eax
|
mov rsp, rcx
|
||||||
|
|
||||||
; skip loading Microcode if the MicrocodeCodeSize is zero
|
; skip loading Microcode if the MicrocodeCodeSize is zero
|
||||||
; and report error if size is less than 2k
|
; and report error if size is less than 2k
|
||||||
@@ -144,14 +143,14 @@ ASM_PFX(LoadMicrocodeDefault):
|
|||||||
jne ParamError
|
jne ParamError
|
||||||
|
|
||||||
; UPD structure is compliant with FSP spec 2.4
|
; UPD structure is compliant with FSP spec 2.4
|
||||||
mov eax, dword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
|
mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
|
||||||
cmp eax, 0
|
cmp rax, 0
|
||||||
jz Exit2
|
jz Exit2
|
||||||
cmp eax, 0800h
|
cmp rax, 0800h
|
||||||
jl ParamError
|
jl ParamError
|
||||||
|
|
||||||
mov esi, dword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeAddr]
|
mov rsi, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeAddr]
|
||||||
cmp esi, 0
|
cmp rsi, 0
|
||||||
jnz CheckMainHeader
|
jnz CheckMainHeader
|
||||||
|
|
||||||
ParamError:
|
ParamError:
|
||||||
@@ -256,7 +255,8 @@ CheckAddress:
|
|||||||
; UPD structure is compliant with FSP spec 2.4
|
; UPD structure is compliant with FSP spec 2.4
|
||||||
; Is automatic size detection ?
|
; Is automatic size detection ?
|
||||||
mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
|
mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
|
||||||
cmp rax, 0ffffffffffffffffh
|
mov rcx, 0ffffffffffffffffh
|
||||||
|
cmp rax, rcx
|
||||||
jz LoadMicrocodeDefault4
|
jz LoadMicrocodeDefault4
|
||||||
|
|
||||||
; Address >= microcode region address + microcode region size?
|
; Address >= microcode region address + microcode region size?
|
||||||
@@ -321,8 +321,7 @@ ASM_PFX(EstablishStackFsp):
|
|||||||
;
|
;
|
||||||
; Save parameter pointer in rdx
|
; Save parameter pointer in rdx
|
||||||
;
|
;
|
||||||
mov rdx, qword [rsp + 8]
|
mov rdx, rcx
|
||||||
|
|
||||||
;
|
;
|
||||||
; Enable FSP STACK
|
; Enable FSP STACK
|
||||||
;
|
;
|
||||||
@@ -420,7 +419,10 @@ ASM_PFX(TempRamInitApi):
|
|||||||
;
|
;
|
||||||
ENABLE_SSE
|
ENABLE_SSE
|
||||||
ENABLE_AVX
|
ENABLE_AVX
|
||||||
|
;
|
||||||
|
; Save Input Parameter in YMM10
|
||||||
|
;
|
||||||
|
SAVE_RCX
|
||||||
;
|
;
|
||||||
; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and YMM6
|
; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and YMM6
|
||||||
;
|
;
|
||||||
@@ -442,9 +444,8 @@ ASM_PFX(TempRamInitApi):
|
|||||||
;
|
;
|
||||||
; Check Parameter
|
; Check Parameter
|
||||||
;
|
;
|
||||||
mov rax, qword [rsp + 8]
|
cmp rcx, 0
|
||||||
cmp rax, 0
|
mov rcx, 08000000000000002h
|
||||||
mov rax, 08000000000000002h
|
|
||||||
jz TempRamInitExit
|
jz TempRamInitExit
|
||||||
|
|
||||||
;
|
;
|
||||||
@@ -455,18 +456,18 @@ ASM_PFX(TempRamInitApi):
|
|||||||
jnz TempRamInitExit
|
jnz TempRamInitExit
|
||||||
|
|
||||||
; Load microcode
|
; Load microcode
|
||||||
LOAD_RSP
|
LOAD_RCX
|
||||||
CALL_YMM ASM_PFX(LoadMicrocodeDefault)
|
CALL_YMM ASM_PFX(LoadMicrocodeDefault)
|
||||||
SAVE_UCODE_STATUS rax ; Save microcode return status in SLOT 0 in YMM9 (upper 128bits).
|
SAVE_UCODE_STATUS rax ; Save microcode return status in SLOT 0 in YMM9 (upper 128bits).
|
||||||
; @note If return value rax is not 0, microcode did not load, but continue and attempt to boot.
|
; @note If return value rax is not 0, microcode did not load, but continue and attempt to boot.
|
||||||
|
|
||||||
; Call Sec CAR Init
|
; Call Sec CAR Init
|
||||||
LOAD_RSP
|
LOAD_RCX
|
||||||
CALL_YMM ASM_PFX(SecCarInit)
|
CALL_YMM ASM_PFX(SecCarInit)
|
||||||
cmp rax, 0
|
cmp rax, 0
|
||||||
jnz TempRamInitExit
|
jnz TempRamInitExit
|
||||||
|
|
||||||
LOAD_RSP
|
LOAD_RCX
|
||||||
CALL_YMM ASM_PFX(EstablishStackFsp)
|
CALL_YMM ASM_PFX(EstablishStackFsp)
|
||||||
cmp rax, 0
|
cmp rax, 0
|
||||||
jnz TempRamInitExit
|
jnz TempRamInitExit
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Intel FSP API definition from Intel Firmware Support Package External
|
Intel FSP API definition from Intel Firmware Support Package External
|
||||||
Architecture Specification v2.0 - v2.2
|
Architecture Specification v2.0 and above.
|
||||||
|
|
||||||
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -11,19 +11,24 @@
|
|||||||
#define _FSP_API_H_
|
#define _FSP_API_H_
|
||||||
|
|
||||||
#include <Pi/PiStatusCode.h>
|
#include <Pi/PiStatusCode.h>
|
||||||
|
#include <Base.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSP Reset Status code
|
/// FSP Reset Status code
|
||||||
/// These are defined in FSP EAS v2.0 section 11.2.2 - OEM Status Code
|
/// These are defined in FSP EAS v2.4 section 13.2.2 - OEM Status Code
|
||||||
/// @{
|
/// @{
|
||||||
#define FSP_STATUS_RESET_REQUIRED_COLD 0x40000001
|
|
||||||
#define FSP_STATUS_RESET_REQUIRED_WARM 0x40000002
|
#define ENCODE_RESET_REQUEST(ResetType) \
|
||||||
#define FSP_STATUS_RESET_REQUIRED_3 0x40000003
|
((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
|
||||||
#define FSP_STATUS_RESET_REQUIRED_4 0x40000004
|
#define FSP_STATUS_RESET_REQUIRED_COLD ENCODE_RESET_REQUEST(1)
|
||||||
#define FSP_STATUS_RESET_REQUIRED_5 0x40000005
|
#define FSP_STATUS_RESET_REQUIRED_WARM ENCODE_RESET_REQUEST(2)
|
||||||
#define FSP_STATUS_RESET_REQUIRED_6 0x40000006
|
#define FSP_STATUS_RESET_REQUIRED_3 ENCODE_RESET_REQUEST(3)
|
||||||
#define FSP_STATUS_RESET_REQUIRED_7 0x40000007
|
#define FSP_STATUS_RESET_REQUIRED_4 ENCODE_RESET_REQUEST(4)
|
||||||
#define FSP_STATUS_RESET_REQUIRED_8 0x40000008
|
#define FSP_STATUS_RESET_REQUIRED_5 ENCODE_RESET_REQUEST(5)
|
||||||
|
#define FSP_STATUS_RESET_REQUIRED_6 ENCODE_RESET_REQUEST(6)
|
||||||
|
#define FSP_STATUS_RESET_REQUIRED_7 ENCODE_RESET_REQUEST(7)
|
||||||
|
#define FSP_STATUS_RESET_REQUIRED_8 ENCODE_RESET_REQUEST(8)
|
||||||
|
#define FSP_STATUS_VARIABLE_REQUEST ENCODE_RESET_REQUEST(10)
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -95,13 +100,14 @@ typedef struct {
|
|||||||
/// "XXXXXX_T" for FSP-T
|
/// "XXXXXX_T" for FSP-T
|
||||||
/// "XXXXXX_M" for FSP-M
|
/// "XXXXXX_M" for FSP-M
|
||||||
/// "XXXXXX_S" for FSP-S
|
/// "XXXXXX_S" for FSP-S
|
||||||
|
/// "XXXXXX_I" for FSP-I
|
||||||
/// Where XXXXXX is an unique signature
|
/// Where XXXXXX is an unique signature
|
||||||
///
|
///
|
||||||
UINT64 Signature;
|
UINT64 Signature;
|
||||||
///
|
///
|
||||||
/// Revision of the Data structure.
|
/// Revision of the Data structure.
|
||||||
/// For FSP spec 2.0/2.1 value is 1.
|
/// For FSP spec 2.0/2.1, this value is 1 and only FSPM_UPD having ARCH_UPD.
|
||||||
/// For FSP spec 2.2 value is 2.
|
/// For FSP spec 2.2 and above, this value is 2 and ARCH_UPD present in all UPD structures.
|
||||||
///
|
///
|
||||||
UINT8 Revision;
|
UINT8 Revision;
|
||||||
UINT8 Reserved[23];
|
UINT8 Reserved[23];
|
||||||
@@ -129,7 +135,7 @@ typedef struct {
|
|||||||
} FSPT_ARCH_UPD;
|
} FSPT_ARCH_UPD;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSPT_ARCH2_UPD Configuration.
|
/// FSPT_ARCH2_UPD Configuration for FSP 2.4 and above.
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
///
|
///
|
||||||
@@ -191,7 +197,7 @@ typedef struct {
|
|||||||
} FSPM_ARCH_UPD;
|
} FSPM_ARCH_UPD;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSPM_ARCH2_UPD Configuration.
|
/// FSPM_ARCH2_UPD Configuration for FSP 2.4 and above.
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
///
|
///
|
||||||
@@ -204,6 +210,13 @@ typedef struct {
|
|||||||
///
|
///
|
||||||
UINT32 Length;
|
UINT32 Length;
|
||||||
///
|
///
|
||||||
|
/// Pointer to the non-volatile storage (NVS) data buffer.
|
||||||
|
/// If it is NULL it indicates the NVS data is not available.
|
||||||
|
/// This value is deprecated starting with v2.4 of the FSP specification,
|
||||||
|
/// and will be removed in an upcoming version of the FSP specification.
|
||||||
|
///
|
||||||
|
EFI_PHYSICAL_ADDRESS NvsBufferPtr;
|
||||||
|
///
|
||||||
/// Pointer to the temporary stack base address to be
|
/// Pointer to the temporary stack base address to be
|
||||||
/// consumed inside FspMemoryInit() API.
|
/// consumed inside FspMemoryInit() API.
|
||||||
///
|
///
|
||||||
@@ -227,7 +240,7 @@ typedef struct {
|
|||||||
/// This value is only valid if Revision is >= 2.
|
/// This value is only valid if Revision is >= 2.
|
||||||
///
|
///
|
||||||
EFI_PHYSICAL_ADDRESS FspEventHandler;
|
EFI_PHYSICAL_ADDRESS FspEventHandler;
|
||||||
UINT8 Reserved1[24];
|
UINT8 Reserved1[16];
|
||||||
} FSPM_ARCH2_UPD;
|
} FSPM_ARCH2_UPD;
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -260,7 +273,7 @@ typedef struct {
|
|||||||
} FSPS_ARCH_UPD;
|
} FSPS_ARCH_UPD;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSPS_ARCH2_UPD Configuration.
|
/// FSPS_ARCH2_UPD Configuration for FSP 2.4 and above.
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
///
|
///
|
||||||
@@ -280,6 +293,40 @@ typedef struct {
|
|||||||
UINT8 Reserved1[16];
|
UINT8 Reserved1[16];
|
||||||
} FSPS_ARCH2_UPD;
|
} FSPS_ARCH2_UPD;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// FSPI_ARCH_UPD Configuration.
|
||||||
|
///
|
||||||
|
typedef struct {
|
||||||
|
///
|
||||||
|
/// Revision of the structure is 1 for this version of the specification.
|
||||||
|
///
|
||||||
|
UINT8 Revision;
|
||||||
|
UINT8 Reserved[3];
|
||||||
|
///
|
||||||
|
/// Length of the structure in bytes. The current value for this field is 64.
|
||||||
|
///
|
||||||
|
UINT32 Length;
|
||||||
|
///
|
||||||
|
/// The physical memory-mapped base address of the bootloader SMM firmware volume (FV).
|
||||||
|
///
|
||||||
|
EFI_PHYSICAL_ADDRESS BootloaderSmmFvBaseAddress;
|
||||||
|
///
|
||||||
|
/// The length in bytes of the bootloader SMM firmware volume (FV).
|
||||||
|
///
|
||||||
|
UINT64 BootloaderSmmFvLength;
|
||||||
|
///
|
||||||
|
/// The physical memory-mapped base address of the bootloader SMM FV context data.
|
||||||
|
/// This data is provided to bootloader SMM drivers through a HOB by the FSP MM Foundation.
|
||||||
|
///
|
||||||
|
EFI_PHYSICAL_ADDRESS BootloaderSmmFvContextData;
|
||||||
|
///
|
||||||
|
/// The length in bytes of the bootloader SMM FV context data.
|
||||||
|
/// This data is provided to bootloader SMM drivers through a HOB by the FSP MM Foundation.
|
||||||
|
///
|
||||||
|
UINT16 BootloaderSmmFvContextDataLength;
|
||||||
|
UINT8 Reserved1[30];
|
||||||
|
} FSPI_ARCH_UPD;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSPT_UPD_COMMON Configuration.
|
/// FSPT_UPD_COMMON Configuration.
|
||||||
///
|
///
|
||||||
@@ -388,6 +435,21 @@ typedef struct {
|
|||||||
FSPS_ARCH2_UPD FspsArchUpd;
|
FSPS_ARCH2_UPD FspsArchUpd;
|
||||||
} FSPS_UPD_COMMON_FSP24;
|
} FSPS_UPD_COMMON_FSP24;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// FSPI_UPD_COMMON Configuration.
|
||||||
|
///
|
||||||
|
typedef struct {
|
||||||
|
///
|
||||||
|
/// FSP_UPD_HEADER Configuration.
|
||||||
|
///
|
||||||
|
FSP_UPD_HEADER FspUpdHeader;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// FSPI_ARCH_UPD Configuration.
|
||||||
|
///
|
||||||
|
FSPI_ARCH_UPD FspiArchUpd;
|
||||||
|
} FSPI_UPD_COMMON;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enumeration of FSP_INIT_PHASE for NOTIFY_PHASE.
|
/// Enumeration of FSP_INIT_PHASE for NOTIFY_PHASE.
|
||||||
///
|
///
|
||||||
@@ -609,4 +671,23 @@ EFI_STATUS
|
|||||||
IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr
|
IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
This FSP API initializes SMM and provide any OS runtime silicon services,
|
||||||
|
including Reliability, Availability, and Serviceability (RAS) features implemented by the CPU.
|
||||||
|
|
||||||
|
@param[in] FspiUpdDataPtr Pointer to the FSPI_UPD data structure.
|
||||||
|
If NULL, FSP will use the default parameters.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS FSP execution environment was initialized successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER Input parameters are invalid.
|
||||||
|
@retval EFI_UNSUPPORTED The FSP calling conditions were not met.
|
||||||
|
@retval EFI_DEVICE_ERROR FSP initialization failed.
|
||||||
|
@retval FSP_STATUS_RESET_REQUIREDx A reset is required. These status codes will not be returned during S3.
|
||||||
|
**/
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *FSP_SMM_INIT)(
|
||||||
|
IN VOID *FspiUpdDataPtr
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#define FSP_IN_API_MODE 0
|
#define FSP_IN_API_MODE 0
|
||||||
#define FSP_IN_DISPATCH_MODE 1
|
#define FSP_IN_DISPATCH_MODE 1
|
||||||
#define FSP_GLOBAL_DATA_VERSION 1
|
#define FSP_GLOBAL_DATA_VERSION 0x2
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ typedef enum {
|
|||||||
TempRamExitApiIndex,
|
TempRamExitApiIndex,
|
||||||
FspSiliconInitApiIndex,
|
FspSiliconInitApiIndex,
|
||||||
FspMultiPhaseSiInitApiIndex,
|
FspMultiPhaseSiInitApiIndex,
|
||||||
|
FspSmmInitApiIndex,
|
||||||
FspApiIndexMax
|
FspApiIndexMax
|
||||||
} FSP_API_INDEX;
|
} FSP_API_INDEX;
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ typedef struct {
|
|||||||
/// Offset 0x08
|
/// Offset 0x08
|
||||||
///
|
///
|
||||||
UINTN CoreStack;
|
UINTN CoreStack;
|
||||||
UINTN Reserved2;
|
VOID *SmmInitUpdPtr;
|
||||||
///
|
///
|
||||||
/// IA32: Offset 0x10; X64: Offset 0x18
|
/// IA32: Offset 0x10; X64: Offset 0x18
|
||||||
///
|
///
|
||||||
@@ -59,17 +60,15 @@ typedef struct {
|
|||||||
///
|
///
|
||||||
UINT8 FspMode;
|
UINT8 FspMode;
|
||||||
UINT8 OnSeparateStack;
|
UINT8 OnSeparateStack;
|
||||||
UINT8 Reserved3;
|
UINT8 Reserved2;
|
||||||
UINT32 NumberOfPhases;
|
UINT32 NumberOfPhases;
|
||||||
UINT32 PhasesExecuted;
|
UINT32 PhasesExecuted;
|
||||||
UINT32 Reserved4[8];
|
UINT32 Reserved3[8];
|
||||||
///
|
///
|
||||||
/// IA32: Offset 0x40; X64: Offset 0x48
|
/// IA32: Offset 0x40; X64: Offset 0x48
|
||||||
/// Start of UINTN and pointer section
|
/// Start of UINTN and pointer section
|
||||||
/// All UINTN and pointer members must be put in this section
|
/// All UINTN and pointer members are put in this section
|
||||||
/// except CoreStack and Reserved2. In addition, the number of
|
/// for maintaining natural alignment for both IA32 and X64 builds.
|
||||||
/// UINTN and pointer members must be even for natural alignment
|
|
||||||
/// in both IA32 and X64.
|
|
||||||
///
|
///
|
||||||
FSP_PLAT_DATA PlatformData;
|
FSP_PLAT_DATA PlatformData;
|
||||||
VOID *TempRamInitUpdPtr;
|
VOID *TempRamInitUpdPtr;
|
||||||
@@ -85,12 +84,15 @@ typedef struct {
|
|||||||
VOID *UpdDataPtr;
|
VOID *UpdDataPtr;
|
||||||
///
|
///
|
||||||
/// End of UINTN and pointer section
|
/// End of UINTN and pointer section
|
||||||
|
/// At this point, next field offset must be either *0h or *8h to
|
||||||
|
/// meet natural alignment requirement.
|
||||||
///
|
///
|
||||||
UINT8 Reserved5[16];
|
UINT8 Reserved4[16];
|
||||||
UINT32 PerfSig;
|
UINT32 PerfSig;
|
||||||
UINT16 PerfLen;
|
UINT16 PerfLen;
|
||||||
UINT16 Reserved6;
|
UINT16 Reserved5;
|
||||||
UINT32 PerfIdx;
|
UINT32 PerfIdx;
|
||||||
|
UINT32 Reserved6;
|
||||||
UINT64 PerfData[32];
|
UINT64 PerfData[32];
|
||||||
} FSP_GLOBAL_DATA;
|
} FSP_GLOBAL_DATA;
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#define FSP_IA32 0
|
#define FSP_IA32 0
|
||||||
#define FSP_X64 1
|
#define FSP_X64 1
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
///
|
///
|
||||||
/// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
|
/// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
|
||||||
@@ -52,7 +52,7 @@ typedef struct {
|
|||||||
UINT8 Reserved1[2];
|
UINT8 Reserved1[2];
|
||||||
///
|
///
|
||||||
/// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.
|
/// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.
|
||||||
/// For revision v2.3 the value will be 0x23.
|
/// For revision v2.4 the value will be 0x24.
|
||||||
///
|
///
|
||||||
UINT8 SpecVersion;
|
UINT8 SpecVersion;
|
||||||
///
|
///
|
||||||
@@ -93,11 +93,28 @@ typedef struct {
|
|||||||
/// Bit 0: Graphics Support - Set to 1 when FSP supports enabling Graphics Display.
|
/// Bit 0: Graphics Support - Set to 1 when FSP supports enabling Graphics Display.
|
||||||
/// Bit 1: Dispatch Mode Support - Set to 1 when FSP supports the optional Dispatch Mode API defined in Section 7.2 and 9. This bit is only valid if FSP HeaderRevision is >= 4.
|
/// Bit 1: Dispatch Mode Support - Set to 1 when FSP supports the optional Dispatch Mode API defined in Section 7.2 and 9. This bit is only valid if FSP HeaderRevision is >= 4.
|
||||||
/// Bit 2: 64-bit mode support - Set to 1 to indicate FSP supports 64-bit long mode interfaces. Set to 0 to indicate FSP supports 32-bit mode interfaces. This bit is only valid if FSP HeaderRevision is >= 7.
|
/// Bit 2: 64-bit mode support - Set to 1 to indicate FSP supports 64-bit long mode interfaces. Set to 0 to indicate FSP supports 32-bit mode interfaces. This bit is only valid if FSP HeaderRevision is >= 7.
|
||||||
/// Bits 15:3 - Reserved
|
/// Bit 3: FSP Variable Services Support - Set to 1 to indicate FSP utilizes the FSP Variable Services defined in Section 9.6 to store non-volatile data. This bit is only valid if FSP HeaderRevision is >= 7.
|
||||||
|
/// Bits 15:4 - Reserved
|
||||||
///
|
///
|
||||||
UINT16 ImageAttribute;
|
UINT16 ImageAttribute;
|
||||||
///
|
///
|
||||||
/// Byte 0x22: Attributes of the FSP Component.
|
/// Byte 0x22: Attributes of the FSP Component.
|
||||||
|
/// Bit 0 - Build Type
|
||||||
|
/// 0 - Debug Build
|
||||||
|
/// 1 - Release Build
|
||||||
|
/// Bit 1 - Release Type
|
||||||
|
/// 0 - Test Release
|
||||||
|
/// 1 - Official Release
|
||||||
|
/// Bit 11:2 - Reserved
|
||||||
|
/// Bits 15:12 - Component Type
|
||||||
|
/// 0000 - Reserved
|
||||||
|
/// 0001 - FSP-T
|
||||||
|
/// 0010 - FSP-M
|
||||||
|
/// 0011 - FSP-S
|
||||||
|
/// 0100 - FSP-I (FSP SMM)
|
||||||
|
/// 0101 to 0111 - Reserved
|
||||||
|
/// 1000 - FSP-O
|
||||||
|
/// 1001 to 1111 - Reserved
|
||||||
///
|
///
|
||||||
UINT16 ComponentAttribute;
|
UINT16 ComponentAttribute;
|
||||||
///
|
///
|
||||||
@@ -159,6 +176,14 @@ typedef struct {
|
|||||||
/// Byte 0x4E: Reserved4.
|
/// Byte 0x4E: Reserved4.
|
||||||
///
|
///
|
||||||
UINT16 Reserved4;
|
UINT16 Reserved4;
|
||||||
|
///
|
||||||
|
/// Byte 0x50: Offset for the API for the Multi-Phase memory initialization.
|
||||||
|
///
|
||||||
|
UINT32 FspMultiPhaseMemInitEntryOffset;
|
||||||
|
///
|
||||||
|
/// Byte 0x54: Offset for the API to initialize SMM.
|
||||||
|
///
|
||||||
|
UINT32 FspSmmInitEntryOffset;
|
||||||
} FSP_INFO_HEADER;
|
} FSP_INFO_HEADER;
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -240,7 +265,7 @@ typedef struct {
|
|||||||
// UINT32 PatchData[];
|
// UINT32 PatchData[];
|
||||||
} FSP_PATCH_TABLE;
|
} FSP_PATCH_TABLE;
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
extern EFI_GUID gFspHeaderFileGuid;
|
extern EFI_GUID gFspHeaderFileGuid;
|
||||||
|
|
||||||
|
@@ -302,7 +302,7 @@ SetPhaseStatusCode (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
FspApiReturnStatusReset (
|
FspApiReturnStatusReset (
|
||||||
IN UINT32 FspResetType
|
IN EFI_STATUS FspResetType
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
Pei2LoaderSwitchStack (
|
Pei2LoaderSwitchStack (
|
||||||
VOID
|
VOID
|
||||||
@@ -46,7 +46,7 @@ Pei2LoaderSwitchStack (
|
|||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
Loader2PeiSwitchStack (
|
Loader2PeiSwitchStack (
|
||||||
VOID
|
VOID
|
||||||
|
195
IntelFsp2Pkg/Include/Ppi/Variable.h
Normal file
195
IntelFsp2Pkg/Include/Ppi/Variable.h
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
/** @file
|
||||||
|
EDKII PEI Variable PPI provides an implementation of variables
|
||||||
|
intended for use as a means to store data in the PEI environment.
|
||||||
|
|
||||||
|
Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef EDKII_PEI_VARIABLE_PPI_H_
|
||||||
|
#define EDKII_PEI_VARIABLE_PPI_H_
|
||||||
|
|
||||||
|
#define EDKII_PEI_VARIABLE_PPI_GUID \
|
||||||
|
{ \
|
||||||
|
0xe7b2cd04, 0x4b14, 0x44c2, { 0xb7, 0x48, 0xce, 0xaf, 0x2b, 0x66, 0x4a, 0xb0 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct _EDKII_PEI_VARIABLE_PPI EDKII_PEI_VARIABLE_PPI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
This service retrieves a variable's value using its name and GUID.
|
||||||
|
|
||||||
|
Read the specified variable from the UEFI variable store. If the Data
|
||||||
|
buffer is too small to hold the contents of the variable,
|
||||||
|
the error EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the
|
||||||
|
required buffer size to obtain the data.
|
||||||
|
|
||||||
|
@param[in] This A pointer to this instance of the EDKII_PEI_VARIABLE_PPI.
|
||||||
|
@param[in] VariableName A pointer to a null-terminated string that is the variable's name.
|
||||||
|
@param[in] VariableGuid A pointer to an EFI_GUID that is the variable's GUID. The combination of
|
||||||
|
VariableGuid and VariableName must be unique.
|
||||||
|
@param[out] Attributes If non-NULL, on return, points to the variable's attributes.
|
||||||
|
@param[in, out] DataSize On entry, points to the size in bytes of the Data buffer.
|
||||||
|
On return, points to the size of the data returned in Data.
|
||||||
|
@param[out] Data Points to the buffer which will hold the returned variable value.
|
||||||
|
May be NULL with a zero DataSize in order to determine the size of the
|
||||||
|
buffer needed.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The variable was read successfully.
|
||||||
|
@retval EFI_NOT_FOUND The variable was not found.
|
||||||
|
@retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data.
|
||||||
|
DataSize is updated with the size required for
|
||||||
|
the specified variable.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
|
||||||
|
|
||||||
|
**/
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *EDKII_PEI_GET_VARIABLE)(
|
||||||
|
IN CONST EDKII_PEI_VARIABLE_PPI *This,
|
||||||
|
IN CONST CHAR16 *VariableName,
|
||||||
|
IN CONST EFI_GUID *VariableGuid,
|
||||||
|
OUT UINT32 *Attributes OPTIONAL,
|
||||||
|
IN OUT UINTN *DataSize,
|
||||||
|
OUT VOID *Data OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return the next variable name and GUID.
|
||||||
|
|
||||||
|
This function is called multiple times to retrieve the VariableName
|
||||||
|
and VariableGuid of all variables currently available in the system.
|
||||||
|
On each call, the previous results are passed into the interface,
|
||||||
|
and, on return, the interface returns the data for the next
|
||||||
|
variable. To get started, VariableName should initially contain L"\0"
|
||||||
|
and VariableNameSize should be sizeof(CHAR16). When the entire
|
||||||
|
variable list has been returned, EFI_NOT_FOUND is returned.
|
||||||
|
|
||||||
|
@param[in] This A pointer to this instance of the EDKII_PEI_VARIABLE_PPI.
|
||||||
|
@param[in, out] VariableNameSize On entry, points to the size of the buffer pointed to by VariableName.
|
||||||
|
On return, the size of the variable name buffer.
|
||||||
|
@param[in, out] VariableName On entry, a pointer to a null-terminated string that is the variable's name.
|
||||||
|
On return, points to the next variable's null-terminated name string.
|
||||||
|
@param[in, out] VariableGuid On entry, a pointer to an EFI_GUID that is the variable's GUID.
|
||||||
|
On return, a pointer to the next variable's GUID.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The next variable name was read successfully.
|
||||||
|
@retval EFI_NOT_FOUND All variables have been enumerated.
|
||||||
|
@retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting
|
||||||
|
data. VariableNameSize is updated with the size
|
||||||
|
required for the specified variable.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName, VariableGuid or
|
||||||
|
VariableNameSize is NULL.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error.
|
||||||
|
|
||||||
|
**/
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *EDKII_PEI_GET_NEXT_VARIABLE_NAME)(
|
||||||
|
IN CONST EDKII_PEI_VARIABLE_PPI *This,
|
||||||
|
IN OUT UINTN *VariableNameSize,
|
||||||
|
IN OUT CHAR16 *VariableName,
|
||||||
|
IN OUT EFI_GUID *VariableGuid
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the value of a variable.
|
||||||
|
|
||||||
|
@param[in] This A pointer to this instance of the EDKII_PEI_VARIABLE_PPI.
|
||||||
|
@param[in] VariableName A Null-terminated string that is the name of the vendor's variable.
|
||||||
|
Each VariableName is unique for each VendorGuid. VariableName must
|
||||||
|
contain 1 or more characters. If VariableName is an empty string,
|
||||||
|
then EFI_INVALID_PARAMETER is returned.
|
||||||
|
@param[in] VendorGuid A unique identifier for the vendor.
|
||||||
|
@param[in] Attributes Attributes bitmask to set for the variable.
|
||||||
|
@param[in] DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE
|
||||||
|
attribute is set, a size of zero causes the variable to be deleted. When the
|
||||||
|
EFI_VARIABLE_APPEND_WRITE attribute is set, then a SetVariable() call with a
|
||||||
|
DataSize of zero will not cause any change to the variable value.
|
||||||
|
@param[in] Data The contents for the variable.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
|
||||||
|
defined by the Attributes.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
|
||||||
|
DataSize exceeds the maximum allowed.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName is an empty string.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be stored due to a hardware error.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
|
||||||
|
@retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS,
|
||||||
|
or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS, or
|
||||||
|
EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS being set. Writing to authenticated
|
||||||
|
variables is not supported in the PEI environment. Updates to authenticated
|
||||||
|
variables can be requested during PEI via the EFI_AUTHENTICATED_VARIABLE_HOB, but
|
||||||
|
these updates won't be written to non-volatile storage until later in DXE.
|
||||||
|
The EFI_AUTHENTICATED_VARIABLE_HOB is a HOB with the GUID
|
||||||
|
gEfiAuthenticatedVariableGuid. This HOB contains a VARIABLE_STORE_HEADER followed
|
||||||
|
by one or more UEFI variables, which are stored as DWORD aligned tuples of
|
||||||
|
(VARIABLE_HEADER + CHAR16 VariableName + VariableData).
|
||||||
|
See MdeModulePkg/Include/Guid/VariableFormat.h for these data structure
|
||||||
|
definitions and MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c for
|
||||||
|
an example of how to parse these data structures.
|
||||||
|
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
|
||||||
|
|
||||||
|
**/
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *EDKII_PEI_SET_VARIABLE)(
|
||||||
|
IN CONST EDKII_PEI_VARIABLE_PPI *This,
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns information about the UEFI variables.
|
||||||
|
|
||||||
|
@param[in] This A pointer to this instance of the EDKII_PEI_VARIABLE_PPI.
|
||||||
|
@param[in] Attributes Attributes bitmask to specify the type of variables on
|
||||||
|
which to return information.
|
||||||
|
@param[out] MaximumVariableStorageSize On output the maximum size of the storage space
|
||||||
|
available for the EFI variables associated with the
|
||||||
|
attributes specified.
|
||||||
|
@param[out] RemainingVariableStorageSize Returns the remaining size of the storage space
|
||||||
|
available for the EFI variables associated with the
|
||||||
|
attributes specified.
|
||||||
|
@param[out] MaximumVariableSize Returns the maximum size of the individual EFI
|
||||||
|
variables associated with the attributes specified.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Valid answer returned.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied
|
||||||
|
@retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the
|
||||||
|
MaximumVariableStorageSize,
|
||||||
|
RemainingVariableStorageSize, MaximumVariableSize
|
||||||
|
are undefined.
|
||||||
|
|
||||||
|
**/
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *EDKII_PEI_QUERY_VARIABLE_INFO)(
|
||||||
|
IN CONST EDKII_PEI_VARIABLE_PPI *This,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
OUT UINT64 *MaximumVariableStorageSize,
|
||||||
|
OUT UINT64 *RemainingVariableStorageSize,
|
||||||
|
OUT UINT64 *MaximumVariableSize
|
||||||
|
);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// PEI Variable PPI is intended for use as a means
|
||||||
|
/// to store data in the PEI environment.
|
||||||
|
///
|
||||||
|
struct _EDKII_PEI_VARIABLE_PPI {
|
||||||
|
EDKII_PEI_GET_VARIABLE GetVariable;
|
||||||
|
EDKII_PEI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
|
||||||
|
EDKII_PEI_SET_VARIABLE SetVariable;
|
||||||
|
EDKII_PEI_QUERY_VARIABLE_INFO QueryVariableInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern EFI_GUID gEdkiiPeiVariablePpiGuid;
|
||||||
|
|
||||||
|
#endif
|
@@ -177,6 +177,30 @@
|
|||||||
LXMMN xmm5, %1, 1
|
LXMMN xmm5, %1, 1
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
;
|
||||||
|
; Upper half of YMM10 to save/restore RCX
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; Save RCX to YMM10[128:191]
|
||||||
|
; Modified: XMM5 and YMM10
|
||||||
|
;
|
||||||
|
|
||||||
|
%macro SAVE_RCX 0
|
||||||
|
LYMMN ymm10, xmm5, 1
|
||||||
|
SXMMN xmm5, 0, rcx
|
||||||
|
SYMMN ymm10, 1, xmm5
|
||||||
|
%endmacro
|
||||||
|
|
||||||
|
;
|
||||||
|
; Restore RCX from YMM10[128:191]
|
||||||
|
; Modified: XMM5 and RCX
|
||||||
|
;
|
||||||
|
|
||||||
|
%macro LOAD_RCX 0
|
||||||
|
LYMMN ymm10, xmm5, 1
|
||||||
|
movq rcx, xmm5
|
||||||
|
%endmacro
|
||||||
|
|
||||||
;
|
;
|
||||||
; YMM7[128:191] for calling stack
|
; YMM7[128:191] for calling stack
|
||||||
; arg 1:Entry
|
; arg 1:Entry
|
||||||
@@ -231,6 +255,7 @@ NextAddress:
|
|||||||
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
||||||
; whether the processor supports SSE instruction.
|
; whether the processor supports SSE instruction.
|
||||||
;
|
;
|
||||||
|
mov r10, rcx
|
||||||
mov rax, 1
|
mov rax, 1
|
||||||
cpuid
|
cpuid
|
||||||
bt rdx, 25
|
bt rdx, 25
|
||||||
@@ -241,6 +266,7 @@ NextAddress:
|
|||||||
;
|
;
|
||||||
bt ecx, 19
|
bt ecx, 19
|
||||||
jnc SseError
|
jnc SseError
|
||||||
|
mov rcx, r10
|
||||||
|
|
||||||
;
|
;
|
||||||
; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit #10)
|
; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit #10)
|
||||||
@@ -258,6 +284,7 @@ NextAddress:
|
|||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro ENABLE_AVX 0
|
%macro ENABLE_AVX 0
|
||||||
|
mov r10, rcx
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
cpuid
|
cpuid
|
||||||
and ecx, 10000000h
|
and ecx, 10000000h
|
||||||
@@ -280,5 +307,6 @@ EnableAvx:
|
|||||||
xgetbv ; result in edx:eax
|
xgetbv ; result in edx:eax
|
||||||
or eax, 00000006h ; Set XCR0 bit #1 and bit #2 to enable SSE state and AVX state
|
or eax, 00000006h ; Set XCR0 bit #1 and bit #2 to enable SSE state and AVX state
|
||||||
xsetbv
|
xsetbv
|
||||||
|
mov rcx, r10
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# Provides driver and definitions to build fsp in EDKII bios.
|
# Provides driver and definitions to build fsp in EDKII bios.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
@@ -59,6 +59,12 @@
|
|||||||
#
|
#
|
||||||
gFspTempRamExitPpiGuid = { 0xbc1cfbdb, 0x7e50, 0x42be, {0xb4, 0x87, 0x22, 0xe0, 0xa9, 0x0c, 0xb0, 0x52}}
|
gFspTempRamExitPpiGuid = { 0xbc1cfbdb, 0x7e50, 0x42be, {0xb4, 0x87, 0x22, 0xe0, 0xa9, 0x0c, 0xb0, 0x52}}
|
||||||
|
|
||||||
|
#
|
||||||
|
# PPI for Variable Services
|
||||||
|
#
|
||||||
|
gEdkiiPeiVariablePpiGuid = { 0xe7b2cd04, 0x4b14, 0x44c2, {0xb7, 0x48, 0xce, 0xaf, 0x2b, 0x66, 0x4a, 0xb0}}
|
||||||
|
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
#
|
#
|
||||||
# GUID defined in package
|
# GUID defined in package
|
||||||
|
@@ -68,6 +68,7 @@
|
|||||||
IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
|
IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
|
||||||
IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
|
IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
|
||||||
IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
|
IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
|
||||||
|
IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
|
||||||
IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf
|
IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf
|
||||||
IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.inf
|
IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.inf
|
||||||
|
|
||||||
|
@@ -200,7 +200,7 @@ SetFspCoreStackPointer (
|
|||||||
UINT32 StackContextLen;
|
UINT32 StackContextLen;
|
||||||
|
|
||||||
FspData = GetFspGlobalDataPointer ();
|
FspData = GetFspGlobalDataPointer ();
|
||||||
StackContextLen = sizeof(CONTEXT_STACK) / sizeof(UINTN);
|
StackContextLen = sizeof (CONTEXT_STACK) / sizeof (UINTN);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reserve space for the ContinuationFunc two parameters
|
// Reserve space for the ContinuationFunc two parameters
|
||||||
@@ -533,7 +533,7 @@ SetPhaseStatusCode (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
FspApiReturnStatusReset (
|
FspApiReturnStatusReset (
|
||||||
IN UINT32 FspResetType
|
IN EFI_STATUS FspResetType
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volatile BOOLEAN LoopUntilReset;
|
volatile BOOLEAN LoopUntilReset;
|
||||||
@@ -546,7 +546,7 @@ FspApiReturnStatusReset (
|
|||||||
/// calls the FSP API without honoring the reset request by FSP
|
/// calls the FSP API without honoring the reset request by FSP
|
||||||
///
|
///
|
||||||
do {
|
do {
|
||||||
SetFspApiReturnStatus ((EFI_STATUS)FspResetType);
|
SetFspApiReturnStatus (FspResetType);
|
||||||
Pei2LoaderSwitchStack ();
|
Pei2LoaderSwitchStack ();
|
||||||
DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n"));
|
DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n"));
|
||||||
DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honor the reset request from FSP\n"));
|
DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honor the reset request from FSP\n"));
|
||||||
|
@@ -13,6 +13,7 @@ import tkinter.ttk as ttk
|
|||||||
import tkinter.messagebox as messagebox
|
import tkinter.messagebox as messagebox
|
||||||
import tkinter.filedialog as filedialog
|
import tkinter.filedialog as filedialog
|
||||||
|
|
||||||
|
from pickle import FALSE, TRUE
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from GenYamlCfg import CGenYamlCfg, bytes_to_value, \
|
from GenYamlCfg import CGenYamlCfg, bytes_to_value, \
|
||||||
bytes_to_bracket_str, value_to_bytes, array_str_to_value
|
bytes_to_bracket_str, value_to_bytes, array_str_to_value
|
||||||
@@ -458,7 +459,10 @@ class FSP_INFORMATION_HEADER(Structure):
|
|||||||
('NotifyPhaseEntryOffset', c_uint32),
|
('NotifyPhaseEntryOffset', c_uint32),
|
||||||
('FspMemoryInitEntryOffset', c_uint32),
|
('FspMemoryInitEntryOffset', c_uint32),
|
||||||
('TempRamExitEntryOffset', c_uint32),
|
('TempRamExitEntryOffset', c_uint32),
|
||||||
('FspSiliconInitEntryOffset', c_uint32)
|
('FspSiliconInitEntryOffset', c_uint32),
|
||||||
|
('FspMultiPhaseSiInitEntryOffset', c_uint32),
|
||||||
|
('ExtendedImageRevision', c_uint16),
|
||||||
|
('Reserved4', c_uint16)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -700,6 +704,34 @@ class FirmwareDevice:
|
|||||||
raise Exception("ERROR: Incorrect FV size in image !")
|
raise Exception("ERROR: Incorrect FV size in image !")
|
||||||
self.CheckFsp()
|
self.CheckFsp()
|
||||||
|
|
||||||
|
def IsIntegerType(self, val):
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
if type(val) in (int, long):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
if type(val) is int:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def ConvertRevisionString(self, obj):
|
||||||
|
for field in obj._fields_:
|
||||||
|
key = field[0]
|
||||||
|
val = getattr(obj, key)
|
||||||
|
rep = ''
|
||||||
|
|
||||||
|
if self.IsIntegerType(val):
|
||||||
|
if (key == 'ImageRevision'):
|
||||||
|
FspImageRevisionMajor = ((val >> 24) & 0xFF)
|
||||||
|
FspImageRevisionMinor = ((val >> 16) & 0xFF)
|
||||||
|
FspImageRevisionRevision = ((val >> 8) & 0xFF)
|
||||||
|
FspImageRevisionBuildNumber = (val & 0xFF)
|
||||||
|
rep = '0x%08X' % val
|
||||||
|
elif (key == 'ExtendedImageRevision'):
|
||||||
|
FspImageRevisionRevision |= (val & 0xFF00)
|
||||||
|
FspImageRevisionBuildNumber |= ((val << 8) & 0xFF00)
|
||||||
|
rep = "0x%04X ('%02X.%02X.%04X.%04X')" % (val, FspImageRevisionMajor, FspImageRevisionMinor, FspImageRevisionRevision, FspImageRevisionBuildNumber)
|
||||||
|
return rep
|
||||||
|
|
||||||
def OutputFsp(self):
|
def OutputFsp(self):
|
||||||
def copy_text_to_clipboard():
|
def copy_text_to_clipboard():
|
||||||
window.clipboard_clear()
|
window.clipboard_clear()
|
||||||
@@ -721,7 +753,8 @@ class FirmwareDevice:
|
|||||||
self.OutputText = self.OutputText + "Fsp Header Details \n\n"
|
self.OutputText = self.OutputText + "Fsp Header Details \n\n"
|
||||||
while i < len(self.FihList):
|
while i < len(self.FihList):
|
||||||
try:
|
try:
|
||||||
self.OutputText += str(self.BuildList[i].decode()) + "\n"
|
# self.OutputText += str(self.BuildList[i].decode()) + "\n"
|
||||||
|
self.OutputText += str(self.BuildList[i]) + "\n"
|
||||||
except Exception:
|
except Exception:
|
||||||
self.OutputText += "No description found\n"
|
self.OutputText += "No description found\n"
|
||||||
self.OutputText += "FSP Header :\n "
|
self.OutputText += "FSP Header :\n "
|
||||||
@@ -729,6 +762,8 @@ class FirmwareDevice:
|
|||||||
str(self.FihList[i].Signature.decode('utf-8')) + "\n "
|
str(self.FihList[i].Signature.decode('utf-8')) + "\n "
|
||||||
self.OutputText += "Header Length : " + \
|
self.OutputText += "Header Length : " + \
|
||||||
str(hex(self.FihList[i].HeaderLength)) + "\n "
|
str(hex(self.FihList[i].HeaderLength)) + "\n "
|
||||||
|
self.OutputText += "Reserved1 : " + \
|
||||||
|
str(hex(self.FihList[i].Reserved1)) + "\n "
|
||||||
self.OutputText += "Header Revision : " + \
|
self.OutputText += "Header Revision : " + \
|
||||||
str(hex(self.FihList[i].HeaderRevision)) + "\n "
|
str(hex(self.FihList[i].HeaderRevision)) + "\n "
|
||||||
self.OutputText += "Spec Version : " + \
|
self.OutputText += "Spec Version : " + \
|
||||||
@@ -743,15 +778,17 @@ class FirmwareDevice:
|
|||||||
str(hex(self.FihList[i].ImageBase)) + "\n "
|
str(hex(self.FihList[i].ImageBase)) + "\n "
|
||||||
self.OutputText += "Image Attribute : " + \
|
self.OutputText += "Image Attribute : " + \
|
||||||
str(hex(self.FihList[i].ImageAttribute)) + "\n "
|
str(hex(self.FihList[i].ImageAttribute)) + "\n "
|
||||||
|
self.OutputText += "Component Attribute : " + \
|
||||||
|
str(hex(self.FihList[i].ComponentAttribute)) + "\n "
|
||||||
self.OutputText += "Cfg Region Offset : " + \
|
self.OutputText += "Cfg Region Offset : " + \
|
||||||
str(hex(self.FihList[i].CfgRegionOffset)) + "\n "
|
str(hex(self.FihList[i].CfgRegionOffset)) + "\n "
|
||||||
self.OutputText += "Cfg Region Size : " + \
|
self.OutputText += "Cfg Region Size : " + \
|
||||||
str(hex(self.FihList[i].CfgRegionSize)) + "\n "
|
str(hex(self.FihList[i].CfgRegionSize)) + "\n "
|
||||||
self.OutputText += "API Entry Num : " + \
|
self.OutputText += "Reserved2 : " + \
|
||||||
str(hex(self.FihList[i].Reserved2)) + "\n "
|
str(hex(self.FihList[i].Reserved2)) + "\n "
|
||||||
self.OutputText += "Temp Ram Init Entry : " + \
|
self.OutputText += "Temp Ram Init Entry : " + \
|
||||||
str(hex(self.FihList[i].TempRamInitEntryOffset)) + "\n "
|
str(hex(self.FihList[i].TempRamInitEntryOffset)) + "\n "
|
||||||
self.OutputText += "FSP Init Entry : " + \
|
self.OutputText += "Reserved3 : " + \
|
||||||
str(hex(self.FihList[i].Reserved3)) + "\n "
|
str(hex(self.FihList[i].Reserved3)) + "\n "
|
||||||
self.OutputText += "Notify Phase Entry : " + \
|
self.OutputText += "Notify Phase Entry : " + \
|
||||||
str(hex(self.FihList[i].NotifyPhaseEntryOffset)) + "\n "
|
str(hex(self.FihList[i].NotifyPhaseEntryOffset)) + "\n "
|
||||||
@@ -760,7 +797,23 @@ class FirmwareDevice:
|
|||||||
self.OutputText += "Temp Ram Exit Entry : " + \
|
self.OutputText += "Temp Ram Exit Entry : " + \
|
||||||
str(hex(self.FihList[i].TempRamExitEntryOffset)) + "\n "
|
str(hex(self.FihList[i].TempRamExitEntryOffset)) + "\n "
|
||||||
self.OutputText += "Fsp Silicon Init Entry : " + \
|
self.OutputText += "Fsp Silicon Init Entry : " + \
|
||||||
str(hex(self.FihList[i].FspSiliconInitEntryOffset)) + "\n\n"
|
str(hex(self.FihList[i].FspSiliconInitEntryOffset)) + "\n "
|
||||||
|
self.OutputText += "Fsp Multi Phase Si Init Entry : " + \
|
||||||
|
str(hex(self.FihList[i].FspMultiPhaseSiInitEntryOffset)) + "\n "
|
||||||
|
|
||||||
|
# display ExtendedImageRevision & Reserved4 if HeaderRevision >= 6
|
||||||
|
for fsp in self.FihList:
|
||||||
|
if fsp.HeaderRevision >= 6:
|
||||||
|
Display_ExtndImgRev = TRUE
|
||||||
|
else:
|
||||||
|
Display_ExtndImgRev = FALSE
|
||||||
|
self.OutputText += "\n"
|
||||||
|
if Display_ExtndImgRev == TRUE:
|
||||||
|
self.OutputText += "ExtendedImageRevision : " + \
|
||||||
|
str(self.ConvertRevisionString(self.FihList[i])) + "\n "
|
||||||
|
self.OutputText += "Reserved4 : " + \
|
||||||
|
str(hex(self.FihList[i].Reserved4)) + "\n\n"
|
||||||
|
|
||||||
self.OutputText += "FSP Extended Header:\n "
|
self.OutputText += "FSP Extended Header:\n "
|
||||||
self.OutputText += "Signature : " + \
|
self.OutputText += "Signature : " + \
|
||||||
str(self.FspExtList[i].Signature.decode('utf-8')) + "\n "
|
str(self.FspExtList[i].Signature.decode('utf-8')) + "\n "
|
||||||
|
@@ -929,17 +929,25 @@ into %d bytes !" % (value_str, length))
|
|||||||
]]:
|
]]:
|
||||||
tmp_list.append((op_val, op_str))
|
tmp_list.append((op_val, op_str))
|
||||||
else:
|
else:
|
||||||
opt_list = item['option'].split(',')
|
if item['option'].find(';') != -1:
|
||||||
|
opt_list = item['option'].split(';')
|
||||||
|
else:
|
||||||
|
opt_list = re.split(', ', item['option'])
|
||||||
for option in opt_list:
|
for option in opt_list:
|
||||||
option = option.strip()
|
option = option.strip()
|
||||||
try:
|
try:
|
||||||
|
if option.find(':') != -1:
|
||||||
(op_val, op_str) = option.split(':')
|
(op_val, op_str) = option.split(':')
|
||||||
|
else:
|
||||||
|
op_val = option
|
||||||
|
op_str = option
|
||||||
except Exception:
|
except Exception:
|
||||||
raise SystemExit("Exception: Invalide \
|
raise SystemExit("Exception: Invalid \
|
||||||
option format '%s' !" % option)
|
option format '%s' !" % option)
|
||||||
tmp_list.append((op_val, op_str))
|
tmp_list.append((op_val, op_str))
|
||||||
return tmp_list
|
return tmp_list
|
||||||
|
|
||||||
|
|
||||||
def get_page_title(self, page_id, top=None):
|
def get_page_title(self, page_id, top=None):
|
||||||
if top is None:
|
if top is None:
|
||||||
top = self.get_cfg_page()['root']
|
top = self.get_cfg_page()['root']
|
||||||
|
@@ -953,12 +953,17 @@ EndList
|
|||||||
return NoFileChange
|
return NoFileChange
|
||||||
|
|
||||||
def CreateSplitUpdTxt (self, UpdTxtFile):
|
def CreateSplitUpdTxt (self, UpdTxtFile):
|
||||||
GuidList = ['FSP_T_UPD_TOOL_GUID','FSP_M_UPD_TOOL_GUID','FSP_S_UPD_TOOL_GUID']
|
GuidList = ['FSP_T_UPD_TOOL_GUID','FSP_M_UPD_TOOL_GUID','FSP_S_UPD_TOOL_GUID','FSP_I_UPD_TOOL_GUID']
|
||||||
SignatureList = ['0x545F', '0x4D5F','0x535F'] # _T, _M, and _S signature for FSPT, FSPM, FSPS
|
SignatureList = ['0x545F', '0x4D5F','0x535F','0x495F'] # _T, _M, _S and _I signature for FSPT, FSPM, FSPS, FSPI
|
||||||
for Index in range(len(GuidList)):
|
for Index in range(len(GuidList)):
|
||||||
UpdTxtFile = ''
|
UpdTxtFile = ''
|
||||||
FvDir = self._FvDir
|
FvDir = self._FvDir
|
||||||
if GuidList[Index] not in self._MacroDict:
|
if GuidList[Index] not in self._MacroDict:
|
||||||
|
NoFSPI = False
|
||||||
|
if GuidList[Index] == 'FSP_I_UPD_TOOL_GUID':
|
||||||
|
NoFSPI = True
|
||||||
|
continue
|
||||||
|
else:
|
||||||
self.Error = "%s definition is missing in DSC file" % (GuidList[Index])
|
self.Error = "%s definition is missing in DSC file" % (GuidList[Index])
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -1288,19 +1293,22 @@ EndList
|
|||||||
Chars.append(chr(Value & 0xFF))
|
Chars.append(chr(Value & 0xFF))
|
||||||
Value = Value >> 8
|
Value = Value >> 8
|
||||||
SignatureStr = ''.join(Chars)
|
SignatureStr = ''.join(Chars)
|
||||||
# Signature will be _T / _M / _S for FSPT / FSPM / FSPS accordingly
|
# Signature will be _T / _M / _S / _I for FSPT / FSPM / FSPS /FSPI accordingly
|
||||||
if '_T' in SignatureStr[6:6+2]:
|
if '_T' in SignatureStr[6:6+2]:
|
||||||
TxtBody.append("#define FSPT_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
TxtBody.append("#define FSPT_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
||||||
elif '_M' in SignatureStr[6:6+2]:
|
elif '_M' in SignatureStr[6:6+2]:
|
||||||
TxtBody.append("#define FSPM_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
TxtBody.append("#define FSPM_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
||||||
elif '_S' in SignatureStr[6:6+2]:
|
elif '_S' in SignatureStr[6:6+2]:
|
||||||
TxtBody.append("#define FSPS_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
TxtBody.append("#define FSPS_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
||||||
|
elif '_I' in SignatureStr[6:6+2]:
|
||||||
|
if NoFSPI == False:
|
||||||
|
TxtBody.append("#define FSPI_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
|
||||||
TxtBody.append("\n")
|
TxtBody.append("\n")
|
||||||
|
|
||||||
for Region in ['UPD']:
|
for Region in ['UPD']:
|
||||||
UpdOffsetTable = []
|
UpdOffsetTable = []
|
||||||
UpdSignature = ['0x545F', '0x4D5F', '0x535F'] #['_T', '_M', '_S'] signature for FSPT, FSPM, FSPS
|
UpdSignature = ['0x545F', '0x4D5F', '0x535F', '0x495F'] #['_T', '_M', '_S', '_I'] signature for FSPT, FSPM, FSPS, FSPI
|
||||||
UpdStructure = ['FSPT_UPD', 'FSPM_UPD', 'FSPS_UPD']
|
UpdStructure = ['FSPT_UPD', 'FSPM_UPD', 'FSPS_UPD', 'FSPI_UPD']
|
||||||
for Item in self._CfgItemList:
|
for Item in self._CfgItemList:
|
||||||
if Item["cname"] == 'Signature' and Item["value"][0:6] in UpdSignature:
|
if Item["cname"] == 'Signature' and Item["value"][0:6] in UpdSignature:
|
||||||
Item["offset"] = 0 # re-initialize offset to 0 when new UPD structure starting
|
Item["offset"] = 0 # re-initialize offset to 0 when new UPD structure starting
|
||||||
@@ -1393,11 +1401,12 @@ EndList
|
|||||||
HeaderTFileName = 'FsptUpd.h'
|
HeaderTFileName = 'FsptUpd.h'
|
||||||
HeaderMFileName = 'FspmUpd.h'
|
HeaderMFileName = 'FspmUpd.h'
|
||||||
HeaderSFileName = 'FspsUpd.h'
|
HeaderSFileName = 'FspsUpd.h'
|
||||||
|
HeaderIFileName = 'FspiUpd.h'
|
||||||
|
|
||||||
UpdRegionCheck = ['FSPT', 'FSPM', 'FSPS'] # FSPX_UPD_REGION
|
UpdRegionCheck = ['FSPT', 'FSPM', 'FSPS', 'FSPI'] # FSPX_UPD_REGION
|
||||||
UpdConfigCheck = ['FSP_T', 'FSP_M', 'FSP_S'] # FSP_X_CONFIG, FSP_X_TEST_CONFIG, FSP_X_RESTRICTED_CONFIG
|
UpdConfigCheck = ['FSP_T', 'FSP_M', 'FSP_S', 'FSP_I'] # FSP_X_CONFIG, FSP_X_TEST_CONFIG, FSP_X_RESTRICTED_CONFIG
|
||||||
UpdSignatureCheck = ['FSPT_UPD_SIGNATURE', 'FSPM_UPD_SIGNATURE', 'FSPS_UPD_SIGNATURE']
|
UpdSignatureCheck = ['FSPT_UPD_SIGNATURE', 'FSPM_UPD_SIGNATURE', 'FSPS_UPD_SIGNATURE', 'FSPI_UPD_SIGNATURE']
|
||||||
ExcludedSpecificUpd = ['FSPT_ARCH_UPD', 'FSPM_ARCH_UPD', 'FSPS_ARCH_UPD']
|
ExcludedSpecificUpd = ['FSPT_ARCH_UPD', 'FSPM_ARCH_UPD', 'FSPS_ARCH_UPD', 'FSPI_ARCH_UPD']
|
||||||
ExcludedSpecificUpd1 = ['FSPT_ARCH2_UPD', 'FSPM_ARCH2_UPD', 'FSPS_ARCH2_UPD']
|
ExcludedSpecificUpd1 = ['FSPT_ARCH2_UPD', 'FSPM_ARCH2_UPD', 'FSPS_ARCH2_UPD']
|
||||||
|
|
||||||
IncLines = []
|
IncLines = []
|
||||||
@@ -1420,6 +1429,9 @@ EndList
|
|||||||
elif UpdRegionCheck[item] == 'FSPS':
|
elif UpdRegionCheck[item] == 'FSPS':
|
||||||
HeaderFd = open(os.path.join(FvDir, HeaderSFileName), "w")
|
HeaderFd = open(os.path.join(FvDir, HeaderSFileName), "w")
|
||||||
FileBase = os.path.basename(os.path.join(FvDir, HeaderSFileName))
|
FileBase = os.path.basename(os.path.join(FvDir, HeaderSFileName))
|
||||||
|
elif UpdRegionCheck[item] == 'FSPI':
|
||||||
|
HeaderFd = open(os.path.join(FvDir, HeaderIFileName), "w")
|
||||||
|
FileBase = os.path.basename(os.path.join(FvDir, HeaderIFileName))
|
||||||
FileName = FileBase.replace(".", "_").upper()
|
FileName = FileBase.replace(".", "_").upper()
|
||||||
HeaderFd.write("%s\n" % (__copyright_h__ % date.today().year))
|
HeaderFd.write("%s\n" % (__copyright_h__ % date.today().year))
|
||||||
HeaderFd.write("#ifndef __%s__\n" % FileName)
|
HeaderFd.write("#ifndef __%s__\n" % FileName)
|
||||||
@@ -1696,7 +1708,7 @@ EndList
|
|||||||
|
|
||||||
|
|
||||||
def Usage():
|
def Usage():
|
||||||
print ("GenCfgOpt Version 0.57")
|
print ("GenCfgOpt Version 0.59")
|
||||||
print ("Usage:")
|
print ("Usage:")
|
||||||
print (" GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]")
|
print (" GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]")
|
||||||
print (" GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]")
|
print (" GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]")
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## @ SplitFspBin.py
|
## @ SplitFspBin.py
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
@@ -492,7 +492,7 @@ class FspImage:
|
|||||||
self.FihOffset = fihoff
|
self.FihOffset = fihoff
|
||||||
self.Offset = offset
|
self.Offset = offset
|
||||||
self.FvIdxList = []
|
self.FvIdxList = []
|
||||||
self.Type = "XTMSXXXXOXXXXXXX"[(fih.ComponentAttribute >> 12) & 0x0F]
|
self.Type = "XTMSIXXXOXXXXXXX"[(fih.ComponentAttribute >> 12) & 0x0F]
|
||||||
self.PatchList = patch
|
self.PatchList = patch
|
||||||
self.PatchList.append(fihoff + 0x1C)
|
self.PatchList.append(fihoff + 0x1C)
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ def main ():
|
|||||||
parser_rebase = subparsers.add_parser('rebase', help='rebase a FSP into a new base address')
|
parser_rebase = subparsers.add_parser('rebase', help='rebase a FSP into a new base address')
|
||||||
parser_rebase.set_defaults(which='rebase')
|
parser_rebase.set_defaults(which='rebase')
|
||||||
parser_rebase.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
|
parser_rebase.add_argument('-f', '--fspbin' , dest='FspBinary', type=str, help='FSP binary file path', required = True)
|
||||||
parser_rebase.add_argument('-c', '--fspcomp', choices=['t','m','s','o'], nargs='+', dest='FspComponent', type=str, help='FSP component to rebase', default = "['t']", required = True)
|
parser_rebase.add_argument('-c', '--fspcomp', choices=['t','m','s','o','i'], nargs='+', dest='FspComponent', type=str, help='FSP component to rebase', default = "['t']", required = True)
|
||||||
parser_rebase.add_argument('-b', '--newbase', dest='FspBase', nargs='+', type=str, help='Rebased FSP binary file name', default = '', required = True)
|
parser_rebase.add_argument('-b', '--newbase', dest='FspBase', nargs='+', type=str, help='Rebased FSP binary file name', default = '', required = True)
|
||||||
parser_rebase.add_argument('-o', '--outdir' , dest='OutputDir', type=str, help='Output directory path', default = '.')
|
parser_rebase.add_argument('-o', '--outdir' , dest='OutputDir', type=str, help='Output directory path', default = '.')
|
||||||
parser_rebase.add_argument('-n', '--outfile', dest='OutputFile', type=str, help='Rebased FSP binary file name', default = '')
|
parser_rebase.add_argument('-n', '--outfile', dest='OutputFile', type=str, help='Rebased FSP binary file name', default = '')
|
||||||
|
@@ -97,7 +97,7 @@ OnPciEnumerationComplete (
|
|||||||
//
|
//
|
||||||
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
||||||
DEBUG ((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
|
DEBUG ((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
|
||||||
CallFspWrapperResetSystem ((UINT32)Status);
|
CallFspWrapperResetSystem (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Status != EFI_SUCCESS) {
|
if (Status != EFI_SUCCESS) {
|
||||||
@@ -140,7 +140,7 @@ OnReadyToBoot (
|
|||||||
//
|
//
|
||||||
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
||||||
DEBUG ((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
|
DEBUG ((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
|
||||||
CallFspWrapperResetSystem ((UINT32)Status);
|
CallFspWrapperResetSystem (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Status != EFI_SUCCESS) {
|
if (Status != EFI_SUCCESS) {
|
||||||
@@ -184,7 +184,7 @@ OnEndOfFirmware (
|
|||||||
//
|
//
|
||||||
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
||||||
DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
|
DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
|
||||||
CallFspWrapperResetSystem ((UINT32)Status);
|
CallFspWrapperResetSystem (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Status != EFI_SUCCESS) {
|
if (Status != EFI_SUCCESS) {
|
||||||
|
@@ -43,16 +43,15 @@ extern EFI_GUID gFspHobGuid;
|
|||||||
|
|
||||||
@return FSP-M UPD Data Address
|
@return FSP-M UPD Data Address
|
||||||
**/
|
**/
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
GetFspmUpdDataAddress (
|
GetFspmUpdDataAddress (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (PcdGet64 (PcdFspmUpdDataAddress64) != 0) {
|
if (PcdGet64 (PcdFspmUpdDataAddress64) != 0) {
|
||||||
return (UINTN) PcdGet64 (PcdFspmUpdDataAddress64);
|
return (UINTN)PcdGet64 (PcdFspmUpdDataAddress64);
|
||||||
} else {
|
} else {
|
||||||
return (UINTN) PcdGet32 (PcdFspmUpdDataAddress);
|
return (UINTN)PcdGet32 (PcdFspmUpdDataAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ PeiFspMemoryInit (
|
|||||||
//
|
//
|
||||||
// External UPD is ready, get the buffer from PCD pointer.
|
// External UPD is ready, get the buffer from PCD pointer.
|
||||||
//
|
//
|
||||||
FspmUpdDataPtr = (VOID *) GetFspmUpdDataAddress();
|
FspmUpdDataPtr = (VOID *)GetFspmUpdDataAddress ();
|
||||||
ASSERT (FspmUpdDataPtr != NULL);
|
ASSERT (FspmUpdDataPtr != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,6 +114,7 @@ PeiFspMemoryInit (
|
|||||||
DEBUG ((DEBUG_INFO, " BootLoaderTolumSize - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootLoaderTolumSize));
|
DEBUG ((DEBUG_INFO, " BootLoaderTolumSize - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootLoaderTolumSize));
|
||||||
DEBUG ((DEBUG_INFO, " BootMode - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootMode));
|
DEBUG ((DEBUG_INFO, " BootMode - 0x%x\n", ((FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((DEBUG_INFO, " HobListPtr - 0x%x\n", &FspHobListPtr));
|
DEBUG ((DEBUG_INFO, " HobListPtr - 0x%x\n", &FspHobListPtr));
|
||||||
|
|
||||||
TimeStampCounterStart = AsmReadTsc ();
|
TimeStampCounterStart = AsmReadTsc ();
|
||||||
@@ -129,7 +129,7 @@ PeiFspMemoryInit (
|
|||||||
//
|
//
|
||||||
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
|
||||||
DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
|
DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
|
||||||
CallFspWrapperResetSystem ((UINT32)Status);
|
CallFspWrapperResetSystem (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user