Compare commits
78 Commits
edk2-stabl
...
a2abc5e15f
Author | SHA1 | Date | |
---|---|---|---|
|
a2abc5e15f | ||
|
a618e43977 | ||
|
bbc04972bc | ||
|
61a7f360d9 | ||
|
fc1c47ccad | ||
|
fec64b04eb | ||
|
05aa27ef23 | ||
|
06cc698885 | ||
|
cb870a1ce9 | ||
|
90e04a7e31 | ||
|
1d01d2a9a7 | ||
|
70e9b22f5c | ||
|
e9d6369050 | ||
|
58d6aae969 | ||
|
4e0fcaba18 | ||
|
2d04a62512 | ||
|
8a0955dfa8 | ||
|
06f4583ea5 | ||
|
9daa69a59e | ||
|
9030464a1b | ||
|
bcfe7a54aa | ||
|
600c565eb2 | ||
|
aae506ce44 | ||
|
bf2ca74bb6 | ||
|
654e5958cd | ||
|
9657bbe08f | ||
|
10cbbe06d3 | ||
|
802391f1fe | ||
|
db04386fd9 | ||
|
7d5abcd016 | ||
|
d296a36cc4 | ||
|
bdb15bf9ba | ||
|
25af751320 | ||
|
7f99fae217 | ||
|
c134065066 | ||
|
eec38fd383 | ||
|
b9564773f1 | ||
|
8c767bb014 | ||
|
7386ad5ae3 | ||
|
e727453a97 | ||
|
553bda4d8e | ||
|
3e7febc83c | ||
|
b664a5352c | ||
|
b376a7d60f | ||
|
3fb944f925 | ||
|
1d70aa7a9b | ||
|
0bef9ccd43 | ||
|
d3b38ea28a | ||
|
69ae47ba5d | ||
|
95c492569f | ||
|
d996a4bc9f | ||
|
9f528fb4c0 | ||
|
bbab5b95b4 | ||
|
5e84cc0714 | ||
|
2af54dd5bd | ||
|
00283317d8 | ||
|
232f661f99 | ||
|
552ca5cc88 | ||
|
94e7cfc7e7 | ||
|
de7030ed26 | ||
|
587653cd8b | ||
|
e167ed1a3d | ||
|
003534f8f0 | ||
|
a363907bc9 | ||
|
530cc53f96 | ||
|
112268c70d | ||
|
726280b214 | ||
|
b1ab82d4c8 | ||
|
2e16857f3d | ||
|
308f9a49b0 | ||
|
7ab09015b1 | ||
|
d1c0828262 | ||
|
b4dd94c217 | ||
|
f428f538b6 | ||
|
75b91c0b9f | ||
|
9f1dd0acb1 | ||
|
6db1a5555a | ||
|
72f8b9d80b |
@@ -48,9 +48,6 @@ jobs:
|
||||
TARGET_SECURITY:
|
||||
Build.Pkgs: 'SecurityPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
||||
TARGET_UEFIPAYLOAD:
|
||||
Build.Pkgs: 'UefiPayloadPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
||||
TARGET_PLATFORMS:
|
||||
# For Platforms only check code. Leave it to Platform CI
|
||||
# to build them.
|
||||
|
@@ -67,8 +67,7 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
"CryptoPkg",
|
||||
"UnitTestFrameworkPkg",
|
||||
"OvmfPkg",
|
||||
"RedfishPkg",
|
||||
"UefiPayloadPkg"
|
||||
"RedfishPkg"
|
||||
)
|
||||
|
||||
def GetArchitecturesSupported(self):
|
||||
|
@@ -3,7 +3,6 @@
|
||||
#
|
||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@@ -338,9 +337,9 @@
|
||||
# UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
|
||||
# UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
|
||||
#
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
|
||||
# PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
|
||||
# PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
|
||||
# PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
|
||||
#
|
||||
# because (a) the target address space (ie. the cpu-physical space) is
|
||||
# 64-bit, and (b) the translation values are meant as offsets for *modular*
|
||||
@@ -357,11 +356,11 @@
|
||||
# UINT64 TranslatedMmio64Address; // output parameter
|
||||
#
|
||||
# TranslatedIoAddress = UntranslatedIoAddress +
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation;
|
||||
# PcdPciIoTranslation;
|
||||
# TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation;
|
||||
# PcdPciMmio32Translation;
|
||||
# TranslatedMmio64Address = UntranslatedMmio64Address +
|
||||
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation;
|
||||
# PcdPciMmio64Translation;
|
||||
#
|
||||
# The modular arithmetic performed in UINT64 ensures that the translation
|
||||
# works correctly regardless of the relation between IoCpuBase and
|
||||
@@ -370,20 +369,16 @@
|
||||
#
|
||||
gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
|
||||
gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000052
|
||||
gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
|
||||
gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
|
||||
gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
|
||||
gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
|
||||
gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
|
||||
gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058
|
||||
|
||||
#
|
||||
# Inclusive range of allowed PCI buses.
|
||||
#
|
||||
gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x00000059
|
||||
gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x0000005A
|
||||
|
||||
[PcdsDynamicEx]
|
||||
#
|
||||
# This dynamic PCD hold the GUID of a firmware FFS which contains
|
||||
# the LinuxBoot payload.
|
||||
#
|
||||
gArmTokenSpaceGuid.PcdLinuxBootFileGuid|{0x0}|VOID*|0x0000005C
|
||||
|
@@ -5,7 +5,6 @@
|
||||
# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) Microsoft Corporation.<BR>
|
||||
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@@ -151,7 +150,6 @@
|
||||
ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
|
||||
ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
|
||||
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|
||||
ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
|
||||
|
||||
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
|
||||
ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
|
||||
|
@@ -344,6 +344,10 @@ GicV3ExitBootServicesEvent (
|
||||
GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index);
|
||||
}
|
||||
|
||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||
GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, Index);
|
||||
}
|
||||
|
||||
// Disable Gic Interface
|
||||
ArmGicV3DisableInterruptInterface ();
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
UefiBootServicesTableLib
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation
|
||||
|
||||
[Protocols]
|
||||
gEfiCpuIo2ProtocolGuid ## PRODUCES
|
||||
|
@@ -1,186 +0,0 @@
|
||||
/** @file
|
||||
Implementation for PlatformBootManagerLib library class interfaces.
|
||||
|
||||
Copyright (C) 2015-2016, Red Hat, Inc.
|
||||
Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Guid/EventGroup.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/UefiBootManagerLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/PlatformBootManager.h>
|
||||
|
||||
/**
|
||||
Register a boot option using a file GUID in the FV.
|
||||
|
||||
@param FileGuid The file GUID name in the FV.
|
||||
@param Description The description of the boot option.
|
||||
@param Attributes The attributes of the boot option.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
PlatformRegisterFvBootOption (
|
||||
CONST EFI_GUID *FileGuid,
|
||||
CHAR16 *Description,
|
||||
UINT32 Attributes
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
INTN OptionIndex;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION NewOption;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
|
||||
UINTN BootOptionCount;
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
gImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);
|
||||
DevicePath = DevicePathFromHandle (LoadedImage->DeviceHandle);
|
||||
ASSERT (DevicePath != NULL);
|
||||
DevicePath = AppendDevicePathNode (
|
||||
DevicePath,
|
||||
(EFI_DEVICE_PATH_PROTOCOL *)&FileNode
|
||||
);
|
||||
ASSERT (DevicePath != NULL);
|
||||
|
||||
Status = EfiBootManagerInitializeLoadOption (
|
||||
&NewOption,
|
||||
LoadOptionNumberUnassigned,
|
||||
LoadOptionTypeBoot,
|
||||
Attributes,
|
||||
Description,
|
||||
DevicePath,
|
||||
NULL,
|
||||
0
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
FreePool (DevicePath);
|
||||
|
||||
BootOptions = EfiBootManagerGetLoadOptions (
|
||||
&BootOptionCount,
|
||||
LoadOptionTypeBoot
|
||||
);
|
||||
|
||||
OptionIndex = EfiBootManagerFindLoadOption (
|
||||
&NewOption,
|
||||
BootOptions,
|
||||
BootOptionCount
|
||||
);
|
||||
|
||||
if (OptionIndex == -1) {
|
||||
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
EfiBootManagerFreeLoadOption (&NewOption);
|
||||
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
|
||||
}
|
||||
|
||||
/**
|
||||
Do the platform specific action before the console is connected.
|
||||
|
||||
Such as:
|
||||
Update console variable;
|
||||
Register new Driver#### or Boot####;
|
||||
Signal ReadyToLock event.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PlatformBootManagerBeforeConsole (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Signal EndOfDxe PI Event
|
||||
//
|
||||
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
|
||||
}
|
||||
|
||||
/**
|
||||
Do the platform specific action after the console is connected.
|
||||
|
||||
Such as:
|
||||
Dynamically switch output mode;
|
||||
Signal console ready platform customized event;
|
||||
Run diagnostics like memory testing;
|
||||
Connect certain devices;
|
||||
Dispatch additional option roms.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PlatformBootManagerAfterConsole (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_GUID LinuxBootFileGuid;
|
||||
|
||||
CopyGuid (&LinuxBootFileGuid, PcdGetPtr (PcdLinuxBootFileGuid));
|
||||
|
||||
if (!CompareGuid (&LinuxBootFileGuid, &gZeroGuid)) {
|
||||
//
|
||||
// Register LinuxBoot
|
||||
//
|
||||
PlatformRegisterFvBootOption (
|
||||
&LinuxBootFileGuid,
|
||||
L"LinuxBoot",
|
||||
LOAD_OPTION_ACTIVE
|
||||
);
|
||||
} else {
|
||||
DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __FUNCTION__));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This function is called each second during the boot manager waits the
|
||||
timeout.
|
||||
|
||||
@param TimeoutRemain The remaining timeout.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PlatformBootManagerWaitCallback (
|
||||
UINT16 TimeoutRemain
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
The function is called when no boot option could be launched,
|
||||
including platform recovery options and options pointing to applications
|
||||
built into firmware volumes.
|
||||
|
||||
If this function returns, BDS attempts to enter an infinite loop.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PlatformBootManagerUnableToBoot (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
@@ -1,58 +0,0 @@
|
||||
## @file
|
||||
# Implementation for PlatformBootManagerLib library class interfaces.
|
||||
#
|
||||
# Copyright (C) 2015-2016, Red Hat, Inc.
|
||||
# Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x0001001B
|
||||
BASE_NAME = LinuxBootBootManagerLib
|
||||
FILE_GUID = 1FA91547-DB23-4F6A-8AF8-3B9782A7F917
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = ARM AARCH64
|
||||
#
|
||||
|
||||
[Sources]
|
||||
LinuxBootBm.c
|
||||
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
ShellPkg/ShellPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
MemoryAllocationLib
|
||||
PcdLib
|
||||
PrintLib
|
||||
UefiBootManagerLib
|
||||
UefiBootServicesTableLib
|
||||
UefiLib
|
||||
UefiRuntimeServicesTableLib
|
||||
|
||||
[Pcd]
|
||||
gArmTokenSpaceGuid.PcdLinuxBootFileGuid
|
||||
|
||||
[Guids]
|
||||
gEfiEndOfDxeEventGroupGuid
|
||||
gUefiShellFileGuid
|
||||
gZeroGuid
|
||||
|
||||
[Protocols]
|
||||
gEfiLoadedImageProtocolGuid
|
@@ -2,10 +2,9 @@
|
||||
Implementation for PlatformBootManagerLib library class interfaces.
|
||||
|
||||
Copyright (C) 2015-2016, Red Hat, Inc.
|
||||
Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2021, Semihalf All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -20,7 +19,6 @@
|
||||
#include <Library/UefiBootManagerLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Protocol/BootManagerPolicy.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/EsrtManagement.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
@@ -29,7 +27,6 @@
|
||||
#include <Protocol/PciIo.h>
|
||||
#include <Protocol/PciRootBridgeIo.h>
|
||||
#include <Protocol/PlatformBootManager.h>
|
||||
#include <Guid/BootDiscoveryPolicy.h>
|
||||
#include <Guid/EventGroup.h>
|
||||
#include <Guid/NonDiscoverableDevice.h>
|
||||
#include <Guid/TtyTerm.h>
|
||||
@@ -706,113 +703,6 @@ HandleCapsules (
|
||||
|
||||
#define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version "
|
||||
|
||||
/**
|
||||
This functions checks the value of BootDiscoverPolicy variable and
|
||||
connect devices of class specified by that variable. Then it refreshes
|
||||
Boot order for newly discovered boot device.
|
||||
|
||||
@retval EFI_SUCCESS Devices connected successfully or connection
|
||||
not required.
|
||||
@retval others Return values from GetVariable(), LocateProtocol()
|
||||
and ConnectDeviceClass().
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
BootDiscoveryPolicyHandler (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DiscoveryPolicy;
|
||||
UINT32 DiscoveryPolicyOld;
|
||||
UINTN Size;
|
||||
EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy;
|
||||
EFI_GUID *Class;
|
||||
|
||||
Size = sizeof (DiscoveryPolicy);
|
||||
Status = gRT->GetVariable (
|
||||
BOOT_DISCOVERY_POLICY_VAR,
|
||||
&gBootDiscoveryPolicyMgrFormsetGuid,
|
||||
NULL,
|
||||
&Size,
|
||||
&DiscoveryPolicy
|
||||
);
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
DiscoveryPolicy = PcdGet32 (PcdBootDiscoveryPolicy);
|
||||
Status = PcdSet32S (PcdBootDiscoveryPolicy, DiscoveryPolicy);
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
return EFI_SUCCESS;
|
||||
} else if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
} else if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (DiscoveryPolicy == BDP_CONNECT_MINIMAL) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
switch (DiscoveryPolicy) {
|
||||
case BDP_CONNECT_NET:
|
||||
Class = &gEfiBootManagerPolicyNetworkGuid;
|
||||
break;
|
||||
case BDP_CONNECT_ALL:
|
||||
Class = &gEfiBootManagerPolicyConnectAllGuid;
|
||||
break;
|
||||
default:
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
|
||||
__FUNCTION__,
|
||||
DiscoveryPolicy
|
||||
));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiBootManagerPolicyProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&BMPolicy
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_INFO, "%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
|
||||
"Driver connect will be skipped.\n", __FUNCTION__));
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
|
||||
if (EFI_ERROR (Status)){
|
||||
DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCTION__, Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Refresh Boot Options if Boot Discovery Policy has been changed
|
||||
//
|
||||
Size = sizeof (DiscoveryPolicyOld);
|
||||
Status = gRT->GetVariable (
|
||||
BOOT_DISCOVERY_POLICY_OLD_VAR,
|
||||
&gBootDiscoveryPolicyMgrFormsetGuid,
|
||||
NULL,
|
||||
&Size,
|
||||
&DiscoveryPolicyOld
|
||||
);
|
||||
if ((Status == EFI_NOT_FOUND) || (DiscoveryPolicyOld != DiscoveryPolicy)) {
|
||||
EfiBootManagerRefreshAllBootOption ();
|
||||
|
||||
Status = gRT->SetVariable (
|
||||
BOOT_DISCOVERY_POLICY_OLD_VAR,
|
||||
&gBootDiscoveryPolicyMgrFormsetGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof (DiscoveryPolicyOld),
|
||||
&DiscoveryPolicy
|
||||
);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Do the platform specific action after the console is ready
|
||||
Possible things that can be done in PlatformBootManagerAfterConsole:
|
||||
@@ -863,12 +753,6 @@ PlatformBootManagerAfterConsole (
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Connect device specified by BootDiscoverPolicy variable and
|
||||
// refresh Boot order for newly discovered boot devices
|
||||
//
|
||||
BootDiscoveryPolicyHandler ();
|
||||
|
||||
//
|
||||
// On ARM, there is currently no reason to use the phased capsule
|
||||
// update approach where some capsules are dispatched before EndOfDxe
|
||||
|
@@ -65,15 +65,11 @@
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
|
||||
|
||||
[Guids]
|
||||
gBootDiscoveryPolicyMgrFormsetGuid
|
||||
gEdkiiNonDiscoverableEhciDeviceGuid
|
||||
gEdkiiNonDiscoverableUhciDeviceGuid
|
||||
gEdkiiNonDiscoverableXhciDeviceGuid
|
||||
gEfiBootManagerPolicyNetworkGuid
|
||||
gEfiBootManagerPolicyConnectAllGuid
|
||||
gEfiFileInfoGuid
|
||||
gEfiFileSystemInfoGuid
|
||||
gEfiFileSystemVolumeLabelInfoIdGuid
|
||||
@@ -83,7 +79,6 @@
|
||||
|
||||
[Protocols]
|
||||
gEdkiiNonDiscoverableDeviceProtocolGuid
|
||||
gEfiBootManagerPolicyProtocolGuid
|
||||
gEfiDevicePathProtocolGuid
|
||||
gEfiGraphicsOutputProtocolGuid
|
||||
gEfiLoadedImageProtocolGuid
|
||||
|
@@ -219,7 +219,7 @@ ConfigureCacheArchitectureInformation (
|
||||
CacheSize32 = CacheSize16;
|
||||
} else if ((CacheSize64 / 64) < MAX_INT16) {
|
||||
CacheSize16 = (1 << 15) | (CacheSize64 / 64);
|
||||
CacheSize32 = (1 << 31) | (CacheSize64 / 64);
|
||||
CacheSize32 = CacheSize16;
|
||||
} else {
|
||||
if ((CacheSize64 / 1024) <= 2047) {
|
||||
CacheSize32 = CacheSize64;
|
||||
@@ -689,7 +689,7 @@ AddSmbiosProcessorTypeTable (
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
FreePool (Type4Record);
|
||||
|
||||
|
@@ -2,7 +2,6 @@
|
||||
Functions for processor information common to ARM and AARCH64.
|
||||
|
||||
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
|
||||
Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -172,7 +171,7 @@ SmbiosGetProcessorId (
|
||||
|
||||
if (HasSmcArm64SocId ()) {
|
||||
SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
|
||||
ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code;
|
||||
ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
|
||||
} else {
|
||||
ProcessorId = ArmReadMidr ();
|
||||
}
|
||||
|
@@ -240,12 +240,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
|
||||
SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB);
|
||||
if (BiosPhysicalSize < SIZE_16MB) {
|
||||
SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
|
||||
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
|
||||
SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
|
||||
} else {
|
||||
SmbiosRecord->BiosSize = 0xFF;
|
||||
if (BiosPhysicalSize < SIZE_16GB) {
|
||||
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
|
||||
SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
|
||||
} else {
|
||||
if (BiosPhysicalSize > 0x3FFF) {
|
||||
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1GB;
|
||||
SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB
|
||||
}
|
||||
@@ -271,7 +270,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
|
||||
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -162,7 +162,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer)
|
||||
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -196,7 +196,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer)
|
||||
Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -178,7 +178,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
|
||||
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -158,7 +158,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages)
|
||||
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -68,7 +68,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)
|
||||
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
|
||||
__FUNCTION__, DEBUG_LINE_NUMBER, Status));
|
||||
__FUNCTION__, __LINE__, Status));
|
||||
}
|
||||
|
||||
FreePool (SmbiosRecord);
|
||||
|
@@ -49,13 +49,12 @@
|
||||
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
|
||||
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
|
||||
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
|
||||
|
||||
!include MdePkg/MdeLibs.dsc.inc
|
||||
|
||||
@@ -193,7 +192,7 @@
|
||||
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
|
||||
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation|0
|
||||
|
||||
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
|
||||
|
||||
@@ -293,9 +292,9 @@
|
||||
#
|
||||
# Platform Driver
|
||||
#
|
||||
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
|
||||
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
|
||||
OvmfPkg/VirtioNetDxe/VirtioNet.inf
|
||||
@@ -342,12 +341,12 @@
|
||||
#
|
||||
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
|
||||
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
|
||||
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
|
||||
@@ -361,5 +360,5 @@
|
||||
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
|
||||
ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
|
@@ -105,9 +105,9 @@ READ_LOCK_STATUS = TRUE
|
||||
|
||||
INF MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
||||
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
|
||||
#
|
||||
# PI DXE Drivers producing Architectural Protocols (EFI Services)
|
||||
|
@@ -57,9 +57,9 @@
|
||||
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
|
||||
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
|
||||
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
@@ -184,7 +184,7 @@
|
||||
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
|
||||
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
|
||||
#
|
||||
# Set video resolution for boot options and for text setup.
|
||||
@@ -291,9 +291,9 @@
|
||||
# Platform Driver
|
||||
#
|
||||
ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
|
||||
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
|
||||
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
|
||||
OvmfPkg/VirtioNetDxe/VirtioNet.inf
|
||||
@@ -338,17 +338,17 @@
|
||||
#
|
||||
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
|
||||
}
|
||||
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
|
||||
}
|
||||
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
|
||||
}
|
||||
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
|
||||
|
@@ -119,10 +119,10 @@ READ_LOCK_STATUS = TRUE
|
||||
|
||||
INF MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
||||
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
|
||||
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
|
||||
#
|
||||
# PI DXE Drivers producing Architectural Protocols (EFI Services)
|
||||
|
@@ -35,6 +35,9 @@
|
||||
|
||||
gArmVirtVariableGuid = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
|
||||
|
||||
[Protocols]
|
||||
gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
|
||||
|
||||
[PcdsFeatureFlag]
|
||||
#
|
||||
# Feature Flag PCD that defines whether TPM2 support is enabled
|
||||
|
@@ -59,7 +59,7 @@
|
||||
# Virtio Support
|
||||
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
|
||||
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
|
||||
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
|
||||
QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
|
||||
QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
|
||||
QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
|
||||
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
|
||||
@@ -77,19 +77,17 @@
|
||||
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
|
||||
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
|
||||
|
||||
!if $(TPM2_ENABLE) == TRUE
|
||||
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
|
||||
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
|
||||
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
|
||||
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
|
||||
!else
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
|
||||
!endif
|
||||
|
||||
[LibraryClasses.common.PEIM]
|
||||
@@ -249,7 +247,7 @@
|
||||
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
|
||||
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
|
||||
#
|
||||
# Set video resolution for boot options and for text setup.
|
||||
@@ -405,9 +403,9 @@
|
||||
#
|
||||
# Platform Driver
|
||||
#
|
||||
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
|
||||
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
|
||||
OvmfPkg/VirtioNetDxe/VirtioNet.inf
|
||||
@@ -489,12 +487,12 @@
|
||||
#
|
||||
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
|
||||
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
|
||||
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
|
||||
@@ -545,5 +543,5 @@
|
||||
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
|
||||
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
|
@@ -40,9 +40,9 @@ READ_LOCK_STATUS = TRUE
|
||||
|
||||
INF MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
||||
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
|
||||
#
|
||||
# PI DXE Drivers producing Architectural Protocols (EFI Services)
|
||||
|
@@ -57,7 +57,7 @@
|
||||
# Virtio Support
|
||||
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
|
||||
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
|
||||
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
|
||||
QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
|
||||
QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
|
||||
QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
|
||||
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
|
||||
@@ -75,12 +75,11 @@
|
||||
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
|
||||
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
|
||||
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
|
||||
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
|
||||
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
|
||||
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
|
||||
|
||||
[LibraryClasses.common.DXE_DRIVER]
|
||||
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||
@@ -228,7 +227,7 @@
|
||||
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
|
||||
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
|
||||
|
||||
#
|
||||
# Set video resolution for boot options and for text setup.
|
||||
@@ -340,9 +339,9 @@
|
||||
#
|
||||
# Platform Driver
|
||||
#
|
||||
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf
|
||||
ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
|
||||
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
ArmVirtPkg/HighMemDxe/HighMemDxe.inf
|
||||
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
|
||||
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
|
||||
OvmfPkg/VirtioNetDxe/VirtioNet.inf
|
||||
@@ -424,12 +423,12 @@
|
||||
#
|
||||
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
|
||||
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
|
||||
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
|
||||
@@ -460,5 +459,5 @@
|
||||
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
|
||||
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
|
||||
<LibraryClasses>
|
||||
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
|
||||
}
|
||||
|
@@ -50,7 +50,6 @@
|
||||
PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|
||||
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
|
||||
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
|
||||
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
|
||||
|
||||
[LibraryClasses.common.UEFI_DRIVER]
|
||||
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
|
||||
@@ -197,7 +196,7 @@
|
||||
# Platform Driver
|
||||
#
|
||||
ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
|
||||
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
|
||||
#
|
||||
# FAT filesystem + GPT/MBR partitioning + UDF filesystem
|
||||
|
@@ -139,7 +139,7 @@ READ_LOCK_STATUS = TRUE
|
||||
INF MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
||||
INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
|
||||
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
|
||||
INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
|
||||
|
||||
#
|
||||
# PI DXE Drivers producing Architectural Protocols (EFI Services)
|
||||
|
@@ -19,6 +19,7 @@
|
||||
FdtClientDxe.c
|
||||
|
||||
[Packages]
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
@@ -1,6 +1,5 @@
|
||||
/** @file
|
||||
* High memory node enumeration DXE driver for ARM and RISC-V
|
||||
* Virtual Machines
|
||||
* High memory node enumeration DXE driver for ARM Virtual Machines
|
||||
*
|
||||
* Copyright (c) 2015-2016, Linaro Ltd. All rights reserved.
|
||||
*
|
@@ -1,6 +1,5 @@
|
||||
## @file
|
||||
# High memory node enumeration DXE driver for ARM and RISC-V
|
||||
# Virtual Machines
|
||||
# High memory node enumeration DXE driver for ARM Virtual Machines
|
||||
#
|
||||
# Copyright (c) 2015-2016, Linaro Ltd. All rights reserved.
|
||||
#
|
||||
@@ -21,10 +20,10 @@
|
||||
HighMemDxe.c
|
||||
|
||||
[Packages]
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
@@ -30,7 +30,6 @@
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
[Protocols]
|
||||
|
@@ -22,7 +22,6 @@
|
||||
[Packages]
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
|
@@ -24,7 +24,6 @@
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
|
@@ -20,14 +20,15 @@
|
||||
# The following information is for reference only and not required by the build
|
||||
# tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = AARCH64 ARM RISCV64
|
||||
# VALID_ARCHITECTURES = AARCH64 ARM
|
||||
#
|
||||
|
||||
[Sources]
|
||||
FdtPciHostBridgeLib.c
|
||||
|
||||
[Packages]
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
@@ -42,11 +43,11 @@
|
||||
PciPcdProducerLib
|
||||
|
||||
[FixedPcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation
|
||||
gArmTokenSpaceGuid.PcdPciMmio32Translation
|
||||
gArmTokenSpaceGuid.PcdPciMmio64Translation
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
||||
|
||||
[Depex]
|
@@ -20,7 +20,8 @@
|
||||
FdtPciPcdProducerLib.c
|
||||
|
||||
[Packages]
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
@@ -34,7 +35,7 @@
|
||||
gFdtClientProtocolGuid ## CONSUMES
|
||||
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation ## PRODUCES
|
||||
gArmTokenSpaceGuid.PcdPciIoTranslation ## PRODUCES
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## PRODUCES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration ## PRODUCES
|
||||
|
@@ -21,7 +21,6 @@
|
||||
|
||||
[Packages]
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
PcAtChipsetPkg/PcAtChipsetPkg.dec
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
|
@@ -24,7 +24,6 @@
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
|
@@ -16,7 +16,6 @@
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/PlatformBmPrintScLib.h>
|
||||
#include <Library/QemuBootOrderLib.h>
|
||||
#include <Library/TpmPlatformHierarchyLib.h>
|
||||
#include <Library/UefiBootManagerLib.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/FirmwareVolume2.h>
|
||||
@@ -697,11 +696,6 @@ PlatformBootManagerBeforeConsole (
|
||||
//
|
||||
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
|
||||
|
||||
//
|
||||
// Disable the TPM 2 platform hierarchy
|
||||
//
|
||||
ConfigureTpmPlatformHierarchy ();
|
||||
|
||||
//
|
||||
// Dispatch deferred images after EndOfDxe event.
|
||||
//
|
||||
|
@@ -33,7 +33,6 @@
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
SecurityPkg/SecurityPkg.dec
|
||||
ShellPkg/ShellPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
@@ -48,7 +47,6 @@
|
||||
QemuBootOrderLib
|
||||
QemuLoadImageLib
|
||||
ReportStatusCodeLib
|
||||
TpmPlatformHierarchyLib
|
||||
UefiBootManagerLib
|
||||
UefiBootServicesTableLib
|
||||
UefiLib
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
Copyright (C) 2013 - 2014, Red Hat, Inc.
|
||||
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -240,7 +239,7 @@ MmioReadBytes (
|
||||
UINT8 *Ptr;
|
||||
UINT8 *End;
|
||||
|
||||
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||
#ifdef MDE_CPU_AARCH64
|
||||
Left = Size & 7;
|
||||
#else
|
||||
Left = Size & 3;
|
||||
@@ -250,7 +249,7 @@ MmioReadBytes (
|
||||
Ptr = Buffer;
|
||||
End = Ptr + Size;
|
||||
|
||||
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||
#ifdef MDE_CPU_AARCH64
|
||||
while (Ptr < End) {
|
||||
*(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
|
||||
Ptr += 8;
|
||||
@@ -323,7 +322,7 @@ DmaTransferBytes (
|
||||
//
|
||||
// This will fire off the transfer.
|
||||
//
|
||||
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||
#ifdef MDE_CPU_AARCH64
|
||||
MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
|
||||
#else
|
||||
MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
|
@@ -23,16 +23,16 @@
|
||||
# The following information is for reference only and not required by the build
|
||||
# tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = ARM AARCH64 RISCV64
|
||||
# VALID_ARCHITECTURES = ARM AARCH64
|
||||
#
|
||||
|
||||
[Sources]
|
||||
QemuFwCfgLibMmio.c
|
||||
QemuFwCfgLib.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
@@ -20,7 +20,7 @@
|
||||
VirtioFdtDxe.c
|
||||
|
||||
[Packages]
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
|
@@ -26,7 +26,6 @@
|
||||
|
||||
[Packages]
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
|
@@ -21,7 +21,6 @@
|
||||
|
||||
[Packages]
|
||||
ArmVirtPkg/ArmVirtPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
OvmfPkg/OvmfPkg.dec
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
## @file
|
||||
# Download GCC AARCH64 compiler from Arm's release site
|
||||
# Download GCC AARCH64 compiler from Linaro's release site
|
||||
# Set shell variable GCC5_AARCH64_INSTALL to this folder
|
||||
#
|
||||
# This is only downloaded when a build activates scope gcc_aarch64_linux
|
||||
@@ -11,11 +11,11 @@
|
||||
"scope": "gcc_aarch64_linux",
|
||||
"type": "web",
|
||||
"name": "gcc_aarch64_linux",
|
||||
"source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz",
|
||||
"version": "10.3-2021.07",
|
||||
"sha256": "1e33d53dea59c8de823bbdfe0798280bdcd138636c7060da9d77a97ded095a84",
|
||||
"source": "http://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz",
|
||||
"version": "7.4.1",
|
||||
"sha256": "27f1dc2c491ed61ae8f0d4b0c11de59cd2f7dd9c94761ee7153006fcac1bf9ab",
|
||||
"compression_type": "tar",
|
||||
"internal_path": "/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/",
|
||||
"internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/",
|
||||
"flags": ["set_shell_var", ],
|
||||
"var_name": "GCC5_AARCH64_INSTALL"
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
## @file
|
||||
# Download GCC ARM compiler from Arm's release site
|
||||
# Download GCC ARM compiler from Linaro's release site
|
||||
# Set shell variable GCC5_ARM_INSTALL to this folder
|
||||
#
|
||||
# This is only downloaded when a build activates scope gcc_arm_linux
|
||||
@@ -11,11 +11,11 @@
|
||||
"scope": "gcc_arm_linux",
|
||||
"type": "web",
|
||||
"name": "gcc_arm_linux",
|
||||
"source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.asc",
|
||||
"version": "10.3-2021.07",
|
||||
"sha256": "aa074fa8371a4f73fecbd16bd62c8b1945f23289e26414794f130d6ccdf8e39c",
|
||||
"source": "https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz",
|
||||
"version": "7.4.1",
|
||||
"sha256": "3C951CF1941D0FA06D64CC0D5E88612B209D8123B273FA26C16D70BD7BC6B163",
|
||||
"compression_type": "tar",
|
||||
"internal_path": "/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/",
|
||||
"internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/",
|
||||
"flags": ["set_shell_var", ],
|
||||
"var_name": "GCC5_ARM_INSTALL"
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
|
||||
return 0
|
||||
|
||||
# make GCC5_ARM_PREFIX to align with tools_def.txt
|
||||
prefix = os.path.join(install_path, "bin", "arm-none-linux-gnueabihf-")
|
||||
prefix = os.path.join(install_path, "bin", "arm-linux-gnueabihf-")
|
||||
shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix)
|
||||
|
||||
# now confirm it exists
|
||||
@@ -80,7 +80,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
|
||||
return 0
|
||||
|
||||
# make GCC5_AARCH64_PREFIX to align with tools_def.txt
|
||||
prefix = os.path.join(install_path, "bin", "aarch64-none-linux-gnu-")
|
||||
prefix = os.path.join(install_path, "bin", "aarch64-linux-gnu-")
|
||||
shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix)
|
||||
|
||||
# now confirm it exists
|
||||
|
@@ -142,7 +142,7 @@ class parser_lst(object):
|
||||
line.append(struct)
|
||||
unparse.append(line)
|
||||
else:
|
||||
if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:
|
||||
if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
|
||||
line = [offset, t_name, 0, uint]
|
||||
line.append(struct)
|
||||
unparse.append(line)
|
||||
@@ -569,7 +569,7 @@ class mainprocess(object):
|
||||
for i in List:
|
||||
for j in i:
|
||||
tmp = j.split("|")
|
||||
if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'):
|
||||
if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):
|
||||
tmp[0] = tmp[0][:tmp[0].index('[')]
|
||||
List[List.index(i)][i.index(j)] = "|".join(tmp)
|
||||
else:
|
||||
|
@@ -46,10 +46,7 @@ UPSTREAMS = [
|
||||
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-platforms'},
|
||||
{'name': 'edk2-non-osi',
|
||||
'repo': 'https://github.com/tianocore/edk2-non-osi.git',
|
||||
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'},
|
||||
{'name': 'edk2-test',
|
||||
'repo': 'https://github.com/tianocore/edk2-test.git',
|
||||
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-test'}
|
||||
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'}
|
||||
]
|
||||
|
||||
# The minimum version required for all of the below options to work
|
||||
|
Submodule BaseTools/Source/C/BrotliCompress/brotli updated: 666c3280cc...aa7b018dcb
@@ -1135,8 +1135,6 @@ CVfrVarDataTypeDB::DataTypeAddBitField (
|
||||
if (FieldName != NULL) {
|
||||
strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1);
|
||||
pNewField->mFieldName[MAX_NAME_LEN - 1] = 0;
|
||||
} else {
|
||||
strncpy (pNewField->mFieldName, "", MAX_NAME_LEN - 1);
|
||||
}
|
||||
pNewField->mFieldType = pFieldType;
|
||||
pNewField->mIsBitField = TRUE;
|
||||
@@ -3918,3 +3916,5 @@ CVfrStringDB::GetUnicodeStringTextSize (
|
||||
CVfrVarDataTypeDB gCVfrVarDataTypeDB;
|
||||
CVfrDefaultStore gCVfrDefaultStore;
|
||||
CVfrDataStorage gCVfrDataStorage;
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# Create makefile for MS nmake and GNU make
|
||||
#
|
||||
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
|
||||
@@ -177,11 +177,11 @@ class BuildFile(object):
|
||||
|
||||
MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH')
|
||||
if not MakePath:
|
||||
MakePath = AutoGenObject.ToolDefinition.get('MAKE', {}).get('PATH')
|
||||
if "nmake" in MakePath:
|
||||
self._FileType = ""
|
||||
elif "nmake" in MakePath:
|
||||
self._FileType = NMAKE_FILETYPE
|
||||
else:
|
||||
self._FileType = GMAKE_FILETYPE
|
||||
self._FileType = "gmake"
|
||||
|
||||
if sys.platform == "win32":
|
||||
self._Platform = WIN32_PLATFORM
|
||||
|
@@ -15,7 +15,6 @@ from Common.VariableAttributes import VariableAttributes
|
||||
from Common.Misc import *
|
||||
import collections
|
||||
import Common.DataType as DataType
|
||||
import Common.GlobalData as GlobalData
|
||||
|
||||
var_info = collections.namedtuple("uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default_value, default_value, data_type,PcdDscLine,StructurePcd")
|
||||
NvStorageHeaderSize = 28
|
||||
@@ -174,16 +173,11 @@ class VariableMgr(object):
|
||||
offset += VariableHeaderSize + len(default_info.var_name.split(","))
|
||||
var_data_offset[default_info.pcdindex] = offset
|
||||
offset += data_size - len(default_info.var_name.split(","))
|
||||
if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE":
|
||||
var_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
|
||||
else:
|
||||
var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
|
||||
|
||||
var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
|
||||
NvStoreDataBuffer += (var_header_buffer + DataBuffer)
|
||||
|
||||
if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE":
|
||||
variable_storage_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
|
||||
else:
|
||||
variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
|
||||
variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
|
||||
|
||||
nv_default_part = VariableMgr.AlignData(VariableMgr.PACK_DEFAULT_DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8)
|
||||
|
||||
@@ -258,20 +252,6 @@ class VariableMgr(object):
|
||||
|
||||
return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
|
||||
|
||||
def PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(size):
|
||||
#Signature: gEfiAuthenticatedVariableGuid
|
||||
Guid = "{ 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}"
|
||||
Guid = GuidStructureStringToGuidString(Guid)
|
||||
GuidBuffer = PackGUID(Guid.split('-'))
|
||||
|
||||
SizeBuffer = pack('=L', size)
|
||||
FormatBuffer = pack('=B', 0x5A)
|
||||
StateBuffer = pack('=B', 0xFE)
|
||||
reservedBuffer = pack('=H', 0)
|
||||
reservedBuffer += pack('=L', 0)
|
||||
|
||||
return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
|
||||
|
||||
@staticmethod
|
||||
def PACK_NV_STORE_DEFAULT_HEADER(size, maxsize):
|
||||
Signature = pack('=B', ord('N'))
|
||||
@@ -299,37 +279,6 @@ class VariableMgr(object):
|
||||
|
||||
return Buffer
|
||||
|
||||
@staticmethod
|
||||
def PACK_AUTHENTICATED_VARIABLE_HEADER(attribute, namesize, datasize, vendorguid):
|
||||
|
||||
Buffer = pack('=H', 0x55AA) # pack StartID
|
||||
Buffer += pack('=B', 0x3F) # pack State
|
||||
Buffer += pack('=B', 0) # pack reserved
|
||||
|
||||
Buffer += pack('=L', attribute)
|
||||
|
||||
Buffer += pack('=Q', 0) # pack MonotonicCount
|
||||
Buffer += pack('=HBBBBBBLhBB', # pack TimeStamp
|
||||
0, # UINT16 Year
|
||||
0, # UINT8 Month
|
||||
0, # UINT8 Day
|
||||
0, # UINT8 Hour
|
||||
0, # UINT8 Minute
|
||||
0, # UINT8 Second
|
||||
0, # UINT8 Pad1
|
||||
0, # UINT32 Nanosecond
|
||||
0, # INT16 TimeZone
|
||||
0, # UINT8 Daylight
|
||||
0) # UINT8 Pad2
|
||||
Buffer += pack('=L', 0) # pack PubKeyIndex
|
||||
|
||||
Buffer += pack('=L', namesize)
|
||||
Buffer += pack('=L', datasize)
|
||||
|
||||
Buffer += PackGUID(vendorguid)
|
||||
|
||||
return Buffer
|
||||
|
||||
@staticmethod
|
||||
def PACK_VARIABLES_DATA(var_value,data_type, tail = None):
|
||||
Buffer = bytearray()
|
||||
|
@@ -254,6 +254,7 @@ class ModuleAutoGen(AutoGen):
|
||||
self.AutoGenDepSet = set()
|
||||
self.ReferenceModules = []
|
||||
self.ConstPcd = {}
|
||||
self.Makefile = None
|
||||
self.FileDependCache = {}
|
||||
|
||||
def __init_platform_info__(self):
|
||||
|
@@ -406,7 +406,6 @@ TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
|
||||
TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION'
|
||||
TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX = 'PCD_DYNAMIC_AS_DYNAMICEX'
|
||||
TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION'
|
||||
TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE = 'VPD_AUTHENTICATED_VARIABLE_STORE'
|
||||
TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
|
||||
TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
|
||||
TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
|
||||
|
@@ -105,7 +105,7 @@ class Ecc(object):
|
||||
|
||||
def InitDefaultConfigIni(self):
|
||||
paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)
|
||||
paths = (os.path.abspath('config.ini'),) + tuple(paths)
|
||||
paths = (os.path.realpath('config.ini'),) + tuple(paths)
|
||||
for path in paths:
|
||||
if os.path.exists(path):
|
||||
self.ConfigFile = path
|
||||
|
@@ -152,11 +152,11 @@ class CompressedImage(Image):
|
||||
try:
|
||||
TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
|
||||
DecData = array('B')
|
||||
DecData.fromstring(TmpData)
|
||||
DecData.frombytes(TmpData)
|
||||
except:
|
||||
TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
|
||||
DecData = array('B')
|
||||
DecData.fromstring(TmpData)
|
||||
DecData.frombytes(TmpData)
|
||||
|
||||
SectionList = []
|
||||
Offset = 0
|
||||
@@ -196,7 +196,7 @@ class Ui(Image):
|
||||
return len(self)
|
||||
|
||||
def _GetUiString(self):
|
||||
return codecs.utf_16_decode(self[0:-2].tostring())[0]
|
||||
return codecs.utf_16_decode(self[0:-2].tobytes())[0]
|
||||
|
||||
String = property(_GetUiString)
|
||||
|
||||
@@ -738,7 +738,7 @@ class GuidDefinedImage(Image):
|
||||
Offset = self.DataOffset - 4
|
||||
TmpData = DeCompress('Framework', self[self.Offset:])
|
||||
DecData = array('B')
|
||||
DecData.fromstring(TmpData)
|
||||
DecData.frombytes(TmpData)
|
||||
Offset = 0
|
||||
while Offset < len(DecData):
|
||||
Sec = Section()
|
||||
@@ -759,7 +759,7 @@ class GuidDefinedImage(Image):
|
||||
|
||||
TmpData = DeCompress('Lzma', self[self.Offset:])
|
||||
DecData = array('B')
|
||||
DecData.fromstring(TmpData)
|
||||
DecData.frombytes(TmpData)
|
||||
Offset = 0
|
||||
while Offset < len(DecData):
|
||||
Sec = Section()
|
||||
|
@@ -707,8 +707,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
||||
FileName,
|
||||
'DEBUG'
|
||||
)
|
||||
OutputPath = os.path.abspath(OutputPath)
|
||||
DebugPath = os.path.abspath(DebugPath)
|
||||
OutputPath = os.path.realpath(OutputPath)
|
||||
DebugPath = os.path.realpath(DebugPath)
|
||||
return OutputPath, DebugPath
|
||||
|
||||
## __GenSimpleFileSection__() method
|
||||
|
@@ -20,7 +20,7 @@ from linecache import getlines
|
||||
from io import BytesIO
|
||||
|
||||
import Common.LongFilePathOs as os
|
||||
from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile
|
||||
from Common.TargetTxtClassObject import TargetTxtDict
|
||||
from Common.DataType import *
|
||||
import Common.GlobalData as GlobalData
|
||||
from Common import EdkLogger
|
||||
@@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
|
||||
FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
|
||||
|
||||
if FdfFilename[0:2] == '..':
|
||||
FdfFilename = os.path.abspath(FdfFilename)
|
||||
FdfFilename = os.path.realpath(FdfFilename)
|
||||
if not os.path.isabs(FdfFilename):
|
||||
FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
|
||||
if not os.path.exists(FdfFilename):
|
||||
@@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
|
||||
ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
|
||||
|
||||
if ActivePlatform[0:2] == '..':
|
||||
ActivePlatform = os.path.abspath(ActivePlatform)
|
||||
ActivePlatform = os.path.realpath(ActivePlatform)
|
||||
|
||||
if not os.path.isabs (ActivePlatform):
|
||||
ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
|
||||
@@ -207,7 +207,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
|
||||
GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
|
||||
if not GlobalData.gConfDirectory:
|
||||
GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir
|
||||
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))
|
||||
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
|
||||
if os.path.isfile(BuildConfigurationFile) == True:
|
||||
# if no build target given in command line, get it from target.txt
|
||||
TargetObj = TargetTxtDict()
|
||||
@@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
|
||||
for Key in GenFdsGlobalVariable.OutputDirDict:
|
||||
OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]
|
||||
if OutputDir[0:2] == '..':
|
||||
OutputDir = os.path.abspath(OutputDir)
|
||||
OutputDir = os.path.realpath(OutputDir)
|
||||
|
||||
if OutputDir[1] != ':':
|
||||
OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)
|
||||
|
@@ -24,7 +24,7 @@ from Common import EdkLogger
|
||||
from Common.Misc import SaveFileOnChange
|
||||
|
||||
from Common.TargetTxtClassObject import TargetTxtDict
|
||||
from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile
|
||||
from Common.ToolDefClassObject import ToolDefDict
|
||||
from AutoGen.BuildEngine import ToolBuildRule
|
||||
import Common.DataType as DataType
|
||||
from Common.Misc import PathClass,CreateDirectory
|
||||
@@ -103,7 +103,7 @@ class GenFdsGlobalVariable:
|
||||
TargetObj = TargetTxtDict()
|
||||
ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||
if ToolDefinitionFile == '':
|
||||
ToolDefinitionFile = os.path.join('Conf', gDefaultToolsDefFile)
|
||||
ToolDefinitionFile = "Conf/tools_def.txt"
|
||||
if os.path.isfile(ToolDefinitionFile):
|
||||
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
|
||||
|
@@ -17,7 +17,6 @@ import Common.BuildToolError as BuildToolError
|
||||
from Common.DataType import *
|
||||
from Common.BuildVersion import gBUILD_VERSION
|
||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||
from Common.TargetTxtClassObject import gDefaultTargetTxtFile
|
||||
|
||||
# To Do 1.set clean, 2. add item, if the line is disabled.
|
||||
|
||||
@@ -26,7 +25,7 @@ class TargetTool():
|
||||
self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE'))
|
||||
self.Opt = opt
|
||||
self.Arg = args[0]
|
||||
self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', gDefaultTargetTxtFile))
|
||||
self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', 'target.txt'))
|
||||
if os.path.isfile(self.FileName) == False:
|
||||
print("%s does not exist." % self.FileName)
|
||||
sys.exit(1)
|
||||
|
@@ -590,6 +590,7 @@ class PackageBuildClassObject(BuildData):
|
||||
# @var OutputDirectory: To store value for OutputDirectory
|
||||
# @var FlashDefinition: To store value for FlashDefinition
|
||||
# @var BuildNumber: To store value for BuildNumber
|
||||
# @var MakefileName: To store value for MakefileName
|
||||
# @var SkuIds: To store value for SkuIds, it is a set structure as
|
||||
# { 'SkuName' : SkuId, '!include' : includefilename, ...}
|
||||
# @var Modules: To store value for Modules, it is a list structure as
|
||||
@@ -613,6 +614,7 @@ class PlatformBuildClassObject(BuildData):
|
||||
self.OutputDirectory = ''
|
||||
self.FlashDefinition = ''
|
||||
self.BuildNumber = ''
|
||||
self.MakefileName = ''
|
||||
|
||||
self.SkuIds = {}
|
||||
self.Modules = []
|
||||
|
@@ -19,8 +19,8 @@ from Common.Misc import *
|
||||
from types import *
|
||||
from Common.Expression import *
|
||||
from CommonDataClass.CommonClass import SkuInfoClass
|
||||
from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile
|
||||
from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile
|
||||
from Common.TargetTxtClassObject import TargetTxtDict
|
||||
from Common.ToolDefClassObject import ToolDefDict
|
||||
from .MetaDataTable import *
|
||||
from .MetaFileTable import *
|
||||
from .MetaFileParser import *
|
||||
@@ -387,10 +387,6 @@ class DscBuildData(PlatformBuildClassObject):
|
||||
for i in range(0, len(LanguageCodes), 3):
|
||||
LanguageList.append(LanguageCodes[i:i + 3])
|
||||
self._ISOLanguages = LanguageList
|
||||
elif Name == TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE:
|
||||
if TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE not in gCommandLineDefines:
|
||||
gCommandLineDefines[TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE] = Record[2].strip()
|
||||
|
||||
elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID:
|
||||
#
|
||||
# try to convert GUID to a real UUID value to see whether the GUID is format
|
||||
@@ -3530,11 +3526,12 @@ class DscBuildData(PlatformBuildClassObject):
|
||||
self._ToolChainFamily = TAB_COMPILER_MSFT
|
||||
TargetObj = TargetTxtDict()
|
||||
TargetTxt = TargetObj.Target
|
||||
BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, gDefaultTargetTxtFile))
|
||||
BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt"))
|
||||
if os.path.isfile(BuildConfigurationFile) == True:
|
||||
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||
if ToolDefinitionFile == '':
|
||||
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', gDefaultToolsDefFile))
|
||||
ToolDefinitionFile = "tools_def.txt"
|
||||
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
|
||||
if os.path.isfile(ToolDefinitionFile) == True:
|
||||
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
|
||||
# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@@ -67,6 +67,10 @@ from AutoGen.AutoGen import CalculatePriorityValue
|
||||
## standard targets of build command
|
||||
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
|
||||
|
||||
## build configuration file
|
||||
gBuildConfiguration = "target.txt"
|
||||
gToolsDefinition = "tools_def.txt"
|
||||
|
||||
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
|
||||
TmpTableDict = {}
|
||||
|
||||
@@ -1304,9 +1308,6 @@ class Build():
|
||||
if Target == 'run':
|
||||
return True
|
||||
|
||||
# Fetch the MakeFileName.
|
||||
self.MakeFileName = AutoGenObject.MakeFileName
|
||||
|
||||
# build modules
|
||||
if BuildModule:
|
||||
BuildCommand = BuildCommand + [Target]
|
||||
@@ -2182,6 +2183,8 @@ class Build():
|
||||
Pa.CreateLibModuelDirs()
|
||||
# Fetch the MakeFileName.
|
||||
self.MakeFileName = Pa.MakeFileName
|
||||
if not self.MakeFileName:
|
||||
self.MakeFileName = Pa.MakeFile
|
||||
|
||||
Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
|
||||
Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}
|
||||
|
@@ -864,11 +864,15 @@ Pkcs7Verify (
|
||||
// For generic PKCS#7 handling, InData may be NULL if the content is present
|
||||
// in PKCS#7 structure. So ignore NULL checking here.
|
||||
//
|
||||
DataBio = BIO_new_mem_buf (InData, (int) DataLength);
|
||||
DataBio = BIO_new (BIO_s_mem ());
|
||||
if (DataBio == NULL) {
|
||||
goto _Exit;
|
||||
}
|
||||
|
||||
if (BIO_write (DataBio, InData, (int) DataLength) <= 0) {
|
||||
goto _Exit;
|
||||
}
|
||||
|
||||
//
|
||||
// Allow partial certificate chains, terminated by a non-self-signed but
|
||||
// still trusted intermediate certificate. Also disable time checks.
|
||||
|
Submodule CryptoPkg/Library/OpensslLib/openssl updated: 52c587d60b...e2e09d9fba
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Dsc include file for Dynamic Tables Framework.
|
||||
#
|
||||
# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@@ -13,7 +13,6 @@
|
||||
RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
|
||||
|
||||
[LibraryClasses.common]
|
||||
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
||||
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
||||
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
||||
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
||||
@@ -37,9 +36,6 @@
|
||||
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
|
||||
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
|
||||
|
||||
# AML Codegen
|
||||
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
|
||||
|
||||
#
|
||||
# Dynamic Table Factory Dxe
|
||||
#
|
||||
@@ -59,9 +55,6 @@
|
||||
# AML Fixup
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
|
||||
|
||||
# AML Codegen
|
||||
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
|
||||
}
|
||||
|
||||
#
|
||||
|
@@ -5,28 +5,6 @@
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
{
|
||||
"EccCheck": {
|
||||
## Exception sample looks like below:
|
||||
## "ExceptionList": [
|
||||
## "<ErrorID>", "<KeyWord>"
|
||||
## ]
|
||||
"ExceptionList": [
|
||||
# "The #ifndef at the start of an include file should use
|
||||
# both prefix and postfix underscore characters, '_'"
|
||||
# This error is not triggered for the latest BaseTools code.
|
||||
# @TODO The error should be re-enabled when the python packages
|
||||
# containing the BaseTools are updated to the latest version.
|
||||
"8003", "DISABLE_NEW_DEPRECATED_INTERFACES",
|
||||
"9005", "@defgroup", # Use extra Doxygen commands
|
||||
"9005", "@ingroup", # Use extra Doxygen commands
|
||||
"9005", "@mainpage", # Use extra Doxygen commands
|
||||
"9005", "@ref", # Use extra Doxygen commands
|
||||
],
|
||||
## Both file path and directory path are accepted.
|
||||
"IgnoreFiles": [
|
||||
]
|
||||
},
|
||||
|
||||
## options defined .pytool/Plugin/CompilerPlugin
|
||||
"CompilerPlugin": {
|
||||
"DscPath": "DynamicTablesPkg.dsc"
|
||||
@@ -45,7 +23,6 @@
|
||||
## options defined .pytool/Plugin/DependencyCheck
|
||||
"DependencyCheck": {
|
||||
"AcceptableDependencies": [
|
||||
"ArmPkg/ArmPkg.dec",
|
||||
"ArmPlatformPkg/ArmPlatformPkg.dec",
|
||||
"EmbeddedPkg/EmbeddedPkg.dec",
|
||||
"DynamicTablesPkg/DynamicTablesPkg.dec",
|
||||
@@ -100,25 +77,19 @@
|
||||
"CCIDX",
|
||||
"CCSIDR",
|
||||
"countof",
|
||||
"edynamic",
|
||||
"EOBJECT",
|
||||
"invoc",
|
||||
"ITARGETSR",
|
||||
"GTBLOCK",
|
||||
"lgreater",
|
||||
"lless",
|
||||
"MPIDR",
|
||||
"PERIPHBASE",
|
||||
"phandle",
|
||||
"pytool",
|
||||
"Rdword",
|
||||
"Roadmap",
|
||||
"ROOTNODEBASE",
|
||||
"ssdtcmn",
|
||||
"ssdtserialporttemplate",
|
||||
"SMMUV",
|
||||
"ssdtpcieosctemplate",
|
||||
"SSDTPC",
|
||||
"standardised",
|
||||
"TABLEEX",
|
||||
"TNSID",
|
||||
|
@@ -17,10 +17,6 @@
|
||||
Include
|
||||
|
||||
[LibraryClasses]
|
||||
## @libraryclass Defines a set of Acpi helper methods
|
||||
# independent from the Dynamic Tables Framework.
|
||||
AcpiHelperLib|Include/Library/AcpiHelperLib.h
|
||||
|
||||
## @libraryclass Defines a set of APIs for Dynamic AML generation.
|
||||
AmlLib|Include/Library/AmlLib/AmlLib.h
|
||||
|
||||
|
@@ -35,11 +35,9 @@
|
||||
|
||||
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
||||
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
|
||||
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
|
||||
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
|
||||
|
||||
[Components.common]
|
||||
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
|
||||
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
|
||||
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
|
||||
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
|
||||
@@ -52,3 +50,4 @@
|
||||
# Inhibit C6305: Potential mismatch between sizeof and countof quantities.
|
||||
*_VS2017_*_CC_FLAGS = /wd6305 /analyze
|
||||
!endif
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -63,10 +63,6 @@ The Dynamic Tables Framework implements the following ACPI table generators:
|
||||
The SSDT CMN-600 generator collates the CMN-600 information
|
||||
from the Configuration Manager and patches the SSDT CMN-600
|
||||
template to build the SSDT CMN-600 table.
|
||||
- SSDT Cpu-Topology:
|
||||
The SSDT Cpu-Topology generator collates the cpu and LPI
|
||||
information from the Configuration Manager and generates a
|
||||
SSDT table describing the CPU hierarchy.
|
||||
*/
|
||||
|
||||
/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
|
||||
@@ -92,7 +88,6 @@ typedef enum StdAcpiTableId {
|
||||
EStdAcpiTableIdSrat, ///< SRAT Generator
|
||||
EStdAcpiTableIdSsdtSerialPort, ///< SSDT Serial-Port Generator
|
||||
EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Generator
|
||||
EStdAcpiTableIdSsdtCpuTopology, ///< SSDT Cpu Topology
|
||||
EStdAcpiTableIdMax
|
||||
} ESTD_ACPI_TABLE_ID;
|
||||
|
||||
|
@@ -58,7 +58,6 @@ typedef enum ArmObjectID {
|
||||
EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
|
||||
EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info
|
||||
EArmObjCmn600Info, ///< 36 - CMN-600 Info
|
||||
EArmObjLpiInfo, ///< 37 - Lpi Info
|
||||
EArmObjMax
|
||||
} EARM_OBJECT_ID;
|
||||
|
||||
@@ -396,21 +395,21 @@ typedef struct CmArmGTBlockInfo {
|
||||
} CM_ARM_GTBLOCK_INFO;
|
||||
|
||||
/** A structure that describes the
|
||||
Arm Generic Watchdog information for the Platform.
|
||||
SBSA Generic Watchdog information for the Platform.
|
||||
|
||||
ID: EArmObjPlatformGenericWatchdogInfo
|
||||
*/
|
||||
typedef struct CmArmGenericWatchdogInfo {
|
||||
/// The physical base address of the Arm Watchdog control frame
|
||||
/// The physical base address of the SBSA Watchdog control frame
|
||||
UINT64 ControlFrameAddress;
|
||||
|
||||
/// The physical base address of the Arm Watchdog refresh frame
|
||||
/// The physical base address of the SBSA Watchdog refresh frame
|
||||
UINT64 RefreshFrameAddress;
|
||||
|
||||
/// The watchdog interrupt
|
||||
UINT32 TimerGSIV;
|
||||
|
||||
/** The flags for the watchdog as described by the Arm watchdog
|
||||
/** The flags for the watchdog as described by the SBSA watchdog
|
||||
structure in the ACPI specification.
|
||||
*/
|
||||
UINT32 Flags;
|
||||
@@ -712,10 +711,6 @@ typedef struct CmArmProcHierarchyInfo {
|
||||
/// the NoOfPrivateResources is 0, in which case it is recommended to set
|
||||
/// this field to CM_NULL_TOKEN.
|
||||
CM_OBJECT_TOKEN PrivateResourcesArrayToken;
|
||||
/// Optional field: Reference Token for the Lpi state of this processor.
|
||||
/// Token identifying a CM_ARM_OBJ_REF structure, itself referencing
|
||||
/// CM_ARM_LPI_INFO objects.
|
||||
CM_OBJECT_TOKEN LpiToken;
|
||||
} CM_ARM_PROC_HIERARCHY_INFO;
|
||||
|
||||
/** A structure that describes the Cache Type Structure (Type 1) in PPTT
|
||||
@@ -883,69 +878,6 @@ typedef struct CmArmCmn600Info {
|
||||
CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4];
|
||||
} CM_ARM_CMN_600_INFO;
|
||||
|
||||
/** A structure that describes the Lpi information.
|
||||
|
||||
The Low Power Idle states are described in DSDT/SSDT and associated
|
||||
to cpus/clusters in the cpu topology.
|
||||
|
||||
ID: EArmObjLpiInfo
|
||||
*/
|
||||
typedef struct CmArmLpiInfo {
|
||||
/** Minimum Residency. Time in microseconds after which a
|
||||
state becomes more energy efficient than any shallower state.
|
||||
*/
|
||||
UINT32 MinResidency;
|
||||
|
||||
/** Worst case time in microseconds from a wake interrupt
|
||||
being asserted to the return to a running state
|
||||
*/
|
||||
UINT32 WorstCaseWakeLatency;
|
||||
|
||||
/** Flags.
|
||||
*/
|
||||
UINT32 Flags;
|
||||
|
||||
/** Architecture specific context loss flags.
|
||||
*/
|
||||
UINT32 ArchFlags;
|
||||
|
||||
/** Residency counter frequency in cycles-per-second (Hz).
|
||||
*/
|
||||
UINT32 ResCntFreq;
|
||||
|
||||
/** Every shallower power state in the parent is also enabled.
|
||||
*/
|
||||
UINT32 EnableParentState;
|
||||
|
||||
/** The EntryMethod _LPI field can be described as an integer
|
||||
or in a Register resource data descriptor.
|
||||
|
||||
If IsInteger is TRUE, the IntegerEntryMethod field is used.
|
||||
If IsInteger is FALSE, the RegisterEntryMethod field is used.
|
||||
*/
|
||||
BOOLEAN IsInteger;
|
||||
|
||||
/** EntryMethod described as an Integer.
|
||||
*/
|
||||
UINT64 IntegerEntryMethod;
|
||||
|
||||
/** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.
|
||||
*/
|
||||
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE RegisterEntryMethod;
|
||||
|
||||
/** Residency counter register.
|
||||
*/
|
||||
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResidencyCounterRegister;
|
||||
|
||||
/** Usage counter register.
|
||||
*/
|
||||
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE UsageCounterRegister;
|
||||
|
||||
/** String representing the Lpi state
|
||||
*/
|
||||
CHAR8 StateName[16];
|
||||
} CM_ARM_LPI_INFO;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif // ARM_NAMESPACE_OBJECTS_H_
|
||||
|
@@ -1,93 +0,0 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#ifndef ACPI_HELPER_LIB_H_
|
||||
#define ACPI_HELPER_LIB_H_
|
||||
|
||||
/** Is a character upper case
|
||||
*/
|
||||
#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
|
||||
|
||||
/** Is a character a decimal digit
|
||||
*/
|
||||
#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
|
||||
|
||||
/** Is a character an upper case hexadecimal digit
|
||||
*/
|
||||
#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
|
||||
|
||||
/** Convert a hex number to its ASCII code.
|
||||
|
||||
@param [in] Hex Hex number to convert.
|
||||
Must be 0 <= x < 16.
|
||||
|
||||
@return The ASCII code corresponding to x.
|
||||
-1 if error.
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
AsciiFromHex (
|
||||
IN UINT8 Hex
|
||||
);
|
||||
|
||||
/** Convert an ASCII char representing an hexadecimal number
|
||||
to its integer value.
|
||||
|
||||
@param [in] Char Char to convert.
|
||||
Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
|
||||
|
||||
@return The corresponding integer (between 0-16).
|
||||
-1 if error.
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
HexFromAscii (
|
||||
IN CHAR8 Char
|
||||
);
|
||||
|
||||
/** Check if a HID is a valid PNP ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid PNP ID.
|
||||
@retval FALSE The Hid is not a valid PNP ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidPnpId (
|
||||
IN CONST CHAR8 * Hid
|
||||
);
|
||||
|
||||
/** Check if a HID is a valid ACPI ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid ACPI ID.
|
||||
@retval FALSE The Hid is not a valid ACPI ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidAcpiId (
|
||||
IN CONST CHAR8 * Hid
|
||||
);
|
||||
|
||||
/** Convert a EisaId string to its compressed UINT32 equivalent.
|
||||
|
||||
Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
|
||||
|
||||
@param [in] EisaIdStr Input EisaId string.
|
||||
@param [out] EisaIdInt Output EisaId UINT32 (compressed).
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlGetEisaIdFromString (
|
||||
IN CONST CHAR8 * EisaIdStr,
|
||||
OUT UINT32 * EisaIdInt
|
||||
);
|
||||
|
||||
#endif // ACPI_HELPER_LIB_H_
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
AML Lib.
|
||||
|
||||
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -301,7 +301,7 @@ AmlNameOpUpdateString (
|
||||
IN CONST CHAR8 * NewName
|
||||
);
|
||||
|
||||
/** Get the first Resource Data element contained in a named object.
|
||||
/** Get the first Resource Data element contained in a "_CRS" object.
|
||||
|
||||
In the following ASL code, the function will return the Resource Data
|
||||
node corresponding to the "QWordMemory ()" ASL macro.
|
||||
@@ -312,26 +312,27 @@ AmlNameOpUpdateString (
|
||||
)
|
||||
|
||||
Note:
|
||||
"_CRS" names defined as methods are not handled by this function.
|
||||
They must be defined as names, using the "Name ()" statement.
|
||||
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
|
||||
- "_CRS" declared using ASL "Method (Declare Control Method)" is not
|
||||
supported.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] NameOpNode NameOp object node defining a named object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the named object. A Resource Data element
|
||||
is stored in a data node.
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the "_CRS" object. A Resource Data element
|
||||
is stored in a data node.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpNode,
|
||||
AmlNameOpCrsGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
);
|
||||
|
||||
@@ -346,14 +347,13 @@ AmlNameOpGetFirstRdNode (
|
||||
}
|
||||
)
|
||||
|
||||
Note:
|
||||
"_CRS" names defined as methods are not handled by this function.
|
||||
They must be defined as names, using the "Name ()" statement.
|
||||
The CurrRdNode Resource Data node must be defined in an object named "_CRS"
|
||||
and defined by a "Name ()" ASL function.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] CurrRdNode Pointer to the current Resource Data element of
|
||||
the named object.
|
||||
the "_CRS" variable.
|
||||
@param [out] OutRdNode Pointer to the Resource Data element following
|
||||
the CurrRdNode.
|
||||
Contain a NULL pointer if CurrRdNode is the
|
||||
@@ -366,7 +366,7 @@ AmlNameOpGetFirstRdNode (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpGetNextRdNode (
|
||||
AmlNameOpCrsGetNextRdNode (
|
||||
IN AML_DATA_NODE_HANDLE CurrRdNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
);
|
||||
@@ -418,21 +418,36 @@ AmlUpdateRdQWord (
|
||||
IN UINT64 BaseAddressLength
|
||||
);
|
||||
|
||||
/** Code generation for the "Interrupt ()" ASL function.
|
||||
/** Add an Interrupt Resource Data node.
|
||||
|
||||
This function creates a Resource Data element corresponding to the
|
||||
"Interrupt ()" ASL function, stores it in an AML Data Node.
|
||||
|
||||
It then adds it after the input CurrRdNode in the list of resource data
|
||||
element.
|
||||
|
||||
The Resource Data effectively created is an Extended Interrupt Resource
|
||||
Data. Cf ACPI 6.4:
|
||||
- s6.4.3.6 "Extended Interrupt Descriptor"
|
||||
- s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"
|
||||
Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
|
||||
for more information about Extended Interrupt Resource Data.
|
||||
|
||||
The created resource data node can be:
|
||||
- appended to the list of resource data elements of the NameOpNode.
|
||||
In such case NameOpNode must be defined by a the "Name ()" ASL statement
|
||||
and initially contain a "ResourceTemplate ()".
|
||||
- returned through the NewRdNode parameter.
|
||||
The Extended Interrupt contains one single interrupt.
|
||||
|
||||
@ingroup CodeGenApis
|
||||
This function allocates memory to create a data node. It is the caller's
|
||||
responsibility to either:
|
||||
- attach this node to an AML tree;
|
||||
- delete this node.
|
||||
|
||||
Note: The _CRS node must be defined using the ASL Name () function.
|
||||
e.g. Name (_CRS, ResourceTemplate () {
|
||||
...
|
||||
}
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [in] ResourceConsumer The device consumes the specified interrupt
|
||||
or produces it for use by a child device.
|
||||
@param [in] EdgeTriggered The interrupt is edge triggered or
|
||||
@@ -442,12 +457,7 @@ AmlUpdateRdQWord (
|
||||
devices or not (Exclusive).
|
||||
@param [in] IrqList Interrupt list. Must be non-NULL.
|
||||
@param [in] IrqCount Interrupt count. Must be non-zero.
|
||||
@param [in] NameOpNode NameOp object node defining a named object.
|
||||
If provided, append the new resource data node
|
||||
to the list of resource data elements of this
|
||||
node.
|
||||
@param [out] NewRdNode If provided and success,
|
||||
contain the created node.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@@ -455,15 +465,14 @@ AmlUpdateRdQWord (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlCodeGenRdInterrupt (
|
||||
AmlCodeGenCrsAddRdInterrupt (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
IN BOOLEAN ResourceConsumer,
|
||||
IN BOOLEAN EdgeTriggered,
|
||||
IN BOOLEAN ActiveLow,
|
||||
IN BOOLEAN Shared,
|
||||
IN UINT32 *IrqList,
|
||||
IN UINT8 IrqCount,
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
|
||||
OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL
|
||||
IN UINT32 * IrqList,
|
||||
IN UINT8 IrqCount
|
||||
);
|
||||
|
||||
/** AML code generation for DefinitionBlock.
|
||||
@@ -619,310 +628,4 @@ AmlCodeGenScope (
|
||||
OUT AML_OBJECT_NODE_HANDLE * NewObjectNode OPTIONAL
|
||||
);
|
||||
|
||||
/** AML code generation for a method returning a NameString.
|
||||
|
||||
AmlCodeGenMethodRetNameString (
|
||||
"MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode
|
||||
);
|
||||
is equivalent of the following ASL code:
|
||||
Method(MET0, 1, Serialized, 3) {
|
||||
Return (_CRS)
|
||||
}
|
||||
|
||||
The ASL parameters "ReturnType" and "ParameterTypes" are not asked
|
||||
in this function. They are optional parameters in ASL.
|
||||
|
||||
@ingroup CodeGenApis
|
||||
|
||||
@param [in] MethodNameString The new Method's name.
|
||||
Must be a NULL-terminated ASL NameString
|
||||
e.g.: "MET0", "_SB.MET0", etc.
|
||||
The input string is copied.
|
||||
@param [in] ReturnedNameString The name of the object returned by the
|
||||
method. Optional parameter, can be:
|
||||
- NULL (ignored).
|
||||
- A NULL-terminated ASL NameString.
|
||||
e.g.: "MET0", "_SB.MET0", etc.
|
||||
The input string is copied.
|
||||
@param [in] NumArgs Number of arguments.
|
||||
Must be 0 <= NumArgs <= 6.
|
||||
@param [in] IsSerialized TRUE is equivalent to Serialized.
|
||||
FALSE is equivalent to NotSerialized.
|
||||
Default is NotSerialized in ASL spec.
|
||||
@param [in] SyncLevel Synchronization level for the method.
|
||||
Must be 0 <= SyncLevel <= 15.
|
||||
Default is 0 in ASL.
|
||||
@param [in] ParentNode If provided, set ParentNode as the parent
|
||||
of the node created.
|
||||
@param [out] NewObjectNode If success, contains the created node.
|
||||
|
||||
@retval EFI_SUCCESS Success.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlCodeGenMethodRetNameString (
|
||||
IN CONST CHAR8 * MethodNameString,
|
||||
IN CONST CHAR8 * ReturnedNameString, OPTIONAL
|
||||
IN UINT8 NumArgs,
|
||||
IN BOOLEAN IsSerialized,
|
||||
IN UINT8 SyncLevel,
|
||||
IN AML_NODE_HANDLE ParentNode, OPTIONAL
|
||||
OUT AML_OBJECT_NODE_HANDLE * NewObjectNode OPTIONAL
|
||||
);
|
||||
|
||||
/** Create a _LPI name.
|
||||
|
||||
AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is
|
||||
equivalent of the following ASL code:
|
||||
Name (_LPI, Package (
|
||||
0, // Revision
|
||||
1, // LevelId
|
||||
0 // Count
|
||||
))
|
||||
|
||||
This function doesn't define any LPI state. As shown above, the count
|
||||
of _LPI state is set to 0.
|
||||
The AmlAddLpiState () function must be used to add LPI states.
|
||||
|
||||
Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
|
||||
|
||||
@ingroup CodeGenApis
|
||||
|
||||
@param [in] LpiNameString The new LPI 's object name.
|
||||
Must be a NULL-terminated ASL NameString
|
||||
e.g.: "_LPI", "DEV0.PLPI", etc.
|
||||
The input string is copied.
|
||||
@param [in] Revision Revision number of the _LPI states.
|
||||
@param [in] LevelId A platform defined number that identifies the
|
||||
level of hierarchy of the processor node to
|
||||
which the LPI states apply.
|
||||
@param [in] ParentNode If provided, set ParentNode as the parent
|
||||
of the node created.
|
||||
@param [out] NewLpiNode If success, contains the created node.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlCreateLpiNode (
|
||||
IN CONST CHAR8 * LpiNameString,
|
||||
IN UINT16 Revision,
|
||||
IN UINT64 LevelId,
|
||||
IN AML_NODE_HANDLE ParentNode, OPTIONAL
|
||||
OUT AML_OBJECT_NODE_HANDLE * NewLpiNode OPTIONAL
|
||||
);
|
||||
|
||||
/** Add an _LPI state to a LPI node created using AmlCreateLpiNode ().
|
||||
|
||||
AmlAddLpiState () increments the Count of LPI states in the LPI node by one,
|
||||
and adds the following package:
|
||||
Package() {
|
||||
MinResidency,
|
||||
WorstCaseWakeLatency,
|
||||
Flags,
|
||||
ArchFlags,
|
||||
ResCntFreq,
|
||||
EnableParentState,
|
||||
(GenericRegisterDescriptor != NULL) ? // Entry method. If a
|
||||
ResourceTemplate(GenericRegisterDescriptor) : // Register is given,
|
||||
Integer, // use it. Use the
|
||||
// Integer otherwise.
|
||||
ResourceTemplate() { // NULL Residency Counter
|
||||
Register (SystemMemory, 0, 0, 0, 0)
|
||||
},
|
||||
ResourceTemplate() { // NULL Usage Counter
|
||||
Register (SystemMemory, 0, 0, 0, 0)
|
||||
},
|
||||
"" // NULL State Name
|
||||
},
|
||||
|
||||
Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
|
||||
|
||||
@ingroup CodeGenApis
|
||||
|
||||
@param [in] MinResidency Minimum Residency.
|
||||
@param [in] WorstCaseWakeLatency Worst case wake-up latency.
|
||||
@param [in] Flags Flags.
|
||||
@param [in] ArchFlags Architectural flags.
|
||||
@param [in] ResCntFreq Residency Counter Frequency.
|
||||
@param [in] EnableParentState Enabled Parent State.
|
||||
@param [in] GenericRegisterDescriptor Entry Method.
|
||||
If not NULL, use this Register to
|
||||
describe the entry method address.
|
||||
@param [in] Integer Entry Method.
|
||||
If GenericRegisterDescriptor is NULL,
|
||||
take this value.
|
||||
@param [in] ResidencyCounterRegister If not NULL, use it to populate the
|
||||
residency counter register.
|
||||
@param [in] UsageCounterRegister If not NULL, use it to populate the
|
||||
usage counter register.
|
||||
@param [in] StateName If not NULL, use it to populate the
|
||||
state name.
|
||||
@param [in] LpiNode Lpi node created with the function
|
||||
AmlCreateLpiNode to which the new LPI
|
||||
state is appended.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlAddLpiState (
|
||||
IN UINT32 MinResidency,
|
||||
IN UINT32 WorstCaseWakeLatency,
|
||||
IN UINT32 Flags,
|
||||
IN UINT32 ArchFlags,
|
||||
IN UINT32 ResCntFreq,
|
||||
IN UINT32 EnableParentState,
|
||||
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * GenericRegisterDescriptor, OPTIONAL
|
||||
IN UINT64 Integer, OPTIONAL
|
||||
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * ResidencyCounterRegister, OPTIONAL
|
||||
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * UsageCounterRegister, OPTIONAL
|
||||
IN CHAR8 * StateName, OPTIONAL
|
||||
IN AML_OBJECT_NODE_HANDLE LpiNode
|
||||
);
|
||||
|
||||
// DEPRECATED APIS
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/** DEPRECATED API
|
||||
|
||||
Get the first Resource Data element contained in a "_CRS" object.
|
||||
|
||||
In the following ASL code, the function will return the Resource Data
|
||||
node corresponding to the "QWordMemory ()" ASL macro.
|
||||
Name (_CRS, ResourceTemplate() {
|
||||
QWordMemory (...) {...},
|
||||
Interrupt (...) {...}
|
||||
}
|
||||
)
|
||||
|
||||
Note:
|
||||
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
|
||||
- "_CRS" declared using ASL "Method (Declare Control Method)" is not
|
||||
supported.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the "_CRS" object. A Resource Data element
|
||||
is stored in a data node.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpCrsGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
);
|
||||
|
||||
/** DEPRECATED API
|
||||
|
||||
Get the Resource Data element following the CurrRdNode Resource Data.
|
||||
|
||||
In the following ASL code, if CurrRdNode corresponds to the first
|
||||
"QWordMemory ()" ASL macro, the function will return the Resource Data
|
||||
node corresponding to the "Interrupt ()" ASL macro.
|
||||
Name (_CRS, ResourceTemplate() {
|
||||
QwordMemory (...) {...},
|
||||
Interrupt (...) {...}
|
||||
}
|
||||
)
|
||||
|
||||
The CurrRdNode Resource Data node must be defined in an object named "_CRS"
|
||||
and defined by a "Name ()" ASL function.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] CurrRdNode Pointer to the current Resource Data element of
|
||||
the "_CRS" variable.
|
||||
@param [out] OutRdNode Pointer to the Resource Data element following
|
||||
the CurrRdNode.
|
||||
Contain a NULL pointer if CurrRdNode is the
|
||||
last Resource Data element in the list.
|
||||
The "End Tag" is not considered as a resource
|
||||
data element and is not returned.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpCrsGetNextRdNode (
|
||||
IN AML_DATA_NODE_HANDLE CurrRdNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
);
|
||||
|
||||
/** DEPRECATED API
|
||||
|
||||
Add an Interrupt Resource Data node.
|
||||
|
||||
This function creates a Resource Data element corresponding to the
|
||||
"Interrupt ()" ASL function, stores it in an AML Data Node.
|
||||
|
||||
It then adds it after the input CurrRdNode in the list of resource data
|
||||
element.
|
||||
|
||||
The Resource Data effectively created is an Extended Interrupt Resource
|
||||
Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
|
||||
for more information about Extended Interrupt Resource Data.
|
||||
|
||||
The Extended Interrupt contains one single interrupt.
|
||||
|
||||
This function allocates memory to create a data node. It is the caller's
|
||||
responsibility to either:
|
||||
- attach this node to an AML tree;
|
||||
- delete this node.
|
||||
|
||||
Note: The _CRS node must be defined using the ASL Name () function.
|
||||
e.g. Name (_CRS, ResourceTemplate () {
|
||||
...
|
||||
}
|
||||
|
||||
@ingroup CodeGenApis
|
||||
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [in] ResourceConsumer The device consumes the specified interrupt
|
||||
or produces it for use by a child device.
|
||||
@param [in] EdgeTriggered The interrupt is edge triggered or
|
||||
level triggered.
|
||||
@param [in] ActiveLow The interrupt is active-high or active-low.
|
||||
@param [in] Shared The interrupt can be shared with other
|
||||
devices or not (Exclusive).
|
||||
@param [in] IrqList Interrupt list. Must be non-NULL.
|
||||
@param [in] IrqCount Interrupt count. Must be non-zero.
|
||||
|
||||
|
||||
@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
|
||||
AmlCodeGenCrsAddRdInterrupt (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
IN BOOLEAN ResourceConsumer,
|
||||
IN BOOLEAN EdgeTriggered,
|
||||
IN BOOLEAN ActiveLow,
|
||||
IN BOOLEAN Shared,
|
||||
IN UINT32 * IrqList,
|
||||
IN UINT8 IrqCount
|
||||
);
|
||||
|
||||
#endif // DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
#endif // AML_LIB_H_
|
||||
|
@@ -12,7 +12,17 @@
|
||||
#ifndef TABLE_HELPER_LIB_H_
|
||||
#define TABLE_HELPER_LIB_H_
|
||||
|
||||
#include <Library/AmlLib/AmlLib.h>
|
||||
/** Is a character upper case
|
||||
*/
|
||||
#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
|
||||
|
||||
/** Is a character a decimal digit
|
||||
*/
|
||||
#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
|
||||
|
||||
/** Is a character an upper case hexadecimal digit
|
||||
*/
|
||||
#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
|
||||
|
||||
/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
|
||||
object from the Configuration Manager.
|
||||
@@ -64,39 +74,6 @@ AddAcpiHeader (
|
||||
IN CONST UINT32 Length
|
||||
);
|
||||
|
||||
/** Build a RootNode containing SSDT ACPI header information using the AmlLib.
|
||||
|
||||
The function utilizes the ACPI table Generator and the Configuration
|
||||
Manager protocol to obtain any information required for constructing the
|
||||
header. It then creates a RootNode. The SSDT ACPI header is part of the
|
||||
RootNode.
|
||||
|
||||
This is essentially a wrapper around AmlCodeGenDefinitionBlock ()
|
||||
from the AmlLib.
|
||||
|
||||
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
|
||||
protocol interface.
|
||||
@param [in] Generator Pointer to the ACPI table Generator.
|
||||
@param [in] AcpiTableInfo Pointer to the ACPI table info structure.
|
||||
@param [out] RootNode If success, contains the created RootNode.
|
||||
The SSDT ACPI header is part of the RootNode.
|
||||
|
||||
@retval EFI_SUCCESS Success.
|
||||
@retval EFI_INVALID_PARAMETER A parameter is invalid.
|
||||
@retval EFI_NOT_FOUND The required object information is not found.
|
||||
@retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
|
||||
Manager is less than the Object size for the
|
||||
requested object.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AddSsdtAcpiHeader (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
|
||||
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
|
||||
OUT AML_ROOT_NODE_HANDLE * RootNode
|
||||
);
|
||||
|
||||
/**
|
||||
Function prototype for testing if two arbitrary objects are equal.
|
||||
|
||||
@@ -142,14 +119,41 @@ FindDuplicateValue (
|
||||
IN PFN_IS_EQUAL EqualTestFunction
|
||||
);
|
||||
|
||||
/** Parse and print a CmObjDesc.
|
||||
/** Convert a hex number to its ASCII code.
|
||||
|
||||
@param [in] CmObjDesc The CmObjDesc to parse and print.
|
||||
@param [in] x Hex number to convert.
|
||||
Must be 0 <= x < 16.
|
||||
|
||||
@return The ASCII code corresponding to x.
|
||||
**/
|
||||
VOID
|
||||
UINT8
|
||||
EFIAPI
|
||||
ParseCmObjDesc (
|
||||
IN CONST CM_OBJ_DESCRIPTOR * CmObjDesc
|
||||
AsciiFromHex (
|
||||
IN UINT8 x
|
||||
);
|
||||
|
||||
/** Check if a HID is a valid PNP ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid PNP ID.
|
||||
@retval FALSE The Hid is not a valid PNP ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidPnpId (
|
||||
IN CONST CHAR8 * Hid
|
||||
);
|
||||
|
||||
/** Check if a HID is a valid ACPI ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid ACPI ID.
|
||||
@retval FALSE The Hid is not a valid ACPI ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidAcpiId (
|
||||
IN CONST CHAR8 * Hid
|
||||
);
|
||||
|
||||
#endif // TABLE_HELPER_LIB_H_
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/** @file
|
||||
FADT Table Generator
|
||||
|
||||
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
|
||||
Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
- ACPI 6.4 Specification, January 2021
|
||||
- ACPI 6.3 Specification, January 2019
|
||||
|
||||
**/
|
||||
|
||||
@@ -32,8 +32,8 @@ Requirements:
|
||||
|
||||
/** This macro defines the FADT flag options for ARM Platforms.
|
||||
*/
|
||||
#define FADT_FLAGS (EFI_ACPI_6_4_HW_REDUCED_ACPI | \
|
||||
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE)
|
||||
#define FADT_FLAGS (EFI_ACPI_6_3_HW_REDUCED_ACPI | \
|
||||
EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
|
||||
|
||||
/** This macro defines the valid mask for the FADT flag option
|
||||
if HW_REDUCED_ACPI flag in the table is set.
|
||||
@@ -42,47 +42,47 @@ Requirements:
|
||||
22-31 (reserved).
|
||||
|
||||
Valid bits are:
|
||||
EFI_ACPI_6_4_WBINVD BIT0
|
||||
EFI_ACPI_6_4_PWR_BUTTON BIT4
|
||||
EFI_ACPI_6_4_SLP_BUTTON BIT5
|
||||
EFI_ACPI_6_4_FIX_RTC BIT6
|
||||
EFI_ACPI_6_4_DCK_CAP BIT9
|
||||
EFI_ACPI_6_4_RESET_REG_SUP BIT10
|
||||
EFI_ACPI_6_4_SEALED_CASE BIT11
|
||||
EFI_ACPI_6_4_HEADLESS BIT12
|
||||
EFI_ACPI_6_4_USE_PLATFORM_CLOCK BIT15
|
||||
EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL BIT18
|
||||
EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
|
||||
EFI_ACPI_6_4_HW_REDUCED_ACPI BIT20
|
||||
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE BIT21
|
||||
EFI_ACPI_6_3_WBINVD BIT0
|
||||
EFI_ACPI_6_3_PWR_BUTTON BIT4
|
||||
EFI_ACPI_6_3_SLP_BUTTON BIT5
|
||||
EFI_ACPI_6_3_FIX_RTC BIT6
|
||||
EFI_ACPI_6_3_DCK_CAP BIT9
|
||||
EFI_ACPI_6_3_RESET_REG_SUP BIT10
|
||||
EFI_ACPI_6_3_SEALED_CASE BIT11
|
||||
EFI_ACPI_6_3_HEADLESS BIT12
|
||||
EFI_ACPI_6_3_USE_PLATFORM_CLOCK BIT15
|
||||
EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL BIT18
|
||||
EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
|
||||
EFI_ACPI_6_3_HW_REDUCED_ACPI BIT20
|
||||
EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE BIT21
|
||||
*/
|
||||
#define VALID_HARDWARE_REDUCED_FLAG_MASK ( \
|
||||
EFI_ACPI_6_4_WBINVD | \
|
||||
EFI_ACPI_6_4_PWR_BUTTON | \
|
||||
EFI_ACPI_6_4_SLP_BUTTON | \
|
||||
EFI_ACPI_6_4_FIX_RTC | \
|
||||
EFI_ACPI_6_4_DCK_CAP | \
|
||||
EFI_ACPI_6_4_RESET_REG_SUP | \
|
||||
EFI_ACPI_6_4_SEALED_CASE | \
|
||||
EFI_ACPI_6_4_HEADLESS | \
|
||||
EFI_ACPI_6_4_USE_PLATFORM_CLOCK | \
|
||||
EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL | \
|
||||
EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
|
||||
EFI_ACPI_6_4_HW_REDUCED_ACPI | \
|
||||
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE)
|
||||
EFI_ACPI_6_3_WBINVD | \
|
||||
EFI_ACPI_6_3_PWR_BUTTON | \
|
||||
EFI_ACPI_6_3_SLP_BUTTON | \
|
||||
EFI_ACPI_6_3_FIX_RTC | \
|
||||
EFI_ACPI_6_3_DCK_CAP | \
|
||||
EFI_ACPI_6_3_RESET_REG_SUP | \
|
||||
EFI_ACPI_6_3_SEALED_CASE | \
|
||||
EFI_ACPI_6_3_HEADLESS | \
|
||||
EFI_ACPI_6_3_USE_PLATFORM_CLOCK | \
|
||||
EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL | \
|
||||
EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
|
||||
EFI_ACPI_6_3_HW_REDUCED_ACPI | \
|
||||
EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/** The AcpiFadt is a template EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE
|
||||
/** The AcpiFadt is a template EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE
|
||||
structure used for generating the FADT Table.
|
||||
Note: fields marked with "{Template}" will be updated dynamically.
|
||||
*/
|
||||
STATIC
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
|
||||
ACPI_HEADER (
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE,
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE,
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
|
||||
),
|
||||
// UINT32 FirmwareCtrl
|
||||
0,
|
||||
@@ -91,7 +91,7 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
|
||||
// UINT8 Reserved0
|
||||
EFI_ACPI_RESERVED_BYTE,
|
||||
// UINT8 PreferredPmProfile
|
||||
EFI_ACPI_6_4_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile
|
||||
EFI_ACPI_6_3_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile
|
||||
// UINT16 SciInt
|
||||
0,
|
||||
// UINT32 SmiCmd
|
||||
@@ -160,37 +160,37 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
|
||||
0,
|
||||
// UINT32 Flags
|
||||
FADT_FLAGS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ResetReg
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResetReg
|
||||
NULL_GAS,
|
||||
// UINT8 ResetValue
|
||||
0,
|
||||
// UINT16 ArmBootArch
|
||||
EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
|
||||
EFI_ACPI_6_3_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
|
||||
// UINT8 MinorRevision
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
|
||||
// UINT64 XFirmwareCtrl
|
||||
0,
|
||||
// UINT64 XDsdt
|
||||
0,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe0Blk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XGpe0Blk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe1Blk
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XGpe1Blk
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepControlReg
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE SleepControlReg
|
||||
NULL_GAS,
|
||||
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepStatusReg
|
||||
// EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE SleepStatusReg
|
||||
NULL_GAS,
|
||||
// UINT64 HypervisorVendorIdentity
|
||||
EFI_ACPI_RESERVED_QWORD // {Template}: Hypervisor Vendor ID
|
||||
@@ -532,7 +532,7 @@ BuildFadtTable (
|
||||
This,
|
||||
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
|
||||
AcpiTableInfo,
|
||||
sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE)
|
||||
sizeof (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE)
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((
|
||||
@@ -614,9 +614,9 @@ ACPI_TABLE_GENERATOR FadtGenerator = {
|
||||
// Generator Description
|
||||
L"ACPI.STD.FADT.GENERATOR",
|
||||
// ACPI Table Signature
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
|
||||
// ACPI Table Revision supported by this Generator
|
||||
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
|
||||
EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
|
||||
// Minimum supported ACPI Table Revision
|
||||
EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
|
||||
// Creator ID
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/** @file
|
||||
GTDT Table Generator
|
||||
|
||||
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved.
|
||||
Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
- ACPI 6.4 Specification - January 2021
|
||||
- ACPI 6.3 Specification - January 2019
|
||||
|
||||
**/
|
||||
|
||||
@@ -41,7 +41,7 @@ GET_OBJECT_LIST (
|
||||
CM_ARM_GENERIC_TIMER_INFO
|
||||
);
|
||||
|
||||
/** This macro expands to a function that retrieves the Arm Generic
|
||||
/** This macro expands to a function that retrieves the SBSA Generic
|
||||
Watchdog Timer Information from the Configuration Manager.
|
||||
*/
|
||||
GET_OBJECT_LIST (
|
||||
@@ -91,7 +91,7 @@ EFI_STATUS
|
||||
EFIAPI
|
||||
AddGenericTimerInfo (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN CONST UINT32 PlatformTimerCount,
|
||||
IN CONST UINT32 AcpiTableRevision
|
||||
)
|
||||
@@ -133,7 +133,7 @@ AddGenericTimerInfo (
|
||||
GenericTimerInfo->CounterReadBaseAddress;
|
||||
Gtdt->PlatformTimerCount = PlatformTimerCount;
|
||||
Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
|
||||
sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||
sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||
|
||||
if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
|
||||
Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
|
||||
@@ -143,7 +143,7 @@ AddGenericTimerInfo (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/** Add the Arm Generic Watchdog Timers to the GTDT table.
|
||||
/** Add the SBSA Generic Watchdog Timers to the GTDT table.
|
||||
|
||||
@param [in] Gtdt Pointer to the GTDT Table.
|
||||
@param [in] WatchdogOffset Offset to the watchdog information in the
|
||||
@@ -154,26 +154,26 @@ AddGenericTimerInfo (
|
||||
STATIC
|
||||
VOID
|
||||
AddGenericWatchdogList (
|
||||
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN CONST UINT32 WatchdogOffset,
|
||||
IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList,
|
||||
IN UINT32 WatchdogCount
|
||||
)
|
||||
{
|
||||
EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
|
||||
EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
|
||||
|
||||
ASSERT (Gtdt != NULL);
|
||||
ASSERT (WatchdogInfoList != NULL);
|
||||
|
||||
Watchdog = (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *)
|
||||
Watchdog = (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE *)
|
||||
((UINT8*)Gtdt + WatchdogOffset);
|
||||
|
||||
while (WatchdogCount-- != 0) {
|
||||
// Add watchdog entry
|
||||
DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
|
||||
Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG;
|
||||
Watchdog->Type = EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG;
|
||||
Watchdog->Length =
|
||||
sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE);
|
||||
sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE);
|
||||
Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
|
||||
Watchdog->RefreshFramePhysicalAddress =
|
||||
WatchdogInfoList->RefreshFrameAddress;
|
||||
@@ -249,7 +249,7 @@ IsGtFrameNumberEqual (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
AddGTBlockTimerFrames (
|
||||
IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
|
||||
IN EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
|
||||
IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList,
|
||||
IN UINT32 GTBlockFrameCount
|
||||
)
|
||||
@@ -329,15 +329,15 @@ STATIC
|
||||
EFI_STATUS
|
||||
AddGTBlockList (
|
||||
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
|
||||
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
|
||||
IN CONST UINT32 GTBlockOffset,
|
||||
IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo,
|
||||
IN UINT32 BlockTimerCount
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
|
||||
EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
|
||||
EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
|
||||
EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
|
||||
CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList;
|
||||
UINT32 GTBlockTimerFrameCount;
|
||||
UINTN Length;
|
||||
@@ -345,7 +345,7 @@ AddGTBlockList (
|
||||
ASSERT (Gtdt != NULL);
|
||||
ASSERT (GTBlockInfo != NULL);
|
||||
|
||||
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
|
||||
GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
|
||||
GTBlockOffset);
|
||||
|
||||
while (BlockTimerCount-- != 0) {
|
||||
@@ -367,8 +367,8 @@ AddGTBlockList (
|
||||
return Status;
|
||||
}
|
||||
|
||||
Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) +
|
||||
(sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||
Length = sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) +
|
||||
(sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||
GTBlockInfo->GTBlockTimerFrameCount);
|
||||
|
||||
// Check that the length of the GT block does not
|
||||
@@ -386,15 +386,15 @@ AddGTBlockList (
|
||||
return Status;
|
||||
}
|
||||
|
||||
GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK;
|
||||
GTBlock->Type = EFI_ACPI_6_3_GTDT_GT_BLOCK;
|
||||
GTBlock->Length = (UINT16)Length;
|
||||
GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
|
||||
GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
|
||||
GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
|
||||
GTBlock->GTBlockTimerOffset =
|
||||
sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE);
|
||||
sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE);
|
||||
|
||||
GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
|
||||
GtBlockFrame = (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
|
||||
((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
|
||||
|
||||
// Add GT Block Timer frames
|
||||
@@ -413,7 +413,7 @@ AddGTBlockList (
|
||||
}
|
||||
|
||||
// Next GTBlock
|
||||
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
|
||||
GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
|
||||
GTBlock->Length);
|
||||
GTBlockInfo++;
|
||||
}// for
|
||||
@@ -460,7 +460,7 @@ BuildGtdtTable (
|
||||
UINT32 BlockTimerCount;
|
||||
CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList;
|
||||
CM_ARM_GTBLOCK_INFO * GTBlockInfo;
|
||||
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
|
||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
|
||||
UINT32 Idx;
|
||||
UINT32 GTBlockOffset;
|
||||
UINT32 WatchdogOffset;
|
||||
@@ -527,11 +527,11 @@ BuildGtdtTable (
|
||||
|
||||
// Calculate the GTDT Table Size
|
||||
PlatformTimerCount = 0;
|
||||
TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||
TableSize = sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
|
||||
if (BlockTimerCount != 0) {
|
||||
GTBlockOffset = TableSize;
|
||||
PlatformTimerCount += BlockTimerCount;
|
||||
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
|
||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) *
|
||||
BlockTimerCount);
|
||||
|
||||
for (Idx = 0; Idx < BlockTimerCount; Idx++) {
|
||||
@@ -546,7 +546,7 @@ BuildGtdtTable (
|
||||
));
|
||||
goto error_handler;
|
||||
}
|
||||
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
|
||||
GTBlockInfo[Idx].GTBlockTimerFrameCount);
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ BuildGtdtTable (
|
||||
if (WatchdogCount != 0) {
|
||||
WatchdogOffset = TableSize;
|
||||
PlatformTimerCount += WatchdogCount;
|
||||
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) *
|
||||
TableSize += (sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE) *
|
||||
WatchdogCount);
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
@@ -585,7 +585,7 @@ BuildGtdtTable (
|
||||
goto error_handler;
|
||||
}
|
||||
|
||||
Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
|
||||
Gtdt = (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
|
||||
@@ -712,9 +712,9 @@ ACPI_TABLE_GENERATOR GtdtGenerator = {
|
||||
// Generator Description
|
||||
L"ACPI.STD.GTDT.GENERATOR",
|
||||
// ACPI Table Signature
|
||||
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
|
||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
|
||||
// ACPI Table Revision supported by this Generator
|
||||
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
||||
EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
||||
// Minimum ACPI Table Revision supported by this Generator
|
||||
EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
|
||||
// Creator ID
|
||||
|
@@ -10,19 +10,21 @@
|
||||
- Generic ACPI for Arm Components 1.0 Platform Design Document
|
||||
**/
|
||||
|
||||
#include <IndustryStandard/DebugPort2Table.h>
|
||||
#include <Library/AcpiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Protocol/AcpiTable.h>
|
||||
|
||||
// Module specific include files.
|
||||
#include <AcpiTableGenerator.h>
|
||||
#include <ConfigurationManagerObject.h>
|
||||
#include <ConfigurationManagerHelper.h>
|
||||
#include <Library/AcpiHelperLib.h>
|
||||
#include <Library/AmlLib/AmlLib.h>
|
||||
#include <Library/TableHelperLib.h>
|
||||
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||
#include "SsdtCmn600Generator.h"
|
||||
|
||||
@@ -284,7 +286,7 @@ FixupCmn600Info (
|
||||
|
||||
// Get the first Rd node in the "_CRS" object.
|
||||
// This is the PERIPHBASE node.
|
||||
Status = AmlNameOpGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode);
|
||||
Status = AmlNameOpCrsGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto error_handler;
|
||||
}
|
||||
@@ -307,7 +309,7 @@ FixupCmn600Info (
|
||||
// Get the QWord node corresponding to the ROOTNODEBASE.
|
||||
// It is the second Resource Data element in the BufferNode's
|
||||
// variable list of arguments.
|
||||
Status = AmlNameOpGetNextRdNode (
|
||||
Status = AmlNameOpCrsGetNextRdNode (
|
||||
CmnPeriphBaseRdNode,
|
||||
&CmnRootNodeBaseRdNode
|
||||
);
|
||||
@@ -336,8 +338,8 @@ FixupCmn600Info (
|
||||
// Resource Data nodes.
|
||||
for (Index = 0; Index < Cmn600Info->DtcCount; Index++) {
|
||||
DtcInt = &Cmn600Info->DtcInterrupt[Index];
|
||||
|
||||
Status = AmlCodeGenRdInterrupt (
|
||||
Status = AmlCodeGenCrsAddRdInterrupt (
|
||||
NameOpCrsNode,
|
||||
((DtcInt->Flags &
|
||||
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) != 0),
|
||||
((DtcInt->Flags &
|
||||
@@ -347,9 +349,7 @@ FixupCmn600Info (
|
||||
((DtcInt->Flags &
|
||||
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0),
|
||||
(UINT32*)&DtcInt->Interrupt,
|
||||
1,
|
||||
NameOpCrsNode,
|
||||
NULL
|
||||
1
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto error_handler;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Ssdt CMN-600 Table Generator
|
||||
#
|
||||
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
@@ -29,7 +29,6 @@
|
||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
AcpiHelperLib
|
||||
AmlLib
|
||||
BaseLib
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,134 +0,0 @@
|
||||
/** @file
|
||||
SSDT Cpu Topology Table Generator.
|
||||
|
||||
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@par Reference(s):
|
||||
- ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors
|
||||
**/
|
||||
|
||||
#ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_
|
||||
#define SSDT_CPU_TOPOLOGY_GENERATOR_H_
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
// Mask for the flags that need to be checked.
|
||||
#define PPTT_PROCESSOR_MASK ( \
|
||||
(EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL) | \
|
||||
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
|
||||
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
|
||||
|
||||
// Mask for the cpu flags.
|
||||
#define PPTT_CPU_PROCESSOR_MASK ( \
|
||||
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
|
||||
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
|
||||
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
|
||||
|
||||
// Mask for the cluster flags.
|
||||
// Even though a _UID is generated for clusters, it is simpler to use
|
||||
// EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID and to not match the cluster id of
|
||||
// the PPTT table (not sure the PPTT table is generated).
|
||||
#define PPTT_CLUSTER_PROCESSOR_MASK ( \
|
||||
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
|
||||
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID << 1) | \
|
||||
(EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF << 3))
|
||||
|
||||
/** LPI states are stored in the ASL namespace at '\_SB_.Lxxx',
|
||||
with xxx being the node index of the LPI state.
|
||||
*/
|
||||
#define SB_SCOPE "\\_SB_"
|
||||
#define SB_SCOPE_PREFIX SB_SCOPE "."
|
||||
/// Size of the SB_SCOPE_PREFIX string.
|
||||
#define SB_SCOPE_PREFIX_SIZE sizeof (SB_SCOPE_PREFIX)
|
||||
|
||||
/// HID for a processor device.
|
||||
#define ACPI_HID_PROCESSOR_DEVICE "ACPI0007"
|
||||
|
||||
/// HID for a processor container device.
|
||||
#define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010"
|
||||
|
||||
/** Node names of Cpus and Clusters are 'Cxxx', and 'Lxxx' for LPI states.
|
||||
The 'xxx' is an index on 12 bits is given to node name,
|
||||
thus the limitation in the number of nodes.
|
||||
*/
|
||||
#define MAX_NODE_COUNT (1 << 12)
|
||||
|
||||
/** A structure used to handle the Lpi structures referencing.
|
||||
|
||||
A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARM_OBJ_REF.
|
||||
This CM_ARM_OBJ_REF references CM_ARM_LPI_INFO structures.
|
||||
|
||||
Example:
|
||||
(Cpu0) (Cpu1)
|
||||
CM_ARM_PROC_HIERARCHY_INFO CM_ARM_PROC_HIERARCHY_INFO
|
||||
| |
|
||||
+----------------------------------------
|
||||
|
|
||||
v
|
||||
(List of references to Lpi states)
|
||||
CM_ARM_OBJ_REF
|
||||
|
|
||||
+----------------------------------------
|
||||
| |
|
||||
v v
|
||||
(A first Lpi state) (A second Lpi state)
|
||||
CM_ARM_LPI_INFO[0] CM_ARM_LPI_INFO[1]
|
||||
|
||||
Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO
|
||||
structures reference the same CM_ARM_OBJ_REF. An entry is created in the
|
||||
TokenTable such as:
|
||||
0 <-> CM_ARM_OBJ_REF
|
||||
|
||||
This will lead to the creation of this pseudo-ASL code where Cpu0 and Cpu1
|
||||
return the same object at \_SB.L000:
|
||||
Scope (\_SB) {
|
||||
Device (C000) {
|
||||
[...]
|
||||
Method (_LPI) {
|
||||
Return (\_SB.L000)
|
||||
}
|
||||
} // C000
|
||||
|
||||
Device (C001) {
|
||||
[...]
|
||||
Method (_LPI) {
|
||||
Return (\_SB.L000)
|
||||
}
|
||||
} // C001
|
||||
|
||||
// Lpi states
|
||||
Name (L000, Package (0x05) {
|
||||
[...]
|
||||
}
|
||||
}
|
||||
*/
|
||||
typedef struct TokenTable {
|
||||
/// TokenTable, a table allowing to map:
|
||||
/// Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures).
|
||||
CM_OBJECT_TOKEN * Table;
|
||||
|
||||
/// Last used index of the TokenTable.
|
||||
/// LastIndex is bound by ProcNodeCount.
|
||||
UINT32 LastIndex;
|
||||
} TOKEN_TABLE;
|
||||
|
||||
/** A structure holding the Cpu topology generator and additional private data.
|
||||
*/
|
||||
typedef struct AcpiCpuTopologyGenerator {
|
||||
/// ACPI Table generator header
|
||||
ACPI_TABLE_GENERATOR Header;
|
||||
|
||||
// Private fields are defined from here.
|
||||
|
||||
/// Private object used to handle token referencing.
|
||||
TOKEN_TABLE TokenTable;
|
||||
/// List of CM_ARM_PROC_HIERARCHY_INFO CM objects.
|
||||
CM_ARM_PROC_HIERARCHY_INFO * ProcNodeList;
|
||||
/// Count of CM_ARM_PROC_HIERARCHY_INFO CM objects.
|
||||
UINT32 ProcNodeCount;
|
||||
} ACPI_CPU_TOPOLOGY_GENERATOR;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_
|
@@ -1,33 +0,0 @@
|
||||
## @file
|
||||
# Ssdt Cpu Topology Table Generator
|
||||
#
|
||||
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x0001001B
|
||||
BASE_NAME = SsdtCpuTopologyLibArm
|
||||
FILE_GUID = F2835EB6-4B05-48D4-A475-147DA0F3755C
|
||||
VERSION_STRING = 1.0
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
LIBRARY_CLASS = NULL|DXE_DRIVER
|
||||
CONSTRUCTOR = AcpiSsdtCpuTopologyLibConstructor
|
||||
DESTRUCTOR = AcpiSsdtCpuTopologyLibDestructor
|
||||
|
||||
[Sources]
|
||||
SsdtCpuTopologyGenerator.c
|
||||
SsdtCpuTopologyGenerator.h
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
AcpiHelperLib
|
||||
AmlLib
|
||||
BaseLib
|
@@ -6,19 +6,21 @@
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#include <IndustryStandard/DebugPort2Table.h>
|
||||
#include <Library/AcpiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Protocol/AcpiTable.h>
|
||||
|
||||
// Module specific include files.
|
||||
#include <AcpiTableGenerator.h>
|
||||
#include <ConfigurationManagerObject.h>
|
||||
#include <ConfigurationManagerHelper.h>
|
||||
#include <Library/AcpiHelperLib.h>
|
||||
#include <Library/SsdtSerialPortFixupLib.h>
|
||||
#include <Library/TableHelperLib.h>
|
||||
#include <Protocol/ConfigurationManagerProtocol.h>
|
||||
|
||||
/** ARM standard SSDT Serial Port Table Generator
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Ssdt Serial Port Table Generator
|
||||
#
|
||||
# Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
@@ -27,7 +27,7 @@
|
||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
AcpiHelperLib
|
||||
AmlLib
|
||||
BaseLib
|
||||
TableHelperLib
|
||||
SsdtSerialPortFixupLib
|
||||
|
@@ -1,210 +0,0 @@
|
||||
/** @file
|
||||
Acpi Helper
|
||||
|
||||
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
// Module specific include files.
|
||||
#include <Library/AcpiHelperLib.h>
|
||||
|
||||
/** Convert a hex number to its ASCII code.
|
||||
|
||||
@param [in] Hex Hex number to convert.
|
||||
Must be 0 <= x < 16.
|
||||
|
||||
@return The ASCII code corresponding to x.
|
||||
-1 if error.
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
AsciiFromHex (
|
||||
IN UINT8 Hex
|
||||
)
|
||||
{
|
||||
if (Hex < 10) {
|
||||
return (UINT8)(Hex + '0');
|
||||
}
|
||||
|
||||
if (Hex < 16) {
|
||||
return (UINT8)(Hex - 10 + 'A');
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
return (UINT8)-1;
|
||||
}
|
||||
|
||||
/** Convert an ASCII char representing an hexadecimal number
|
||||
to its integer value.
|
||||
|
||||
@param [in] Char Char to convert.
|
||||
Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
|
||||
|
||||
@return The corresponding integer (between 0-16).
|
||||
-1 if error.
|
||||
**/
|
||||
UINT8
|
||||
EFIAPI
|
||||
HexFromAscii (
|
||||
IN CHAR8 Char
|
||||
)
|
||||
{
|
||||
if ((Char >= '0') && (Char <= '9')) {
|
||||
return (UINT8)(Char - '0');
|
||||
}
|
||||
|
||||
if ((Char >= 'A') && (Char <= 'F')) {
|
||||
return (UINT8)(Char - 'A' + 10);
|
||||
}
|
||||
|
||||
if ((Char >= 'a') && (Char <= 'f')) {
|
||||
return (UINT8)(Char - 'a' + 10);
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
return (UINT8)-1;
|
||||
}
|
||||
|
||||
/** Check if a HID is a valid PNP ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid PNP ID.
|
||||
@retval FALSE The Hid is not a valid PNP ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidPnpId (
|
||||
IN CONST CHAR8 * Hid
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
if (AsciiStrLen (Hid) != 7) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// A valid PNP ID must be of the form "AAA####"
|
||||
// where A is an uppercase letter and # is a hex digit.
|
||||
for (Index = 0; Index < 3; Index++) {
|
||||
if (!IS_UPPER_CHAR (Hid[Index])) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for (Index = 3; Index < 7; Index++) {
|
||||
if (!IS_UPPER_HEX (Hid[Index])) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Check if a HID is a valid ACPI ID.
|
||||
|
||||
@param [in] Hid The Hid to validate.
|
||||
|
||||
@retval TRUE The Hid is a valid ACPI ID.
|
||||
@retval FALSE The Hid is not a valid ACPI ID.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidAcpiId (
|
||||
IN CONST CHAR8 * Hid
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
if (AsciiStrLen (Hid) != 8) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// A valid ACPI ID must be of the form "NNNN####"
|
||||
// where N is an uppercase letter or a digit ('0'-'9')
|
||||
// and # is a hex digit.
|
||||
for (Index = 0; Index < 4; Index++) {
|
||||
if (!(IS_UPPER_CHAR (Hid[Index]) || IS_DIGIT (Hid[Index]))) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for (Index = 4; Index < 8; Index++) {
|
||||
if (!IS_UPPER_HEX (Hid[Index])) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Convert a EisaId string to its compressed UINT32 equivalent.
|
||||
|
||||
Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
|
||||
|
||||
@param [in] EisaIdStr Input EisaId string.
|
||||
@param [out] EisaIdInt Output EisaId UINT32 (compressed).
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlGetEisaIdFromString (
|
||||
IN CONST CHAR8 * EisaIdStr,
|
||||
OUT UINT32 * EisaIdInt
|
||||
)
|
||||
{
|
||||
if ((EisaIdStr == NULL) ||
|
||||
(!IsValidPnpId (EisaIdStr)) ||
|
||||
(EisaIdInt == NULL)) {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
|
||||
|
||||
Converts and compresses the 7-character text argument into its corresponding
|
||||
4-byte numeric EISA ID encoding (Integer). This can be used when declaring
|
||||
IDs for devices that are EISA IDs.
|
||||
|
||||
The algorithm used to convert the TextID is as shown in the following
|
||||
example:
|
||||
Starting with a seven character input string "PNP0303", we want to create
|
||||
a DWordConst. This string contains a three character manufacturer code
|
||||
"PNP", a three character hex product identifier "030", and a one character
|
||||
revision identifier "3".
|
||||
The compressed manufacturer code is created as follows:
|
||||
1) Find hex ASCII value for each letter
|
||||
2) Subtract 40h from each ASCII value
|
||||
3) Retain 5 least significant bits for each letter and discard remaining
|
||||
0's:
|
||||
|
||||
Byte 0:
|
||||
Bit 7: reserved (0)
|
||||
Bit 6-2: 1st character of compressed mfg code "P"
|
||||
Bit 1-0: Upper 2 bits of 2nd character of mfg code "N"
|
||||
Byte 1:
|
||||
Bit 7-5: Lower 3 bits of 2nd character of mfg code "N"
|
||||
Bit 4-0: 3rd character of mfg code "P"
|
||||
Byte 2:
|
||||
Bit 7-4: 1st hex digit of product number "0"
|
||||
Bit 3-0: 2nd hex digit of product number "3"
|
||||
Byte 3:
|
||||
Bit 7-4: 3rd hex digit of product number "0"
|
||||
Bit 3-0: 4th hex digit of product number "3"
|
||||
*/
|
||||
*EisaIdInt = SwapBytes32 (
|
||||
((EisaIdStr[0] - 0x40) << 26) |
|
||||
((EisaIdStr[1] - 0x40) << 21) |
|
||||
((EisaIdStr[2] - 0x40) << 16) |
|
||||
(HexFromAscii (EisaIdStr[3]) << 12) |
|
||||
(HexFromAscii (EisaIdStr[4]) << 8) |
|
||||
(HexFromAscii (EisaIdStr[5]) << 4) |
|
||||
(HexFromAscii (EisaIdStr[6]))
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
## @file
|
||||
# Acpi Helper
|
||||
#
|
||||
# Copyright (c) 2021, ARM Limited. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x0001001B
|
||||
BASE_NAME = AcpiHelperLib
|
||||
FILE_GUID = 45968FB4-A724-46FC-822D-F9E557601F9B
|
||||
VERSION_STRING = 1.0
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
LIBRARY_CLASS = AcpiHelperLib
|
||||
|
||||
[Sources]
|
||||
AcpiHelper.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
@@ -2,7 +2,7 @@
|
||||
AML Print Function.
|
||||
|
||||
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -199,7 +199,7 @@ AmlDbgPrintNodeHeader (
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%3d | %-15a | ",
|
||||
"%3d | %-15s | ",
|
||||
Level,
|
||||
NodeTypeStrTbl[Node->NodeType]
|
||||
));
|
||||
@@ -227,7 +227,7 @@ AmlDbgPrintDataNode (
|
||||
|
||||
AmlDbgPrintNodeHeader ((AML_NODE_HEADER*)DataNode, Level);
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%-36a | ", NodeDataTypeStrTbl[DataNode->DataType]));
|
||||
DEBUG ((DEBUG_INFO, "%-36s | ", NodeDataTypeStrTbl[DataNode->DataType]));
|
||||
DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size));
|
||||
|
||||
if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
|
||||
@@ -300,13 +300,13 @@ AmlDbgPrintObjectNode (
|
||||
|
||||
// Print a string corresponding to the field object OpCode/SubOpCode.
|
||||
if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) {
|
||||
DEBUG ((DEBUG_INFO, "%-15a ", AmlGetFieldOpCodeStr (
|
||||
DEBUG ((DEBUG_INFO, "%-15s ", AmlGetFieldOpCodeStr (
|
||||
ObjectNode->AmlByteEncoding->OpCode,
|
||||
0
|
||||
)));
|
||||
} else {
|
||||
// Print a string corresponding to the object OpCode/SubOpCode.
|
||||
DEBUG ((DEBUG_INFO, "%-15a | ", AmlGetOpCodeStr (
|
||||
DEBUG ((DEBUG_INFO, "%-15s | ", AmlGetOpCodeStr (
|
||||
ObjectNode->AmlByteEncoding->OpCode,
|
||||
ObjectNode->AmlByteEncoding->SubOpCode)
|
||||
));
|
||||
@@ -378,19 +378,19 @@ AmlDbgPrintTableHeader (
|
||||
DEBUG ((DEBUG_INFO, "Lvl | Node Type |\n"));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
" | %-15a | Signature| Length | Rev | CSum | OemId | "
|
||||
" | %-15s | Signature| Length | Rev | CSum | OemId | "
|
||||
"OemTableId | OemRev | CreatorId| CreatorRev\n",
|
||||
NodeTypeStrTbl[EAmlNodeRoot]
|
||||
));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
" | %-15a | Op | SubOp| OpName | MaxI| Attribute | "
|
||||
" | %-15s | Op | SubOp| OpName | MaxI| Attribute | "
|
||||
"PkgLen | NodeName (opt)\n",
|
||||
NodeTypeStrTbl[EAmlNodeObject]
|
||||
));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
" | %-15a | Data Type | Size | "
|
||||
" | %-15s | Data Type | Size | "
|
||||
"Buffer\n",
|
||||
NodeTypeStrTbl[EAmlNodeData]
|
||||
));
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AML grammar definitions.
|
||||
|
||||
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -803,88 +803,3 @@ AmlComputePkgLengthWidth (
|
||||
// Length < 2^6
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Given a length, compute the value of a PkgLen.
|
||||
|
||||
In AML, some object have a PkgLen, telling the size of the AML object.
|
||||
It can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is
|
||||
itself counted in the PkgLen value.
|
||||
This means that if an AML object sees its size increment/decrement,
|
||||
the number of bytes used to encode the PkgLen value can itself
|
||||
increment/decrement.
|
||||
|
||||
For instance, the AML encoding of a DeviceOp is:
|
||||
DefDevice := DeviceOp PkgLength NameString TermList
|
||||
If:
|
||||
- sizeof (NameString) = 4 (the name is "DEV0" for instance);
|
||||
- sizeof (TermList) = (2^6-6)
|
||||
then the PkgLen is encoded on 1 byte. Indeed, its value is:
|
||||
sizeof (PkgLen) + sizeof (NameString) + sizeof (TermList) =
|
||||
sizeof (PkgLen) + 4 + (2^6-6)
|
||||
So:
|
||||
PkgLen = sizeof (PkgLen) + (2^6-2)
|
||||
|
||||
The input arguments Length and PkgLen represent, for the DefDevice:
|
||||
DefDevice := DeviceOp PkgLength NameString TermList
|
||||
|------Length-----|
|
||||
|--------*PgkLength---------|
|
||||
|
||||
@param [in] Length The length to encode as a PkgLen.
|
||||
Length cannot exceed 2^28 - 4 (4 bytes for the
|
||||
PkgLen encoding).
|
||||
The size of the PkgLen encoding bytes should not be
|
||||
counted in this length value.
|
||||
@param [out] PkgLen If success, contains the value of the PkgLen,
|
||||
ready to encode in the PkgLen format.
|
||||
This value takes into account the size of PkgLen
|
||||
encoding.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlComputePkgLength (
|
||||
IN UINT32 Length,
|
||||
OUT UINT32 * PkgLen
|
||||
)
|
||||
{
|
||||
UINT32 PkgLenWidth;
|
||||
UINT32 ReComputedPkgLenWidth;
|
||||
|
||||
if (PkgLen == NULL) {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Compute the PkgLenWidth.
|
||||
PkgLenWidth = AmlComputePkgLengthWidth (Length);
|
||||
if (PkgLenWidth == 0) {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Add it to the Length.
|
||||
Length += PkgLenWidth;
|
||||
|
||||
// Check that adding the PkgLenWidth didn't trigger a domino effect,
|
||||
// increasing the encoding width of the PkgLen again.
|
||||
// The PkgLen is encoded in at most 4 bytes. It is possible to increase
|
||||
// the PkgLen width if its encoding is less than 3 bytes.
|
||||
ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Length);
|
||||
if (ReComputedPkgLenWidth != PkgLenWidth) {
|
||||
if ((ReComputedPkgLenWidth != 0) &&
|
||||
(ReComputedPkgLenWidth < 4)) {
|
||||
// No need to recompute the PkgLen since a new threshold cannot
|
||||
// be reached by incrementing the value by one.
|
||||
Length += 1;
|
||||
} else {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
*PkgLen = Length;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AML grammar definitions.
|
||||
|
||||
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -326,50 +326,5 @@ AmlComputePkgLengthWidth (
|
||||
IN UINT32 Length
|
||||
);
|
||||
|
||||
/** Given a length, compute the value of a PkgLen.
|
||||
|
||||
In AML, some object have a PkgLen, telling the size of the AML object.
|
||||
It can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is
|
||||
itself counted in the PkgLen value.
|
||||
This means that if an AML object sees its size increment/decrement,
|
||||
the number of bytes used to encode the PkgLen value can itself
|
||||
increment/decrement.
|
||||
|
||||
For instance, the AML encoding of a DeviceOp is:
|
||||
DefDevice := DeviceOp PkgLength NameString TermList
|
||||
If:
|
||||
- sizeof (NameString) = 4 (the name is "DEV0" for instance);
|
||||
- sizeof (TermList) = (2^6-6)
|
||||
then the PkgLen is encoded on 1 byte. Indeed, its value is:
|
||||
sizeof (PkgLen) + sizeof (NameString) + sizeof (TermList) =
|
||||
sizeof (PkgLen) + 4 + (2^6-6)
|
||||
So:
|
||||
PkgLen = sizeof (PkgLen) + (2^6-2)
|
||||
|
||||
The input arguments Length and PkgLen represent, for the DefDevice:
|
||||
DefDevice := DeviceOp PkgLength NameString TermList
|
||||
|------Length-----|
|
||||
|--------*PgkLength---------|
|
||||
|
||||
@param [in] Length The length to encode as a PkgLen.
|
||||
Length cannot exceed 2^28 - 4 (4 bytes for the
|
||||
PkgLen encoding).
|
||||
The size of the PkgLen encoding bytes should not be
|
||||
counted in this length value.
|
||||
@param [out] PkgLen If success, contains the value of the PkgLen,
|
||||
ready to encode in the PkgLen format.
|
||||
This value takes into account the size of PkgLen
|
||||
encoding.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlComputePkgLength (
|
||||
IN UINT32 Length,
|
||||
OUT UINT32 * PkgLen
|
||||
);
|
||||
|
||||
#endif // AML_H_
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# AML Generation Library
|
||||
#
|
||||
# Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
@@ -66,7 +66,6 @@
|
||||
DynamicTablesPkg/DynamicTablesPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
AcpiHelperLib
|
||||
BaseLib
|
||||
|
||||
[BuildOptions]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
AML Api.
|
||||
|
||||
Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
@@ -222,7 +222,7 @@ AmlNameOpUpdateString (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/** Get the first Resource Data element contained in a named object.
|
||||
/** Get the first Resource Data element contained in a "_CRS" object.
|
||||
|
||||
In the following ASL code, the function will return the Resource Data
|
||||
node corresponding to the "QWordMemory ()" ASL macro.
|
||||
@@ -233,33 +233,35 @@ AmlNameOpUpdateString (
|
||||
)
|
||||
|
||||
Note:
|
||||
"_CRS" names defined as methods are not handled by this function.
|
||||
They must be defined as names, using the "Name ()" statement.
|
||||
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
|
||||
- "_CRS" declared using ASL "Method (Declare Control Method)" is not
|
||||
supported.
|
||||
|
||||
@param [in] NameOpNode NameOp object node defining a named object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the named object. A Resource Data element
|
||||
is stored in a data node.
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the "_CRS" object. A Resource Data element
|
||||
is stored in a data node.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpNode,
|
||||
AmlNameOpCrsGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
)
|
||||
{
|
||||
AML_OBJECT_NODE_HANDLE BufferOpNode;
|
||||
AML_DATA_NODE_HANDLE FirstRdNode;
|
||||
|
||||
if ((NameOpNode == NULL) ||
|
||||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpNode) != EAmlNodeObject) ||
|
||||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0)) ||
|
||||
if ((NameOpCrsNode == NULL) ||
|
||||
(AmlGetNodeType ((AML_NODE_HANDLE)NameOpCrsNode) != EAmlNodeObject) ||
|
||||
(!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0)) ||
|
||||
(!AmlNameOpCompareName (NameOpCrsNode, "_CRS")) ||
|
||||
(OutRdNode == NULL)) {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -267,10 +269,10 @@ AmlNameOpGetFirstRdNode (
|
||||
|
||||
*OutRdNode = NULL;
|
||||
|
||||
// Get the value of the variable which is represented as a BufferOp object
|
||||
// node which is the 2nd fixed argument (i.e. index 1).
|
||||
// Get the _CRS value which is represented as a BufferOp object node
|
||||
// which is the 2nd fixed argument (i.e. index 1).
|
||||
BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
|
||||
NameOpNode,
|
||||
NameOpCrsNode,
|
||||
EAmlParseIndexTerm1
|
||||
);
|
||||
if ((BufferOpNode == NULL) ||
|
||||
@@ -308,12 +310,11 @@ AmlNameOpGetFirstRdNode (
|
||||
}
|
||||
)
|
||||
|
||||
Note:
|
||||
"_CRS" names defined as methods are not handled by this function.
|
||||
They must be defined as names, using the "Name ()" statement.
|
||||
The CurrRdNode Resource Data node must be defined in an object named "_CRS"
|
||||
and defined by a "Name ()" ASL function.
|
||||
|
||||
@param [in] CurrRdNode Pointer to the current Resource Data element of
|
||||
the named object.
|
||||
the "_CRS" object.
|
||||
@param [out] OutRdNode Pointer to the Resource Data element following
|
||||
the CurrRdNode.
|
||||
Contain a NULL pointer if CurrRdNode is the
|
||||
@@ -326,12 +327,12 @@ AmlNameOpGetFirstRdNode (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpGetNextRdNode (
|
||||
AmlNameOpCrsGetNextRdNode (
|
||||
IN AML_DATA_NODE_HANDLE CurrRdNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
)
|
||||
{
|
||||
AML_OBJECT_NODE_HANDLE NameOpNode;
|
||||
AML_OBJECT_NODE_HANDLE NameOpCrsNode;
|
||||
AML_OBJECT_NODE_HANDLE BufferOpNode;
|
||||
|
||||
if ((CurrRdNode == NULL) ||
|
||||
@@ -355,11 +356,12 @@ AmlNameOpGetNextRdNode (
|
||||
}
|
||||
|
||||
// The parent of the BufferOpNode must be a NameOp node.
|
||||
NameOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetParent (
|
||||
(AML_NODE_HANDLE)BufferOpNode
|
||||
);
|
||||
if ((NameOpNode == NULL) ||
|
||||
(!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) {
|
||||
NameOpCrsNode = (AML_OBJECT_NODE_HANDLE)AmlGetParent (
|
||||
(AML_NODE_HANDLE)BufferOpNode
|
||||
);
|
||||
if ((NameOpCrsNode == NULL) ||
|
||||
(!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0)) ||
|
||||
(!AmlNameOpCompareName (NameOpCrsNode, "_CRS"))) {
|
||||
ASSERT (0);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -378,88 +380,3 @@ AmlNameOpGetNextRdNode (
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
// DEPRECATED APIS
|
||||
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
||||
/** DEPRECATED API
|
||||
|
||||
Get the first Resource Data element contained in a "_CRS" object.
|
||||
|
||||
In the following ASL code, the function will return the Resource Data
|
||||
node corresponding to the "QWordMemory ()" ASL macro.
|
||||
Name (_CRS, ResourceTemplate() {
|
||||
QWordMemory (...) {...},
|
||||
Interrupt (...) {...}
|
||||
}
|
||||
)
|
||||
|
||||
Note:
|
||||
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
|
||||
- "_CRS" declared using ASL "Method (Declare Control Method)" is not
|
||||
supported.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
|
||||
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [out] OutRdNode Pointer to the first Resource Data element of
|
||||
the "_CRS" object. A Resource Data element
|
||||
is stored in a data node.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpCrsGetFirstRdNode (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
)
|
||||
{
|
||||
return AmlNameOpGetFirstRdNode (NameOpCrsNode, OutRdNode);
|
||||
}
|
||||
|
||||
/** DEPRECATED API
|
||||
|
||||
Get the Resource Data element following the CurrRdNode Resource Data.
|
||||
|
||||
In the following ASL code, if CurrRdNode corresponds to the first
|
||||
"QWordMemory ()" ASL macro, the function will return the Resource Data
|
||||
node corresponding to the "Interrupt ()" ASL macro.
|
||||
Name (_CRS, ResourceTemplate() {
|
||||
QwordMemory (...) {...},
|
||||
Interrupt (...) {...}
|
||||
}
|
||||
)
|
||||
|
||||
The CurrRdNode Resource Data node must be defined in an object named "_CRS"
|
||||
and defined by a "Name ()" ASL function.
|
||||
|
||||
@ingroup UserApis
|
||||
|
||||
@param [in] CurrRdNode Pointer to the current Resource Data element of
|
||||
the "_CRS" variable.
|
||||
@param [out] OutRdNode Pointer to the Resource Data element following
|
||||
the CurrRdNode.
|
||||
Contain a NULL pointer if CurrRdNode is the
|
||||
last Resource Data element in the list.
|
||||
The "End Tag" is not considered as a resource
|
||||
data element and is not returned.
|
||||
|
||||
@retval EFI_SUCCESS The function completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
AmlNameOpCrsGetNextRdNode (
|
||||
IN AML_DATA_NODE_HANDLE CurrRdNode,
|
||||
OUT AML_DATA_NODE_HANDLE * OutRdNode
|
||||
)
|
||||
{
|
||||
return AmlNameOpGetNextRdNode (CurrRdNode, OutRdNode);
|
||||
}
|
||||
|
||||
#endif // DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user