Compare commits

..

47 Commits

Author SHA1 Message Date
Sean Rhodes
2dc1e51593 UefiPayloadPkg: Add Secure Boot support
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I4f44e29bc967b7d2208193e21aeeef8b96afcc69
2022-06-03 09:03:42 -06:00
Sean Rhodes
35dde2452d MdeModulePkg/FaultTolerantWriteDxe: Don't check for address alignment
WorkSpaceAddress and SpareAreaAddress point into MMIO, which isn't
always aligned. Remove the check for block alignment to avoid
false assertions.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ia1c1f44b6a0e7f32cac0d7806e74d729e5d83a6d
2022-06-03 09:03:42 -06:00
Matt DeVillier
0f49a3fc87 Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal
Recent model Chromebooks only return ACK, but not
BAT_SUCCESS, which causes hanging and failed ps2k init.
To mitigate this, make the absence of BAT_SUCCESS reply
non-fatal, and reduce the no-reply timeout from 4s to 1s.

Tested on google/dracia and purism/librem_14

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ib644f6797eb50eb3bb75235ac48ddb6096a7bd6d
2022-06-03 09:03:42 -06:00
Patrick Rudolph
792844cb3b UefiPayloadPkg: Hook up RNG support
Hoop Up RNG from SecurityPkg.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I9fadc2f36b0601b8a2f5b8a9abc3f208e7987e6c
2022-06-03 09:03:42 -06:00
Patrick Rudolph
136138411f SecurityPkg: Add RNG support
Uses the RDRAND instruction if available and install EfiRngProtocol.
The protocol may be used by iPXE or the Linux kernel to gather entropy.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I0f74b64c6a7e8fc6fdd8ea8f2a416d8b7c0334f4
2022-06-03 09:03:42 -06:00
Sean Rhodes
1f31c0e81e UefiPayloadPkg: Add support for Firmware Volume Block Protocol
This adds support for FVB in order to support a platform independent
and non-volatile variable store on UefiPayloadPkg. The variable store
makes use the SmmStoreLib to provide an unauthenticed variable store.

Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements a SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The communication is done using a fixed communication buffer that is
allocated in CBMEM. The existence of this optional feature is advertised
by a coreboot table.
When the SMMSTORE feature is not available the variable emulation is used
by setting PcdEmuVariableNvModeEnable to TRUE.

The DXE component provides runtime services and takes care of virtual to
physical mapping the communication buffers between SMM and OS.

The contents of the variable store can be accessed and modified by any
priviledged application. As authentication is done by runtime services
only the store shouldn't be used to store authenticated variables.

Tested on Linux and Windows 10 on real hardware.
Currently this cannot be tested on coreboot and qemu as it doesn't support
the SMMSTORE on qemu.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I79a234275e25961869edf959cfbf4f8d17df2383
2022-06-03 09:03:42 -06:00
Patrick Rudolph
dcdfb2f083 UefiPayloadPkg: Add SmmStoreLib
Implement all of the FVB protocol functions on top of the SmmStore
as a library. The library consumes the introduced gEfiSmmStoreInfoHobGuid.

The SMI handler uses a fixed communication buffer in reserved DRAM.
To initiate a transaction you must write to the I/O APM_CNT port.

Tests on Intel(R) Xeon(R) E-2288G CPU @ 3.70G showed that the SMI isn't
triggered with a probability of 1:40 of all cases when called in a tight
loop. The CPU continues running and the SMI is triggeres asynchronously
a few clock cycles later. coreboot only handels synchronous APM request
and does nothing on asynchronous APM triggers.

As there's no livesign from SMM it's impossible to tell if the handler
has run. Just wait a bit and try again to trigger a synchronous SMI.

Tests confirmed that out of 5 million tries the SMI is now always handled.

When a synchronous SMI happens with the correct write to the APM_CNT port,
the ebx register is checked first that it doesn't point to SMRAM.
If it doesn't it's used to read in the arguments that define a SmmStore
transaction.

The SMI handler will only operate on a predefined and memory mapped region in
the boot media.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: Id4182623e4198c6512d3fe6ec20adf6738586d9b
2022-06-03 09:03:42 -06:00
Patrick Rudolph
13dd54ae32 UefiPayloadPkg: Add SmmStoreInfoGuid
Add a new InfoHob that contains the SmmStore information passed from
coreboot tables when the SMMSTOREV2 feature is enabled.

This will be used to implement the FVB in top of the MM installed by
coreboot.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: Ia3f7eef27d4758768c1a6736afe1cb77ee6a2f8f
2022-06-03 09:03:42 -06:00
Patrick Rudolph
bb19b4bc30 UefiPayloadPkg/Include/Coreboot: Add headers for SMMSTOREv2 table
Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements a SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The existence of this optional feature is advertised by a coreboot table.

Add the tag and headers to parse the table.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I02be3fa8d5d6ff47d56b81876590afef8f6c43c0
2022-06-03 09:03:42 -06:00
Patrick Rudolph
7693804ed1 UefiPayloadPkg: Increase FV size to 8MB
The following commits need additional space.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I6b757f73fe4e90282b4bfb84469545ab1af9d1bb
Reviewed-on: https://review.coreboot.org/c/edk2/+/58630
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Jeremy Soller
626f1a3273 UefiPayloadPkg: Add System76 Setup menu 2022-06-03 09:03:42 -06:00
Jeremy Soller
0420529401 UefiPayloadPkg: Add Intel GOP driver 2022-06-03 09:03:42 -06:00
Tim Crawford
13e6178201 UefiPayloadPkg: Add Pop!_OS Recovery to boot text
Preserve existing UI and add the note about pressing Space to go to
the systemd-boot menu for Pop!_OS Recovery.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:42 -06:00
Tim Crawford
cbff8f0510 MdeModulePkg/BmBootDesciption: Remove device prefixes
Remove the device prefixes to match current System76 firmware UI in the
One Time Boot menu.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:42 -06:00
Tim Crawford
601bcb9ce2 MdeModulePkg/BM: Update boot options on device change
Register an event to trigger when a block device is added or removed
that will update the list of boot options. Use a refreshguid to force
the form to display the changes if it already open.
2022-06-03 09:03:42 -06:00
Tim Crawford
6468032370 MdeModulePkg/Core: Signal notify events on protocol removal
In order for BootManager to maintain a valid list of boot options, it
must know when the BlockIo protocol is also removed, not just added.
2022-06-03 09:03:42 -06:00
Jeremy Soller
7b3153b1cb UiApp: Dynamically generated firmware configuration information page
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:42 -06:00
Tim Crawford
f2e99ad7b6 MdeModulePkg/BMM: Unregister F9 and F10 hotkeys 2022-06-03 09:03:42 -06:00
Tim Crawford
ae93abfcbf MdeModulePkg/BMM: Remove Commit/Discard buttons 2022-06-03 09:03:42 -06:00
Tim Crawford
de3e52e5d3 MdeModulePkg/BMM: Save BootOrder on list update 2022-06-03 09:03:42 -06:00
Tim Crawford
260b22ed3e MdeModulePkg/BMM: Add some debug logging 2022-06-03 09:03:42 -06:00
Tim Crawford
b79d3f9599 MdeModulePkg/UiApp: Add warning if no bootable options found 2022-06-03 09:03:42 -06:00
Tim Crawford
49dad2f15d MdeModulePkg/BootMaintenanceManagerUiLib: Make it look like current BMM 2022-06-03 09:03:42 -06:00
Tim Crawford
21bbc9ae0e MdeModulePkg/UiApp: Make it look like current FrontPage
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:42 -06:00
Tim Crawford
52d9ce76db MdeModulePkg/BM: Make it look like current BootMngr 2022-06-03 09:03:42 -06:00
Tim Crawford
0d209e3a81 UefiPayloadPkg: Disable EFI shell 2022-06-03 09:03:42 -06:00
Jeremy Soller
c418d4eb9e UefiPayloadPkg: Add library for logging to EC
Make use of the SMFI command interface to forward logs from edk2 to
System76 EC.

Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:42 -06:00
Patrick Rudolph
648620d59d UefiPayloadPkg: Scan for Option ROMs
Scanning for PCI Option ROMs on UEFI works with full PCI enumeration.
On platforms where the bootloader has done PCI enumeration a
platform specific driver needs to provide the Option ROMs.

As this is not specific to any platform, but rather to the UEFI as
payload concept, add the PCI platform driver to UefiPayloadPkg.

On coreboot the ROM BAR is part of the PCI bridge MMIO window and
can safely enabled if existing.

The Option ROMs are not passed in by bootloader in a HOB as:
- they might not fit into a HOB
- this is EDK2 specific and would just bloat the bootloader code
- would waste lot's of non reclaimable memory if placed in e820
  reserved DRAM space

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2022-06-03 09:03:42 -06:00
Patrick Rudolph
6284b7fe6f UefiPayloadPkg: Use new filesystem drivers
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2022-06-03 09:03:42 -06:00
CoolStar
e3ac04f774 Add filesystem drivers
Add EXT2/EXT4, exFAT, NTFS filesystem drivers.
Do not add ISO9115 drivers as it breaks El Torito boot.
2022-06-03 09:03:42 -06:00
Tim Crawford
5f7a6fe58b UefiPayloadPkg: Stall before connecting devices
USB devices are not being detected when booting. Pause a bit for them to
be initialized and detected by EfiBootManagerConnectAll().
2022-06-03 09:03:42 -06:00
Tim Crawford
4f9743107d MdeModulePkg/BdsDxe: Forward any key for booting
Pressing escape will bring a user to the boot manager. Pressing any
other key will continue booting, forwarding the key to systemd-boot.
2022-06-03 09:03:42 -06:00
Matt DeVillier
f300ed8297 MdeModulePkg: Wait for input after boot failure
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Tim Crawford
1fd1cf3dfb UefiPayloadPkg: Clear screen on boot error 2022-06-03 09:03:42 -06:00
Tim Crawford
053e8aed4d UefiPayloadPkg: Copy PlatformBootManagerUnableToBoot() from OvmfPkg 2022-06-03 09:03:42 -06:00
Matt DeVillier
b219d5c94f UefiPayloadPkg: Set ResetOnMemoryTypeInformationChange to FALSE
the default value, TRUE, causes reboots if a device boots to the
shell, exits, and then attempts to boot from another source.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Matt DeVillier
20a7334a96 MdeModulePkg/GraphicsConsole: don't draw cursor at 0,0
Prevents cursor from flashing on screen when
changing modes or clearing the screen.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Matt DeVillier
a8abddc10a MdeModulePkg/BmBootDesciption: Improve device descriptions
Add device type prefixes for USB, IDE, SATA, and NVMe drives.
Remove UEFI prefix, remove serial numbers.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Matt DeVillier
93688ae1e5 MdeModulePkg/BmBoot: skip secondary eMMC entries
Internal eMMC devices often show multiple entries, so skip
any after the initial entry.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:42 -06:00
Matt DeVillier
38a3b6f58d MdeModulePkg/Frontpage: get SMBIOS Data from table directly
rather than getting it from the EFI SMBIOS protocol

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:41 -06:00
Tim Crawford
85f616be1b UefiPayloadPkg: Disable Device Manager 2022-06-03 09:03:41 -06:00
Matt DeVillier
1aed3a3e36 BmpSupportLib: fix BMP validation
BMP files by tools other than MS paint can have a
variable number of padding bytes, which results in
the DataSize being less than (ImageSize - HeaderSize).
Fix the check to be less stringent.

Test: use BMP created by/saved by Photoshop

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:41 -06:00
Matt DeVillier
f8d5dcd99b MdeModulePkg: load boot logo into BGRT table
This is a shoehorned-in implementation of an ACPI BGRT
table, ported pretty much directly from the version used
under CorebootPayloadPkg.

EDK2 provides a facility to do this already, but it assumes
the ACPI tables already exist as EFI structures, so would need
to write code to populate those using the tables already in RAM
created by coreboot. This seemed like the easier option ATM.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2022-06-03 09:03:41 -06:00
Tim Crawford
2046be8d5e MdeModulePkg/BootLogoLib: Center logo 38.2% from top of screen
Use Microsoft's recommended positioning [1] for the boot logo.

> We recommend that the logo is placed with its center at 38.2% from the
> screen's top edge. This positioning is based on the golden ratio's
> visual aesthetics and matches the Windows 10 design proportions.

[1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components#position-the-logo-during-post
2022-06-03 09:03:41 -06:00
Tim Crawford
57ed7e7151 MdeModulePkg/Logo: Use System76 boot logo 2022-06-03 09:03:41 -06:00
Tim Crawford
a8285c29d8 UefiPayloadPkg: Enable boot logo
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:41 -06:00
Tim Crawford
be10ebabba UefiPayloadPkg: Show boot message as progress text
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-06-03 09:03:41 -06:00
390 changed files with 9191 additions and 19189 deletions

View File

@@ -290,7 +290,7 @@ class UncrustifyCheck(ICiBuildPlugin):
# This information is only used for reporting (not used here) and
# the ignore lines are being passed directly as they are given to
# this plugin.
return parse_gitignore_lines(ignored_files, "Package configuration file", self._abs_package_path)
return parse_gitignore_lines(ignored_files, "Package configuration file", self._abs_workspace_path)
def _get_git_ignored_paths(self) -> List[str]:
""""

View File

@@ -366,9 +366,10 @@ ArmGicIsInterruptEnabled (
FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||
SourceIsSpi (Source))
{
Interrupts = MmioRead32 (
GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
);
Interrupts = ((MmioRead32 (
GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)
)
& (1 << RegShift)) != 0);
} else {
GicCpuRedistributorBase = GicGetCpuRedistributorBase (
GicRedistributorBase,

View File

@@ -256,6 +256,12 @@ CpuDxeInitialize (
SyncCacheConfig (&mCpu);
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
//

View File

@@ -104,6 +104,21 @@ SyncCacheConfig (
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)
UINT64
EfiAttributeToArmAttribute (

View File

@@ -21,6 +21,7 @@
[Sources.Common]
CpuDxe.c
CpuDxe.h
CpuMpCore.c
CpuMmuCommon.c
Exception.c

View File

@@ -0,0 +1,98 @@
/** @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);
}
}
}
}

View File

@@ -23,9 +23,36 @@ typedef struct {
UINT64 MailboxClearValue;
} 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 \
{ 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;
#endif /* ARM_MP_CORE_INFO_GUID_H_ */

View File

@@ -4,7 +4,6 @@
* Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
* Copyright (c) 2016 HP Development Company, L.P.
* Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -195,6 +194,32 @@ CopyExceptionHandlers (
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
provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt
@@ -204,8 +229,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
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.
NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,
otherwise EFI_UNSUPPORTED returned.
NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or
InitializeCpuInterruptHandlers() invoked, otherwise EFI_UNSUPPORTED returned.
@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
@@ -287,25 +312,33 @@ CommonCExceptionHandler (
}
/**
Setup separate stacks for certain exception handlers.
If the input Buffer and BufferSize are both NULL, use global variable if possible.
Initializes all CPU exceptions entries with optional extra initializations.
@param[in] Buffer Point to buffer used to separate exception stack.
@param[in, out] BufferSize On input, it indicates the byte size of Buffer.
If the size is not enough, the return status will
be EFI_BUFFER_TOO_SMALL, and output BufferSize
will be the size it needs.
By default, this method should include all functionalities implemented by
InitializeCpuExceptionHandlers(), plus extra initialization works, if any.
This could be done by calling InitializeCpuExceptionHandlers() directly
in this method besides the extra works.
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
EFIAPI
InitializeSeparateExceptionStacks (
IN VOID *Buffer,
IN OUT UINTN *BufferSize
InitializeCpuExceptionHandlersEx (
IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL,
IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL
)
{
return EFI_SUCCESS;
return InitializeCpuExceptionHandlers (VectorInfo);
}

View File

@@ -94,7 +94,6 @@
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x00000000|UINT64|0x00000030
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|0x00000000|UINT64|0x00000031
gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|0x00000000|UINT32|0x00000032
gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt|0x00000000|UINT32|0x00000041
## PL061 GPIO
gArmPlatformTokenSpaceGuid.PcdPL061GpioBase|0x0|UINT32|0x00000025

View File

@@ -815,6 +815,18 @@ LcdGraphicsBlt (
HorizontalResolution = This->Mode->Info->HorizontalResolution;
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
if ((Width == 0) || (Height == 0)) {
DEBUG ((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid dimension: Zero size area.\n"));

View File

@@ -144,7 +144,6 @@
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
DxeHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
# USB Libraries
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
@@ -170,7 +169,6 @@
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
# re-use the UserPhysicalPresent() dummy implementation from the ovmf tree
PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf

View File

@@ -81,7 +81,6 @@
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
PeiHardwareInfoLib|OvmfPkg/Library/HardwareInfoLib/PeiHardwareInfoLib.inf
!if $(TPM2_ENABLE) == TRUE
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf

View File

@@ -128,7 +128,7 @@ EDKII_PLATFORM_REPOSITORY_INFO mKvmtoolPlatRepositoryInfo = {
//
{
EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
EFI_ACPI_IO_REMAPPING_TABLE_REVISION,
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
NULL
},

View File

@@ -18,4 +18,3 @@ Source/C/bin/
Source/C/libs/
Bin/Win32
Lib
BaseToolsBuild/

View File

@@ -16,12 +16,10 @@ include $(MAKEROOT)/Makefiles/app.makefile
GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
ifneq ("$(GCCVERSION)", "5")
ifneq ($(CXX), llvm)
ifneq ($(DARWIN),Darwin)
# gcc 12 trips over device path handling
BUILD_CFLAGS += -Wno-error=stringop-overflow
endif
endif
endif
LIBS = -lCommon
ifeq ($(CYGWIN), CYGWIN)

View File

@@ -2,7 +2,7 @@
Elf64 convert solution
Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2013-2022, ARM Ltd. All rights reserved.<BR>
Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -186,8 +186,8 @@ InitializeElf64 (
}
if (mExportFlag) {
if ((mEhdr->e_machine != EM_X86_64) && (mEhdr->e_machine != EM_AARCH64)) {
Error (NULL, 0, 3000, "Unsupported", "--prm option currently only supports X64 and AArch64 archs.");
if (mEhdr->e_machine != EM_X86_64) {
Error (NULL, 0, 3000, "Unsupported", "--prm option currently only supports X64 arch.");
return FALSE;
}
}

View File

@@ -191,7 +191,7 @@ Returns:
as 0, tool get alignment value from SectionFile. It is\n\
specified in same order that the section file is input.\n");
fprintf (stdout, " --dummy dummyfile\n\
compare dummyfile with input_file to decide whether\n\
compare dummpyfile with input_file to decide whether\n\
need to set PROCESSING_REQUIRED attribute.\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");
@@ -988,155 +988,6 @@ Returns:
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
FfsRebaseImageRead (
IN VOID *FileHandle,
@@ -1740,22 +1591,14 @@ Returns:
}
//
// GuidValue is only required by Guided section and SubtypeGuid section.
// GuidValue is only required by Guided section.
//
if ((SectType != EFI_SECTION_GUID_DEFINED) && (SectType != EFI_SECTION_FREEFORM_SUBTYPE_GUID) &&
if ((SectType != EFI_SECTION_GUID_DEFINED) &&
(SectionName != NULL) &&
(CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
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
//
@@ -1824,16 +1667,6 @@ Returns:
);
break;
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
Status = GenSectionSubtypeGuidSection (
InputFileName,
InputFileAlign,
InputFileNum,
&VendorGuid,
&OutFileBuffer
);
break;
case EFI_SECTION_VERSION:
Index = sizeof (EFI_COMMON_SECTION_HEADER);
//

View File

@@ -911,134 +911,140 @@ Returns:
printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
}
switch (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT) {
case EFI_FVB2_ALIGNMENT_1:
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1) {
printf (" EFI_FVB2_ALIGNMENT_1\n");
break;
}
case EFI_FVB2_ALIGNMENT_2:
printf (" EFI_FVB2_ALIGNMENT_2\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {
printf (" EFI_FVB2_ALIGNMENT_2\n");
}
case EFI_FVB2_ALIGNMENT_4:
printf (" EFI_FVB2_ALIGNMENT_4\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4) {
printf (" EFI_FVB2_ALIGNMENT_4\n");
}
case EFI_FVB2_ALIGNMENT_8:
printf (" EFI_FVB2_ALIGNMENT_8\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {
printf (" EFI_FVB2_ALIGNMENT_8\n");
}
case EFI_FVB2_ALIGNMENT_16:
printf (" EFI_FVB2_ALIGNMENT_16\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16) {
printf (" EFI_FVB2_ALIGNMENT_16\n");
}
case EFI_FVB2_ALIGNMENT_32:
printf (" EFI_FVB2_ALIGNMENT_32\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {
printf (" EFI_FVB2_ALIGNMENT_32\n");
}
case EFI_FVB2_ALIGNMENT_64:
printf (" EFI_FVB2_ALIGNMENT_64\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64) {
printf (" EFI_FVB2_ALIGNMENT_64\n");
}
case EFI_FVB2_ALIGNMENT_128:
printf (" EFI_FVB2_ALIGNMENT_128\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {
printf (" EFI_FVB2_ALIGNMENT_128\n");
}
case EFI_FVB2_ALIGNMENT_256:
printf (" EFI_FVB2_ALIGNMENT_256\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {
printf (" EFI_FVB2_ALIGNMENT_256\n");
}
case EFI_FVB2_ALIGNMENT_512:
printf (" EFI_FVB2_ALIGNMENT_512\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512) {
printf (" EFI_FVB2_ALIGNMENT_512\n");
}
case EFI_FVB2_ALIGNMENT_1K:
printf (" EFI_FVB2_ALIGNMENT_1K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1K) {
printf (" EFI_FVB2_ALIGNMENT_1K\n");
}
case EFI_FVB2_ALIGNMENT_2K:
printf (" EFI_FVB2_ALIGNMENT_2K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {
printf (" EFI_FVB2_ALIGNMENT_2K\n");
}
case EFI_FVB2_ALIGNMENT_4K:
printf (" EFI_FVB2_ALIGNMENT_4K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {
printf (" EFI_FVB2_ALIGNMENT_4K\n");
}
case EFI_FVB2_ALIGNMENT_8K:
printf (" EFI_FVB2_ALIGNMENT_8K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8K) {
printf (" EFI_FVB2_ALIGNMENT_8K\n");
}
case EFI_FVB2_ALIGNMENT_16K:
printf (" EFI_FVB2_ALIGNMENT_16K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {
printf (" EFI_FVB2_ALIGNMENT_16K\n");
}
case EFI_FVB2_ALIGNMENT_32K:
printf (" EFI_FVB2_ALIGNMENT_32K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {
printf (" EFI_FVB2_ALIGNMENT_32K\n");
}
case EFI_FVB2_ALIGNMENT_64K:
printf (" EFI_FVB2_ALIGNMENT_64K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64K) {
printf (" EFI_FVB2_ALIGNMENT_64K\n");
}
case EFI_FVB2_ALIGNMENT_128K:
printf (" EFI_FVB2_ALIGNMENT_128K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128K) {
printf (" EFI_FVB2_ALIGNMENT_128K\n");
}
case EFI_FVB2_ALIGNMENT_256K:
printf (" EFI_FVB2_ALIGNMENT_256K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256K) {
printf (" EFI_FVB2_ALIGNMENT_256K\n");
}
case EFI_FVB2_ALIGNMENT_512K:
printf (" EFI_FVB2_ALIGNMENT_512K\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
printf (" EFI_FVB2_ALIGNMENT_512K\n");
}
case EFI_FVB2_ALIGNMENT_1M:
printf (" EFI_FVB2_ALIGNMENT_1M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {
printf (" EFI_FVB2_ALIGNMENT_1M\n");
}
case EFI_FVB2_ALIGNMENT_2M:
printf (" EFI_FVB2_ALIGNMENT_2M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2M) {
printf (" EFI_FVB2_ALIGNMENT_2M\n");
}
case EFI_FVB2_ALIGNMENT_4M:
printf (" EFI_FVB2_ALIGNMENT_4M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4M) {
printf (" EFI_FVB2_ALIGNMENT_4M\n");
}
case EFI_FVB2_ALIGNMENT_8M:
printf (" EFI_FVB2_ALIGNMENT_8M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8M) {
printf (" EFI_FVB2_ALIGNMENT_8M\n");
}
case EFI_FVB2_ALIGNMENT_16M:
printf (" EFI_FVB2_ALIGNMENT_16M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16M) {
printf (" EFI_FVB2_ALIGNMENT_16M\n");
}
case EFI_FVB2_ALIGNMENT_32M:
printf (" EFI_FVB2_ALIGNMENT_32M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32M) {
printf (" EFI_FVB2_ALIGNMENT_32M\n");
}
case EFI_FVB2_ALIGNMENT_64M:
printf (" EFI_FVB2_ALIGNMENT_64M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
printf (" EFI_FVB2_ALIGNMENT_64M\n");
}
case EFI_FVB2_ALIGNMENT_128M:
printf (" EFI_FVB2_ALIGNMENT_128M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
printf (" EFI_FVB2_ALIGNMENT_128M\n");
}
case EFI_FVB2_ALIGNMENT_256M:
printf (" EFI_FVB2_ALIGNMENT_256M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
printf (" EFI_FVB2_ALIGNMENT_64M\n");
}
case EFI_FVB2_ALIGNMENT_512M:
printf (" EFI_FVB2_ALIGNMENT_512M\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
printf (" EFI_FVB2_ALIGNMENT_128M\n");
}
case EFI_FVB2_ALIGNMENT_1G:
printf (" EFI_FVB2_ALIGNMENT_1G\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256M) {
printf (" EFI_FVB2_ALIGNMENT_256M\n");
}
case EFI_FVB2_ALIGNMENT_2G:
printf (" EFI_FVB2_ALIGNMENT_2G\n");
break;
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512M) {
printf (" EFI_FVB2_ALIGNMENT_512M\n");
}
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1G) {
printf (" EFI_FVB2_ALIGNMENT_1G\n");
}
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2G) {
printf (" EFI_FVB2_ALIGNMENT_2G\n");
}
#endif
@@ -1676,7 +1682,6 @@ Returns:
CHAR8 *ToolInputFileName;
CHAR8 *ToolOutputFileName;
CHAR8 *UIFileName;
CHAR8 *VersionString;
ParsedLength = 0;
ToolInputFileName = NULL;
@@ -1796,30 +1801,20 @@ Returns:
break;
case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
printf ("/------------ Firmware Volume section start ---------------\\\n");
Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE);
if (EFI_ERROR (Status)) {
Error (NULL, 0, 0003, "printing of FV section contents failed", NULL);
return EFI_SECTION_ERROR;
}
printf ("\\------------ Firmware Volume section end -----------------/\n");
break;
case EFI_SECTION_COMPATIBILITY16:
case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
//
// Section does not contain any further header information.
//
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_DXE_DEPEX:
case EFI_SECTION_SMM_DEPEX:
@@ -1827,14 +1822,8 @@ Returns:
break;
case EFI_SECTION_VERSION:
printf (" Build Number: 0x%04X\n", *(UINT16 *)(Ptr + SectionHeaderLen));
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);
printf (" Build Number: 0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));
printf (" Version Strg: %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));
break;
case EFI_SECTION_COMPRESSION:
@@ -1913,9 +1902,7 @@ Returns:
return EFI_SECTION_ERROR;
}
printf ("/------------ Encapsulation section start -----------------\\\n");
Status = ParseSection (UncompressedBuffer, UncompressedLength);
printf ("\\------------ Encapsulation section end -------------------/\n");
if (CompressionType == EFI_STANDARD_COMPRESSION) {
//
@@ -2034,7 +2021,6 @@ Returns:
return EFI_SECTION_ERROR;
}
printf ("/------------ Encapsulation section start -----------------\\\n");
Status = ParseSection (
ToolOutputBuffer,
ToolOutputLength
@@ -2043,7 +2029,6 @@ Returns:
Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL);
return EFI_SECTION_ERROR;
}
printf ("\\------------ Encapsulation section end -------------------/\n");
//
// Check for CRC32 sections which we can handle internally if needed.
@@ -2056,7 +2041,6 @@ Returns:
//
// CRC32 guided section
//
printf ("/------------ Encapsulation section start -----------------\\\n");
Status = ParseSection (
SectionBuffer + DataOffset,
BufferLength - DataOffset
@@ -2065,7 +2049,6 @@ Returns:
Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
return EFI_SECTION_ERROR;
}
printf ("\\------------ Encapsulation section end -------------------/\n");
} else {
//
// We don't know how to parse it now.

View File

@@ -22,8 +22,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define EFI_DEP_END 0x08
#define EFI_DEP_SOR 0x09
#define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1C
#define EFI_SECTION_LAST_SECTION_TYPE 0x1C
#define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B
#define EFI_SECTION_LAST_SECTION_TYPE 0x1B
#define OPENSSL_COMMAND_FORMAT_STRING "%s sha1 -out %s %s"
#define EXTRACT_COMMAND_FORMAT_STRING "%s -d -o %s %s"

View File

@@ -120,7 +120,7 @@ class BuildFile(object):
},
POSIX_PLATFORM : {
"CP" : "cp -p -f",
"CP" : "cp -f",
"MV" : "mv -f",
"RM" : "rm -f",
"MD" : "mkdir -p",
@@ -1110,8 +1110,7 @@ cleanlib:
CmdTargetDict[CmdSign].append(SingleCommandList[-1])
Index = CommandList.index(Item)
CommandList.pop(Index)
BaseName = SingleCommandList[-1].rsplit('.',1)[0]
if BaseName.endswith("%s%s" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
Cpplist = CmdCppDict[T.Target.SubDir]
Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
source_files = CmdTargetDict[CmdSign][1:]

View File

@@ -10,7 +10,7 @@
# keep the tool as simple as possible, it has the following limitations:
# * Do not support vendor code bytes in a capsule.
#
# Copyright (c) 2018 - 2022, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -38,11 +38,11 @@ from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass
# Globals for help information
#
__prog__ = 'GenerateCapsule'
__version__ = '0.10'
__copyright__ = 'Copyright (c) 2022, Intel Corporation. All rights reserved.'
__version__ = '0.9'
__copyright__ = 'Copyright (c) 2018, Intel Corporation. All rights reserved.'
__description__ = 'Generate a capsule.\n'
def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = False):
def SignPayloadSignTool (Payload, ToolPath, PfxFile, Verbose = False):
#
# Create a temporary directory
#
@@ -72,10 +72,7 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = Fals
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 + '/p7 {TempDir} '.format (TempDir = TempDirectoryName)
if PfxFile is not None:
Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
if SubjectName is not None:
Command = Command + '/n {SubjectName} '.format (SubjectName = SubjectName)
Command = Command + '/f {PfxFile} '.format (PfxFile = PfxFile)
Command = Command + TempFileName
if Verbose:
print (Command)
@@ -108,7 +105,7 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = Fals
shutil.rmtree (TempDirectoryName)
return Signature
def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, SubjectName, Verbose = False):
def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, Verbose = False):
print ('signtool verify is not supported.')
raise ValueError ('GenerateCapsule: error: signtool verify is not supported.')
@@ -252,7 +249,6 @@ if __name__ == '__main__':
HardwareInstance = ConvertJsonValue (Config, 'HardwareInstance', 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)
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)
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)
@@ -268,7 +264,6 @@ if __name__ == '__main__':
HardwareInstance,
UpdateImageIndex,
SignToolPfxFile,
SignToolSubjectName,
OpenSslSignerPrivateCertFile,
OpenSslOtherPublicCertFile,
OpenSslTrustedPublicCertFile,
@@ -308,7 +303,6 @@ if __name__ == '__main__':
UpdateImageIndex = ConvertJsonValue (Config, 'UpdateImageIndex', ValidateUnsignedInteger, Required = False, Default = 1)
MonotonicCount = ConvertJsonValue (Config, 'MonotonicCount', ValidateUnsignedInteger, Required = False, Default = 0)
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)
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)
@@ -335,7 +329,6 @@ if __name__ == '__main__':
HardwareInstance,
UpdateImageIndex,
SignToolPfxFile,
SignToolSubjectName,
OpenSslSignerPrivateCertFile,
OpenSslOtherPublicCertFile,
OpenSslTrustedPublicCertFile,
@@ -355,7 +348,6 @@ if __name__ == '__main__':
"HardwareInstance": str(PayloadDescriptor.HardwareInstance),
"UpdateImageIndex": str(PayloadDescriptor.UpdateImageIndex),
"SignToolPfxFile": str(PayloadDescriptor.SignToolPfxFile),
"SignToolSubjectName": str(PayloadDescriptor.SignToolSubjectName),
"OpenSslSignerPrivateCertFile": str(PayloadDescriptor.OpenSslSignerPrivateCertFile),
"OpenSslOtherPublicCertFile": str(PayloadDescriptor.OpenSslOtherPublicCertFile),
"OpenSslTrustedPublicCertFile": str(PayloadDescriptor.OpenSslTrustedPublicCertFile),
@@ -371,8 +363,6 @@ if __name__ == '__main__':
for PayloadField in PayloadSection:
if PayloadJsonDescriptorList[Index].SignToolPfxFile is None:
del PayloadField ['SignToolPfxFile']
if PayloadJsonDescriptorList[Index].SignToolSubjectName is None:
del PayloadField ['SignToolSubjectName']
if PayloadJsonDescriptorList[Index].OpenSslSignerPrivateCertFile is None:
del PayloadField ['OpenSslSignerPrivateCertFile']
if PayloadJsonDescriptorList[Index].OpenSslOtherPublicCertFile is None:
@@ -412,9 +402,6 @@ if __name__ == '__main__':
if args.SignToolPfxFile:
print ('GenerateCapsule: error: Argument --pfx-file conflicts with Argument -j')
sys.exit (1)
if args.SignToolSubjectName:
print ('GenerateCapsule: error: Argument --SubjectName conflicts with Argument -j')
sys.exit (1)
if args.OpenSslSignerPrivateCertFile:
print ('GenerateCapsule: error: Argument --signer-private-cert conflicts with Argument -j')
sys.exit (1)
@@ -438,7 +425,6 @@ if __name__ == '__main__':
HardwareInstance = 0,
UpdateImageIndex = 1,
SignToolPfxFile = None,
SignToolSubjectName = None,
OpenSslSignerPrivateCertFile = None,
OpenSslOtherPublicCertFile = None,
OpenSslTrustedPublicCertFile = None,
@@ -453,15 +439,13 @@ if __name__ == '__main__':
self.HardwareInstance = HardwareInstance
self.UpdateImageIndex = UpdateImageIndex
self.SignToolPfxFile = SignToolPfxFile
self.SignToolSubjectName = SignToolSubjectName
self.OpenSslSignerPrivateCertFile = OpenSslSignerPrivateCertFile
self.OpenSslOtherPublicCertFile = OpenSslOtherPublicCertFile
self.OpenSslTrustedPublicCertFile = OpenSslTrustedPublicCertFile
self.SigningToolPath = SigningToolPath
self.DepexExp = DepexExp
self.UseSignTool = (self.SignToolPfxFile is not None or
self.SignToolSubjectName is not None)
self.UseSignTool = self.SignToolPfxFile is not None
self.UseOpenSsl = (self.OpenSslSignerPrivateCertFile is not None and
self.OpenSslOtherPublicCertFile is not None and
self.OpenSslTrustedPublicCertFile is not None)
@@ -520,9 +504,8 @@ if __name__ == '__main__':
raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x0..0xff')
if self.UseSignTool:
if self.SignToolPfxFile is not None:
self.SignToolPfxFile.close()
self.SignToolPfxFile = self.SignToolPfxFile.name
self.SignToolPfxFile.close()
self.SignToolPfxFile = self.SignToolPfxFile.name
if self.UseOpenSsl:
self.OpenSslSignerPrivateCertFile.close()
self.OpenSslOtherPublicCertFile.close()
@@ -565,7 +548,6 @@ if __name__ == '__main__':
args.HardwareInstance,
args.UpdateImageIndex,
args.SignToolPfxFile,
args.SignToolSubjectName,
args.OpenSslSignerPrivateCertFile,
args.OpenSslOtherPublicCertFile,
args.OpenSslTrustedPublicCertFile,
@@ -608,7 +590,6 @@ if __name__ == '__main__':
Result + struct.pack ('<Q', SinglePayloadDescriptor.MonotonicCount),
SinglePayloadDescriptor.SigningToolPath,
SinglePayloadDescriptor.SignToolPfxFile,
SinglePayloadDescriptor.SignToolSubjectName,
Verbose = args.Verbose
)
else:
@@ -690,7 +671,6 @@ if __name__ == '__main__':
args.HardwareInstance,
args.UpdateImageIndex,
args.SignToolPfxFile,
args.SignSubjectName,
args.OpenSslSignerPrivateCertFile,
args.OpenSslOtherPublicCertFile,
args.OpenSslTrustedPublicCertFile,
@@ -735,7 +715,6 @@ if __name__ == '__main__':
HardwareInstance,
UpdateImageIndex,
PayloadDescriptorList[Index].SignToolPfxFile,
PayloadDescriptorList[Index].SignToolSubjectName,
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
@@ -774,7 +753,6 @@ if __name__ == '__main__':
HardwareInstance,
UpdateImageIndex,
PayloadDescriptorList[Index].SignToolPfxFile,
PayloadDescriptorList[Index].SignToolSubjectName,
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
@@ -807,7 +785,6 @@ if __name__ == '__main__':
FmpAuthHeader.CertData,
SinglePayloadDescriptor.SigningToolPath,
SinglePayloadDescriptor.SignToolPfxFile,
SinglePayloadDescriptor.SignToolSubjectName,
Verbose = args.Verbose
)
else:
@@ -991,8 +968,6 @@ if __name__ == '__main__':
parser.add_argument ("--pfx-file", dest='SignToolPfxFile', type=argparse.FileType('rb'),
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'),
help="OpenSSL signer private certificate filename.")

View File

@@ -2612,8 +2612,8 @@ def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, Fu
if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':
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> is NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
ErrorMsgList.append('Line %d : in Comment, <%s> does 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)
Index += 1
if Index < ParamNumber:

View File

@@ -97,8 +97,7 @@ PcdMakefileEnd = '''
AppTarget = '''
all: $(APPFILE)
$(APPLICATION): $(OBJECTS)
$(APPFILE): $(APPLICATION)
$(APPFILE): $(OBJECTS)
%s
'''
@@ -2932,7 +2931,7 @@ class DscBuildData(PlatformBuildClassObject):
MakeApp = MakeApp + PcdMakefileEnd
MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """)
else:
MakeApp = MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) $(APPFILE) """)
MakeApp = MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(APPFILE) """)
MakeApp = MakeApp + '\n'
IncludeFileFullPaths = []
for includefile in IncludeFiles:
@@ -2955,7 +2954,7 @@ class DscBuildData(PlatformBuildClassObject):
else:
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 + '\tcp -p -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath)
MakeApp = MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % (PcdValueCommonPath, self.OutputPath)
MakeFileName = os.path.join(self.OutputPath, 'Makefile')
MakeApp += "$(OBJECTS) : %s\n" % MakeFileName
SaveFileOnChange(MakeFileName, MakeApp, False)

View File

@@ -1084,9 +1084,7 @@ class InfBuildData(ModuleBuildClassObject):
else:
for Name, Guid in self.Pcds:
if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
PcdFullName = '%s.%s' % (Guid, Name);
if not PcdFullName in Pcds:
Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue
Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name, Guid)].DefaultValue
try:
Value = ValueExpression(Instance, Pcds)()
if Value == True:

View File

@@ -150,9 +150,7 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
EdkLogger.error("build", OPTION_MISSING,
"Module type [%s] is not supported by library instance [%s]" \
% (ModuleType, LibraryPath), File=FileName,
ExtraData="consumed by library instance [%s] which is consumed by module [%s]" \
% (str(M), str(Module))
)
ExtraData="consumed by [%s]" % str(Module))
else:
return []

View File

@@ -109,9 +109,6 @@
[LibraryClasses.ARM]
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
[LibraryClasses.common.SEC]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
[LibraryClasses.common.PEIM]
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
@@ -239,7 +236,6 @@
!if $(CRYPTO_SERVICES) == PACKAGE
[Components]
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

View File

@@ -1,163 +0,0 @@
/** @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;
}

View File

@@ -1,166 +0,0 @@
/** @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;
}

View File

@@ -1,162 +0,0 @@
/** @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;
}

View File

@@ -1,164 +0,0 @@
/** @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;
}

View File

@@ -1,152 +0,0 @@
/** @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;
}

View File

@@ -1,121 +0,0 @@
/** @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;
}

View File

@@ -1,91 +0,0 @@
## @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

View File

@@ -15,7 +15,6 @@
[LibraryClasses.common]
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf

View File

@@ -108,7 +108,6 @@
"lgreater",
"lless",
"MPIDR",
"PASID",
"PERIPHBASE",
"phandle",
"pytool",

View File

@@ -30,9 +30,6 @@
## @libraryclass Defines a set of APIs to a hardware information parser.
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.
SsdtSerialPortFixupLib|Include/Library/SsdtSerialPortFixupLib.h

View File

@@ -41,7 +41,6 @@
[Components.common]
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -61,8 +61,6 @@ typedef enum ArmObjectID {
EArmObjLpiInfo, ///< 37 - Lpi Info
EArmObjPciAddressMapInfo, ///< 38 - Pci Address Map Info
EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info
EArmObjRmr, ///< 40 - Reserved Memory Range Node
EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor
EArmObjMax
} EARM_OBJECT_ID;
@@ -479,9 +477,6 @@ typedef struct CmArmItsGroupNode {
UINT32 ItsIdCount;
/// Reference token for the ITS identifier array
CM_OBJECT_TOKEN ItsIdToken;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_ITS_GROUP_NODE;
/** A structure that describes the
@@ -514,9 +509,6 @@ typedef struct CmArmNamedComponentNode {
the entry in the namespace for this object.
*/
CHAR8 *ObjectName;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_NAMED_COMPONENT_NODE;
/** A structure that describes the
@@ -545,13 +537,6 @@ typedef struct CmArmRootComplexNode {
UINT32 PciSegmentNumber;
/// Memory address size limit
UINT8 MemoryAddressSize;
/// PASID capabilities
UINT16 PasidCapabilities;
/// Flags
UINT32 Flags;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_ROOT_COMPLEX_NODE;
/** A structure that describes the
@@ -594,9 +579,6 @@ typedef struct CmArmSmmuV1SmmuV2Node {
UINT32 SMMU_NSgCfgIrpt;
/// SMMU_NSgCfgIrpt interrupt flags
UINT32 SMMU_NSgCfgIrptFlags;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_SMMUV1_SMMUV2_NODE;
/** A structure that describes the
@@ -633,9 +615,6 @@ typedef struct CmArmSmmuV3Node {
UINT32 ProximityDomain;
/// Index into the array of ID mapping
UINT32 DeviceIdMappingIndex;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_SMMUV3_NODE;
/** A structure that describes the
@@ -660,9 +639,6 @@ typedef struct CmArmPmcgNode {
/// Reference token for the IORT node associated with this node
CM_OBJECT_TOKEN ReferenceToken;
/// Unique identifier for this node.
UINT32 Identifier;
} CM_ARM_PMCG_NODE;
/** A structure that describes the
@@ -1030,46 +1006,6 @@ typedef struct CmArmPciInterruptMapInfo {
CM_ARM_GENERIC_INTERRUPT IntcInterrupt;
} 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()
#endif // ARM_NAMESPACE_OBJECTS_H_

View File

@@ -1,73 +0,0 @@
/** @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_

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -105,14 +105,6 @@ typedef struct CmAStdObjAcpiTableInfo {
/// Generators shall populate this information using the revision of the
/// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
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;
/** A structure used to describe the SMBIOS table generators to be invoked.

View File

@@ -1,7 +1,7 @@
/** @file
FADT Table Generator
Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s):
@@ -167,7 +167,7 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
// UINT16 ArmBootArch
EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
// UINT8 MinorRevision
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // {Template}
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
// UINT64 XFirmwareCtrl
0,
// UINT64 XDsdt
@@ -546,31 +546,6 @@ BuildFadtTable (
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
Status = FadtAddPmProfileInfo (CfgMgrProtocol);
if (EFI_ERROR (Status)) {

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2018 - 2022, Arm Limited. All rights reserved.
Copyright (c) 2018, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -25,9 +25,6 @@ typedef struct IortNodeIndexer {
VOID *Object;
/// Node offset from the start of the IORT table
UINT32 Offset;
/// Unique identifier for the Node
UINT32 Identifier;
} IORT_NODE_INDEXER;
typedef struct AcpiIortGenerator {

View File

@@ -29,7 +29,6 @@
#include <Library/AcpiHelperLib.h>
#include <Library/TableHelperLib.h>
#include <Library/AmlLib/AmlLib.h>
#include <Library/SsdtPcieSupportLib.h>
#include <Protocol/ConfigurationManagerProtocol.h>
#include "SsdtPcieGenerator.h"
@@ -281,6 +280,86 @@ GeneratePciDeviceInfo (
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.
Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
@@ -370,7 +449,7 @@ GeneratePrt (
if ((Index > 0) &&
(IrqMapInfo->IntcInterrupt.Interrupt >= 32) &&
(IrqMapInfo->IntcInterrupt.Interrupt < 1020) &&
((IrqMapInfo->IntcInterrupt.Flags & 0xB) != 0))
((IrqMapInfo->IntcInterrupt.Flags & 0x3) != BIT0))
{
Status = EFI_INVALID_PARAMETER;
ASSERT_EFI_ERROR (Status);
@@ -416,7 +495,7 @@ GeneratePrt (
PrtNode = NULL;
// Generate the Pci slots once all the device have been added.
Status = GeneratePciSlots (PciInfo, &Generator->DeviceTable, PciNode);
Status = GeneratePciSlots (&Generator->DeviceTable, PciNode);
if (EFI_ERROR (Status)) {
ASSERT (0);
goto exit_handler;
@@ -461,7 +540,6 @@ GeneratePciCrs (
UINT32 RefCount;
CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;
AML_OBJECT_NODE_HANDLE CrsNode;
BOOLEAN IsPosDecode;
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -531,11 +609,6 @@ GeneratePciCrs (
}
Translation = (AddrMapInfo->CpuAddress != AddrMapInfo->PciAddress);
if (AddrMapInfo->CpuAddress >= AddrMapInfo->PciAddress) {
IsPosDecode = TRUE;
} else {
IsPosDecode = FALSE;
}
switch (AddrMapInfo->SpaceCode) {
case PCI_SS_IO:
@@ -543,12 +616,12 @@ GeneratePciCrs (
FALSE,
TRUE,
TRUE,
IsPosDecode,
TRUE,
3,
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
Translation ? AddrMapInfo->CpuAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,
@@ -562,7 +635,7 @@ GeneratePciCrs (
case PCI_SS_M32:
Status = AmlCodeGenRdDWordMemory (
FALSE,
IsPosDecode,
TRUE,
TRUE,
TRUE,
TRUE,
@@ -570,7 +643,7 @@ GeneratePciCrs (
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
Translation ? AddrMapInfo->CpuAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,
@@ -584,7 +657,7 @@ GeneratePciCrs (
case PCI_SS_M64:
Status = AmlCodeGenRdQWordMemory (
FALSE,
IsPosDecode,
TRUE,
TRUE,
TRUE,
TRUE,
@@ -592,7 +665,7 @@ GeneratePciCrs (
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
Translation ? AddrMapInfo->CpuAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,
@@ -616,6 +689,89 @@ GeneratePciCrs (
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.
@param [in] Generator The SSDT Pci generator.
@@ -662,10 +818,7 @@ GeneratePciDevice (
// Write the name of the PCI device.
CopyMem (AslName, "PCIx", AML_NAME_SEG_SIZE + 1);
AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid & 0xF);
if (Uid > 0xF) {
AslName[AML_NAME_SEG_SIZE - 2] = AsciiFromHex ((Uid >> 4) & 0xF);
}
AslName[AML_NAME_SEG_SIZE - 1] = AsciiFromHex (Uid);
// ASL: Device (PCIx) {}
Status = AmlCodeGenDevice (AslName, ScopeNode, &PciNode);
@@ -703,7 +856,7 @@ GeneratePciDevice (
}
// Add the template _OSC method.
Status = AddOscMethod (PciInfo, PciNode);
Status = AddOscMethod (PciNode);
ASSERT_EFI_ERROR (Status);
return Status;
}

View File

@@ -31,13 +31,34 @@
Corresponding changes would be needed to support the Name and
UID fields describing the Pci root complexes.
*/
#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 256
#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 16
// _SB scope of the AML namespace.
#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)
/** 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.
*/
typedef struct AcpiPcieGenerator {

View File

@@ -19,6 +19,7 @@
[Sources]
SsdtPcieGenerator.c
SsdtPcieGenerator.h
SsdtPcieOscTemplate.asl
[Packages]
DynamicTablesPkg/DynamicTablesPkg.dec
@@ -29,4 +30,3 @@
AcpiHelperLib
AmlLib
BaseLib
SsdtPcieSupportLib

View File

@@ -1,200 +0,0 @@
/** @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;
}

View File

@@ -1,30 +0,0 @@
## @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

View File

@@ -1,25 +0,0 @@
/** @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_

View File

@@ -8,7 +8,6 @@
@par Reference(s):
- Arm Server Base Boot Requirements (SBBR), s4.2.1.8 "SPCR".
- Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
- ACPI for Arm Components 1.0 - 2020
**/
#include <IndustryStandard/DebugPort2Table.h>
@@ -177,7 +176,7 @@ FixupIds (
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART:
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X:
{
HidString = "ARMHB000";
HidString = "ARMH0011";
CidString = "";
break;
}

View File

@@ -60,7 +60,7 @@
#define SPI_OFFSET (32U)
#define DT_PPI_IRQ (1U)
#define DT_SPI_IRQ (0U)
#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT1)) != 0))
#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT2)) != 0))
#define DT_IRQ_IS_ACTIVE_LOW(x) ((((x) & (BIT1 | BIT3)) != 0))
#define IRQ_TYPE_OFFSET (0U)
#define IRQ_NUMBER_OFFSET (1U)

View File

@@ -134,7 +134,6 @@
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
!else
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf

View File

@@ -1187,7 +1187,7 @@ PosixFileSetInfo (
}
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
if (OldFileName == NULL) {
if (OldFileInfo == NULL) {
goto Done;
}

View File

@@ -0,0 +1,47 @@
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.

View File

@@ -0,0 +1,340 @@
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.

47
FSDrivers/X64/LICENSE.txt Normal file
View File

@@ -0,0 +1,47 @@
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.

View File

@@ -0,0 +1,340 @@
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.

BIN
FSDrivers/X64/exfat_x64.efi Normal file

Binary file not shown.

BIN
FSDrivers/X64/ext2_x64.efi Normal file

Binary file not shown.

BIN
FSDrivers/X64/ext4_x64.efi Normal file

Binary file not shown.

BIN
FSDrivers/X64/ntfs_x64.efi Normal file

Binary file not shown.

27
FSDrivers/exfat.inf Normal file
View File

@@ -0,0 +1,27 @@
# 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|*

25
FSDrivers/ext2.inf Normal file
View File

@@ -0,0 +1,25 @@
# 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|*

25
FSDrivers/ext4.inf Normal file
View File

@@ -0,0 +1,25 @@
# 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|*

27
FSDrivers/ntfs.inf Normal file
View File

@@ -0,0 +1,27 @@
# 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|*

View File

@@ -1,54 +0,0 @@
## @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

View File

@@ -1,44 +0,0 @@
;; @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)

View File

@@ -40,13 +40,12 @@ struc FSPM_UPD_COMMON_FSP24
.Revision: resb 1
.Reserved: resb 3
.Length resd 1
.NvsBufferPtr resq 1
.StackBase: resq 1
.StackSize: resq 1
.BootLoaderTolumSize: resd 1
.BootMode: resd 1
.FspEventHandler resq 1
.Reserved1: resb 16
.Reserved1: resb 24
; }
.size:
endstruc

View File

@@ -16,20 +16,19 @@
@return FSP specific IDT gate descriptor.
**/
IA32_IDT_GATE_DESCRIPTOR
UINT64
FspGetExceptionHandler (
IN UINT64 IdtEntryTemplate
)
{
UINT32 Entry;
IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;
UINT64 ExceptionHandler;
IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;
FSP_INFO_HEADER *FspInfoHeader;
ZeroMem ((VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR));
FspInfoHeader = (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader ();
*(UINT64 *) &ExceptionHandler = IdtEntryTemplate;
IdtGateDescriptor = &ExceptionHandler;
ExceptionHandler = IdtEntryTemplate;
IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;
Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;
Entry = FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1);
IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16);
@@ -201,11 +200,11 @@ FspGlobalDataInit (
(PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \
(PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
(((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) : \
((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \
(((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) :\
((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \
(PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \
((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)) : \
(PeiFspData->FspInfoHeader->ImageRevision & 0xFF)
((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)): \
(PeiFspData->FspInfoHeader->ImageRevision & 0xFF)
));
}

View File

@@ -30,7 +30,7 @@
@return FSP specific IDT gate descriptor.
**/
IA32_IDT_GATE_DESCRIPTOR
UINT64
FspGetExceptionHandler (
IN UINT64 IdtEntryTemplate
);

View File

@@ -71,19 +71,6 @@ FspApiCallingCheck (
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 {
Status = EFI_UNSUPPORTED;
}

View File

@@ -58,13 +58,13 @@ SecStartup (
IN UINT32 ApiIdx
)
{
EFI_SEC_PEI_HAND_OFF SecCoreData;
IA32_DESCRIPTOR IdtDescriptor;
SEC_IDT_TABLE IdtTableInStack;
UINT32 Index;
FSP_GLOBAL_DATA PeiFspData;
IA32_IDT_GATE_DESCRIPTOR ExceptionHandler;
UINTN IdtSize;
EFI_SEC_PEI_HAND_OFF SecCoreData;
IA32_DESCRIPTOR IdtDescriptor;
SEC_IDT_TABLE IdtTableInStack;
UINT32 Index;
FSP_GLOBAL_DATA PeiFspData;
UINT64 ExceptionHandler;
UINTN IdtSize;
//
// Process all libraries constructor function linked to SecCore.
@@ -119,7 +119,7 @@ SecStartup (
if (IdtDescriptor.Base == 0) {
ExceptionHandler = FspGetExceptionHandler (mIdtEntryTemplate);
for (Index = 0; Index < FixedPcdGet8 (PcdFspMaxInterruptSupported); Index++) {
CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR));
CopyMem ((VOID *)&IdtTableInStack.IdtTable[Index], (VOID *)&ExceptionHandler, sizeof (UINT64));
}
IdtSize = sizeof (IdtTableInStack.IdtTable);

View File

@@ -26,7 +26,7 @@
typedef
VOID
(EFIAPI *PEI_CORE_ENTRY)(
(EFIAPI *PEI_CORE_ENTRY) (
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
);
@@ -38,8 +38,8 @@ typedef struct _SEC_IDT_TABLE {
// Note: For IA32, only the 4 bytes immediately preceding IDT is used to store
// EFI_PEI_SERVICES**
//
UINT64 PeiService;
IA32_IDT_GATE_DESCRIPTOR IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];
UINT64 PeiService;
UINT64 IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];
} SEC_IDT_TABLE;
/**

View File

@@ -24,7 +24,7 @@ STACK_SAVED_RAX_OFFSET EQU 8 * 7 ; size of a general purpose register *
;----------------------------------------------------------------------------
global ASM_PFX(NotifyPhaseApi)
ASM_PFX(NotifyPhaseApi):
mov rax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
@@ -36,7 +36,7 @@ ASM_PFX(NotifyPhaseApi):
;----------------------------------------------------------------------------
global ASM_PFX(FspSiliconInitApi)
ASM_PFX(FspSiliconInitApi):
mov rax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
@@ -54,7 +54,7 @@ ASM_PFX(FspSiliconInitApi):
global ASM_PFX(FspMultiPhaseSiInitApi)
ASM_PFX(FspMultiPhaseSiInitApi):
mov rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
mov eax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
@@ -68,7 +68,7 @@ ASM_PFX(FspApiCommonContinue):
;
; Handle FspMultiPhaseSiInitApiIndex API
;
cmp rax, 6 ; FSP_API_INDEX.FspMultiPhaseSiInitApiIndex
cmp eax, 6
jnz NotMultiPhaseSiInitApi
PUSHA_64

View File

@@ -1,44 +0,0 @@
;; @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)

View File

@@ -22,13 +22,12 @@ struc FSPM_UPD_COMMON_FSP24
.Revision: resb 1
.Reserved: resb 3
.Length resd 1
.NvsBufferPtr resq 1
.StackBase: resq 1
.StackSize: resq 1
.BootLoaderTolumSize: resd 1
.BootMode: resd 1
.FspEventHandler resq 1
.Reserved1: resb 16
.Reserved1: resb 24
; }
.size:
endstruc
@@ -56,7 +55,7 @@ FSP_HEADER_CFGREG_OFFSET EQU 24h
;----------------------------------------------------------------------------
global ASM_PFX(FspMemoryInitApi)
ASM_PFX(FspMemoryInitApi):
mov rax, 3 ; FSP_API_INDEX.FspMemoryInitApiIndex
mov eax, 3 ; FSP_API_INDEX.FspMemoryInitApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
@@ -67,7 +66,7 @@ ASM_PFX(FspMemoryInitApi):
;----------------------------------------------------------------------------
global ASM_PFX(TempRamExitApi)
ASM_PFX(TempRamExitApi):
mov rax, 4 ; FSP_API_INDEX.TempRamExitApiIndex
mov eax, 4 ; FSP_API_INDEX.TempRamExitApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------

View File

@@ -21,7 +21,7 @@ extern ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
global ASM_PFX(NotifyPhaseApi)
ASM_PFX(NotifyPhaseApi):
mov rax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
mov eax, 2 ; FSP_API_INDEX.NotifyPhaseApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------
@@ -33,7 +33,7 @@ ASM_PFX(NotifyPhaseApi):
;----------------------------------------------------------------------------
global ASM_PFX(FspSiliconInitApi)
ASM_PFX(FspSiliconInitApi):
mov rax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
mov eax, 5 ; FSP_API_INDEX.FspSiliconInitApiIndex
jmp ASM_PFX(FspApiCommon)
;----------------------------------------------------------------------------

View File

@@ -114,7 +114,7 @@ endstruc
global ASM_PFX(LoadMicrocodeDefault)
ASM_PFX(LoadMicrocodeDefault):
; Inputs:
; rcx -> LoadMicrocodeParams pointer
; rsp -> LoadMicrocodeParams pointer
; Register Usage:
; rsp Preserved
; All others destroyed
@@ -130,9 +130,10 @@ ASM_PFX(LoadMicrocodeDefault):
cmp rsp, 0
jz ParamError
cmp rcx, 0
mov eax, dword [rsp + 8] ; Parameter pointer
cmp eax, 0
jz ParamError
mov rsp, rcx
mov esp, eax
; skip loading Microcode if the MicrocodeCodeSize is zero
; and report error if size is less than 2k
@@ -143,14 +144,14 @@ ASM_PFX(LoadMicrocodeDefault):
jne ParamError
; UPD structure is compliant with FSP spec 2.4
mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
cmp rax, 0
mov eax, dword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
cmp eax, 0
jz Exit2
cmp rax, 0800h
cmp eax, 0800h
jl ParamError
mov rsi, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeAddr]
cmp rsi, 0
mov esi, dword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeAddr]
cmp esi, 0
jnz CheckMainHeader
ParamError:
@@ -255,8 +256,7 @@ CheckAddress:
; UPD structure is compliant with FSP spec 2.4
; Is automatic size detection ?
mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize]
mov rcx, 0ffffffffffffffffh
cmp rax, rcx
cmp rax, 0ffffffffffffffffh
jz LoadMicrocodeDefault4
; Address >= microcode region address + microcode region size?
@@ -321,7 +321,8 @@ ASM_PFX(EstablishStackFsp):
;
; Save parameter pointer in rdx
;
mov rdx, rcx
mov rdx, qword [rsp + 8]
;
; Enable FSP STACK
;
@@ -419,10 +420,7 @@ ASM_PFX(TempRamInitApi):
;
ENABLE_SSE
ENABLE_AVX
;
; Save Input Parameter in YMM10
;
SAVE_RCX
;
; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and YMM6
;
@@ -444,8 +442,9 @@ ASM_PFX(TempRamInitApi):
;
; Check Parameter
;
cmp rcx, 0
mov rcx, 08000000000000002h
mov rax, qword [rsp + 8]
cmp rax, 0
mov rax, 08000000000000002h
jz TempRamInitExit
;
@@ -456,18 +455,18 @@ ASM_PFX(TempRamInitApi):
jnz TempRamInitExit
; Load microcode
LOAD_RCX
LOAD_RSP
CALL_YMM ASM_PFX(LoadMicrocodeDefault)
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.
; Call Sec CAR Init
LOAD_RCX
LOAD_RSP
CALL_YMM ASM_PFX(SecCarInit)
cmp rax, 0
jnz TempRamInitExit
LOAD_RCX
LOAD_RSP
CALL_YMM ASM_PFX(EstablishStackFsp)
cmp rax, 0
jnz TempRamInitExit

View File

@@ -1,6 +1,6 @@
/** @file
Intel FSP API definition from Intel Firmware Support Package External
Architecture Specification v2.0 and above.
Architecture Specification v2.0 - v2.2
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -11,24 +11,19 @@
#define _FSP_API_H_
#include <Pi/PiStatusCode.h>
#include <Base.h>
///
/// FSP Reset Status code
/// These are defined in FSP EAS v2.4 section 13.2.2 - OEM Status Code
/// These are defined in FSP EAS v2.0 section 11.2.2 - OEM Status Code
/// @{
#define ENCODE_RESET_REQUEST(ResetType) \
((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
#define FSP_STATUS_RESET_REQUIRED_COLD ENCODE_RESET_REQUEST(1)
#define FSP_STATUS_RESET_REQUIRED_WARM ENCODE_RESET_REQUEST(2)
#define FSP_STATUS_RESET_REQUIRED_3 ENCODE_RESET_REQUEST(3)
#define FSP_STATUS_RESET_REQUIRED_4 ENCODE_RESET_REQUEST(4)
#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)
#define FSP_STATUS_RESET_REQUIRED_COLD 0x40000001
#define FSP_STATUS_RESET_REQUIRED_WARM 0x40000002
#define FSP_STATUS_RESET_REQUIRED_3 0x40000003
#define FSP_STATUS_RESET_REQUIRED_4 0x40000004
#define FSP_STATUS_RESET_REQUIRED_5 0x40000005
#define FSP_STATUS_RESET_REQUIRED_6 0x40000006
#define FSP_STATUS_RESET_REQUIRED_7 0x40000007
#define FSP_STATUS_RESET_REQUIRED_8 0x40000008
/// @}
///
@@ -100,14 +95,13 @@ typedef struct {
/// "XXXXXX_T" for FSP-T
/// "XXXXXX_M" for FSP-M
/// "XXXXXX_S" for FSP-S
/// "XXXXXX_I" for FSP-I
/// Where XXXXXX is an unique signature
///
UINT64 Signature;
///
/// Revision of the Data structure.
/// For FSP spec 2.0/2.1, this value is 1 and only FSPM_UPD having ARCH_UPD.
/// For FSP spec 2.2 and above, this value is 2 and ARCH_UPD present in all UPD structures.
/// For FSP spec 2.0/2.1 value is 1.
/// For FSP spec 2.2 value is 2.
///
UINT8 Revision;
UINT8 Reserved[23];
@@ -135,24 +129,24 @@ typedef struct {
} FSPT_ARCH_UPD;
///
/// FSPT_ARCH2_UPD Configuration for FSP 2.4 and above.
/// FSPT_ARCH2_UPD Configuration.
///
typedef struct {
///
/// Revision of the structure is 2 for this version of the specification.
///
UINT8 Revision;
UINT8 Reserved[3];
UINT8 Revision;
UINT8 Reserved[3];
///
/// Length of the structure in bytes. The current value for this field is 32.
///
UINT32 Length;
UINT32 Length;
///
/// FspDebugHandler Optional debug handler for the bootloader to receive debug messages
/// occurring during FSP execution.
///
EFI_PHYSICAL_ADDRESS FspDebugHandler;
UINT8 Reserved1[16];
EFI_PHYSICAL_ADDRESS FspDebugHandler;
UINT8 Reserved1[16];
} FSPT_ARCH2_UPD;
///
@@ -197,50 +191,43 @@ typedef struct {
} FSPM_ARCH_UPD;
///
/// FSPM_ARCH2_UPD Configuration for FSP 2.4 and above.
/// FSPM_ARCH2_UPD Configuration.
///
typedef struct {
///
/// Revision of the structure is 3 for this version of the specification.
///
UINT8 Revision;
UINT8 Reserved[3];
UINT8 Revision;
UINT8 Reserved[3];
///
/// Length of the structure in bytes. The current value for this field is 64.
///
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;
UINT32 Length;
///
/// Pointer to the temporary stack base address to be
/// consumed inside FspMemoryInit() API.
///
EFI_PHYSICAL_ADDRESS StackBase;
EFI_PHYSICAL_ADDRESS StackBase;
///
/// Temporary stack size to be consumed inside
/// FspMemoryInit() API.
///
UINT64 StackSize;
UINT64 StackSize;
///
/// Size of memory to be reserved by FSP below "top
/// of low usable memory" for bootloader usage.
///
UINT32 BootLoaderTolumSize;
UINT32 BootLoaderTolumSize;
///
/// Current boot mode.
///
UINT32 BootMode;
UINT32 BootMode;
///
/// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
/// This value is only valid if Revision is >= 2.
///
EFI_PHYSICAL_ADDRESS FspEventHandler;
UINT8 Reserved1[16];
EFI_PHYSICAL_ADDRESS FspEventHandler;
UINT8 Reserved1[24];
} FSPM_ARCH2_UPD;
///
@@ -273,60 +260,26 @@ typedef struct {
} FSPS_ARCH_UPD;
///
/// FSPS_ARCH2_UPD Configuration for FSP 2.4 and above.
/// FSPS_ARCH2_UPD Configuration.
///
typedef struct {
///
/// Revision of the structure is 2 for this version of the specification.
///
UINT8 Revision;
UINT8 Reserved[3];
UINT8 Revision;
UINT8 Reserved[3];
///
/// Length of the structure in bytes. The current value for this field is 32.
///
UINT32 Length;
UINT32 Length;
///
/// FspEventHandler Optional event handler for the bootloader to be informed of events
/// occurring during FSP execution.
///
EFI_PHYSICAL_ADDRESS FspEventHandler;
UINT8 Reserved1[16];
EFI_PHYSICAL_ADDRESS FspEventHandler;
UINT8 Reserved1[16];
} 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.
///
@@ -435,21 +388,6 @@ typedef struct {
FSPS_ARCH2_UPD FspsArchUpd;
} 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.
///
@@ -671,23 +609,4 @@ EFI_STATUS
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

View File

@@ -10,9 +10,9 @@
#include <FspEas.h>
#define FSP_IN_API_MODE 0
#define FSP_IN_DISPATCH_MODE 1
#define FSP_GLOBAL_DATA_VERSION 0x2
#define FSP_IN_API_MODE 0
#define FSP_IN_DISPATCH_MODE 1
#define FSP_GLOBAL_DATA_VERSION 1
#pragma pack(1)
@@ -24,17 +24,16 @@ typedef enum {
TempRamExitApiIndex,
FspSiliconInitApiIndex,
FspMultiPhaseSiInitApiIndex,
FspSmmInitApiIndex,
FspApiIndexMax
} FSP_API_INDEX;
typedef struct {
VOID *DataPtr;
UINTN MicrocodeRegionBase;
UINTN MicrocodeRegionSize;
UINTN CodeRegionBase;
UINTN CodeRegionSize;
UINTN Reserved;
VOID *DataPtr;
UINTN MicrocodeRegionBase;
UINTN MicrocodeRegionSize;
UINTN CodeRegionBase;
UINTN CodeRegionSize;
UINTN Reserved;
} FSP_PLAT_DATA;
#define FSP_GLOBAL_DATA_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'D')
@@ -49,7 +48,7 @@ typedef struct {
/// Offset 0x08
///
UINTN CoreStack;
VOID *SmmInitUpdPtr;
UINTN Reserved2;
///
/// IA32: Offset 0x10; X64: Offset 0x18
///
@@ -60,15 +59,17 @@ typedef struct {
///
UINT8 FspMode;
UINT8 OnSeparateStack;
UINT8 Reserved2;
UINT8 Reserved3;
UINT32 NumberOfPhases;
UINT32 PhasesExecuted;
UINT32 Reserved3[8];
UINT32 Reserved4[8];
///
/// IA32: Offset 0x40; X64: Offset 0x48
/// Start of UINTN and pointer section
/// All UINTN and pointer members are put in this section
/// for maintaining natural alignment for both IA32 and X64 builds.
/// All UINTN and pointer members must be put in this section
/// except CoreStack and Reserved2. In addition, the number of
/// UINTN and pointer members must be even for natural alignment
/// in both IA32 and X64.
///
FSP_PLAT_DATA PlatformData;
VOID *TempRamInitUpdPtr;
@@ -84,15 +85,12 @@ typedef struct {
VOID *UpdDataPtr;
///
/// End of UINTN and pointer section
/// At this point, next field offset must be either *0h or *8h to
/// meet natural alignment requirement.
///
UINT8 Reserved4[16];
UINT8 Reserved5[16];
UINT32 PerfSig;
UINT16 PerfLen;
UINT16 Reserved5;
UINT16 Reserved6;
UINT32 PerfIdx;
UINT32 Reserved6;
UINT64 PerfData[32];
} FSP_GLOBAL_DATA;

View File

@@ -26,13 +26,13 @@
#define FSP_INFO_HEADER_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'H')
#define IMAGE_ATTRIBUTE_GRAPHICS_SUPPORT BIT0
#define IMAGE_ATTRIBUTE_DISPATCH_MODE_SUPPORT BIT1
#define IMAGE_ATTRIBUTE_64BIT_MODE_SUPPORT BIT2
#define FSP_IA32 0
#define FSP_X64 1
#define IMAGE_ATTRIBUTE_GRAPHICS_SUPPORT BIT0
#define IMAGE_ATTRIBUTE_DISPATCH_MODE_SUPPORT BIT1
#define IMAGE_ATTRIBUTE_64BIT_MODE_SUPPORT BIT2
#define FSP_IA32 0
#define FSP_X64 1
#pragma pack(1)
#pragma pack(1)
///
/// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
@@ -52,7 +52,7 @@ typedef struct {
UINT8 Reserved1[2];
///
/// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.
/// For revision v2.4 the value will be 0x24.
/// For revision v2.3 the value will be 0x23.
///
UINT8 SpecVersion;
///
@@ -93,28 +93,11 @@ typedef struct {
/// 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 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 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
/// Bits 15:3 - Reserved
///
UINT16 ImageAttribute;
///
/// 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;
///
@@ -176,14 +159,6 @@ typedef struct {
/// Byte 0x4E: 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;
///
@@ -265,7 +240,7 @@ typedef struct {
// UINT32 PatchData[];
} FSP_PATCH_TABLE;
#pragma pack()
#pragma pack()
extern EFI_GUID gFspHeaderFileGuid;

View File

@@ -302,7 +302,7 @@ SetPhaseStatusCode (
VOID
EFIAPI
FspApiReturnStatusReset (
IN EFI_STATUS FspResetType
IN UINT32 FspResetType
);
#endif

View File

@@ -30,7 +30,7 @@
**/
EFI_STATUS
UINT32
EFIAPI
Pei2LoaderSwitchStack (
VOID
@@ -46,7 +46,7 @@ Pei2LoaderSwitchStack (
**/
EFI_STATUS
UINT32
EFIAPI
Loader2PeiSwitchStack (
VOID

View File

@@ -1,195 +0,0 @@
/** @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

View File

@@ -177,30 +177,6 @@
LXMMN xmm5, %1, 1
%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
; arg 1:Entry
@@ -255,7 +231,6 @@ NextAddress:
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
; whether the processor supports SSE instruction.
;
mov r10, rcx
mov rax, 1
cpuid
bt rdx, 25
@@ -266,7 +241,6 @@ NextAddress:
;
bt ecx, 19
jnc SseError
mov rcx, r10
;
; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit #10)
@@ -284,7 +258,6 @@ NextAddress:
%endmacro
%macro ENABLE_AVX 0
mov r10, rcx
mov eax, 1
cpuid
and ecx, 10000000h
@@ -307,6 +280,5 @@ EnableAvx:
xgetbv ; result in edx:eax
or eax, 00000006h ; Set XCR0 bit #1 and bit #2 to enable SSE state and AVX state
xsetbv
mov rcx, r10
%endmacro

View File

@@ -1,7 +1,7 @@
## @file
# Provides driver and definitions to build fsp in EDKII bios.
#
# Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -59,12 +59,6 @@
#
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]
#
# GUID defined in package

View File

@@ -68,7 +68,6 @@
IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf
IntelFsp2Pkg/FspNotifyPhase/FspNotifyPhasePeim.inf

View File

@@ -200,13 +200,13 @@ SetFspCoreStackPointer (
UINT32 StackContextLen;
FspData = GetFspGlobalDataPointer ();
StackContextLen = sizeof (CONTEXT_STACK) / sizeof (UINTN);
StackContextLen = sizeof(CONTEXT_STACK) / sizeof(UINTN);
//
// Reserve space for the ContinuationFunc two parameters
//
OldStack = (UINTN *)FspData->CoreStack;
NewStack = (UINTN *)NewStackTop - StackContextLen - 2;
OldStack = (UINTN *)FspData->CoreStack;
NewStack = (UINTN *)NewStackTop - StackContextLen - 2;
FspData->CoreStack = (UINTN)NewStack;
while (StackContextLen-- != 0) {
*NewStack++ = *OldStack++;
@@ -533,7 +533,7 @@ SetPhaseStatusCode (
VOID
EFIAPI
FspApiReturnStatusReset (
IN EFI_STATUS FspResetType
IN UINT32 FspResetType
)
{
volatile BOOLEAN LoopUntilReset;
@@ -546,7 +546,7 @@ FspApiReturnStatusReset (
/// calls the FSP API without honoring the reset request by FSP
///
do {
SetFspApiReturnStatus (FspResetType);
SetFspApiReturnStatus ((EFI_STATUS)FspResetType);
Pei2LoaderSwitchStack ();
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"));

View File

@@ -13,7 +13,6 @@ import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import tkinter.filedialog as filedialog
from pickle import FALSE, TRUE
from pathlib import Path
from GenYamlCfg import CGenYamlCfg, bytes_to_value, \
bytes_to_bracket_str, value_to_bytes, array_str_to_value
@@ -459,10 +458,7 @@ class FSP_INFORMATION_HEADER(Structure):
('NotifyPhaseEntryOffset', c_uint32),
('FspMemoryInitEntryOffset', c_uint32),
('TempRamExitEntryOffset', c_uint32),
('FspSiliconInitEntryOffset', c_uint32),
('FspMultiPhaseSiInitEntryOffset', c_uint32),
('ExtendedImageRevision', c_uint16),
('Reserved4', c_uint16)
('FspSiliconInitEntryOffset', c_uint32)
]
@@ -704,34 +700,6 @@ class FirmwareDevice:
raise Exception("ERROR: Incorrect FV size in image !")
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 copy_text_to_clipboard():
window.clipboard_clear()
@@ -753,8 +721,7 @@ class FirmwareDevice:
self.OutputText = self.OutputText + "Fsp Header Details \n\n"
while i < len(self.FihList):
try:
# self.OutputText += str(self.BuildList[i].decode()) + "\n"
self.OutputText += str(self.BuildList[i]) + "\n"
self.OutputText += str(self.BuildList[i].decode()) + "\n"
except Exception:
self.OutputText += "No description found\n"
self.OutputText += "FSP Header :\n "
@@ -762,8 +729,6 @@ class FirmwareDevice:
str(self.FihList[i].Signature.decode('utf-8')) + "\n "
self.OutputText += "Header Length : " + \
str(hex(self.FihList[i].HeaderLength)) + "\n "
self.OutputText += "Reserved1 : " + \
str(hex(self.FihList[i].Reserved1)) + "\n "
self.OutputText += "Header Revision : " + \
str(hex(self.FihList[i].HeaderRevision)) + "\n "
self.OutputText += "Spec Version : " + \
@@ -778,17 +743,15 @@ class FirmwareDevice:
str(hex(self.FihList[i].ImageBase)) + "\n "
self.OutputText += "Image Attribute : " + \
str(hex(self.FihList[i].ImageAttribute)) + "\n "
self.OutputText += "Component Attribute : " + \
str(hex(self.FihList[i].ComponentAttribute)) + "\n "
self.OutputText += "Cfg Region Offset : " + \
str(hex(self.FihList[i].CfgRegionOffset)) + "\n "
self.OutputText += "Cfg Region Size : " + \
str(hex(self.FihList[i].CfgRegionSize)) + "\n "
self.OutputText += "Reserved2 : " + \
self.OutputText += "API Entry Num : " + \
str(hex(self.FihList[i].Reserved2)) + "\n "
self.OutputText += "Temp Ram Init Entry : " + \
str(hex(self.FihList[i].TempRamInitEntryOffset)) + "\n "
self.OutputText += "Reserved3 : " + \
self.OutputText += "FSP Init Entry : " + \
str(hex(self.FihList[i].Reserved3)) + "\n "
self.OutputText += "Notify Phase Entry : " + \
str(hex(self.FihList[i].NotifyPhaseEntryOffset)) + "\n "
@@ -797,23 +760,7 @@ class FirmwareDevice:
self.OutputText += "Temp Ram Exit Entry : " + \
str(hex(self.FihList[i].TempRamExitEntryOffset)) + "\n "
self.OutputText += "Fsp Silicon Init Entry : " + \
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"
str(hex(self.FihList[i].FspSiliconInitEntryOffset)) + "\n\n"
self.OutputText += "FSP Extended Header:\n "
self.OutputText += "Signature : " + \
str(self.FspExtList[i].Signature.decode('utf-8')) + "\n "

View File

@@ -929,25 +929,17 @@ into %d bytes !" % (value_str, length))
]]:
tmp_list.append((op_val, op_str))
else:
if item['option'].find(';') != -1:
opt_list = item['option'].split(';')
else:
opt_list = re.split(', ', item['option'])
opt_list = item['option'].split(',')
for option in opt_list:
option = option.strip()
try:
if option.find(':') != -1:
(op_val, op_str) = option.split(':')
else:
op_val = option
op_str = option
(op_val, op_str) = option.split(':')
except Exception:
raise SystemExit("Exception: Invalid \
raise SystemExit("Exception: Invalide \
option format '%s' !" % option)
tmp_list.append((op_val, op_str))
return tmp_list
def get_page_title(self, page_id, top=None):
if top is None:
top = self.get_cfg_page()['root']

View File

@@ -953,19 +953,14 @@ EndList
return NoFileChange
def CreateSplitUpdTxt (self, UpdTxtFile):
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','0x495F'] # _T, _M, _S and _I signature for FSPT, FSPM, FSPS, FSPI
GuidList = ['FSP_T_UPD_TOOL_GUID','FSP_M_UPD_TOOL_GUID','FSP_S_UPD_TOOL_GUID']
SignatureList = ['0x545F', '0x4D5F','0x535F'] # _T, _M, and _S signature for FSPT, FSPM, FSPS
for Index in range(len(GuidList)):
UpdTxtFile = ''
FvDir = self._FvDir
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])
return 1
self.Error = "%s definition is missing in DSC file" % (GuidList[Index])
return 1
if UpdTxtFile == '':
UpdTxtFile = os.path.join(FvDir, self._MacroDict[GuidList[Index]] + '.txt')
@@ -1293,22 +1288,19 @@ EndList
Chars.append(chr(Value & 0xFF))
Value = Value >> 8
SignatureStr = ''.join(Chars)
# Signature will be _T / _M / _S / _I for FSPT / FSPM / FSPS /FSPI accordingly
# Signature will be _T / _M / _S for FSPT / FSPM / FSPS accordingly
if '_T' in SignatureStr[6:6+2]:
TxtBody.append("#define FSPT_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
elif '_M' in SignatureStr[6:6+2]:
TxtBody.append("#define FSPM_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
elif '_S' in SignatureStr[6:6+2]:
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")
for Region in ['UPD']:
UpdOffsetTable = []
UpdSignature = ['0x545F', '0x4D5F', '0x535F', '0x495F'] #['_T', '_M', '_S', '_I'] signature for FSPT, FSPM, FSPS, FSPI
UpdStructure = ['FSPT_UPD', 'FSPM_UPD', 'FSPS_UPD', 'FSPI_UPD']
UpdSignature = ['0x545F', '0x4D5F', '0x535F'] #['_T', '_M', '_S'] signature for FSPT, FSPM, FSPS
UpdStructure = ['FSPT_UPD', 'FSPM_UPD', 'FSPS_UPD']
for Item in self._CfgItemList:
if Item["cname"] == 'Signature' and Item["value"][0:6] in UpdSignature:
Item["offset"] = 0 # re-initialize offset to 0 when new UPD structure starting
@@ -1401,12 +1393,11 @@ EndList
HeaderTFileName = 'FsptUpd.h'
HeaderMFileName = 'FspmUpd.h'
HeaderSFileName = 'FspsUpd.h'
HeaderIFileName = 'FspiUpd.h'
UpdRegionCheck = ['FSPT', 'FSPM', 'FSPS', 'FSPI'] # FSPX_UPD_REGION
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', 'FSPI_UPD_SIGNATURE']
ExcludedSpecificUpd = ['FSPT_ARCH_UPD', 'FSPM_ARCH_UPD', 'FSPS_ARCH_UPD', 'FSPI_ARCH_UPD']
UpdRegionCheck = ['FSPT', 'FSPM', 'FSPS'] # FSPX_UPD_REGION
UpdConfigCheck = ['FSP_T', 'FSP_M', 'FSP_S'] # FSP_X_CONFIG, FSP_X_TEST_CONFIG, FSP_X_RESTRICTED_CONFIG
UpdSignatureCheck = ['FSPT_UPD_SIGNATURE', 'FSPM_UPD_SIGNATURE', 'FSPS_UPD_SIGNATURE']
ExcludedSpecificUpd = ['FSPT_ARCH_UPD', 'FSPM_ARCH_UPD', 'FSPS_ARCH_UPD']
ExcludedSpecificUpd1 = ['FSPT_ARCH2_UPD', 'FSPM_ARCH2_UPD', 'FSPS_ARCH2_UPD']
IncLines = []
@@ -1429,9 +1420,6 @@ EndList
elif UpdRegionCheck[item] == 'FSPS':
HeaderFd = open(os.path.join(FvDir, HeaderSFileName), "w")
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()
HeaderFd.write("%s\n" % (__copyright_h__ % date.today().year))
HeaderFd.write("#ifndef __%s__\n" % FileName)
@@ -1708,7 +1696,7 @@ EndList
def Usage():
print ("GenCfgOpt Version 0.59")
print ("GenCfgOpt Version 0.57")
print ("Usage:")
print (" GenCfgOpt UPDTXT PlatformDscFile BuildFvDir [-D Macros]")
print (" GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile [-D Macros]")

View File

@@ -1,6 +1,6 @@
## @ SplitFspBin.py
#
# Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -492,7 +492,7 @@ class FspImage:
self.FihOffset = fihoff
self.Offset = offset
self.FvIdxList = []
self.Type = "XTMSIXXXOXXXXXXX"[(fih.ComponentAttribute >> 12) & 0x0F]
self.Type = "XTMSXXXXOXXXXXXX"[(fih.ComponentAttribute >> 12) & 0x0F]
self.PatchList = patch
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.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('-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('-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('-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('-n', '--outfile', dest='OutputFile', type=str, help='Rebased FSP binary file name', default = '')

View File

@@ -97,7 +97,7 @@ OnPciEnumerationComplete (
//
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));
CallFspWrapperResetSystem (Status);
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {
@@ -140,7 +140,7 @@ OnReadyToBoot (
//
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));
CallFspWrapperResetSystem (Status);
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {
@@ -184,7 +184,7 @@ OnEndOfFirmware (
//
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));
CallFspWrapperResetSystem (Status);
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {

View File

@@ -43,15 +43,16 @@ extern EFI_GUID gFspHobGuid;
@return FSP-M UPD Data Address
**/
UINTN
GetFspmUpdDataAddress (
VOID
)
{
if (PcdGet64 (PcdFspmUpdDataAddress64) != 0) {
return (UINTN)PcdGet64 (PcdFspmUpdDataAddress64);
return (UINTN) PcdGet64 (PcdFspmUpdDataAddress64);
} else {
return (UINTN)PcdGet32 (PcdFspmUpdDataAddress);
return (UINTN) PcdGet32 (PcdFspmUpdDataAddress);
}
}
@@ -96,7 +97,7 @@ PeiFspMemoryInit (
//
// External UPD is ready, get the buffer from PCD pointer.
//
FspmUpdDataPtr = (VOID *)GetFspmUpdDataAddress ();
FspmUpdDataPtr = (VOID *) GetFspmUpdDataAddress();
ASSERT (FspmUpdDataPtr != NULL);
}
@@ -114,7 +115,6 @@ PeiFspMemoryInit (
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, " HobListPtr - 0x%x\n", &FspHobListPtr));
TimeStampCounterStart = AsmReadTsc ();
@@ -129,7 +129,7 @@ PeiFspMemoryInit (
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
CallFspWrapperResetSystem (Status);
CallFspWrapperResetSystem ((UINT32)Status);
}
if (EFI_ERROR (Status)) {

Some files were not shown because too many files have changed in this diff Show More