Date   

[edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver

Agyeman, Prince
 

Added a generic Super I/O driver that produces the
Sio protocol. This driver was moved from the
SimicsOpenBoardPkg.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
.../Intel/BoardModulePkg/BoardModulePkg.dsc | 5 +
.../LegacySioDxe/ComponentName.c | 173 +++++
.../LegacySioDxe/ComponentName.h | 87 +++
.../LegacySioDxe/LegacySioDxe.inf | 51 ++
.../BoardModulePkg/LegacySioDxe/Register.h | 15 +
.../BoardModulePkg/LegacySioDxe/SioChip.c | 270 ++++++++
.../BoardModulePkg/LegacySioDxe/SioChip.h | 185 ++++++
.../BoardModulePkg/LegacySioDxe/SioDriver.c | 600 ++++++++++++++++++
.../BoardModulePkg/LegacySioDxe/SioDriver.h | 133 ++++
.../BoardModulePkg/LegacySioDxe/SioService.c | 249 ++++++++
.../BoardModulePkg/LegacySioDxe/SioService.h | 143 +++++
11 files changed, 1911 insertions(+)
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.c
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.h
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/Register.h
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.h
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.c
create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.h

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
index 5ec68ceebf..5af26eb97e 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
@@ -32,6 +32,10 @@
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+ UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+ UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+ UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

[LibraryClasses.common.PEIM]
FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf
@@ -76,6 +80,7 @@

[Components]
BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMediaInfoPei.inf
+ BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLibNull.inf

diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.c
new file mode 100644
index 0000000000..c9b3df0473
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.c
@@ -0,0 +1,173 @@
+/** @file
+ Component Name functions implementation for the Super I/O DXE driver.
+
+ Copyright (c) 2013 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "SioDriver.h"
+
+///
+/// Component Name Protocol instance
+///
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mSioComponentName = {
+ SioComponentNameGetDriverName,
+ SioComponentNameGetControllerName,
+ "eng"
+};
+
+///
+/// Component Name 2 Protocol instance
+///
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mSioComponentName2 = {
+ (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SioComponentNameGetDriverName,
+ (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)SioComponentNameGetControllerName,
+ "en"
+};
+
+///
+/// Table of driver names
+///
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioDriverNameTable[] = {
+ {
+ "eng;en",
+ L"Super I/O Driver"
+ },
+ {
+ NULL,
+ NULL
+ }
+};
+
+///
+/// Table of Controller names
+///
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioControllerNameTable[] = {
+ {
+ "eng;en",
+ L"Super I/O Controller"
+ },
+ {
+ NULL,
+ NULL
+ }
+};
+
+/**
+ Retrieves a Unicode string that is the user-readable name of the EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param Language A pointer to a three-character ISO 639-2 language identifier.
+ This is the language of the driver name that that the caller
+ is requesting, and it must match one of the languages specified
+ in SupportedLanguages. The number of languages supported by a
+ driver is up to the driver writer.
+ @param DriverName A pointer to the Unicode string to return. This Unicode string
+ is the name of the driver specified by This in the language
+ specified by Language.
+
+ @retval EFI_SUCCESS The Unicode string for the Driver specified by This
+ and the language specified by Language was returned
+ in DriverName.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+EFI_STATUS
+EFIAPI
+SioComponentNameGetDriverName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+ )
+{
+ return LookupUnicodeString2 (
+ Language,
+ This->SupportedLanguages,
+ mSioDriverNameTable,
+ DriverName,
+ (BOOLEAN)(This == &mSioComponentName)
+ );
+}
+
+/**
+ Retrieves a Unicode string that is the user readable name of the controller
+ that is being managed by an EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param ControllerHandle The handle of a controller that the driver specified by
+ This is managing. This handle specifies the controller
+ whose name is to be returned.
+ @param ChildHandle The handle of the child controller to retrieve the name
+ of. This is an optional parameter that may be NULL. It
+ will be NULL for device drivers. It will also be NULL
+ for a bus drivers that wish to retrieve the name of the
+ bus controller. It will not be NULL for a bus driver
+ that wishes to retrieve the name of a child controller.
+ @param Language A pointer to a three character ISO 639-2 language
+ identifier. This is the language of the controller name
+ that the caller is requesting, and it must match one
+ of the languages specified in SupportedLanguages. The
+ number of languages supported by a driver is up to the
+ driver writer.
+ @param ControllerName A pointer to the Unicode string to return. This Unicode
+ string is the name of the controller specified by
+ ControllerHandle and ChildHandle in the language specified
+ by Language, from the point of view of the driver specified
+ by This.
+
+ @retval EFI_SUCCESS The Unicode string for the user-readable name in the
+ language specified by Language for the driver
+ specified by This was returned in DriverName.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
+ the controller specified by ControllerHandle and
+ ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+EFI_STATUS
+EFIAPI
+SioComponentNameGetControllerName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Make sure this driver is currently managing ControllHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ mSioDriver.DriverBindingHandle,
+ &gEfiPciIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ //
+ // ChildHandle must be NULL for a Device Driver
+ //
+ if (ChildHandle != NULL) {
+ return EFI_UNSUPPORTED;
+ }
+
+ return LookupUnicodeString2 (
+ Language,
+ This->SupportedLanguages,
+ mSioControllerNameTable,
+ ControllerName,
+ (BOOLEAN)(This == &mSioComponentName)
+ );
+}
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.h
new file mode 100644
index 0000000000..85ca348701
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.h
@@ -0,0 +1,87 @@
+/** @file
+ Component Name functions declaration for Super I/O DXE driver.
+
+ Copyright (c) 2013 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+/**
+ Retrieves a Unicode string that is the user-readable name of the EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param Language A pointer to a three-character ISO 639-2 language identifier.
+ This is the language of the driver name that that the caller
+ is requesting, and it must match one of the languages specified
+ in SupportedLanguages. The number of languages supported by a
+ driver is up to the driver writer.
+ @param DriverName A pointer to the Unicode string to return. This Unicode string
+ is the name of the driver specified by This in the language
+ specified by Language.
+
+ @retval EFI_SUCCESS The Unicode string for the Driver specified by This
+ and the language specified by Language was returned
+ in DriverName.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER DriverName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+EFI_STATUS
+EFIAPI
+SioComponentNameGetDriverName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+ );
+
+/**
+ Retrieves a Unicode string that is the user readable name of the controller
+ that is being managed by an EFI Driver.
+
+ @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ @param ControllerHandle The handle of a controller that the driver specified by
+ This is managing. This handle specifies the controller
+ whose name is to be returned.
+ @param ChildHandle The handle of the child controller to retrieve the name
+ of. This is an optional parameter that may be NULL. It
+ will be NULL for device drivers. It will also be NULL
+ for a bus drivers that wish to retrieve the name of the
+ bus controller. It will not be NULL for a bus driver
+ that wishes to retrieve the name of a child controller.
+ @param Language A pointer to a three character ISO 639-2 language
+ identifier. This is the language of the controller name
+ that the caller is requesting, and it must match one
+ of the languages specified in SupportedLanguages. The
+ number of languages supported by a driver is up to the
+ driver writer.
+ @param ControllerName A pointer to the Unicode string to return. This Unicode
+ string is the name of the controller specified by
+ ControllerHandle and ChildHandle in the language specified
+ by Language, from the point of view of the driver specified
+ by This.
+
+ @retval EFI_SUCCESS The Unicode string for the user-readable name in the
+ language specified by Language for the driver
+ specified by This was returned in DriverName.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Language is NULL.
+ @retval EFI_INVALID_PARAMETER ControllerName is NULL.
+ @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
+ the controller specified by ControllerHandle and
+ ChildHandle.
+ @retval EFI_UNSUPPORTED The driver specified by This does not support the
+ language specified by Language.
+
+**/
+EFI_STATUS
+EFIAPI
+SioComponentNameGetControllerName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+ );
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
new file mode 100644
index 0000000000..f01f63e69e
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
@@ -0,0 +1,51 @@
+## @file
+# Module information that produces the
+# EFI_SIO_PROTOCOL.
+#
+# Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010017
+ BASE_NAME = LegacySioDxe
+ FILE_GUID = 7807E404-8281-4FF1-8457-0B54BABE263F
+ VERSION_STRING = 1.0
+ MODULE_TYPE = UEFI_DRIVER
+ ENTRY_POINT = SioDriverEntryPoint
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[LibraryClasses]
+ BaseLib
+ UefiLib
+ DebugLib
+ MemoryAllocationLib
+ PcdLib
+ DevicePathLib
+ UefiDriverEntryPoint
+ UefiBootServicesTableLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+[Sources]
+ SioChip.c
+ SioChip.h
+ SioService.c
+ SioService.h
+ SioDriver.c
+ SioDriver.h
+ ComponentName.c
+
+[Protocols]
+ gEfiPciIoProtocolGuid ## CONSUMES
+ gEfiDevicePathProtocolGuid ## PRODUCES
+ gEfiSioProtocolGuid ## PRODUCES
+
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/Register.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/Register.h
new file mode 100644
index 0000000000..f61f713cf2
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/Register.h
@@ -0,0 +1,15 @@
+/** @file
+ Super I/O register definitions
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _REGISTER_H_
+#define _REGISTER_H_
+
+#define EC_COMMAND_PORT 0x66
+#define EC_DATA_PORT 0x62
+
+#endif
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
new file mode 100644
index 0000000000..81efe3c38b
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
@@ -0,0 +1,270 @@
+/** @file
+ Super I/O specific implementation.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "SioDriver.h"
+
+//
+// System configuration (setup) information
+//
+// SYSTEM_CONFIGURATION mSystemConfiguration;
+
+//
+// COM 1 UART Controller
+//
+ACPI_SIO_RESOURCES_IO_IRQ mCom1Resources = {
+ {
+ { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
+ 0x3f8,
+ 8
+ },
+ {
+ { ACPI_IRQ_NOFLAG_DESCRIPTOR },
+ BIT4 // IRQ4
+ },
+ {
+ ACPI_END_TAG_DESCRIPTOR,
+ 0
+ }
+};
+
+//
+// PS/2 Keyboard Controller
+//
+ACPI_SIO_RESOURCES_IO_IRQ mKeyboardResources = {
+ {
+ { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
+ 0x60,
+ 5
+ },
+ {
+ { ACPI_IRQ_NOFLAG_DESCRIPTOR },
+ BIT1
+ },
+ {
+ ACPI_END_TAG_DESCRIPTOR,
+ 0
+ }
+};
+
+//
+// PS/2 Mouse Controller
+//
+ACPI_SIO_RESOURCES_IO_IRQ mMouseResources = {
+ {
+ { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
+ 0x60,
+ 5
+ },
+ {
+ { ACPI_IRQ_NOFLAG_DESCRIPTOR },
+ BIT12
+ },
+ {
+ ACPI_END_TAG_DESCRIPTOR,
+ 0
+ }
+};
+
+//
+// Table of SIO Controllers
+//
+DEVICE_INFO mDeviceInfo[] = {
+ {
+ {
+ EISA_PNP_ID(0x501),
+ 0
+ },
+ 0,
+ RESOURCE_IO | RESOURCE_IRQ,
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
+ }, // COM 1 UART Controller
+ {
+ {
+ EISA_PNP_ID(0x303),
+ 0
+ },
+ 0,
+ 0, // Cannot change resource
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mKeyboardResources },
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mKeyboardResources }
+ }, // PS/2 Keyboard Controller
+ {
+ {
+ EISA_PNP_ID(0xF03),
+ 0
+ },
+ 0,
+ 0, // Cannot change resource
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
+ { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
+ } // PS/2 Mouse Controller
+};
+
+
+/**
+ Return the supported devices.
+
+ @param[out] Devices Pointer to pointer of EFI_SIO_ACPI_DEVICE_ID.
+ Caller is responsible to free the buffer.
+ @param[out] Count Pointer to UINTN holding the device count.
+**/
+VOID
+DeviceGetList (
+ OUT EFI_SIO_ACPI_DEVICE_ID **Devices,
+ OUT UINTN *Count
+ )
+{
+ EFI_SIO_ACPI_DEVICE_ID *LocalDevices;
+ UINTN LocalCount;
+ UINTN DeviceCount;
+ UINTN Index;
+
+ //
+ // Allocate enough memory for simplicity
+ //
+ DeviceCount = sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
+ LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceCount);
+ ASSERT (LocalDevices != NULL);
+ if (LocalDevices == NULL) {
+ return;
+ }
+ LocalCount = 0;
+
+ for (Index = 0; Index < DeviceCount; Index++) {
+ CopyMem (&LocalDevices[LocalCount], &mDeviceInfo[Index].Device, sizeof (EFI_SIO_ACPI_DEVICE_ID));
+ LocalCount++;
+ }
+
+ *Devices = LocalDevices;
+ *Count = LocalCount;
+}
+
+
+/**
+ Super I/O controller initialization.
+
+ @retval EFI_SUCCESS The super I/O controller is found and initialized.
+ @retval EFI_UNSUPPORTED The super I/O controller is not found.
+**/
+EFI_STATUS
+SioInit (
+ VOID
+ )
+{
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Find the DEVICE_INFO for specified Device.
+
+ @param[in] Device Pointer to the EFI_SIO_ACPI_DEVICE_ID.
+
+ @retval DEVICE_INFO* Pointer to the DEVICE_INFO.
+**/
+DEVICE_INFO *
+DeviceSearch (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device
+ )
+{
+ UINTN Index;
+
+ for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); Index++) {
+ if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) == 0) {
+ return &mDeviceInfo[Index];
+ }
+ }
+
+ ASSERT (FALSE);
+ return NULL;
+}
+
+
+/**
+ Program the SIO chip to enable the specified device using the default resource.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+**/
+VOID
+DeviceEnable (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device
+ )
+{
+}
+
+
+/**
+ Get the ACPI resources for specified device.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_SUCCESS The resources are returned successfully.
+**/
+EFI_STATUS
+DeviceGetResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ OUT ACPI_RESOURCE_HEADER_PTR *Resources
+ )
+{
+ DEVICE_INFO *DeviceInfo;
+
+ DeviceInfo = DeviceSearch (Device);
+
+ *Resources = DeviceInfo->Resources;
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Set the ACPI resources for specified device.
+
+ The SIO chip is programmed to use the new resources and the
+ resources setting are saved. The function assumes the resources
+ are valid.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[in] Resources ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_UNSUPPORTED
+**/
+EFI_STATUS
+DeviceSetResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ IN ACPI_RESOURCE_HEADER_PTR Resources
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+
+/**
+ Get the possible ACPI resources for specified device.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_SUCCESS The resources are returned successfully.
+**/
+EFI_STATUS
+DevicePossibleResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ OUT ACPI_RESOURCE_HEADER_PTR *Resources
+ )
+{
+ DEVICE_INFO *DeviceInfo;
+
+ DeviceInfo = DeviceSearch (Device);
+
+ *Resources = DeviceInfo->PossibleResources;
+
+ return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
new file mode 100644
index 0000000000..9322365923
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
@@ -0,0 +1,185 @@
+/** @file
+ Super I/O specific header.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _SIO_H_
+#define _SIO_H_
+
+
+#include "Register.h"
+
+typedef
+UINT8
+(EFIAPI *LOCAL_IO_WRITE8) (
+ IN UINTN Port,
+ IN UINT8 Value
+ );
+
+#define RESOURCE_IO BIT0
+#define RESOURCE_IRQ BIT1
+#define RESOURCE_DMA BIT2
+#define RESOURCE_MEM BIT3
+
+#pragma pack(1)
+
+typedef struct {
+ EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR Io;
+ EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR Irq;
+ EFI_ACPI_END_TAG_DESCRIPTOR End;
+} ACPI_SIO_RESOURCES_IO_IRQ;
+#pragma pack()
+
+typedef struct {
+ UINT32 HID;
+ UINT32 UID;
+} EFI_SIO_ACPI_DEVICE_ID;
+
+typedef struct {
+ EFI_SIO_ACPI_DEVICE_ID Device;
+ UINT8 DeviceId;
+ UINT8 ResourceMask;
+ ACPI_RESOURCE_HEADER_PTR Resources;
+ ACPI_RESOURCE_HEADER_PTR PossibleResources;
+} DEVICE_INFO;
+
+/**
+ Return the supported devices.
+
+ @param[out] Devices Pointer to pointer of EFI_SIO_ACPI_DEVICE_ID.
+ Caller is responsible to free the buffer.
+ @param[out] Count Pointer to UINTN holding the device count.
+**/
+VOID
+DeviceGetList (
+ OUT EFI_SIO_ACPI_DEVICE_ID **Devices,
+ OUT UINTN *Count
+ );
+
+
+/**
+ Program the SIO chip to enable the specified device using the default resource.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+**/
+VOID
+DeviceEnable (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device
+ );
+
+
+/**
+ Get the possible ACPI resources for specified device.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_SUCCESS The resources are returned successfully.
+**/
+EFI_STATUS
+DevicePossibleResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ OUT ACPI_RESOURCE_HEADER_PTR *Resources
+ );
+
+
+/**
+ Set the ACPI resources for specified device.
+
+ The SIO chip is programmed to use the new resources and the
+ resources setting are saved. The function assumes the resources
+ are valid.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[in] Resources ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_SUCCESS The resources are set successfully.
+**/
+EFI_STATUS
+DeviceSetResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ IN ACPI_RESOURCE_HEADER_PTR Resources
+ );
+
+
+/**
+ Get the ACPI resources for specified device.
+
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
+
+ @retval EFI_SUCCESS The resources are returned successfully.
+**/
+EFI_STATUS
+DeviceGetResources (
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ OUT ACPI_RESOURCE_HEADER_PTR *Resources
+ );
+
+
+/**
+ Program the SIO chip to enter the configure mode.
+**/
+VOID
+EnterConfigMode (
+ VOID
+ );
+
+
+/**
+ Program the SIO chip to exit the configure mode.
+**/
+VOID
+ExitConfigMode (
+ VOID
+ );
+
+
+/**
+ Perform a 8-bit I/O write to SIO register.
+
+ @param[in] Index The register index.
+ @param[in] Data The value to write to register.
+**/
+VOID
+WriteRegister (
+ IN UINT8 Index,
+ IN UINT8 Data
+ );
+
+
+/**
+ Perform a 8-bit I/O read from SIO register.
+
+ @param[in] Index The register index.
+
+ @retval Value The value written to the register.
+**/
+UINT8
+ReadRegister (
+ IN UINT8 Index
+ );
+
+//
+// Prototypes for the sio internal function
+//
+//
+// Internal function
+//
+
+
+/**
+ Find Super I/O controller.
+
+ @retval EFI_SUCCESS Super I/O controller exists.
+ @retval EFI_UNSUPPORTED Super I/O controller does not exist.
+**/
+EFI_STATUS
+SioInit (
+ VOID
+ );
+
+#endif
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
new file mode 100644
index 0000000000..408c6ff301
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
@@ -0,0 +1,600 @@
+/** @file
+ EFI Driver following Driver Binding Protocol.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "SioDriver.h"
+
+
+//
+// This driver is for ACPI(PNP0A03,0)/PCI(0x1f,0)
+//
+//
+// Sio Driver Global Variables
+//
+EFI_DRIVER_BINDING_PROTOCOL mSioDriver = {
+ SioDriverSupported,
+ SioDriverStart,
+ SioDriverStop,
+ 1,
+ NULL,
+ NULL
+};
+
+//
+// The list of the created SIO_DEV
+//
+LIST_ENTRY mSioDevPool = INITIALIZE_LIST_HEAD_VARIABLE (mSioDevPool);
+
+//
+// Template structure to create SIO_DEV
+//
+SIO_DEV mSioDevTemplate = {
+ SIO_DEV_SIGNATURE, // Signature
+ NULL, // PciHandle
+ {
+ 0x00000000, // HID
+ 0x00000000 // UID
+ },
+ NULL, // Handle
+ { // Sio Instance
+ SioRegisterAccess,
+ SioGetResources,
+ SioSetResources,
+ SioPossibleResources,
+ SioModify
+ },
+ NULL, // DevicePath
+ {
+ NULL, // ForwardLink
+ NULL, // BackLink
+ }
+};
+
+//
+// Template ACPI_HID_DEVICE_PATH structure to create device path
+//
+ACPI_HID_DEVICE_PATH mAcpiNodeTemplate = {
+ {
+ ACPI_DEVICE_PATH, // Type
+ ACPI_DP, // SubType
+ {
+ sizeof (ACPI_HID_DEVICE_PATH), // Length[0]
+ 0 // Length[1]
+ }
+ },
+ 0x00000000, // HID
+ 0x00000000 // UID
+};
+
+
+/**
+ The user Entry Point for module Lpc47m17x. The user code starts with this function.
+
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.
+ @param[in] SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The entry point is executed successfully.
+ @retval other Some error occurs when executing this entry point.
+**/
+EFI_STATUS
+EFIAPI
+SioDriverEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ if (EFI_ERROR (SioInit())) {
+ return EFI_UNSUPPORTED;
+ } else {
+
+ //
+ // Install protocols
+ //
+ return EfiLibInstallDriverBindingComponentName2 (
+ ImageHandle,
+ SystemTable,
+ &mSioDriver,
+ ImageHandle,
+ &mSioComponentName,
+ &mSioComponentName2
+ );
+ }
+}
+
+
+/**
+ Test to see if this driver supports Controller Handle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to test
+ @param[in] RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver supports this device
+ @retval EFI_ALREADY_STARTED This driver is already running on this device
+ @retval other This driver does not support this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverSupported (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ )
+{
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
+ ACPI_HID_DEVICE_PATH *AcpiNode;
+ PCI_TYPE00 Pci;
+ UINTN Index;
+ EFI_SIO_ACPI_DEVICE_ID *Devices;
+ UINTN Count;
+ UINTN SegmentNumber;
+ UINTN BusNumber;
+ UINTN DeviceNumber;
+ UINTN FunctionNumber;
+
+ //
+ // If RemainingDevicePath is not NULL, it should verify that the first device
+ // path node in RemainingDevicePath is an ACPI Device path node which is a
+ // legal Device Path Node for this bus driver's children.
+ //
+ if (RemainingDevicePath != NULL) {
+ if (!IsDevicePathEnd (RemainingDevicePath)) {
+ if ((RemainingDevicePath->Type != ACPI_DEVICE_PATH) ||
+ (((RemainingDevicePath->SubType != ACPI_DP) || (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_HID_DEVICE_PATH))) &&
+ ((RemainingDevicePath->SubType != ACPI_EXTENDED_DP) || (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_EXTENDED_HID_DEVICE_PATH))))
+ ) {
+ return EFI_UNSUPPORTED;
+ }
+
+ DeviceGetList (&Devices, &Count);
+ if (Devices == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+ AcpiNode = (ACPI_HID_DEVICE_PATH *) RemainingDevicePath;
+ for (Index = 0; Index < Count; Index++) {
+ if ((AcpiNode->HID == Devices[Index].HID) &&
+ (AcpiNode->UID == Devices[Index].UID)) {
+ break;
+ }
+ }
+ FreePool (Devices);
+ if (Index == Count) {
+ return EFI_UNSUPPORTED;
+ }
+ }
+ }
+
+ //
+ // See if the parent device path can be opened BY_DRIVER
+ //
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &ParentDevicePath,
+ This->DriverBindingHandle,
+ Controller,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
+ return Status;
+ }
+
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+
+ //
+ // Get PciIo protocol instance
+ //
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo,
+ This->DriverBindingHandle,
+ Controller,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+
+ if (!EFI_ERROR (Status)) {
+ Status = PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ 0,
+ sizeof (Pci) / sizeof (UINT32),
+ &Pci
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = EFI_UNSUPPORTED;
+ if ((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEMORY_SPACE))
+ == (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEMORY_SPACE)
+ ) {
+ if (Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) {
+ //
+ // See if this is a standard PCI to ISA Bridge from the Base Code and Class Code
+ //
+ if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA) {
+ Status = EFI_SUCCESS;
+ }
+
+ //
+ // See if this is an Intel PCI to ISA Bridge in Positive Decode Mode
+ //
+ if ((Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE) &&
+ (Pci.Hdr.VendorId == 0x8086)) {
+ //
+ // See if this is on Function #0 to avoid false positive on
+ // PCI_CLASS_BRIDGE_OTHER that has the same value as
+ // PCI_CLASS_BRIDGE_ISA_PDECODE
+ //
+ Status = PciIo->GetLocation (
+ PciIo,
+ &SegmentNumber,
+ &BusNumber,
+ &DeviceNumber,
+ &FunctionNumber
+ );
+ if (!EFI_ERROR (Status) && (FunctionNumber == 0)) {
+ Status = EFI_SUCCESS;
+ } else {
+ Status = EFI_UNSUPPORTED;
+ }
+ }
+ }
+ }
+
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ }
+ if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Destroy the SIO controller handle.
+
+ @param[in] ChildHandle The SIO controller handle.
+
+ @retval EFI_SUCCESS The SIO controller handle is destroyed successfully.
+**/
+EFI_STATUS
+SioDestroyDevice (
+ IN EFI_HANDLE ChildHandle
+ )
+{
+ EFI_STATUS Status;
+ SIO_DEV *SioDev;
+ EFI_SIO_PROTOCOL *Sio;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+
+ Status = gBS->HandleProtocol (
+ ChildHandle,
+ &gEfiSioProtocolGuid,
+ (VOID **) &Sio
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ SioDev = SIO_DEV_FROM_THIS (Sio);
+
+ Status = gBS->CloseProtocol (
+ SioDev->PciHandle,
+ &gEfiPciIoProtocolGuid,
+ mSioDriver.DriverBindingHandle,
+ ChildHandle
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ChildHandle,
+ &gEfiDevicePathProtocolGuid,
+ SioDev->DevicePath,
+ &gEfiSioProtocolGuid,
+ &SioDev->Sio,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ gBS->OpenProtocol (
+ SioDev->PciHandle,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo,
+ mSioDriver.DriverBindingHandle,
+ ChildHandle,
+ EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
+ );
+ return Status;
+ }
+
+ RemoveEntryList (&SioDev->Link);
+ FreePool (SioDev->DevicePath);
+ FreePool (SioDev);
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Create the SIO controller handle.
+
+ @param[in] Controller The parent PCI controller handle.
+ @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
+ @param[in] ParentDevicePath The device path of the parent controller.
+ @param[out] PciIo The PciIo instance of the parent controller.
+**/
+VOID
+SioCreateDevice (
+ IN EFI_HANDLE Controller,
+ IN EFI_SIO_ACPI_DEVICE_ID *Device,
+ IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
+ OUT EFI_PCI_IO_PROTOCOL *PciIo
+ )
+{
+ EFI_STATUS Status;
+ SIO_DEV *SioDev;
+
+ DeviceEnable (Device);
+ SioDev = AllocateCopyPool (sizeof (SIO_DEV), &mSioDevTemplate);
+ ASSERT (SioDev != NULL);
+ if (SioDev == NULL) {
+ return;
+ }
+ InsertHeadList (&mSioDevPool, &SioDev->Link);
+
+ SioDev->PciHandle = Controller;
+
+ CopyMem (&SioDev->Device, Device, sizeof (*Device));
+
+ mAcpiNodeTemplate.HID = Device->HID;
+ mAcpiNodeTemplate.UID = Device->UID;
+ SioDev->DevicePath = AppendDevicePathNode (ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &mAcpiNodeTemplate);
+ ASSERT (SioDev->DevicePath != NULL);
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &SioDev->Handle,
+ &gEfiSioProtocolGuid, &SioDev->Sio,
+ &gEfiDevicePathProtocolGuid, SioDev->DevicePath,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo,
+ mSioDriver.DriverBindingHandle,
+ SioDev->Handle,
+ EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
+ );
+ ASSERT_EFI_ERROR (Status);
+}
+
+
+/**
+ Start this driver on ControllerHandle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to bind driver to
+ @param[in] RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver is added to ControllerHandle
+ @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
+ @retval other This driver does not support this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverStart (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ )
+{
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
+ EFI_SIO_ACPI_DEVICE_ID *Devices;
+ SIO_DEV *SioDev;
+ UINTN Count;
+ UINTN Index;
+ ACPI_HID_DEVICE_PATH *AcpiNode;
+ BOOLEAN *HasCreated;
+ BOOLEAN *RequestCreate;
+ LIST_ENTRY *Node;
+
+ HasCreated = NULL;
+ RequestCreate = NULL;
+ //
+ // Get the ISA bridge's Device Path
+ //
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &ParentDevicePath,
+ This->DriverBindingHandle,
+ Controller,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
+ return Status;
+ }
+
+ //
+ // Get Pci IO
+ //
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo,
+ This->DriverBindingHandle,
+ Controller,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+
+ if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ return Status;
+ }
+
+ if ((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath)) {
+ return EFI_SUCCESS;
+ }
+
+ DeviceGetList (&Devices, &Count);
+ if (Devices == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto Exit_Start;
+ }
+ HasCreated = AllocatePool (sizeof (BOOLEAN) * Count);
+ ASSERT (HasCreated != NULL);
+ if (HasCreated == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto Exit_Start;
+ }
+ RequestCreate = AllocatePool (sizeof (BOOLEAN) * Count);
+ ASSERT (RequestCreate != NULL);
+ if (RequestCreate == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto Exit_Start;
+ }
+
+ //
+ // Assume no children has been created.
+ // Assume the SIO interface hasn't been initialized.
+ //
+ ZeroMem (HasCreated, sizeof (BOOLEAN) * Count);
+
+ if (Status == EFI_ALREADY_STARTED) {
+ for (Node = GetFirstNode (&mSioDevPool);
+ !IsNull (&mSioDevPool, Node);
+ Node = GetNextNode (&mSioDevPool, Node)
+ ) {
+ SioDev = CR (Node, SIO_DEV, Link, SIO_DEV_SIGNATURE);
+ Status = gBS->HandleProtocol (
+ SioDev->PciHandle,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &DevicePath
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // See if they are under the same PCI to ISA Bridge
+ //
+ if (CompareMem (DevicePath, ParentDevicePath, GetDevicePathSize (DevicePath)) == 0) {
+ for (Index = 0; Index < Count; Index++) {
+ if (CompareMem (&SioDev->Device, &Devices[Index], sizeof (EFI_SIO_ACPI_DEVICE_ID)) == 0) {
+ HasCreated[Index] = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ AcpiNode = (ACPI_HID_DEVICE_PATH *) RemainingDevicePath;
+ for (Index = 0; Index < Count; Index++) {
+ if ((AcpiNode == NULL) ||
+ ((AcpiNode->HID == Devices[Index].HID) && (AcpiNode->UID == Devices[Index].UID))
+ ) {
+ RequestCreate[Index] = TRUE;
+ } else {
+ RequestCreate[Index] = FALSE;
+ }
+ }
+
+ for (Index = 0; Index < Count; Index++) {
+ if (RequestCreate[Index] && !HasCreated[Index]) {
+ SioCreateDevice (Controller, &Devices[Index], ParentDevicePath, PciIo);
+ }
+ }
+Exit_Start:
+ if (Devices != NULL) {
+ FreePool (Devices);
+ }
+ if (HasCreated != NULL) {
+ FreePool (HasCreated);
+ }
+ if (RequestCreate != NULL) {
+ FreePool (RequestCreate);
+ }
+
+ return Status;
+}
+
+
+/**
+ Stop this driver on ControllerHandle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to stop driver on
+ @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
+ children is zero stop the entire bus driver.
+ @param[in] ChildHandleBuffer List of Child Handles to Stop.
+
+ @retval EFI_SUCCESS This driver is removed ControllerHandle
+ @retval other This driver was not removed from this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverStop (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer
+ )
+{
+ EFI_STATUS Status;
+ UINTN Index;
+ BOOLEAN AllChildrenStopped;
+
+ if (NumberOfChildren == 0) {
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ return EFI_SUCCESS;
+ }
+
+ AllChildrenStopped = TRUE;
+ for (Index = 0; Index < NumberOfChildren; Index++) {
+ Status = SioDestroyDevice (ChildHandleBuffer[Index]);
+ if (EFI_ERROR (Status)) {
+ AllChildrenStopped = FALSE;
+ }
+ }
+
+ if (AllChildrenStopped) {
+ return EFI_SUCCESS;
+ } else {
+ return EFI_DEVICE_ERROR;
+ }
+}
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.h
new file mode 100644
index 0000000000..8817019fbf
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.h
@@ -0,0 +1,133 @@
+/** @file
+ Header file for Driver Binding Protocol.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _SIO_DRIVER_H_
+#define _SIO_DRIVER_H_
+
+#include <PiDxe.h>
+#include <IndustryStandard/Pci.h>
+#include <Library/BaseLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/PciLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/UefiLib.h>
+#include <Library/PcdLib.h>
+
+//
+// Driver Consumed Protocol Prototypes
+//
+#include <Protocol/DriverBinding.h>
+#include <Protocol/PciIo.h>
+#include <Protocol/DevicePath.h>
+
+//
+// Driver Produced Protocol Prototypes
+//
+#include <Protocol/SuperIo.h>
+
+
+#include "SioChip.h"
+#include "SioService.h"
+#include "ComponentName.h"
+
+//
+// Global Variables definitions
+//
+extern EFI_DRIVER_BINDING_PROTOCOL mSioDriver;
+extern EFI_COMPONENT_NAME_PROTOCOL mSioComponentName;
+extern EFI_COMPONENT_NAME2_PROTOCOL mSioComponentName2;
+
+//
+// SIO device private data structure
+//
+#define SIO_DEV_SIGNATURE SIGNATURE_32 ('_', 'S', 'I', 'O')
+
+typedef struct _SIO_DEV {
+ UINT32 Signature;
+ EFI_HANDLE PciHandle;
+ EFI_SIO_ACPI_DEVICE_ID Device;
+ EFI_HANDLE Handle;
+ EFI_SIO_PROTOCOL Sio;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ LIST_ENTRY Link;
+} SIO_DEV;
+
+#define SIO_DEV_FROM_THIS(a) CR (a, SIO_DEV, Sio, SIO_DEV_SIGNATURE)
+
+//
+// Prototypes for Driver model protocol interface
+//
+
+
+/**
+ Test to see if this driver supports Controller Handle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to test
+ @param[in] RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver supports this device
+ @retval EFI_ALREADY_STARTED This driver is already running on this device
+ @retval other This driver does not support this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverSupported (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ );
+
+
+/**
+ Start this driver on ControllerHandle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to bind driver to
+ @param[in] RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver is added to ControllerHandle
+ @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
+ @retval other This driver does not support this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverStart (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ );
+
+
+/**
+ Stop this driver on ControllerHandle.
+
+ @param[in] This Protocol instance pointer.
+ @param[in] Controller Handle of device to stop driver on
+ @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
+ children is zero stop the entire bus driver.
+ @param[in] ChildHandleBuffer List of Child Handles to Stop.
+
+ @retval EFI_SUCCESS This driver is removed ControllerHandle
+ @retval other This driver was not removed from this device
+**/
+EFI_STATUS
+EFIAPI
+SioDriverStop (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE Controller,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer
+ );
+#endif
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.c
new file mode 100644
index 0000000000..379002b833
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.c
@@ -0,0 +1,249 @@
+/** @file
+ Super I/O Interface implementation.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "SioDriver.h"
+
+
+/**
+ Provides an interface to get a list of the current resources consumed by the device in the ACPI
+ Resource Descriptor format.
+
+ GetResources() returns a list of resources currently consumed by the device. The
+ ResourceList is a pointer to the buffer containing resource descriptors for the device. The
+ descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
+ specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
+ resource descriptor.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources
+ used by the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
+ Definitions" below.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioGetResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
+ )
+{
+ SIO_DEV *SioDev;
+
+ if (ResourceList == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ SioDev = SIO_DEV_FROM_THIS (This);
+
+ return DeviceGetResources (&SioDev->Device, ResourceList);
+}
+
+
+/**
+ Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
+ defines a combination of resources that can potentially be used by the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceCollection Collection of the resource descriptor lists.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioPossibleResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
+ )
+{
+ SIO_DEV *SioDev;
+
+ if (ResourceCollection == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ SioDev = SIO_DEV_FROM_THIS (This);
+
+ return DevicePossibleResources (&SioDev->Device, ResourceCollection);
+}
+
+
+/**
+ Sets the resources for the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
+ is defined in the "Related Definitions" section of
+ EFI_SIO_PROTOCOL.GetResources().
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is invalid
+ @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
+**/
+EFI_STATUS
+EFIAPI
+SioSetResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN ACPI_RESOURCE_HEADER_PTR ResourceList
+ )
+{
+ SIO_DEV *SioDev;
+ ACPI_RESOURCE_HEADER_PTR ResourcePtr;
+ ACPI_RESOURCE_HEADER_PTR ResourceCollection;
+ ACPI_RESOURCE_HEADER_PTR ResourcePtr2;
+ BOOLEAN Found;
+
+ ResourcePtr = ResourceList;
+ SioDev = SIO_DEV_FROM_THIS (This);
+
+ //
+ // Check whether the resource is in the possible resource collection
+ //
+ DevicePossibleResources (&SioDev->Device, &ResourceCollection);
+
+ while (ResourcePtr.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {
+
+ Found = FALSE;
+ ResourcePtr2 = ResourceCollection;
+ while (ResourcePtr2.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {
+ if (ResourcePtr2.SmallHeader->Bits.Type == 0) {
+ //
+ // Small Header
+ //
+ if (CompareMem (
+ ResourcePtr2.SmallHeader,
+ ResourcePtr.SmallHeader,
+ ResourcePtr2.SmallHeader->Bits.Length + sizeof (*ResourcePtr2.SmallHeader)
+ ) == 0) {
+ Found = TRUE;
+ break;
+ }
+
+ ResourcePtr2.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr2.SmallHeader
+ + ResourcePtr2.SmallHeader->Bits.Length
+ + sizeof (*ResourcePtr2.SmallHeader));
+
+ } else {
+ //
+ // Large Header
+ //
+ if (CompareMem (
+ ResourcePtr2.LargeHeader,
+ ResourcePtr.LargeHeader,
+ ResourcePtr2.LargeHeader->Length + sizeof (*ResourcePtr2.LargeHeader)
+ ) == 0) {
+ Found = TRUE;
+ break;
+ }
+
+ ResourcePtr2.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr2.LargeHeader
+ + ResourcePtr2.LargeHeader->Length
+ + sizeof (*ResourcePtr2.LargeHeader));
+ }
+ }
+
+ if (!Found) {
+ return EFI_ACCESS_DENIED;
+ }
+
+ if (ResourcePtr.SmallHeader->Bits.Type == 0) {
+ ResourcePtr.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr.SmallHeader
+ + ResourcePtr.SmallHeader->Bits.Length
+ + sizeof (*ResourcePtr.SmallHeader));
+ } else {
+ ResourcePtr.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr.LargeHeader
+ + ResourcePtr.LargeHeader->Length
+ + sizeof (*ResourcePtr.LargeHeader));
+ }
+ }
+
+ //
+ // ResourceList can be set
+ //
+ return DeviceSetResources (&SioDev->Device, ResourceList);
+}
+
+
+/**
+ Provides a low level access to the registers for the Super I/O.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Write Specifies the type of the register operation. If this parameter is TRUE,
+ Value is interpreted as an input parameter and the operation is a register write.
+ If this parameter is FALSE, Value is interpreted as an output parameter and the
+ operation is a register read.
+ @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the
+ Super I/O driver will turn off configuration mode of the Super I/O prior to returning
+ from this function. If this parameter is set to FALSE, the Super I/O driver will
+ leave Super I/O in the configuration mode.
+ The Super I/O driver must track the current state of the Super I/O and enable the
+ configuration mode of Super I/O if necessary prior to register access.
+ @param[in] Register Register number.
+ @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
+ written to the Super I/O register. If Write is FALSE, Value is a pointer to the
+ destination buffer for the byte of data to be read from the Super I/O register.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER The Value is NULL
+ @retval EFI_INVALID_PARAMETER Invalid Register number
+**/
+EFI_STATUS
+EFIAPI
+SioRegisterAccess (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN BOOLEAN Write,
+ IN BOOLEAN ExitCfgMode,
+ IN UINT8 Register,
+ IN OUT UINT8 *Value
+ )
+{
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Provides an interface for a table based programming of the Super I/O registers.
+
+ The Modify() function provides an interface for table based programming of the Super I/O
+ registers. This function can be used to perform programming of multiple Super I/O registers with a
+ single function call. For each table entry, the Register is read, its content is bitwise ANDed with
+ AndMask, and then ORed with OrMask before being written back to the Register. The Super
+ I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
+ O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
+ returned to the original state.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
+ structures. Each structure specifies a single Super I/O register modify operation.
+ Type EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
+ @param[in] NumberOfCommands Number of elements in the Command array.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER Command is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioModify (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN CONST EFI_SIO_REGISTER_MODIFY *Command,
+ IN UINTN NumberOfCommands
+ )
+{
+
+ if (Command == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.h
new file mode 100644
index 0000000000..df08da80b4
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.h
@@ -0,0 +1,143 @@
+/** @file
+ Super I/O Interface function declarations.
+
+ Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _SIO_ACPI_H_
+#define _SIO_ACPI_H_
+
+//
+// Prototypes for the SIO protocol interface
+//
+
+
+/**
+ Provides an interface to get a list of the current resources consumed by the device in the ACPI
+ Resource Descriptor format.
+
+ GetResources() returns a list of resources currently consumed by the device. The
+ ResourceList is a pointer to the buffer containing resource descriptors for the device. The
+ descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
+ specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
+ resource descriptor.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources
+ used by the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
+ Definitions" below.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioGetResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
+ );
+
+
+/**
+ Sets the resources for the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
+ is defined in the "Related Definitions" section of
+ EFI_SIO_PROTOCOL.GetResources().
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceList is invalid
+ @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
+**/
+EFI_STATUS
+EFIAPI
+SioSetResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN ACPI_RESOURCE_HEADER_PTR ResourceList
+ );
+
+
+/**
+ Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
+ defines a combination of resources that can potentially be used by the device.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[out] ResourceCollection Collection of the resource descriptor lists.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioPossibleResources (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
+ );
+
+
+/**
+ Provides a low level access to the registers for the Super I/O.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Write Specifies the type of the register operation. If this parameter is TRUE,
+ Value is interpreted as an input parameter and the operation is a register write.
+ If this parameter is FALSE, Value is interpreted as an output parameter and the
+ operation is a register read.
+ @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the
+ Super I/O driver will turn off configuration mode of the Super I/O prior to returning
+ from this function. If this parameter is set to FALSE, the Super I/O driver will
+ leave Super I/O in the configuration mode.
+ The Super I/O driver must track the current state of the Super I/O and enable the
+ configuration mode of Super I/O if necessary prior to register access.
+ @param[in] Register Register number.
+ @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
+ written to the Super I/O register. If Write is FALSE, Value is a pointer to the
+ destination buffer for the byte of data to be read from the Super I/O register.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER The Value is NULL
+ @retval EFI_INVALID_PARAMETER Invalid Register number
+**/
+EFI_STATUS
+EFIAPI
+SioRegisterAccess (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN BOOLEAN Write,
+ IN BOOLEAN ExitCfgMode,
+ IN UINT8 Register,
+ IN OUT UINT8 *Value
+ );
+
+
+/**
+ Provides an interface for a table based programming of the Super I/O registers.
+
+ The Modify() function provides an interface for table based programming of the Super I/O
+ registers. This function can be used to perform programming of multiple Super I/O registers with a
+ single function call. For each table entry, the Register is read, its content is bitwise ANDed with
+ AndMask, and then ORed with OrMask before being written back to the Register. The Super
+ I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
+ O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
+ returned to the original state.
+
+ @param[in] This Indicates a pointer to the calling context.
+ @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
+ structures. Each structure specifies a single Super I/O register modify operation.
+ Type EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
+ @param[in] NumberOfCommands Number of elements in the Command array.
+
+ @retval EFI_SUCCESS The operation completed successfully
+ @retval EFI_INVALID_PARAMETER Command is NULL
+**/
+EFI_STATUS
+EFIAPI
+SioModify (
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN CONST EFI_SIO_REGISTER_MODIFY *Command,
+ IN UINTN NumberOfCommands
+ );
+
+#endif
--
2.19.1.windows.1


[edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver

Agyeman, Prince
 

Removed the Super I/O DXE driver from SimicsOpenBoardPkg.
This driver will be added to the BoardModulePky as it is
generic and can be shared by other open board packages

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
.../BoardX58Ich10/OpenBoardPkg.dsc | 1 -
.../BoardX58Ich10/OpenBoardPkg.fdf | 1 -
.../LegacySioDxe/ComponentName.c | 173 -----
.../LegacySioDxe/ComponentName.h | 87 ---
.../LegacySioDxe/LegacySioDxe.inf | 54 --
.../LegacySioDxe/Register.h | 15 -
.../SimicsOpenBoardPkg/LegacySioDxe/SioChip.c | 272 --------
.../SimicsOpenBoardPkg/LegacySioDxe/SioChip.h | 195 ------
.../LegacySioDxe/SioDriver.c | 600 ------------------
.../LegacySioDxe/SioDriver.h | 134 ----
.../LegacySioDxe/SioService.c | 249 --------
.../LegacySioDxe/SioService.h | 143 -----
12 files changed, 1924 deletions(-)
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.c
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.h
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/LegacySioDxe.inf
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/Register.h
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.c
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.h
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.c
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.h
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.c
delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.h

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index 78f1e80990..e0a02b4efc 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -280,7 +280,6 @@
#######################################
$(BOARD_PKG)/AcpiTables/AcpiTables.inf
$(BOARD_PKG)/AcpiTables/MinPlatformAcpiTables/AcpiPlatform.inf
- $(BOARD_PKG)/LegacySioDxe/LegacySioDxe.inf
$(BOARD_PKG)/SimicsDxe/SimicsDxe.inf
$(BOARD_PKG)/SimicsVideoDxe/SimicsVideoDxe.inf
$(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
index 39226251a7..6dc7b4aa56 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
@@ -213,7 +213,6 @@ INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
INF MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf

-INF $(BOARD_PKG)/LegacySioDxe/LegacySioDxe.inf
INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf

INF $(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.c b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.c
deleted file mode 100644
index 4ba02f92c0..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/** @file
- Install Base and Size Info Ppi for Firmware Volume Recovery.
-
- Copyright (c) 2013 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include "SioDriver.h"
-
-///
-/// Component Name Protocol instance
-///
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mSioComponentName = {
- SioComponentNameGetDriverName,
- SioComponentNameGetControllerName,
- "eng"
-};
-
-///
-/// Component Name 2 Protocol instance
-///
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mSioComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SioComponentNameGetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)SioComponentNameGetControllerName,
- "en"
-};
-
-///
-/// Table of driver names
-///
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioDriverNameTable[] = {
- {
- "eng;en",
- L"Super I/O Driver"
- },
- {
- NULL,
- NULL
- }
-};
-
-///
-/// Table of Controller names
-///
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioControllerNameTable[] = {
- {
- "eng;en",
- L"Super I/O Controller"
- },
- {
- NULL,
- NULL
- }
-};
-
-/**
- Retrieves a Unicode string that is the user-readable name of the EFI Driver.
-
- @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
- @param Language A pointer to a three-character ISO 639-2 language identifier.
- This is the language of the driver name that that the caller
- is requesting, and it must match one of the languages specified
- in SupportedLanguages. The number of languages supported by a
- driver is up to the driver writer.
- @param DriverName A pointer to the Unicode string to return. This Unicode string
- is the name of the driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by This
- and the language specified by Language was returned
- in DriverName.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
- @retval EFI_UNSUPPORTED The driver specified by This does not support the
- language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SioComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- )
-{
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mSioDriverNameTable,
- DriverName,
- (BOOLEAN)(This == &mSioComponentName)
- );
-}
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by an EFI Driver.
-
- @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
- @param ControllerHandle The handle of a controller that the driver specified by
- This is managing. This handle specifies the controller
- whose name is to be returned.
- @param ChildHandle The handle of the child controller to retrieve the name
- of. This is an optional parameter that may be NULL. It
- will be NULL for device drivers. It will also be NULL
- for a bus drivers that wish to retrieve the name of the
- bus controller. It will not be NULL for a bus driver
- that wishes to retrieve the name of a child controller.
- @param Language A pointer to a three character ISO 639-2 language
- identifier. This is the language of the controller name
- that the caller is requesting, and it must match one
- of the languages specified in SupportedLanguages. The
- number of languages supported by a driver is up to the
- driver writer.
- @param ControllerName A pointer to the Unicode string to return. This Unicode
- string is the name of the controller specified by
- ControllerHandle and ChildHandle in the language specified
- by Language, from the point of view of the driver specified
- by This.
-
- @retval EFI_SUCCESS The Unicode string for the user-readable name in the
- language specified by Language for the driver
- specified by This was returned in DriverName.
- @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
- @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
- the controller specified by ControllerHandle and
- ChildHandle.
- @retval EFI_UNSUPPORTED The driver specified by This does not support the
- language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SioComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- )
-{
- EFI_STATUS Status;
-
- //
- // Make sure this driver is currently managing ControllHandle
- //
- Status = EfiTestManagedDevice (
- ControllerHandle,
- mSioDriver.DriverBindingHandle,
- &gEfiPciIoProtocolGuid
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // ChildHandle must be NULL for a Device Driver
- //
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mSioControllerNameTable,
- ControllerName,
- (BOOLEAN)(This == &mSioComponentName)
- );
-}
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.h b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.h
deleted file mode 100644
index 5368f94bcd..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/ComponentName.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/** @file
- Install Base and Size Info Ppi for Firmware Volume Recovery.
-
- Copyright (c) 2013 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-/**
- Retrieves a Unicode string that is the user-readable name of the EFI Driver.
-
- @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
- @param Language A pointer to a three-character ISO 639-2 language identifier.
- This is the language of the driver name that that the caller
- is requesting, and it must match one of the languages specified
- in SupportedLanguages. The number of languages supported by a
- driver is up to the driver writer.
- @param DriverName A pointer to the Unicode string to return. This Unicode string
- is the name of the driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by This
- and the language specified by Language was returned
- in DriverName.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
- @retval EFI_UNSUPPORTED The driver specified by This does not support the
- language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SioComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- );
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by an EFI Driver.
-
- @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
- @param ControllerHandle The handle of a controller that the driver specified by
- This is managing. This handle specifies the controller
- whose name is to be returned.
- @param ChildHandle The handle of the child controller to retrieve the name
- of. This is an optional parameter that may be NULL. It
- will be NULL for device drivers. It will also be NULL
- for a bus drivers that wish to retrieve the name of the
- bus controller. It will not be NULL for a bus driver
- that wishes to retrieve the name of a child controller.
- @param Language A pointer to a three character ISO 639-2 language
- identifier. This is the language of the controller name
- that the caller is requesting, and it must match one
- of the languages specified in SupportedLanguages. The
- number of languages supported by a driver is up to the
- driver writer.
- @param ControllerName A pointer to the Unicode string to return. This Unicode
- string is the name of the controller specified by
- ControllerHandle and ChildHandle in the language specified
- by Language, from the point of view of the driver specified
- by This.
-
- @retval EFI_SUCCESS The Unicode string for the user-readable name in the
- language specified by Language for the driver
- specified by This was returned in DriverName.
- @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
- @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
- the controller specified by ControllerHandle and
- ChildHandle.
- @retval EFI_UNSUPPORTED The driver specified by This does not support the
- language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SioComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- );
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/LegacySioDxe.inf b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/LegacySioDxe.inf
deleted file mode 100644
index 275f36ca47..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/LegacySioDxe.inf
+++ /dev/null
@@ -1,54 +0,0 @@
-## @file
-# Module information that produces the
-# EFI_SIO_PROTOCOL.
-#
-# Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010017
- BASE_NAME = HitachiH8s2113Dxe
- FILE_GUID = 7807E404-8281-4FF1-8457-0B54BABE263F
- VERSION_STRING = 1.0
- MODULE_TYPE = UEFI_DRIVER
- ENTRY_POINT = SioDriverEntryPoint
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[LibraryClasses]
- BaseLib
- UefiLib
- DebugLib
- MemoryAllocationLib
- PcdLib
- DevicePathLib
- IoLib
- UefiDriverEntryPoint
- UefiBootServicesTableLib
- S3BootScriptLib
- S3IoLib
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[Sources]
- SioChip.c
- SioChip.h
- SioService.c
- SioService.h
- SioDriver.c
- SioDriver.h
- ComponentName.c
-
-[Protocols]
- gEfiPciIoProtocolGuid ## CONSUMES
- gEfiDevicePathProtocolGuid ## PRODUCES
- gEfiSioProtocolGuid ## PRODUCES
-
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/Register.h b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/Register.h
deleted file mode 100644
index f61f713cf2..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/Register.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Super I/O register definitions
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _REGISTER_H_
-#define _REGISTER_H_
-
-#define EC_COMMAND_PORT 0x66
-#define EC_DATA_PORT 0x62
-
-#endif
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.c b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.c
deleted file mode 100644
index b9a7b9cd24..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/** @file
- Super I/O specific implementation.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include "SioDriver.h"
-#include <Library/S3IoLib.h>
-
-LOCAL_IO_WRITE8 mIoWrite8 = IoWrite8;
-//
-// System configuration (setup) information
-//
-// SYSTEM_CONFIGURATION mSystemConfiguration;
-
-//
-// COM 1 UART Controller
-//
-ACPI_SIO_RESOURCES_IO_IRQ mCom1Resources = {
- {
- { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
- 0x3f8,
- 8
- },
- {
- { ACPI_IRQ_NOFLAG_DESCRIPTOR },
- BIT4 // IRQ4
- },
- {
- ACPI_END_TAG_DESCRIPTOR,
- 0
- }
-};
-
-//
-// PS/2 Keyboard Controller
-//
-ACPI_SIO_RESOURCES_IO_IRQ mKeyboardResources = {
- {
- { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
- 0x60,
- 5
- },
- {
- { ACPI_IRQ_NOFLAG_DESCRIPTOR },
- BIT1
- },
- {
- ACPI_END_TAG_DESCRIPTOR,
- 0
- }
-};
-
-//
-// PS/2 Mouse Controller
-//
-ACPI_SIO_RESOURCES_IO_IRQ mMouseResources = {
- {
- { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
- 0x60,
- 5
- },
- {
- { ACPI_IRQ_NOFLAG_DESCRIPTOR },
- BIT12
- },
- {
- ACPI_END_TAG_DESCRIPTOR,
- 0
- }
-};
-
-//
-// Table of SIO Controllers
-//
-DEVICE_INFO mDeviceInfo[] = {
- {
- {
- EISA_PNP_ID(0x501),
- 0
- },
- 0,
- RESOURCE_IO | RESOURCE_IRQ,
- { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
- { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
- }, // COM 1 UART Controller
- {
- {
- EISA_PNP_ID(0x303),
- 0
- },
- 0,
- 0, // Cannot change resource
- { (ACPI_SMALL_RESOURCE_HEADER *) &mKeyboardResources },
- { (ACPI_SMALL_RESOURCE_HEADER *) &mKeyboardResources }
- }, // PS/2 Keyboard Controller
- {
- {
- EISA_PNP_ID(0xF03),
- 0
- },
- 0,
- 0, // Cannot change resource
- { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
- { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
- } // PS/2 Mouse Controller
-};
-
-
-/**
- Return the supported devices.
-
- @param[out] Devices Pointer to pointer of EFI_SIO_ACPI_DEVICE_ID.
- Caller is responsible to free the buffer.
- @param[out] Count Pointer to UINTN holding the device count.
-**/
-VOID
-DeviceGetList (
- OUT EFI_SIO_ACPI_DEVICE_ID **Devices,
- OUT UINTN *Count
- )
-{
- EFI_SIO_ACPI_DEVICE_ID *LocalDevices;
- UINTN LocalCount;
- UINTN DeviceCount;
- UINTN Index;
-
- //
- // Allocate enough memory for simplicity
- //
- DeviceCount = sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
- LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceCount);
- ASSERT (LocalDevices != NULL);
- if (LocalDevices == NULL) {
- return;
- }
- LocalCount = 0;
-
- for (Index = 0; Index < DeviceCount; Index++) {
- CopyMem (&LocalDevices[LocalCount], &mDeviceInfo[Index].Device, sizeof (EFI_SIO_ACPI_DEVICE_ID));
- LocalCount++;
- }
-
- *Devices = LocalDevices;
- *Count = LocalCount;
-}
-
-
-/**
- Super I/O controller initialization.
-
- @retval EFI_SUCCESS The super I/O controller is found and initialized.
- @retval EFI_UNSUPPORTED The super I/O controller is not found.
-**/
-EFI_STATUS
-SioInit (
- VOID
- )
-{
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Find the DEVICE_INFO for specified Device.
-
- @param[in] Device Pointer to the EFI_SIO_ACPI_DEVICE_ID.
-
- @retval DEVICE_INFO* Pointer to the DEVICE_INFO.
-**/
-DEVICE_INFO *
-DeviceSearch (
- IN EFI_SIO_ACPI_DEVICE_ID *Device
- )
-{
- UINTN Index;
-
- for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); Index++) {
- if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) == 0) {
- return &mDeviceInfo[Index];
- }
- }
-
- ASSERT (FALSE);
- return NULL;
-}
-
-
-/**
- Program the SIO chip to enable the specified device using the default resource.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
-**/
-VOID
-DeviceEnable (
- IN EFI_SIO_ACPI_DEVICE_ID *Device
- )
-{
-}
-
-
-/**
- Get the ACPI resources for specified device.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_SUCCESS The resources are returned successfully.
-**/
-EFI_STATUS
-DeviceGetResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- OUT ACPI_RESOURCE_HEADER_PTR *Resources
- )
-{
- DEVICE_INFO *DeviceInfo;
-
- DeviceInfo = DeviceSearch (Device);
-
- *Resources = DeviceInfo->Resources;
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Set the ACPI resources for specified device.
-
- The SIO chip is programmed to use the new resources and the
- resources setting are saved. The function assumes the resources
- are valid.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[in] Resources ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-DeviceSetResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- IN ACPI_RESOURCE_HEADER_PTR Resources
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Get the possible ACPI resources for specified device.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_SUCCESS The resources are returned successfully.
-**/
-EFI_STATUS
-DevicePossibleResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- OUT ACPI_RESOURCE_HEADER_PTR *Resources
- )
-{
- DEVICE_INFO *DeviceInfo;
-
- DeviceInfo = DeviceSearch (Device);
-
- *Resources = DeviceInfo->PossibleResources;
-
- return EFI_SUCCESS;
-}
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.h b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.h
deleted file mode 100644
index 48e28c44b0..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- Super I/O specific header.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _SIO_H_
-#define _SIO_H_
-
-
-#include "Register.h"
-
-typedef
-UINT8
-(EFIAPI *LOCAL_IO_WRITE8) (
- IN UINTN Port,
- IN UINT8 Value
- );
-
-#define RESOURCE_IO BIT0
-#define RESOURCE_IRQ BIT1
-#define RESOURCE_DMA BIT2
-#define RESOURCE_MEM BIT3
-
-#pragma pack(1)
-
-typedef struct {
- EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR Io;
- EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR Irq;
- EFI_ACPI_END_TAG_DESCRIPTOR End;
-} ACPI_SIO_RESOURCES_IO_IRQ;
-#pragma pack()
-
-typedef struct {
- UINT32 HID;
- UINT32 UID;
-} EFI_SIO_ACPI_DEVICE_ID;
-
-typedef struct {
- EFI_SIO_ACPI_DEVICE_ID Device;
- UINT8 DeviceId;
- UINT8 ResourceMask;
- ACPI_RESOURCE_HEADER_PTR Resources;
- ACPI_RESOURCE_HEADER_PTR PossibleResources;
-} DEVICE_INFO;
-
-
-/**
- Initialize the SIO chip for S3.
-**/
-VOID
-SioInitForS3 (
- VOID
- );
-
-
-/**
- Return the supported devices.
-
- @param[out] Devices Pointer to pointer of EFI_SIO_ACPI_DEVICE_ID.
- Caller is responsible to free the buffer.
- @param[out] Count Pointer to UINTN holding the device count.
-**/
-VOID
-DeviceGetList (
- OUT EFI_SIO_ACPI_DEVICE_ID **Devices,
- OUT UINTN *Count
- );
-
-
-/**
- Program the SIO chip to enable the specified device using the default resource.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
-**/
-VOID
-DeviceEnable (
- IN EFI_SIO_ACPI_DEVICE_ID *Device
- );
-
-
-/**
- Get the possible ACPI resources for specified device.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_SUCCESS The resources are returned successfully.
-**/
-EFI_STATUS
-DevicePossibleResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- OUT ACPI_RESOURCE_HEADER_PTR *Resources
- );
-
-
-/**
- Set the ACPI resources for specified device.
-
- The SIO chip is programmed to use the new resources and the
- resources setting are saved. The function assumes the resources
- are valid.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[in] Resources ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_SUCCESS The resources are set successfully.
-**/
-EFI_STATUS
-DeviceSetResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- IN ACPI_RESOURCE_HEADER_PTR Resources
- );
-
-
-/**
- Get the ACPI resources for specified device.
-
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[out] Resources Pointer to ACPI_RESOURCE_HEADER_PTR.
-
- @retval EFI_SUCCESS The resources are returned successfully.
-**/
-EFI_STATUS
-DeviceGetResources (
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- OUT ACPI_RESOURCE_HEADER_PTR *Resources
- );
-
-
-/**
- Program the SIO chip to enter the configure mode.
-**/
-VOID
-EnterConfigMode (
- VOID
- );
-
-
-/**
- Program the SIO chip to exit the configure mode.
-**/
-VOID
-ExitConfigMode (
- VOID
- );
-
-
-/**
- Perform a 8-bit I/O write to SIO register.
-
- @param[in] Index The register index.
- @param[in] Data The value to write to register.
-**/
-VOID
-WriteRegister (
- IN UINT8 Index,
- IN UINT8 Data
- );
-
-
-/**
- Perform a 8-bit I/O read from SIO register.
-
- @param[in] Index The register index.
-
- @retval Value The value written to the register.
-**/
-UINT8
-ReadRegister (
- IN UINT8 Index
- );
-
-//
-// Prototypes for the sio internal function
-//
-//
-// Internal function
-//
-
-
-/**
- Find Super I/O controller.
-
- @retval EFI_SUCCESS Super I/O controller exists.
- @retval EFI_UNSUPPORTED Super I/O controller does not exist.
-**/
-EFI_STATUS
-SioInit (
- VOID
- );
-
-#endif
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.c b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.c
deleted file mode 100644
index 408c6ff301..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.c
+++ /dev/null
@@ -1,600 +0,0 @@
-/** @file
- EFI Driver following Driver Binding Protocol.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include "SioDriver.h"
-
-
-//
-// This driver is for ACPI(PNP0A03,0)/PCI(0x1f,0)
-//
-//
-// Sio Driver Global Variables
-//
-EFI_DRIVER_BINDING_PROTOCOL mSioDriver = {
- SioDriverSupported,
- SioDriverStart,
- SioDriverStop,
- 1,
- NULL,
- NULL
-};
-
-//
-// The list of the created SIO_DEV
-//
-LIST_ENTRY mSioDevPool = INITIALIZE_LIST_HEAD_VARIABLE (mSioDevPool);
-
-//
-// Template structure to create SIO_DEV
-//
-SIO_DEV mSioDevTemplate = {
- SIO_DEV_SIGNATURE, // Signature
- NULL, // PciHandle
- {
- 0x00000000, // HID
- 0x00000000 // UID
- },
- NULL, // Handle
- { // Sio Instance
- SioRegisterAccess,
- SioGetResources,
- SioSetResources,
- SioPossibleResources,
- SioModify
- },
- NULL, // DevicePath
- {
- NULL, // ForwardLink
- NULL, // BackLink
- }
-};
-
-//
-// Template ACPI_HID_DEVICE_PATH structure to create device path
-//
-ACPI_HID_DEVICE_PATH mAcpiNodeTemplate = {
- {
- ACPI_DEVICE_PATH, // Type
- ACPI_DP, // SubType
- {
- sizeof (ACPI_HID_DEVICE_PATH), // Length[0]
- 0 // Length[1]
- }
- },
- 0x00000000, // HID
- 0x00000000 // UID
-};
-
-
-/**
- The user Entry Point for module Lpc47m17x. The user code starts with this function.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @retval other Some error occurs when executing this entry point.
-**/
-EFI_STATUS
-EFIAPI
-SioDriverEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (EFI_ERROR (SioInit())) {
- return EFI_UNSUPPORTED;
- } else {
-
- //
- // Install protocols
- //
- return EfiLibInstallDriverBindingComponentName2 (
- ImageHandle,
- SystemTable,
- &mSioDriver,
- ImageHandle,
- &mSioComponentName,
- &mSioComponentName2
- );
- }
-}
-
-
-/**
- Test to see if this driver supports Controller Handle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to test
- @param[in] RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device
- @retval EFI_ALREADY_STARTED This driver is already running on this device
- @retval other This driver does not support this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
- ACPI_HID_DEVICE_PATH *AcpiNode;
- PCI_TYPE00 Pci;
- UINTN Index;
- EFI_SIO_ACPI_DEVICE_ID *Devices;
- UINTN Count;
- UINTN SegmentNumber;
- UINTN BusNumber;
- UINTN DeviceNumber;
- UINTN FunctionNumber;
-
- //
- // If RemainingDevicePath is not NULL, it should verify that the first device
- // path node in RemainingDevicePath is an ACPI Device path node which is a
- // legal Device Path Node for this bus driver's children.
- //
- if (RemainingDevicePath != NULL) {
- if (!IsDevicePathEnd (RemainingDevicePath)) {
- if ((RemainingDevicePath->Type != ACPI_DEVICE_PATH) ||
- (((RemainingDevicePath->SubType != ACPI_DP) || (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_HID_DEVICE_PATH))) &&
- ((RemainingDevicePath->SubType != ACPI_EXTENDED_DP) || (DevicePathNodeLength (RemainingDevicePath) != sizeof (ACPI_EXTENDED_HID_DEVICE_PATH))))
- ) {
- return EFI_UNSUPPORTED;
- }
-
- DeviceGetList (&Devices, &Count);
- if (Devices == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- AcpiNode = (ACPI_HID_DEVICE_PATH *) RemainingDevicePath;
- for (Index = 0; Index < Count; Index++) {
- if ((AcpiNode->HID == Devices[Index].HID) &&
- (AcpiNode->UID == Devices[Index].UID)) {
- break;
- }
- }
- FreePool (Devices);
- if (Index == Count) {
- return EFI_UNSUPPORTED;
- }
- }
- }
-
- //
- // See if the parent device path can be opened BY_DRIVER
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &ParentDevicePath,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
- return Status;
- }
-
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
-
- //
- // Get PciIo protocol instance
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (!EFI_ERROR (Status)) {
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- 0,
- sizeof (Pci) / sizeof (UINT32),
- &Pci
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = EFI_UNSUPPORTED;
- if ((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEMORY_SPACE))
- == (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEMORY_SPACE)
- ) {
- if (Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) {
- //
- // See if this is a standard PCI to ISA Bridge from the Base Code and Class Code
- //
- if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA) {
- Status = EFI_SUCCESS;
- }
-
- //
- // See if this is an Intel PCI to ISA Bridge in Positive Decode Mode
- //
- if ((Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE) &&
- (Pci.Hdr.VendorId == 0x8086)) {
- //
- // See if this is on Function #0 to avoid false positive on
- // PCI_CLASS_BRIDGE_OTHER that has the same value as
- // PCI_CLASS_BRIDGE_ISA_PDECODE
- //
- Status = PciIo->GetLocation (
- PciIo,
- &SegmentNumber,
- &BusNumber,
- &DeviceNumber,
- &FunctionNumber
- );
- if (!EFI_ERROR (Status) && (FunctionNumber == 0)) {
- Status = EFI_SUCCESS;
- } else {
- Status = EFI_UNSUPPORTED;
- }
- }
- }
- }
-
- gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
- if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Destroy the SIO controller handle.
-
- @param[in] ChildHandle The SIO controller handle.
-
- @retval EFI_SUCCESS The SIO controller handle is destroyed successfully.
-**/
-EFI_STATUS
-SioDestroyDevice (
- IN EFI_HANDLE ChildHandle
- )
-{
- EFI_STATUS Status;
- SIO_DEV *SioDev;
- EFI_SIO_PROTOCOL *Sio;
- EFI_PCI_IO_PROTOCOL *PciIo;
-
- Status = gBS->HandleProtocol (
- ChildHandle,
- &gEfiSioProtocolGuid,
- (VOID **) &Sio
- );
- ASSERT_EFI_ERROR (Status);
-
- SioDev = SIO_DEV_FROM_THIS (Sio);
-
- Status = gBS->CloseProtocol (
- SioDev->PciHandle,
- &gEfiPciIoProtocolGuid,
- mSioDriver.DriverBindingHandle,
- ChildHandle
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->UninstallMultipleProtocolInterfaces (
- ChildHandle,
- &gEfiDevicePathProtocolGuid,
- SioDev->DevicePath,
- &gEfiSioProtocolGuid,
- &SioDev->Sio,
- NULL
- );
- if (EFI_ERROR (Status)) {
- gBS->OpenProtocol (
- SioDev->PciHandle,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
- mSioDriver.DriverBindingHandle,
- ChildHandle,
- EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
- );
- return Status;
- }
-
- RemoveEntryList (&SioDev->Link);
- FreePool (SioDev->DevicePath);
- FreePool (SioDev);
- return EFI_SUCCESS;
-}
-
-
-/**
- Create the SIO controller handle.
-
- @param[in] Controller The parent PCI controller handle.
- @param[in] Device Pointer to EFI_SIO_ACPI_DEVICE_ID.
- @param[in] ParentDevicePath The device path of the parent controller.
- @param[out] PciIo The PciIo instance of the parent controller.
-**/
-VOID
-SioCreateDevice (
- IN EFI_HANDLE Controller,
- IN EFI_SIO_ACPI_DEVICE_ID *Device,
- IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
- OUT EFI_PCI_IO_PROTOCOL *PciIo
- )
-{
- EFI_STATUS Status;
- SIO_DEV *SioDev;
-
- DeviceEnable (Device);
- SioDev = AllocateCopyPool (sizeof (SIO_DEV), &mSioDevTemplate);
- ASSERT (SioDev != NULL);
- if (SioDev == NULL) {
- return;
- }
- InsertHeadList (&mSioDevPool, &SioDev->Link);
-
- SioDev->PciHandle = Controller;
-
- CopyMem (&SioDev->Device, Device, sizeof (*Device));
-
- mAcpiNodeTemplate.HID = Device->HID;
- mAcpiNodeTemplate.UID = Device->UID;
- SioDev->DevicePath = AppendDevicePathNode (ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &mAcpiNodeTemplate);
- ASSERT (SioDev->DevicePath != NULL);
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &SioDev->Handle,
- &gEfiSioProtocolGuid, &SioDev->Sio,
- &gEfiDevicePathProtocolGuid, SioDev->DevicePath,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
- mSioDriver.DriverBindingHandle,
- SioDev->Handle,
- EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
- );
- ASSERT_EFI_ERROR (Status);
-}
-
-
-/**
- Start this driver on ControllerHandle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to bind driver to
- @param[in] RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver is added to ControllerHandle
- @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
- @retval other This driver does not support this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
- EFI_SIO_ACPI_DEVICE_ID *Devices;
- SIO_DEV *SioDev;
- UINTN Count;
- UINTN Index;
- ACPI_HID_DEVICE_PATH *AcpiNode;
- BOOLEAN *HasCreated;
- BOOLEAN *RequestCreate;
- LIST_ENTRY *Node;
-
- HasCreated = NULL;
- RequestCreate = NULL;
- //
- // Get the ISA bridge's Device Path
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &ParentDevicePath,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
- return Status;
- }
-
- //
- // Get Pci IO
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- return Status;
- }
-
- if ((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath)) {
- return EFI_SUCCESS;
- }
-
- DeviceGetList (&Devices, &Count);
- if (Devices == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Exit_Start;
- }
- HasCreated = AllocatePool (sizeof (BOOLEAN) * Count);
- ASSERT (HasCreated != NULL);
- if (HasCreated == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Exit_Start;
- }
- RequestCreate = AllocatePool (sizeof (BOOLEAN) * Count);
- ASSERT (RequestCreate != NULL);
- if (RequestCreate == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Exit_Start;
- }
-
- //
- // Assume no children has been created.
- // Assume the SIO interface hasn't been initialized.
- //
- ZeroMem (HasCreated, sizeof (BOOLEAN) * Count);
-
- if (Status == EFI_ALREADY_STARTED) {
- for (Node = GetFirstNode (&mSioDevPool);
- !IsNull (&mSioDevPool, Node);
- Node = GetNextNode (&mSioDevPool, Node)
- ) {
- SioDev = CR (Node, SIO_DEV, Link, SIO_DEV_SIGNATURE);
- Status = gBS->HandleProtocol (
- SioDev->PciHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &DevicePath
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // See if they are under the same PCI to ISA Bridge
- //
- if (CompareMem (DevicePath, ParentDevicePath, GetDevicePathSize (DevicePath)) == 0) {
- for (Index = 0; Index < Count; Index++) {
- if (CompareMem (&SioDev->Device, &Devices[Index], sizeof (EFI_SIO_ACPI_DEVICE_ID)) == 0) {
- HasCreated[Index] = TRUE;
- break;
- }
- }
- }
- }
- }
-
- AcpiNode = (ACPI_HID_DEVICE_PATH *) RemainingDevicePath;
- for (Index = 0; Index < Count; Index++) {
- if ((AcpiNode == NULL) ||
- ((AcpiNode->HID == Devices[Index].HID) && (AcpiNode->UID == Devices[Index].UID))
- ) {
- RequestCreate[Index] = TRUE;
- } else {
- RequestCreate[Index] = FALSE;
- }
- }
-
- for (Index = 0; Index < Count; Index++) {
- if (RequestCreate[Index] && !HasCreated[Index]) {
- SioCreateDevice (Controller, &Devices[Index], ParentDevicePath, PciIo);
- }
- }
-Exit_Start:
- if (Devices != NULL) {
- FreePool (Devices);
- }
- if (HasCreated != NULL) {
- FreePool (HasCreated);
- }
- if (RequestCreate != NULL) {
- FreePool (RequestCreate);
- }
-
- return Status;
-}
-
-
-/**
- Stop this driver on ControllerHandle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to stop driver on
- @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param[in] ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS This driver is removed ControllerHandle
- @retval other This driver was not removed from this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-{
- EFI_STATUS Status;
- UINTN Index;
- BOOLEAN AllChildrenStopped;
-
- if (NumberOfChildren == 0) {
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- return EFI_SUCCESS;
- }
-
- AllChildrenStopped = TRUE;
- for (Index = 0; Index < NumberOfChildren; Index++) {
- Status = SioDestroyDevice (ChildHandleBuffer[Index]);
- if (EFI_ERROR (Status)) {
- AllChildrenStopped = FALSE;
- }
- }
-
- if (AllChildrenStopped) {
- return EFI_SUCCESS;
- } else {
- return EFI_DEVICE_ERROR;
- }
-}
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.h b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.h
deleted file mode 100644
index 2e75871f7f..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/** @file
- Header file for Driver Binding Protocol.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _SIO_DRIVER_H_
-#define _SIO_DRIVER_H_
-
-#include <PiDxe.h>
-#include <IndustryStandard/Pci.h>
-#include <Library/BaseLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
-#include <Library/S3BootScriptLib.h>
-#include <Library/PciLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/UefiLib.h>
-#include <Library/PcdLib.h>
-
-//
-// Driver Consumed Protocol Prototypes
-//
-#include <Protocol/DriverBinding.h>
-#include <Protocol/PciIo.h>
-#include <Protocol/DevicePath.h>
-
-//
-// Driver Produced Protocol Prototypes
-//
-#include <Protocol/SuperIo.h>
-
-
-#include "SioChip.h"
-#include "SioService.h"
-#include "ComponentName.h"
-
-//
-// Global Variables definitions
-//
-extern EFI_DRIVER_BINDING_PROTOCOL mSioDriver;
-extern EFI_COMPONENT_NAME_PROTOCOL mSioComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL mSioComponentName2;
-
-//
-// SIO device private data structure
-//
-#define SIO_DEV_SIGNATURE SIGNATURE_32 ('_', 'S', 'I', 'O')
-
-typedef struct _SIO_DEV {
- UINT32 Signature;
- EFI_HANDLE PciHandle;
- EFI_SIO_ACPI_DEVICE_ID Device;
- EFI_HANDLE Handle;
- EFI_SIO_PROTOCOL Sio;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- LIST_ENTRY Link;
-} SIO_DEV;
-
-#define SIO_DEV_FROM_THIS(a) CR (a, SIO_DEV, Sio, SIO_DEV_SIGNATURE)
-
-//
-// Prototypes for Driver model protocol interface
-//
-
-
-/**
- Test to see if this driver supports Controller Handle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to test
- @param[in] RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device
- @retval EFI_ALREADY_STARTED This driver is already running on this device
- @retval other This driver does not support this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-
-/**
- Start this driver on ControllerHandle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to bind driver to
- @param[in] RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver is added to ControllerHandle
- @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
- @retval other This driver does not support this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-
-/**
- Stop this driver on ControllerHandle.
-
- @param[in] This Protocol instance pointer.
- @param[in] Controller Handle of device to stop driver on
- @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param[in] ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS This driver is removed ControllerHandle
- @retval other This driver was not removed from this device
-**/
-EFI_STATUS
-EFIAPI
-SioDriverStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- );
-#endif
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.c b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.c
deleted file mode 100644
index 379002b833..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/** @file
- Super I/O Interface implementation.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include "SioDriver.h"
-
-
-/**
- Provides an interface to get a list of the current resources consumed by the device in the ACPI
- Resource Descriptor format.
-
- GetResources() returns a list of resources currently consumed by the device. The
- ResourceList is a pointer to the buffer containing resource descriptors for the device. The
- descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
- specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
- resource descriptor.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources
- used by the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
- Definitions" below.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceList is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioGetResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
- )
-{
- SIO_DEV *SioDev;
-
- if (ResourceList == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- SioDev = SIO_DEV_FROM_THIS (This);
-
- return DeviceGetResources (&SioDev->Device, ResourceList);
-}
-
-
-/**
- Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
- defines a combination of resources that can potentially be used by the device.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[out] ResourceCollection Collection of the resource descriptor lists.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioPossibleResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
- )
-{
- SIO_DEV *SioDev;
-
- if (ResourceCollection == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- SioDev = SIO_DEV_FROM_THIS (This);
-
- return DevicePossibleResources (&SioDev->Device, ResourceCollection);
-}
-
-
-/**
- Sets the resources for the device.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
- is defined in the "Related Definitions" section of
- EFI_SIO_PROTOCOL.GetResources().
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceList is invalid
- @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
-**/
-EFI_STATUS
-EFIAPI
-SioSetResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN ACPI_RESOURCE_HEADER_PTR ResourceList
- )
-{
- SIO_DEV *SioDev;
- ACPI_RESOURCE_HEADER_PTR ResourcePtr;
- ACPI_RESOURCE_HEADER_PTR ResourceCollection;
- ACPI_RESOURCE_HEADER_PTR ResourcePtr2;
- BOOLEAN Found;
-
- ResourcePtr = ResourceList;
- SioDev = SIO_DEV_FROM_THIS (This);
-
- //
- // Check whether the resource is in the possible resource collection
- //
- DevicePossibleResources (&SioDev->Device, &ResourceCollection);
-
- while (ResourcePtr.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {
-
- Found = FALSE;
- ResourcePtr2 = ResourceCollection;
- while (ResourcePtr2.SmallHeader->Byte != ACPI_END_TAG_DESCRIPTOR) {
- if (ResourcePtr2.SmallHeader->Bits.Type == 0) {
- //
- // Small Header
- //
- if (CompareMem (
- ResourcePtr2.SmallHeader,
- ResourcePtr.SmallHeader,
- ResourcePtr2.SmallHeader->Bits.Length + sizeof (*ResourcePtr2.SmallHeader)
- ) == 0) {
- Found = TRUE;
- break;
- }
-
- ResourcePtr2.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr2.SmallHeader
- + ResourcePtr2.SmallHeader->Bits.Length
- + sizeof (*ResourcePtr2.SmallHeader));
-
- } else {
- //
- // Large Header
- //
- if (CompareMem (
- ResourcePtr2.LargeHeader,
- ResourcePtr.LargeHeader,
- ResourcePtr2.LargeHeader->Length + sizeof (*ResourcePtr2.LargeHeader)
- ) == 0) {
- Found = TRUE;
- break;
- }
-
- ResourcePtr2.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr2.LargeHeader
- + ResourcePtr2.LargeHeader->Length
- + sizeof (*ResourcePtr2.LargeHeader));
- }
- }
-
- if (!Found) {
- return EFI_ACCESS_DENIED;
- }
-
- if (ResourcePtr.SmallHeader->Bits.Type == 0) {
- ResourcePtr.SmallHeader = (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr.SmallHeader
- + ResourcePtr.SmallHeader->Bits.Length
- + sizeof (*ResourcePtr.SmallHeader));
- } else {
- ResourcePtr.LargeHeader = (ACPI_LARGE_RESOURCE_HEADER *) ((UINT8 *) ResourcePtr.LargeHeader
- + ResourcePtr.LargeHeader->Length
- + sizeof (*ResourcePtr.LargeHeader));
- }
- }
-
- //
- // ResourceList can be set
- //
- return DeviceSetResources (&SioDev->Device, ResourceList);
-}
-
-
-/**
- Provides a low level access to the registers for the Super I/O.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] Write Specifies the type of the register operation. If this parameter is TRUE,
- Value is interpreted as an input parameter and the operation is a register write.
- If this parameter is FALSE, Value is interpreted as an output parameter and the
- operation is a register read.
- @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the
- Super I/O driver will turn off configuration mode of the Super I/O prior to returning
- from this function. If this parameter is set to FALSE, the Super I/O driver will
- leave Super I/O in the configuration mode.
- The Super I/O driver must track the current state of the Super I/O and enable the
- configuration mode of Super I/O if necessary prior to register access.
- @param[in] Register Register number.
- @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
- written to the Super I/O register. If Write is FALSE, Value is a pointer to the
- destination buffer for the byte of data to be read from the Super I/O register.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER The Value is NULL
- @retval EFI_INVALID_PARAMETER Invalid Register number
-**/
-EFI_STATUS
-EFIAPI
-SioRegisterAccess (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN BOOLEAN Write,
- IN BOOLEAN ExitCfgMode,
- IN UINT8 Register,
- IN OUT UINT8 *Value
- )
-{
- if (Value == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Provides an interface for a table based programming of the Super I/O registers.
-
- The Modify() function provides an interface for table based programming of the Super I/O
- registers. This function can be used to perform programming of multiple Super I/O registers with a
- single function call. For each table entry, the Register is read, its content is bitwise ANDed with
- AndMask, and then ORed with OrMask before being written back to the Register. The Super
- I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
- O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
- returned to the original state.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
- structures. Each structure specifies a single Super I/O register modify operation.
- Type EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
- @param[in] NumberOfCommands Number of elements in the Command array.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER Command is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioModify (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN CONST EFI_SIO_REGISTER_MODIFY *Command,
- IN UINTN NumberOfCommands
- )
-{
-
- if (Command == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- return EFI_SUCCESS;
-}
diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.h b/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.h
deleted file mode 100644
index 6a8081dc6e..0000000000
--- a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioService.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/** @file
- Super I/O Interface function declarations.
-
- Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _SIO_ACPI_H_
-#define _SIO_ACPI_H_
-
-//
-// Prototypes for the SIO protocol interface
-//
-
-
-/**
- Provides an interface to get a list of the current resources consumed by the device in the ACPI
- Resource Descriptor format.
-
- GetResources() returns a list of resources currently consumed by the device. The
- ResourceList is a pointer to the buffer containing resource descriptors for the device. The
- descriptors are in the format of Small or Large ACPI resource descriptor as defined by ACPI
- specification (2.0 & 3.0). The buffer of resource descriptors is terminated with the 'End tag'
- resource descriptor.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[out] ResourceList A pointer to an ACPI resource descriptor list that defines the current resources
- used by the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the "Related
- Definitions" below.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceList is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioGetResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
- );
-
-
-/**
- Sets the resources for the device.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] ResourceList Pointer to the ACPI resource descriptor list. Type ACPI_RESOURCE_HEADER_PTR
- is defined in the "Related Definitions" section of
- EFI_SIO_PROTOCOL.GetResources().
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceList is invalid
- @retval EFI_ACCESS_DENIED Some of the resources in ResourceList are in use
-**/
-EFI_STATUS
-EFIAPI
-SioSetResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN ACPI_RESOURCE_HEADER_PTR ResourceList
- );
-
-
-/**
- Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
- defines a combination of resources that can potentially be used by the device.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[out] ResourceCollection Collection of the resource descriptor lists.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER ResourceCollection is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioPossibleResources (
- IN CONST EFI_SIO_PROTOCOL *This,
- OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
- );
-
-
-/**
- Provides a low level access to the registers for the Super I/O.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] Write Specifies the type of the register operation. If this parameter is TRUE,
- Value is interpreted as an input parameter and the operation is a register write.
- If this parameter is FALSE, Value is interpreted as an output parameter and the
- operation is a register read.
- @param[in] ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the
- Super I/O driver will turn off configuration mode of the Super I/O prior to returning
- from this function. If this parameter is set to FALSE, the Super I/O driver will
- leave Super I/O in the configuration mode.
- The Super I/O driver must track the current state of the Super I/O and enable the
- configuration mode of Super I/O if necessary prior to register access.
- @param[in] Register Register number.
- @param[in, out] Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
- written to the Super I/O register. If Write is FALSE, Value is a pointer to the
- destination buffer for the byte of data to be read from the Super I/O register.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER The Value is NULL
- @retval EFI_INVALID_PARAMETER Invalid Register number
-**/
-EFI_STATUS
-EFIAPI
-SioRegisterAccess (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN BOOLEAN Write,
- IN BOOLEAN ExitCfgMode,
- IN UINT8 Register,
- IN OUT UINT8 *Value
- );
-
-
-/**
- Provides an interface for a table based programming of the Super I/O registers.
-
- The Modify() function provides an interface for table based programming of the Super I/O
- registers. This function can be used to perform programming of multiple Super I/O registers with a
- single function call. For each table entry, the Register is read, its content is bitwise ANDed with
- AndMask, and then ORed with OrMask before being written back to the Register. The Super
- I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
- O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
- returned to the original state.
-
- @param[in] This Indicates a pointer to the calling context.
- @param[in] Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
- structures. Each structure specifies a single Super I/O register modify operation.
- Type EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
- @param[in] NumberOfCommands Number of elements in the Command array.
-
- @retval EFI_SUCCESS The operation completed successfully
- @retval EFI_INVALID_PARAMETER Command is NULL
-**/
-EFI_STATUS
-EFIAPI
-SioModify (
- IN CONST EFI_SIO_PROTOCOL *This,
- IN CONST EFI_SIO_REGISTER_MODIFY *Command,
- IN UINTN NumberOfCommands
- );
-
-#endif
--
2.19.1.windows.1


[edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid

Agyeman, Prince
 

Added gBoardModulePkgTokenSpaceGuid to BoardModulePkg

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
Platform/Intel/BoardModulePkg/BoardModulePkg.dec | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
index f461cc7cab..8a811602e6 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
@@ -42,3 +42,7 @@

## GUID to publish BIOS information HOB
gBiosInfoGuid = { 0x09d0d15c, 0xe9f0, 0x4dfc, {0x9e, 0x0b, 0x39, 0x33, 0x1f, 0xca, 0x66, 0x85} }
+
+ ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343}
+ gBoardModulePkgTokenSpaceGuid = { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba, 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } }
+
--
2.19.1.windows.1


[edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard

Agyeman, Prince
 

This patch series enables BIOS Ps2 keyboard in GalagoPro3

Changes in v2:
* fixed typos
* fixed discriptions
* broke patches down as per recommendation from Michael Kubacki
* renamed the Ps2KbcLib to BdsPs2KbcLib
* moved BdsPs2KbcLib to BoardModulePkg as it is generic and can be
shared

What was done in v1:
Patch 0001 adds PCDs to BoardModulePkg that will enable/disable,
describe Super I/O , Ps2 keyboard/mouse, uart1 and uart2 com ports

Patch 0002 moves the generic Super I/O driver from SimicsOpenBoardPkg to
BoardModulePkg in order for it to be shared. This driver publishes the
gEfiSioProtocolGuid consumed by edk2's MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
driver to enable Ps2 keyboard functions in BIOS

Patch 0003 adds PCDs defined in patch 0001 to enable/disable devices in the
Super I/O driver added in patch 0002

Patch 0004 adds a Null Ps2 Library that adds Ps2 keyboard device path to
ConIn and ConInDev

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Patch 0005 enables Ps2 keyboard in BIOS by setting Ps2 keyboard related PCDs
Prince Agyeman (9):
BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
SimicsOpenBoardPkg: Remove Super I/O DXE driver
BoardModulePkg: Add Super I/O driver
BoardModulePkg: Add fix at build Pcds
BoardModulePkg: Added Pcds to Super I/O driver
BoardModulePkg: Add Ps2 Keyboard Library
KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
SimicsOpenBoardPkg: Add Ps2 keyboard Support
WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support

.../Intel/BoardModulePkg/BoardModulePkg.dec | 25 +++
.../Intel/BoardModulePkg/BoardModulePkg.dsc | 6 +
.../LegacySioDxe/ComponentName.c | 2 +-
.../LegacySioDxe/ComponentName.h | 2 +-
.../LegacySioDxe/LegacySioDxe.inf | 17 +-
.../LegacySioDxe/Register.h | 0
.../LegacySioDxe/SioChip.c | 70 +++++-
.../LegacySioDxe/SioChip.h | 18 +-
.../LegacySioDxe/SioDriver.c | 40 ++++
.../LegacySioDxe/SioDriver.h | 1 -
.../LegacySioDxe/SioService.c | 0
.../LegacySioDxe/SioService.h | 2 +-
.../Library/BdsPs2KbcLib/BdsPs2KbcLib.c | 202 ++++++++++++++++++
.../Library/BdsPs2KbcLib/BdsPs2KbcLib.h | 65 ++++++
.../Library/BdsPs2KbcLib/BdsPs2KbcLib.inf | 38 ++++
.../BoardAcpiLib/DxeBoardAcpiTableLib.inf | 3 +-
.../DxeMultiBoardAcpiSupportLib.inf | 3 +-
.../GalagoPro3/OpenBoardPkg.dsc | 7 +
.../GalagoPro3/OpenBoardPkg.fdf | 2 +
.../GalagoPro3/OpenBoardPkgPcd.dsc | 6 +
.../BoardAcpiLib/DxeBoardAcpiTableLib.inf | 3 +-
.../DxeMultiBoardAcpiSupportLib.inf | 3 +-
.../KabylakeRvp3/OpenBoardPkg.dsc | 6 +
.../KabylakeRvp3/OpenBoardPkg.fdf | 2 +
.../KabylakeRvp3/OpenBoardPkgPcd.dsc | 7 +
.../KabylakeOpenBoardPkg/OpenBoardPkg.dec | 2 -
.../BoardX58Ich10/OpenBoardPkg.dsc | 3 +-
.../BoardX58Ich10/OpenBoardPkg.fdf | 2 +-
.../BoardX58Ich10/OpenBoardPkgPcd.dsc | 6 +
.../WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec | 1 -
.../WhiskeylakeURvp/OpenBoardPkg.dsc | 6 +
.../WhiskeylakeURvp/OpenBoardPkg.fdf | 2 +
.../WhiskeylakeURvp/OpenBoardPkgPcd.dsc | 6 +
33 files changed, 523 insertions(+), 35 deletions(-)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/ComponentName.c (96%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/ComponentName.h (96%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/LegacySioDxe.inf (63%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/Register.h (100%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioChip.c (75%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioChip.h (90%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioDriver.c (88%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioDriver.h (95%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioService.c (100%)
rename Platform/Intel/{SimicsOpenBoardPkg => BoardModulePkg}/LegacySioDxe/SioService.h (97%)
create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf

--
2.19.1.windows.1


Re: [PATCH] Support skipping automatic BM enumeration

Ashish Singhal
 

Reconciling the email chain from devel.io portal as it does not send email to individual participants.

On Nov 5, 2019, at 5:19 PM, Jeff Brasen <jbrasen@...> wrote:

Wouldn't having a variable that we create and delete on every boot put unnecessary stress on the SPI-NOR that the variable store lives on?
What about the alternative approach where we allow the platform code to modify the attributes of the auto created variable to disable it with hidden/!active but still match for detection purposes so that it doesn't delete and recreate the modified variable each boot? That way all the logic on what to disable can still be in the platform code and all the existing logic in the boot manager can stay basically the same?

What changes every boot that forces the variable to need to get modified?

I would assume the NOR driver is smart enough to not update a variable that is not changing.

The custom BDS could could only create the variable for this device if it does not exist.

Thanks,

Andrew Fish

Thanks,

Jeff

-----Original Message-----
From: Laszlo Ersek <lersek@redhat.com>
Sent: Tuesday, November 5, 2019 12:24 PM
To: Ashish Singhal <ashishsingha@nvidia.com>; Andrew Fish <afish@apple.com>
Cc: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Mike Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration

On 11/05/19 19:00, Ashish Singhal wrote:

I agree that I can use the platform boot manager protocol to modify
the boot variable and give the custom optional data I need, but that
would not stop UefiBootManagerLib from creating another boot option
with mBmAutoCreateBootOptionGuid as the optional data on the next
bootup which I would have to delete every time in the platform boot
manager driver.
From a purely pragmatic perspective, I would act exactly like you describe above. I'm not saying that this is the cleanest design, or that it has the best performance. However, it also does not introduce technical debt -- it's not a "wrong" thing to do --, and (from past
experience) keeping it 100% in platform code produces the least amount of friction, and allows for the smoothest development. Extending UefiBootManagerLib has always been an uphill battle.

Thanks
Laszlo

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


[PATCH] SecurityPkg: Fix TPM2 ACPI measurement.

Lin, Derek (HPS SW)
 

We have discussed in this thread.
https://edk2.groups.io/g/devel/topic/32205028

Before the change, TPM FW upgrade will impact TPM2 ACPI PCR value because
TPM2 ACPI HID include FW version.

This change make the measurement before TPM2 HID fixup. So, after TPM FW
upgrade, the ACPI PCR record remains the same.

Signed-off-by: Derek Lin <derek.lin2@hpe.com>
---
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index bd786bf479..54966c83ce 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -664,7 +664,22 @@ PublishAcpiTable (
));

//
- // Update TPM2 HID before measuring it to PCR
+ // Measure to PCR[0] with event EV_POST_CODE ACPI DATA.
+ // The measurement has to be done before UpdateHID since TPM2 ACPI HID
+ // imply TPM Firmware Version. Otherwise, the PCR record would be
+ // different after TPM FW update.
+ //
+ TpmMeasureAndLogData(
+ 0,
+ EV_POST_CODE,
+ EV_POSTCODE_INFO_ACPI_DATA,
+ ACPI_DATA_LEN,
+ Table,
+ TableSize
+ );
+
+ //
+ // Update TPM2 HID after measuring it to PCR
//
Status = UpdateHID(Table);
if (EFI_ERROR(Status)) {
@@ -694,19 +709,6 @@ PublishAcpiTable (
}
}

- //
- // Measure to PCR[0] with event EV_POST_CODE ACPI DATA
- //
- TpmMeasureAndLogData(
- 0,
- EV_POST_CODE,
- EV_POSTCODE_INFO_ACPI_DATA,
- ACPI_DATA_LEN,
- Table,
- TableSize
- );
-
-
ASSERT (Table->OemTableId == SIGNATURE_64 ('T', 'p', 'm', '2', 'T', 'a', 'b', 'l'));
CopyMem (Table->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (Table->OemId) );
mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16) sizeof (TCG_NVS));
--
2.20.1.windows.1


Re: [PATCH v1 1/1] Maintainers.txt: Adding new NetworkPkg reviewer.

Wu, Jiaxin
 

Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

Thanks,
Jiaxin

-----Original Message-----
From: Rabeda, Maciej <maciej.rabeda@intel.com>
Sent: Wednesday, November 6, 2019 1:07 AM
To: devel@edk2.groups.io
Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: [PATCH v1 1/1] Maintainers.txt: Adding new NetworkPkg reviewer.

Add Maciej Rabeda as reviewer of NetworkPkg.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@intel.com>
---
Maintainers.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 71a34a284567..922cc664ddc3 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -356,6 +356,7 @@ F: NetworkPkg/
W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg
M: Jiaxin Wu <jiaxin.wu@intel.com>
R: Siyuan Fu <siyuan.fu@intel.com>
+R: Maciej Rabeda <maciej.rabeda@intel.com>

OvmfPkg
F: OvmfPkg/
--
2.17.0.windows.1


Re: [edk2-platforms] Update Intel Packages on Bugzilla

Michael D Kinney
 

Michael,

 

I have disabled those 4 components for bugs.

 

Thanks,

 

Mike

 

From: Kubacki, Michael A <michael.a.kubacki@...>
Sent: Tuesday, November 5, 2019 1:48 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D <michael.d.kinney@...>; Lu, Shifei A <shifei.a.lu@...>; Zhou, Bowen <bowen.zhou@...>; Oram, Isaac W <isaac.w.oram@...>; Piwko, Maciej <maciej.piwko@...>; Bu, Daocheng <daocheng.bu@...>; Gillispie, Thad <thad.gillispie@...>
Subject: [edk2-platforms] Update Intel Packages on Bugzilla

 

Hi Mike,

 

The following packages have been removed from edk2-platforms in

the patch series below as described in the RFC.

 

* RFC: https://edk2.groups.io/g/devel/message/49360

* Patch series: https://edk2.groups.io/g/devel/message/49843

 

Packages:

* Platform/Intel/PurleyOpenBoardPkg

* Silicon/Intel/LewisburgPkg

* Silicon/Intel/PurleyRcPkg

* Silicon/Intel/PurleySktPkg

 

All open bugs against these packages in Bugzilla have been closed.

 

Can these packages please be removed from the "EDK2 Platforms"

product on Bugzilla?

 

Thanks,

Michael


Re: [Patch v3 22/22] Readme.md: Add CI build status badges

Michael D Kinney
 

Liming,

The Azure Pipelines config is

vm_image: 'ubuntu-latest'

The documentation on available vm_image settings is here:

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

Currently ubuntu-latest is same as ubuntu-18.04.

Mike

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com>
Sent: Tuesday, November 5, 2019 4:21 PM
To: devel@edk2.groups.io; Kinney, Michael D
<michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek
<lersek@redhat.com>; Leif Lindholm
<leif.lindholm@linaro.org>
Subject: RE: [edk2-devel] [Patch v3 22/22] Readme.md:
Add CI build status badges

Mike:
How to know Ubuntu OS version?

Thanks
Liming
-----Original Message-----
From: devel@edk2.groups.io
[mailto:devel@edk2.groups.io] On Behalf Of
Michael D Kinney
Sent: Wednesday, October 30, 2019 3:55 AM
To: devel@edk2.groups.io
Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek
<lersek@redhat.com>;
Leif Lindholm <leif.lindholm@linaro.org>
Subject: [edk2-devel] [Patch v3 22/22] Readme.md: Add
CI build status
badges

https://bugzilla.tianocore.org/show_bug.cgi?id=2315

Update Readme.md with status badges from the most
recent EDK II
Continuous Integration(CI) build.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney
<michael.d.kinney@intel.com>
---
Readme.md | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/Readme.md b/Readme.md
index 27e4ce0771..37183c3265 100644
--- a/Readme.md
+++ b/Readme.md
@@ -3,6 +3,19 @@
A modern, feature-rich, cross-platform firmware
development
environment for the UEFI and PI specifications from
www.uefi.org.

+## Build Status
+
+| Host Type | Toolchain | Branch | Build Status | Test
Status | Code
+| Coverage
|
+| :-------- | :-------- | :---- | :----- | :---- | :--
- | Windows |
+| VS2019 | master | [![Build
Status](https://dev.azure.com/tianocore/edk2-ci-
play/_apis/build/status/Edk2%20Windows%20VS2019%20CI?br
anchName=m
aster)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master) |
[![Azure DevOps
tests](https://img.shields.io/azure-
devops/tests/tianocore/edk2-ci-
play/14.svg)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master) |
[![Code
Coverage](https://img.shields.io/badge/coverage-
coming_soon-
blue)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master)|
+| Ubuntu | GCC5 | master | [![Build
Status](https://dev.azure.com/tianocore/edk2-ci-
play/_apis/build/status/Edk2%20Ubuntu%20GCC5%20CI?branc
hName=maste
r)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master) |
[![Azure DevOps
tests](https://img.shields.io/azure-
devops/tests/tianocore/edk2-ci-
play/15.svg)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master)
| [![Code
Coverage](https://img.shields.io/badge/coverage-
coming_soon-
blue)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master) |
+
+[More CI Build information](ci/readme.md)
+
+## License Details
+
+[![License](https://img.shields.io/badge/license-BSD--
2--Clause--Paten
+t-
blue)](License.txt)
+
The majority of the content in the EDK II open source
project uses a
[BSD-2-Clause Plus Patent License](License.txt). The
EDK II open
source project contains the following components that
are covered by
additional licenses:
@@ -20,7 +33,8 @@ contains the following components
that are covered by
additional licenses:
The EDK II Project is composed of packages. The
maintainers for each
package are listed in
[Maintainers.txt](Maintainers.txt).

-# Resources
+## Resources
+
* [TianoCore](http://www.tianocore.org)
* [EDK
II](https://github.com/tianocore/tianocore.github.io/wi
ki/EDK-II)
* [Getting Started with EDK
II](https://github.com/tianocore/tianocore.github.io/wi
ki/Getting-Start
ed-
with-EDK-II)
@@ -29,7 +43,8 @@ are listed in
[Maintainers.txt](Maintainers.txt).
* [How To
Contribute](https://github.com/tianocore/tianocore.gith
ub.io/wiki/How-T
o-
Contribute)
* [Release
Planning](https://github.com/tianocore/tianocore.github
.io/wiki/EDK-II-
Release-Planning)

-# Code Contributions
+## Code Contributions
+
To make a contribution to a TianoCore project, follow
these steps.
1. Create a change description in the format specified
below to
use in the source control commit log.
@@ -57,7 +72,7 @@ To make a contribution to a TianoCore
project, follow
these steps.
Contributions using other licenses might be
accepted, but further
review will be required.

-# Developer Certificate of Origin
+## Developer Certificate of Origin

Your change description should use the standard format
for a commit
message, and must include your `Signed-off-by`
signature.
@@ -104,7 +119,7 @@ By making a contribution to this
project, I certify that:
this project or the open source license(s)
involved.
```

-# Sample Change Description / Commit Message
+## Sample Change Description / Commit Message

```
From: Contributor Name <contributor@example.com> @@ -
115,14 +130,14 @@
Full-commit-message
Signed-off-by: Contributor Name
<contributor@example.com> ```

-## Notes for sample patch email
+### Notes for sample patch email

* The first line of commit message is taken from the
email's subject
line following `[Repository/Branch PATCH]`. The
remaining portion of the
commit message is the email's content.
* `git format-patch` is one way to create this format

-## Definitions for sample patch email
+### Definitions for sample patch email

* `Repository` is the identifier of the repository the
patch applies.
This identifier should only be provided for
repositories other than
@@ -141,7 +156,7 @@ Signed-off-by: Contributor Name
<contributor@example.com>
* `Signed-off-by` is the contributor's signature
identifying them
by their real/legal name and their email address.

-# Submodules
+## Submodules

Submodule in EDK II is allowed but submodule chain
should be avoided
as possible as we can. Currently EDK II contains two
submodules
--
2.21.0.windows.1



Re: [Patch v3 12/22] MdePkg: Add YAML file for CI builds

Michael D Kinney
 

Yes.

Mike

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com>
Sent: Tuesday, November 5, 2019 4:21 PM
To: Kinney, Michael D <michael.d.kinney@intel.com>;
devel@edk2.groups.io; Sean Brogan
<sean.brogan@microsoft.com>
Subject: RE: [Patch v3 12/22] MdePkg: Add YAML file for
CI builds

Mike:
So, github plugin (.azurepipelines, .mergify) uses
.yml files. Edk2 pytool plugin uses .yaml. Right?

Thanks
Liming
-----Original Message-----
From: Kinney, Michael D
Sent: Wednesday, November 06, 2019 1:05 AM
To: Gao, Liming <liming.gao@intel.com>;
devel@edk2.groups.io; Kinney,
Michael D <michael.d.kinney@intel.com>; Sean Brogan
<sean.brogan@microsoft.com>
Subject: RE: [Patch v3 12/22] MdePkg: Add YAML file for
CI builds

Hi Liming,

There are two types of YAML files in this patch series.

1) Azure Piplelines .yml files.

https://docs.microsoft.com/en-
us/azure/devops/pipelines/yaml-
schema?view=azure-devops&tabs=schema

2) EDK II Package .yaml files. These specify the set
of pytool extensions to
use to make sure an EDK II package passes all the
required checks. The
contents of these files are JSON format and the
syntax for each extension
is defined by each pytool plugin. JSON is
considered a subset of YAML.

https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/CharEncodingCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/CompilerPlugin
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/DependencyCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/DscCompleteCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/GuidCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/LibraryClassCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/SpellCheck

Please let us know if the plugin documentation
including the YAML
syntax is not clear.

Best regards,

Mike

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com>
Sent: Tuesday, November 5, 2019 12:22 AM
To: Kinney, Michael D <michael.d.kinney@intel.com>;
devel@edk2.groups.io
Subject: RE: [Patch v3 12/22] MdePkg: Add YAML file
for CI builds

Mike:
Is there some basic introduction for YAML file
syntax?

Thanks
Liming
-----Original Message-----
From: Kinney, Michael D
Sent: Wednesday, October 30, 2019 3:55 AM
To: devel@edk2.groups.io
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [Patch v3 12/22] MdePkg: Add YAML file for
CI
builds

https://bugzilla.tianocore.org/show_bug.cgi?id=2315

Add YAML file to the package directory with the
configuration of the
checks to perform during a CI build.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney
<michael.d.kinney@intel.com>
---
MdePkg/MdePkg.ci.yaml | 90
+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 MdePkg/MdePkg.ci.yaml

diff --git a/MdePkg/MdePkg.ci.yaml
b/MdePkg/MdePkg.ci.yaml new file
mode 100644 index 0000000000..4015c07f16
--- /dev/null
+++ b/MdePkg/MdePkg.ci.yaml
@@ -0,0 +1,90 @@
+##
+# CI configuration for MdePkg
+#
+# Copyright (c) Microsoft Corporation # SPDX-
License-Identifier:
+BSD-2-Clause-Patent ## {
+ ## options defined ci/Plugin/CompilerPlugin
+ "CompilerPlugin": {
+ "DscPath": "MdePkg.dsc"
+ },
+
+ ## options defined ci/Plugin/CharEncodingCheck
+"CharEncodingCheck": {
+ "IgnoreFiles": []
+ },
+
+ ## options defined ci/Plugin/DependencyCheck
+ "DependencyCheck": {
+ "AcceptableDependencies": [
+ "MdePkg/MdePkg.dec"
+ ],
+ # For host based unit tests
+ "AcceptableDependencies-
HOST_APPLICATION":[],
+ # For UEFI shell based apps
+ "AcceptableDependencies-
UEFI_APPLICATION":[],
+ "IgnoreInf": []
+ },
+
+ ## options defined ci/Plugin/DscCompleteCheck
+ "DscCompleteCheck": {
+ "IgnoreInf": [],
+ "DscPath": "MdePkg.dsc"
+ },
+
+ ## options defined ci/Plugin/GuidCheck
+ "GuidCheck": {
+ "IgnoreGuidName": [
+ "gEfiFirmwareVolumeTopFileGuid" # sec
modules must be set
+ to this
guid
+ ],
+ "IgnoreGuidValue": ["00000000-0000-0000-
0000-
000000000000"],
+ "IgnoreFoldersAndFiles": [],
+ "IgnoreDuplicates": [
+
"gEfiFirmwareVolumeBlockProtocolGuid=gEfiFirmwareVolume
Block2Protocol
Guid",
+
"gEfiMmAccessProtocolGuid=gEfiSmmAccess2ProtocolGuid",
+
"gEfiSmmCommunicationProtocolGuid=gEfiMmCommunicationPr
otocolGuid",
+
"gEfiMmPciRootBridgeIoProtocolGuid=gEfiSmmPciRootBridge
IoProtocolGuid",
+
"gEfiTrEEProtocolGuid=gEfiTcg2ProtocolGuid",
+
"gEfiSmmPowerButtonDispatch2ProtocolGuid=gEfiMmPowerBut
tonDispatch
ProtocolGuid",
+
"gEfiSmmBase2ProtocolGuid=gEfiMmBaseProtocolGuid",
+
"gEfiSmmUsbDispatch2ProtocolGuid=gEfiMmUsbDispatchProto
colGuid",
+
"gEfiSmmCpuProtocolGuid=gEfiMmCpuProtocolGuid",
+
"gEfiAcpiTableGuid=gEfiAcpi20TableGuid",
+
"gEfiSmmControl2ProtocolGuid=gEfiMmControlProtocolGuid",
+
"gEfiSmmStandbyButtonDispatch2ProtocolGuid=gEfiMmStandb
yButtonDispat
chProtocolGuid",
+
+
"gEfiSmmStatusCodeProtocolGuid=gEfiMmStatusCodeProtocolG
uid",
+
"gEfiDxeSmmReadyToLockProtocolGuid=gEfiDxeMmReadyToLock
ProtocolGui
d",
+
"gEfiSmmIoTrapDispatch2ProtocolGuid=gEfiMmIoTrapDispatc
hProtocolGuid",
+
"gEfiSmmReadyToLockProtocolGuid=gEfiMmReadyToLockProtoc
olGuid",
+
"gEfiSmmSxDispatch2ProtocolGuid=gEfiMmSxDispatchProtocol
Guid",
+
"gEfiPeiCapsulePpiGuid=gPeiCapsulePpiGuid",
+
"gEfiSmmCpuIo2ProtocolGuid=gEfiMmCpuIoProtocolGuid",
+
+
"gEfiSmmRscHandlerProtocolGuid=gEfiMmRscHandlerProtocolG
uid",
+
"gEfiSmmConfigurationProtocolGuid=gEfiMmConfigurationPr
otocolGuid",
+
"gEfiSmmGpiDispatch2ProtocolGuid=gEfiMmGpiDispatchProto
colGuid",
+
"gEfiSmmEndOfDxeProtocolGuid=gEfiMmEndOfDxeProtocolGuid"
,
+
+
"gEfiSmmSwDispatch2ProtocolGuid=gEfiMmSwDispatchProtocol
Guid",
+
"gEfiDebugPortProtocolGuid=gEfiDebugPortVariableGuid=gE
fiDebugPortDevi
cePathGuid", ## is this a bug
+
"gEfiProcessorSpecificErrorSectionGuid=gEfiIa32X64Proce
ssorErrorSection
Gui
d", ## is this a bug
+
"gEfiSmmPeriodicTimerDispatch2ProtocolGuid=gEfiMmPeriod
icTimerDispatch
ProtocolGuid",
+
"gEdkiiFormBrowserExProtocolGuid=gEfiFormBrowserExProtoc
olGuid",
+
"gEfiPeiMmAccessPpiGuid=gPeiSmmAccessPpiGuid",
+
"gPeiSmmControlPpiGuid=gEfiPeiMmControlPpiGuid"
+ ]
+ },
+
+ ## options defined ci/Plugin/LibraryClassCheck
+ "LibraryClassCheck": {
+ "IgnoreHeaderFile": []
+ },
+
+ ## options defined ci/Plugin/SpellCheck
+ "SpellCheck": {
+ "AuditOnly": True, # Fails test
but
run in AuditOnly mode to collect
log
+ "IgnoreFiles": [], # use
gitignore
syntax to ignore errors in matching
files
+ "ExtendWords": [], # words to
extend
to the dictionary for this
package
+ "IgnoreStandardPaths": [], # Standard
Plugin
defined paths that should
be ignore
+ "AdditionalIncludePaths": [] # Additional
paths to spell check
+ (wildcards
supported)
+ }
+}
--
2.21.0.windows.1


Re: [Patch v3 22/22] Readme.md: Add CI build status badges

Liming Gao
 

Mike:
How to know Ubuntu OS version?

Thanks
Liming

-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
Michael D Kinney
Sent: Wednesday, October 30, 2019 3:55 AM
To: devel@edk2.groups.io
Cc: Andrew Fish <afish@apple.com>; Laszlo Ersek <lersek@redhat.com>; Leif
Lindholm <leif.lindholm@linaro.org>
Subject: [edk2-devel] [Patch v3 22/22] Readme.md: Add CI build status
badges

https://bugzilla.tianocore.org/show_bug.cgi?id=2315

Update Readme.md with status badges from the most recent
EDK II Continuous Integration(CI) build.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
Readme.md | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/Readme.md b/Readme.md
index 27e4ce0771..37183c3265 100644
--- a/Readme.md
+++ b/Readme.md
@@ -3,6 +3,19 @@
A modern, feature-rich, cross-platform firmware development environment
for the UEFI and PI specifications from www.uefi.org.

+## Build Status
+
+| Host Type | Toolchain | Branch | Build Status | Test Status | Code Coverage
|
+| :-------- | :-------- | :---- | :----- | :---- | :--- |
+| Windows | VS2019 | master | [![Build
Status](https://dev.azure.com/tianocore/edk2-ci-
play/_apis/build/status/Edk2%20Windows%20VS2019%20CI?branchName=m
aster)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master) | [![Azure DevOps
tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-ci-
play/14.svg)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master) | [![Code
Coverage](https://img.shields.io/badge/coverage-coming_soon-
blue)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=14&branchName=master)|
+| Ubuntu | GCC5 | master | [![Build
Status](https://dev.azure.com/tianocore/edk2-ci-
play/_apis/build/status/Edk2%20Ubuntu%20GCC5%20CI?branchName=maste
r)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master) | [![Azure DevOps
tests](https://img.shields.io/azure-devops/tests/tianocore/edk2-ci-
play/15.svg)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master) | [![Code
Coverage](https://img.shields.io/badge/coverage-coming_soon-
blue)](https://dev.azure.com/tianocore/edk2-ci-
play/_build/latest?definitionId=15&branchName=master) |
+
+[More CI Build information](ci/readme.md)
+
+## License Details
+
+[![License](https://img.shields.io/badge/license-BSD--2--Clause--Patent-
blue)](License.txt)
+
The majority of the content in the EDK II open source project uses a
[BSD-2-Clause Plus Patent License](License.txt). The EDK II open source
project
contains the following components that are covered by additional licenses:
@@ -20,7 +33,8 @@ contains the following components that are covered by
additional licenses:
The EDK II Project is composed of packages. The maintainers for each
package
are listed in [Maintainers.txt](Maintainers.txt).

-# Resources
+## Resources
+
* [TianoCore](http://www.tianocore.org)
* [EDK II](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II)
* [Getting Started with EDK
II](https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-
with-EDK-II)
@@ -29,7 +43,8 @@ are listed in [Maintainers.txt](Maintainers.txt).
* [How To
Contribute](https://github.com/tianocore/tianocore.github.io/wiki/How-To-
Contribute)
* [Release
Planning](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-
Release-Planning)

-# Code Contributions
+## Code Contributions
+
To make a contribution to a TianoCore project, follow these steps.
1. Create a change description in the format specified below to
use in the source control commit log.
@@ -57,7 +72,7 @@ To make a contribution to a TianoCore project, follow
these steps.
Contributions using other licenses might be accepted, but further
review will be required.

-# Developer Certificate of Origin
+## Developer Certificate of Origin

Your change description should use the standard format for a
commit message, and must include your `Signed-off-by` signature.
@@ -104,7 +119,7 @@ By making a contribution to this project, I certify that:
this project or the open source license(s) involved.
```

-# Sample Change Description / Commit Message
+## Sample Change Description / Commit Message

```
From: Contributor Name <contributor@example.com>
@@ -115,14 +130,14 @@ Full-commit-message
Signed-off-by: Contributor Name <contributor@example.com>
```

-## Notes for sample patch email
+### Notes for sample patch email

* The first line of commit message is taken from the email's subject
line following `[Repository/Branch PATCH]`. The remaining portion of the
commit message is the email's content.
* `git format-patch` is one way to create this format

-## Definitions for sample patch email
+### Definitions for sample patch email

* `Repository` is the identifier of the repository the patch applies.
This identifier should only be provided for repositories other than
@@ -141,7 +156,7 @@ Signed-off-by: Contributor Name
<contributor@example.com>
* `Signed-off-by` is the contributor's signature identifying them
by their real/legal name and their email address.

-# Submodules
+## Submodules

Submodule in EDK II is allowed but submodule chain should be avoided
as possible as we can. Currently EDK II contains two submodules
--
2.21.0.windows.1



Re: [PATCH] Support skipping automatic BM enumeration

Andrew Fish
 



On Nov 5, 2019, at 5:19 PM, Jeff Brasen <jbrasen@...> wrote:

Wouldn't having a variable that we create and delete on every boot put unnecessary stress on the SPI-NOR that the variable store lives on?
What about the alternative approach where we allow the platform code to modify the attributes of the auto created variable to disable it with hidden/!active but still match for detection purposes so that it doesn't delete and recreate the modified variable each boot? That way all the logic on what to disable can still be in the platform code and all the existing logic in the boot manager can stay basically the same?

What changes every boot that forces the variable to need to get modified? 

I would assume the NOR driver is smart enough to not update a variable that is not changing. 

The custom BDS could could only create the variable for this device if it does not exist. 

Thanks,

Andrew Fish


Thanks,

Jeff
 



Re: [Patch v3 12/22] MdePkg: Add YAML file for CI builds

Liming Gao
 

Mike:
So, github plugin (.azurepipelines, .mergify) uses .yml files. Edk2 pytool plugin uses .yaml. Right?

Thanks
Liming

-----Original Message-----
From: Kinney, Michael D
Sent: Wednesday, November 06, 2019 1:05 AM
To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io; Kinney,
Michael D <michael.d.kinney@intel.com>; Sean Brogan
<sean.brogan@microsoft.com>
Subject: RE: [Patch v3 12/22] MdePkg: Add YAML file for CI builds

Hi Liming,

There are two types of YAML files in this patch series.

1) Azure Piplelines .yml files.

https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-
schema?view=azure-devops&tabs=schema

2) EDK II Package .yaml files. These specify the set of pytool extensions to
use to make sure an EDK II package passes all the required checks. The
contents of these files are JSON format and the syntax for each extension
is defined by each pytool plugin. JSON is considered a subset of YAML.

https://github.com/tianocore/edk2-staging/tree/edk2-ci/.pytool
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/CharEncodingCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/CompilerPlugin
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/DependencyCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/DscCompleteCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/GuidCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/LibraryClassCheck
https://github.com/tianocore/edk2-staging/tree/edk2-
ci/.pytool/Plugin/SpellCheck

Please let us know if the plugin documentation including the YAML syntax is
not clear.

Best regards,

Mike

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com>
Sent: Tuesday, November 5, 2019 12:22 AM
To: Kinney, Michael D <michael.d.kinney@intel.com>;
devel@edk2.groups.io
Subject: RE: [Patch v3 12/22] MdePkg: Add YAML file for
CI builds

Mike:
Is there some basic introduction for YAML file
syntax?

Thanks
Liming
-----Original Message-----
From: Kinney, Michael D
Sent: Wednesday, October 30, 2019 3:55 AM
To: devel@edk2.groups.io
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [Patch v3 12/22] MdePkg: Add YAML file for CI
builds

https://bugzilla.tianocore.org/show_bug.cgi?id=2315

Add YAML file to the package directory with the
configuration of the
checks to perform during a CI build.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney
<michael.d.kinney@intel.com>
---
MdePkg/MdePkg.ci.yaml | 90
+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 MdePkg/MdePkg.ci.yaml

diff --git a/MdePkg/MdePkg.ci.yaml
b/MdePkg/MdePkg.ci.yaml new file
mode 100644 index 0000000000..4015c07f16
--- /dev/null
+++ b/MdePkg/MdePkg.ci.yaml
@@ -0,0 +1,90 @@
+##
+# CI configuration for MdePkg
+#
+# Copyright (c) Microsoft Corporation
+# SPDX-License-Identifier: BSD-2-Clause-Patent ## {
+ ## options defined ci/Plugin/CompilerPlugin
+ "CompilerPlugin": {
+ "DscPath": "MdePkg.dsc"
+ },
+
+ ## options defined ci/Plugin/CharEncodingCheck
+"CharEncodingCheck": {
+ "IgnoreFiles": []
+ },
+
+ ## options defined ci/Plugin/DependencyCheck
+ "DependencyCheck": {
+ "AcceptableDependencies": [
+ "MdePkg/MdePkg.dec"
+ ],
+ # For host based unit tests
+ "AcceptableDependencies-HOST_APPLICATION":[],
+ # For UEFI shell based apps
+ "AcceptableDependencies-UEFI_APPLICATION":[],
+ "IgnoreInf": []
+ },
+
+ ## options defined ci/Plugin/DscCompleteCheck
+ "DscCompleteCheck": {
+ "IgnoreInf": [],
+ "DscPath": "MdePkg.dsc"
+ },
+
+ ## options defined ci/Plugin/GuidCheck
+ "GuidCheck": {
+ "IgnoreGuidName": [
+ "gEfiFirmwareVolumeTopFileGuid" # sec
modules must be set
+ to this
guid
+ ],
+ "IgnoreGuidValue": ["00000000-0000-0000-0000-
000000000000"],
+ "IgnoreFoldersAndFiles": [],
+ "IgnoreDuplicates": [
+
"gEfiFirmwareVolumeBlockProtocolGuid=gEfiFirmwareVolume
Block2Protocol
Guid",
+
"gEfiMmAccessProtocolGuid=gEfiSmmAccess2ProtocolGuid",
+
"gEfiSmmCommunicationProtocolGuid=gEfiMmCommunicationPr
otocolGuid",
+
"gEfiMmPciRootBridgeIoProtocolGuid=gEfiSmmPciRootBridge
IoProtocolGuid",
+
"gEfiTrEEProtocolGuid=gEfiTcg2ProtocolGuid",
+
"gEfiSmmPowerButtonDispatch2ProtocolGuid=gEfiMmPowerBut
tonDispatch
ProtocolGuid",
+
"gEfiSmmBase2ProtocolGuid=gEfiMmBaseProtocolGuid",
+
"gEfiSmmUsbDispatch2ProtocolGuid=gEfiMmUsbDispatchProto
colGuid",
+
"gEfiSmmCpuProtocolGuid=gEfiMmCpuProtocolGuid",
+ "gEfiAcpiTableGuid=gEfiAcpi20TableGuid",
+
"gEfiSmmControl2ProtocolGuid=gEfiMmControlProtocolGuid",
+
"gEfiSmmStandbyButtonDispatch2ProtocolGuid=gEfiMmStandb
yButtonDispat
chProtocolGuid",
+
+
"gEfiSmmStatusCodeProtocolGuid=gEfiMmStatusCodeProtocolG
uid",
+
"gEfiDxeSmmReadyToLockProtocolGuid=gEfiDxeMmReadyToLock
ProtocolGui
d",
+
"gEfiSmmIoTrapDispatch2ProtocolGuid=gEfiMmIoTrapDispatc
hProtocolGuid",
+
"gEfiSmmReadyToLockProtocolGuid=gEfiMmReadyToLockProtoc
olGuid",
+
"gEfiSmmSxDispatch2ProtocolGuid=gEfiMmSxDispatchProtocol
Guid",
+
"gEfiPeiCapsulePpiGuid=gPeiCapsulePpiGuid",
+
"gEfiSmmCpuIo2ProtocolGuid=gEfiMmCpuIoProtocolGuid",
+
+
"gEfiSmmRscHandlerProtocolGuid=gEfiMmRscHandlerProtocolG
uid",
+
"gEfiSmmConfigurationProtocolGuid=gEfiMmConfigurationPr
otocolGuid",
+
"gEfiSmmGpiDispatch2ProtocolGuid=gEfiMmGpiDispatchProto
colGuid",
+
"gEfiSmmEndOfDxeProtocolGuid=gEfiMmEndOfDxeProtocolGuid"
,
+
+
"gEfiSmmSwDispatch2ProtocolGuid=gEfiMmSwDispatchProtocol
Guid",
+
"gEfiDebugPortProtocolGuid=gEfiDebugPortVariableGuid=gE
fiDebugPortDevi
cePathGuid", ## is this a bug
+
"gEfiProcessorSpecificErrorSectionGuid=gEfiIa32X64Proce
ssorErrorSection
Gui
d", ## is this a bug
+
"gEfiSmmPeriodicTimerDispatch2ProtocolGuid=gEfiMmPeriod
icTimerDispatch
ProtocolGuid",
+
"gEdkiiFormBrowserExProtocolGuid=gEfiFormBrowserExProtoc
olGuid",
+
"gEfiPeiMmAccessPpiGuid=gPeiSmmAccessPpiGuid",
+
"gPeiSmmControlPpiGuid=gEfiPeiMmControlPpiGuid"
+ ]
+ },
+
+ ## options defined ci/Plugin/LibraryClassCheck
+ "LibraryClassCheck": {
+ "IgnoreHeaderFile": []
+ },
+
+ ## options defined ci/Plugin/SpellCheck
+ "SpellCheck": {
+ "AuditOnly": True, # Fails test but
run in AuditOnly mode to collect
log
+ "IgnoreFiles": [], # use gitignore
syntax to ignore errors in matching
files
+ "ExtendWords": [], # words to extend
to the dictionary for this
package
+ "IgnoreStandardPaths": [], # Standard Plugin
defined paths that should
be ignore
+ "AdditionalIncludePaths": [] # Additional
paths to spell check
+ (wildcards
supported)
+ }
+}
--
2.21.0.windows.1


Re: [PATCH] SecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL

Dong, Eric
 

Reviewed-by: Eric Dong <eric.dong@intel.com>

-----Original Message-----
From: Chu, Maggie
Sent: Monday, November 4, 2019 12:04 PM
To: devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [PATCH] SecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL

https://bugzilla.tianocore.org/show_bug.cgi?id=2327

RAID drivers abstract their physical drives that make up
the array into a single unit, and do not supply individual
EFI_BLOCK_IO_PROTOCOL instances for each physical drive in the array.
This breaks support for the Security Storage Command Protocol,
which currently requires an EFI_BLOCK_IO_PROTOCOL to be associated
with the same device the protocol is installed on and provide
all the same parameters.

This patch remove dependency on EFI_BLOCK_IO_PROTOCOL and
allows access to Opal drive members of a RAID array.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
---
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 70 ++++++++++----------------
1 file changed, 27 insertions(+), 43 deletions(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index 77905d2bf9..6bec54b932 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -2667,7 +2667,6 @@ OpalEfiDriverBindingSupported(
{

EFI_STATUS Status;

EFI_STORAGE_SECURITY_COMMAND_PROTOCOL* SecurityCommand;

- EFI_BLOCK_IO_PROTOCOL* BlkIo;



if (mOpalEndOfDxe) {

return EFI_UNSUPPORTED;

@@ -2703,33 +2702,6 @@ OpalEfiDriverBindingSupported(
Controller

);



- //

- // Test EFI_BLOCK_IO_PROTOCOL on controller Handle, required by EFI_STORAGE_SECURITY_COMMAND_PROTOCOL

- // function APIs

- //

- Status = gBS->OpenProtocol(

- Controller,

- &gEfiBlockIoProtocolGuid,

- (VOID **)&BlkIo,

- This->DriverBindingHandle,

- Controller,

- EFI_OPEN_PROTOCOL_BY_DRIVER

- );

-

- if (EFI_ERROR(Status)) {

- DEBUG((DEBUG_INFO, "No EFI_BLOCK_IO_PROTOCOL on controller\n"));

- return Status;

- }

-

- //

- // Close protocol and reopen in Start call

- //

- gBS->CloseProtocol(

- Controller,

- &gEfiBlockIoProtocolGuid,

- This->DriverBindingHandle,

- Controller

- );



return EFI_SUCCESS;

}

@@ -2827,30 +2799,42 @@ OpalEfiDriverBindingStart(
);

if (EFI_ERROR(Status)) {

//

- // Close storage security that was opened

+ // Block_IO not supported on handle

//

- gBS->CloseProtocol(

- Controller,

- &gEfiStorageSecurityCommandProtocolGuid,

- This->DriverBindingHandle,

- Controller

- );

+ if(Status == EFI_UNSUPPORTED) {

+ BlkIo = NULL;

+ } else {

+ //

+ // Close storage security that was opened

+ //

+ gBS->CloseProtocol(

+ Controller,

+ &gEfiStorageSecurityCommandProtocolGuid,

+ This->DriverBindingHandle,

+ Controller

+ );



- FreePool(Dev);

- return Status;

+ FreePool(Dev);

+ return Status;

+ }

}



//

// Save mediaId

//

- Dev->MediaId = BlkIo->Media->MediaId;

+ if(BlkIo == NULL) {

+ // If no Block IO present, use defined MediaId value.

+ Dev->MediaId = 0x0;

+ } else {

+ Dev->MediaId = BlkIo->Media->MediaId;



- gBS->CloseProtocol(

- Controller,

- &gEfiBlockIoProtocolGuid,

- This->DriverBindingHandle,

- Controller

+ gBS->CloseProtocol(

+ Controller,

+ &gEfiBlockIoProtocolGuid,

+ This->DriverBindingHandle,

+ Controller

);

+ }



//

// Acquire Ascii printable name of child, if not found, then ignore device

--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 3/8] EdkRepo: Argument String Refactor - Combo Command

Ashley E Desimone
 

Move all argumenet strings for combo_command.py to
edkrepo/commands/arguments/combo_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/combo_args.py | 14 ++++++++++++++
edkrepo/commands/combo_command.py | 5 ++---
edkrepo/common/argument_strings.py | 3 ---
3 files changed, 16 insertions(+), 6 deletions(-)
create mode 100644 edkrepo/commands/arguments/combo_args.py

diff --git a/edkrepo/commands/arguments/combo_args.py b/edkrepo/commands/arguments/combo_args.py
new file mode 100644
index 0000000..2f90ed1
--- /dev/null
+++ b/edkrepo/commands/arguments/combo_args.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+#
+## @file
+# combo_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+combo command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Displays the currently checked out combination and a list of all available combinations.'
\ No newline at end of file
diff --git a/edkrepo/commands/combo_command.py b/edkrepo/commands/combo_command.py
index 3c456c2..68d6854 100644
--- a/edkrepo/commands/combo_command.py
+++ b/edkrepo/commands/combo_command.py
@@ -8,10 +8,9 @@
#
from colorama import Fore

-# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand
from edkrepo.commands.edkrepo_command import ColorArgument
-from edkrepo.common.argument_strings import COMBO_COMMAND_DESCRIPTION
+import edkrepo.commands.arguments.combo_args as arguments
from edkrepo.common.ui_functions import init_color_console
from edkrepo.config.config_factory import get_workspace_manifest

@@ -23,7 +22,7 @@ class ComboCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'combo'
- metadata['help-text'] = COMBO_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append(ColorArgument)
diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index fd74f37..e42d5b1 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -46,9 +46,6 @@ CHECKOUT_COMMAND_DESCRIPTION = 'The checkout command enables checking out a spec
CHECKOUT_COMBINATION_DESCRIPTION = 'EdkRepo checkout <Combination or sha>\n'
CHECKOUT_COMBINATION_HELP = 'Combination: The name of the combination as defined in the workspace manifest file to checkout or the sha of the revision to checkout\n'

-#Args for combos_command.py
-COMBO_COMMAND_DESCRIPTION = 'Displays the list of combinations and the currently checked out combination'
-
#Args for sparse_command.py
SPARSE_COMMAND_DESCRIPTION = 'Displays the current sparse checkout status and allows for changing the sparse checkout state.'
SPARSE_ENABLE_HELP = 'Enables sparse checkout if supported by the manifest.'
--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 4/8] EdkRepo: Argument String Refactory - Combo Command

Ashley E Desimone
 

Move all argument strings for checkout_command.py to
edkrepo/commands/arguments/checkout_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/checkout_args.py | 16 ++++++++++++++++
edkrepo/commands/checkout_command.py | 10 ++++------
edkrepo/common/argument_strings.py | 5 -----
3 files changed, 20 insertions(+), 11 deletions(-)
create mode 100644 edkrepo/commands/arguments/checkout_args.py

diff --git a/edkrepo/commands/arguments/checkout_args.py b/edkrepo/commands/arguments/checkout_args.py
new file mode 100644
index 0000000..6c8841e
--- /dev/null
+++ b/edkrepo/commands/arguments/checkout_args.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+#
+## @file
+# checkout_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+checkout command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Enables checking out a specific branch combination defined in the project manifest file.'
+COMBINATION_DESCRIPTION = 'edkrepo checkout <combination>'
+COMBINATION_HELP = 'The name of the branch combination to checkout as defined in the project manifest file.'
\ No newline at end of file
diff --git a/edkrepo/commands/checkout_command.py b/edkrepo/commands/checkout_command.py
index fe8ba0b..2ae52be 100644
--- a/edkrepo/commands/checkout_command.py
+++ b/edkrepo/commands/checkout_command.py
@@ -14,9 +14,7 @@ import os

# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgument
-from edkrepo.common.argument_strings import CHECKOUT_COMMAND_DESCRIPTION
-from edkrepo.common.argument_strings import CHECKOUT_COMBINATION_DESCRIPTION
-from edkrepo.common.argument_strings import CHECKOUT_COMBINATION_HELP
+import edkrepo.commands.arguments.checkout_args as arguments
from edkrepo.common.common_repo_functions import checkout


@@ -27,15 +25,15 @@ class CheckoutCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'checkout'
- metadata['help-text'] = CHECKOUT_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append({'name' : 'Combination',
'positional' : True,
'position' : 0,
'required': True,
- 'description' : CHECKOUT_COMBINATION_DESCRIPTION,
- 'help-text' : CHECKOUT_COMBINATION_HELP})
+ 'description' : arguments.COMBINATION_DESCRIPTION,
+ 'help-text' : arguments.COMBINATION_HELP})
args.append(OverrideArgument)
return metadata

diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index e42d5b1..e5146df 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -41,11 +41,6 @@ UPDATE_LOCAL_MANIFEST_DESCRIPTION = 'Updates the global manifest repository and
UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local manifest file found in the <workspace>/repo directory prior to performing sync operations.'
SYNC_OVERRIDE_HELP = 'Without this flag sync operations will not be completed if the updated manifest adds/removes repositories or if there are local commits on the target branch.'

-#Args for checkout_command.py
-CHECKOUT_COMMAND_DESCRIPTION = 'The checkout command enables checking out a specific branch combination from the project manifest located in the <workspace>/repo directory or the sha of a specific commit which will update all repos in the workspace to this commit.\nNote that checkout SHA will put the affected repos into detached head mode.\n'
-CHECKOUT_COMBINATION_DESCRIPTION = 'EdkRepo checkout <Combination or sha>\n'
-CHECKOUT_COMBINATION_HELP = 'Combination: The name of the combination as defined in the workspace manifest file to checkout or the sha of the revision to checkout\n'
-
#Args for sparse_command.py
SPARSE_COMMAND_DESCRIPTION = 'Displays the current sparse checkout status and allows for changing the sparse checkout state.'
SPARSE_ENABLE_HELP = 'Enables sparse checkout if supported by the manifest.'
--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 2/8] EdkRepo: Argument String Refactor Manifest Command

Ashley E Desimone
 

Update setup.py to add edkrepo.commands.arguments.
Move all argument strings for manifest_command.py to
edkrepo/commands/arguments/manifest_args.py and remove
unused strings.

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/__init__.py | 8 ++++++++
edkrepo/commands/arguments/manifest_args.py | 15 +++++++++++++++
edkrepo/commands/manifest_command.py | 7 +++----
edkrepo/common/argument_strings.py | 5 -----
setup.py | 2 +-
5 files changed, 27 insertions(+), 10 deletions(-)
create mode 100644 edkrepo/commands/arguments/__init__.py
create mode 100644 edkrepo/commands/arguments/manifest_args.py

diff --git a/edkrepo/commands/arguments/__init__.py b/edkrepo/commands/arguments/__init__.py
new file mode 100644
index 0000000..dea6eb4
--- /dev/null
+++ b/edkrepo/commands/arguments/__init__.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+#
+## @file
+# __init__.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
diff --git a/edkrepo/commands/arguments/manifest_args.py b/edkrepo/commands/arguments/manifest_args.py
new file mode 100644
index 0000000..25b9773
--- /dev/null
+++ b/edkrepo/commands/arguments/manifest_args.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+#
+## @file
+# manifest_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+manifest command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Lists the available projects.'
+ARCHIVED_HELP = 'Include a listing of archived projects.'
\ No newline at end of file
diff --git a/edkrepo/commands/manifest_command.py b/edkrepo/commands/manifest_command.py
index 32cac7f..44218c9 100644
--- a/edkrepo/commands/manifest_command.py
+++ b/edkrepo/commands/manifest_command.py
@@ -12,11 +12,10 @@ import os

from colorama import Fore

-# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand
from edkrepo.commands.edkrepo_command import ColorArgument
+import edkrepo.commands.arguments.manifest_args as arguments
from edkrepo.common.edkrepo_exception import EdkrepoWorkspaceInvalidException
-from edkrepo.common.argument_strings import MANIFEST_COMMAND_DESCRIPTION, ARCHIVED_HELP, MANIFEST_VERBOSE_HELP
from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, verify_manifest_data
from edkrepo.common.ui_functions import init_color_console
from edkrepo.config.config_factory import get_workspace_manifest
@@ -30,14 +29,14 @@ class ManifestCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'manifest'
- metadata['help-text'] = MANIFEST_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append({'name': 'archived',
'short-name': 'a',
'positional': False,
'required': False,
- 'help-text': ARCHIVED_HELP})
+ 'help-text': arguments.ARCHIVED_HELP})
args.append(ColorArgument)
return metadata

diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index 93db079..fd74f37 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -41,11 +41,6 @@ UPDATE_LOCAL_MANIFEST_DESCRIPTION = 'Updates the global manifest repository and
UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local manifest file found in the <workspace>/repo directory prior to performing sync operations.'
SYNC_OVERRIDE_HELP = 'Without this flag sync operations will not be completed if the updated manifest adds/removes repositories or if there are local commits on the target branch.'

-#Args for manifest_command.py
-MANIFEST_COMMAND_DESCRIPTION = 'Lists project manifests'
-ARCHIVED_HELP = 'Include archived projects'
-MANIFEST_VERBOSE_HELP = 'Show XML path'
-
#Args for checkout_command.py
CHECKOUT_COMMAND_DESCRIPTION = 'The checkout command enables checking out a specific branch combination from the project manifest located in the <workspace>/repo directory or the sha of a specific commit which will update all repos in the workspace to this commit.\nNote that checkout SHA will put the affected repos into detached head mode.\n'
CHECKOUT_COMBINATION_DESCRIPTION = 'EdkRepo checkout <Combination or sha>\n'
diff --git a/setup.py b/setup.py
index ed07594..4be04f1 100755
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ from setuptools import setup
setup(name='edkrepo',
version='2.0.0',
description='The edkrepo tools',
- packages=['edkrepo', 'edkrepo.commands', 'edkrepo.common', 'edkrepo.config', 'edkrepo_manifest_parser', 'project_utils'],
+ packages=['edkrepo', 'edkrepo.commands', 'edkrepo.commands.arguments', 'edkrepo.common', 'edkrepo.config', 'edkrepo_manifest_parser', 'project_utils'],
package_data={
},
include_package_data=True,
--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 6/8] EdkRepo: Argument Strings Refactor - Sync Command

Ashley E Desimone
 

Move all argument strings for sync_command.py to
edkrepo/commands/arguments/sparse_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/sync_args.py | 17 +++++++++++++++++
edkrepo/commands/sync_command.py | 13 +++++--------
edkrepo/common/argument_strings.py | 8 --------
3 files changed, 22 insertions(+), 16 deletions(-)
create mode 100644 edkrepo/commands/arguments/sync_args.py

diff --git a/edkrepo/commands/arguments/sync_args.py b/edkrepo/commands/arguments/sync_args.py
new file mode 100644
index 0000000..9961f85
--- /dev/null
+++ b/edkrepo/commands/arguments/sync_args.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+#
+## @file
+# sync_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+sync command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Updates the local copy of the current combination\'s target branches by pulling the latest changes from the server. Does not update local branches.'
+FETCH_HELP = 'Performs a fetch only sync, no changes will be made to the local workspace.'
+UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local copy of the project manifest file prior to performing sync operations.'
+OVERRIDE_HELP = 'Ignore warnings and proceed with sync operations.'
\ No newline at end of file
diff --git a/edkrepo/commands/sync_command.py b/edkrepo/commands/sync_command.py
index 13f0536..8509bce 100644
--- a/edkrepo/commands/sync_command.py
+++ b/edkrepo/commands/sync_command.py
@@ -19,11 +19,10 @@ from git import Repo
# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand
from edkrepo.commands.edkrepo_command import DryRunArgument, SubmoduleSkipArgument
+import edkrepo.commands.arguments.sync_args as arguments
from edkrepo.common.progress_handler import GitProgressHandler
from edkrepo.common.edkrepo_exception import EdkrepoUncommitedChangesException, EdkrepoManifestNotFoundException
from edkrepo.common.edkrepo_exception import EdkrepoManifestChangedException
-from edkrepo.common.argument_strings import SYNC_COMMAND_DESCRIPTION, FETCH_DESCRIPTION, FETCH_HELP, SYNC_OVERRIDE_HELP
-from edkrepo.common.argument_strings import UPDATE_LOCAL_MANIFEST_HELP, UPDATE_LOCAL_MANIFEST_DESCRIPTION
from edkrepo.common.humble import SYNC_UNCOMMITED_CHANGES, SYNC_MANIFEST_NOT_FOUND, SYNC_URL_CHANGE, SYNC_COMBO_CHANGE
from edkrepo.common.humble import SYNC_SOURCE_MOVE_WARNING, SYNC_REMOVE_WARNING, SYNC_REMOVE_LIST_END_FORMATTING
from edkrepo.common.humble import SYNC_MANIFEST_DIFF_WARNING, SYNC_MANIFEST_UPDATE
@@ -54,24 +53,22 @@ class SyncCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'sync'
- metadata['help-text'] = SYNC_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append({'name' : 'fetch',
'positional' : False,
'required' : False,
- 'description': FETCH_DESCRIPTION,
- 'help-text' : FETCH_HELP})
+ 'help-text': arguments.FETCH_HELP})
args.append({'name' : 'update-local-manifest',
'short-name': 'u',
'required' : False,
- 'description' : UPDATE_LOCAL_MANIFEST_DESCRIPTION,
- 'help-text' : UPDATE_LOCAL_MANIFEST_HELP})
+ 'help-text' : arguments.UPDATE_LOCAL_MANIFEST_HELP})
args.append({'name' : 'override',
'short-name': 'o',
'positional' : False,
'required' : False,
- 'help-text' : SYNC_OVERRIDE_HELP})
+ 'help-text' : arguments.OVERRIDE_HELP})
args.append(SubmoduleSkipArgument)
return metadata

diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index 50e25ee..b001441 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -33,11 +33,3 @@ SPARSE_HELP = 'Enables a sparse checkout based on the contents of the DSC file(s
NO_SPARSE_DESCRIPTION = 'Disables sparse checkout support.'
NO_SPARSE_HELP = 'Disables sparse checkout if enabled by default in the manifest.\n'

-#Args for sync_command.py
-SYNC_COMMAND_DESCRIPTION = 'Updates the local copy of the current combination\'s target branches with the latest changes from the server. Does not update local branches.'
-FETCH_DESCRIPTION = 'Downloads the changes from the remote server to the local workspace with out performing a merge'
-FETCH_HELP = 'Performs a fetch only sync, no changes will be made to the local workspace'
-UPDATE_LOCAL_MANIFEST_DESCRIPTION = 'Updates the global manifest repository and local manifest file prior to performing a sync'
-UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local manifest file found in the <workspace>/repo directory prior to performing sync operations.'
-SYNC_OVERRIDE_HELP = 'Without this flag sync operations will not be completed if the updated manifest adds/removes repositories or if there are local commits on the target branch.'
-
--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 5/8] EdkRepo: Argument Strings Refactor - Sparse Command

Ashley E Desimone
 

Move all argument strings for sparse_command.py to
edkrepo/commands/arguments/sparse_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/sparse_args.py | 16 ++++++++++++++++
edkrepo/commands/sparse_command.py | 8 ++++----
edkrepo/common/argument_strings.py | 4 ----
3 files changed, 20 insertions(+), 8 deletions(-)
create mode 100644 edkrepo/commands/arguments/sparse_args.py

diff --git a/edkrepo/commands/arguments/sparse_args.py b/edkrepo/commands/arguments/sparse_args.py
new file mode 100644
index 0000000..d38a0ae
--- /dev/null
+++ b/edkrepo/commands/arguments/sparse_args.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+#
+## @file
+# sparse_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+sparse command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Displays the current sparse checkout status and enables changing the sparse checkout state.'
+ENABLE_HELP = 'Enables sparse checkout is supported in the project manifest file.'
+DISABLE_HELP = 'Disables sparse checkout if it is currently enabled.'
\ No newline at end of file
diff --git a/edkrepo/commands/sparse_command.py b/edkrepo/commands/sparse_command.py
index a20bd89..5d4ef90 100644
--- a/edkrepo/commands/sparse_command.py
+++ b/edkrepo/commands/sparse_command.py
@@ -8,7 +8,7 @@
#

from edkrepo.commands.edkrepo_command import EdkrepoCommand
-from edkrepo.common.argument_strings import SPARSE_COMMAND_DESCRIPTION, SPARSE_ENABLE_HELP, SPARSE_DISABLE_HELP
+import edkrepo.commands.arguments.sparse_args as arguments
from edkrepo.config.config_factory import get_workspace_path, get_workspace_manifest
from edkrepo.common.common_repo_functions import sparse_checkout_enabled, sparse_checkout, reset_sparse_checkout
from edkrepo.common.common_repo_functions import check_dirty_repos
@@ -24,17 +24,17 @@ class SparseCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'sparse'
- metadata['help-text'] = SPARSE_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append({'name': 'enable',
'positional': False,
'required': False,
- 'help-text': SPARSE_ENABLE_HELP})
+ 'help-text': arguments.ENABLE_HELP})
args.append({'name': 'disable',
'positional': False,
'required': False,
- 'help-text': SPARSE_DISABLE_HELP})
+ 'help-text': arguments.DISABLE_HELP})
return metadata

def run_command(self, args, config):
diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index e5146df..50e25ee 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -41,7 +41,3 @@ UPDATE_LOCAL_MANIFEST_DESCRIPTION = 'Updates the global manifest repository and
UPDATE_LOCAL_MANIFEST_HELP = 'Updates the local manifest file found in the <workspace>/repo directory prior to performing sync operations.'
SYNC_OVERRIDE_HELP = 'Without this flag sync operations will not be completed if the updated manifest adds/removes repositories or if there are local commits on the target branch.'

-#Args for sparse_command.py
-SPARSE_COMMAND_DESCRIPTION = 'Displays the current sparse checkout status and allows for changing the sparse checkout state.'
-SPARSE_ENABLE_HELP = 'Enables sparse checkout if supported by the manifest.'
-SPARSE_DISABLE_HELP = 'Disables sparse checkout if enabled.'
--
2.16.2.windows.1


[edk2-staging/EdkRepo][PATCH 7/8] EdkRepo: Argument Strings Refactor - Clone Command

Ashley E Desimone
 

Move all argument strings for clone_command.py to
edkrepo/commands/arguments/clone_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
edkrepo/commands/arguments/clone_args.py | 22 ++++++++++++++++++++++
edkrepo/commands/clone_command.py | 24 +++++++-----------------
edkrepo/common/argument_strings.py | 14 --------------
3 files changed, 29 insertions(+), 31 deletions(-)
create mode 100644 edkrepo/commands/arguments/clone_args.py

diff --git a/edkrepo/commands/arguments/clone_args.py b/edkrepo/commands/arguments/clone_args.py
new file mode 100644
index 0000000..7314938
--- /dev/null
+++ b/edkrepo/commands/arguments/clone_args.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+#
+## @file
+# clone_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+''' Contains the help and description strings for arguments in the
+clone command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace.'
+WORKSPACE_HELP = ('The destination for the newly created workspace, this must be an empty directory.\n'
+ 'A value of "." indicates the current working directory.')
+PROJECT_MANIFEST_HELP = ('Either a project name as listed by "edkrepo manifest" or the path to a project manifest file.\n'
+ 'If a relative path is provided clone will first search relative to the current working directory'
+ ' and then search relative to the global manifest repository.')
+COMBINATION_HELP = 'The name of the combination to checkout. If not specified the projects default combination is used.'
+SPARSE_HELP = 'Enables sparse checkout if supported by the project manifest file.'
+NO_SPARSE_HELP = 'Disables sparse checkout if the project manifest file enables it by default.'
\ No newline at end of file
diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_command.py
index e74c4e4..2400272 100644
--- a/edkrepo/commands/clone_command.py
+++ b/edkrepo/commands/clone_command.py
@@ -10,14 +10,9 @@
import os
import shutil

-
-# Our modules
from edkrepo.commands.edkrepo_command import EdkrepoCommand
from edkrepo.commands.edkrepo_command import SubmoduleSkipArgument
-from edkrepo.common.argument_strings import PROJECT_OR_MANIFEST_DESCRIPTION, PROJECT_OR_MANIFEST_HELP
-from edkrepo.common.argument_strings import COMBINATION_DESCRIPTION, COMBINATION_HELP, WORKSPACE_DESCRIPTION
-from edkrepo.common.argument_strings import WORKSPACE_HELP, CLONE_COMMAND_DESCRIPTION
-from edkrepo.common.argument_strings import SPARSE_HELP, SPARSE_DESCRIPTION, NO_SPARSE_DESCRIPTION, NO_SPARSE_HELP
+import edkrepo.commands.arguments.clone_args as arguments
from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, clone_repos, sparse_checkout, verify_manifest_data
from edkrepo.common.common_repo_functions import case_insensitive_single_match, update_editor_config
from edkrepo.common.common_repo_functions import write_included_config, write_conditional_include
@@ -35,37 +30,32 @@ class CloneCommand(EdkrepoCommand):
def get_metadata(self):
metadata = {}
metadata['name'] = 'clone'
- metadata['help-text'] = CLONE_COMMAND_DESCRIPTION
+ metadata['help-text'] = arguments.COMMAND_DESCRIPTION
args = []
metadata['arguments'] = args
args.append({'name': 'Workspace',
'positional': True,
'position': 0,
'required': True,
- 'description': WORKSPACE_DESCRIPTION,
- 'help-text': WORKSPACE_HELP})
+ 'help-text': arguments.WORKSPACE_HELP})
args.append({'name': 'ProjectNameOrManifestFile',
'positional': True,
'position': 1,
'required': True,
- 'description': PROJECT_OR_MANIFEST_DESCRIPTION,
- 'help-text': PROJECT_OR_MANIFEST_HELP})
+ 'help-text': arguments.PROJECT_MANIFEST_HELP})
args.append({'name': 'Combination',
'positional': True,
'position': 2,
'required': False,
- 'description': COMBINATION_DESCRIPTION,
- 'help-text': COMBINATION_HELP})
+ 'help-text': arguments.COMBINATION_HELP})
args.append({'name': 'sparse',
'positional': False,
'required': False,
- 'description': SPARSE_DESCRIPTION,
- 'help-text': SPARSE_HELP})
+ 'help-text': arguments.SPARSE_HELP})
args.append({'name': 'nosparse',
'positional': False,
'required': False,
- 'description': NO_SPARSE_DESCRIPTION,
- 'help-text': NO_SPARSE_HELP})
+ 'help-text': arguments.NO_SPARSE_HELP})
args.append(SubmoduleSkipArgument)
return metadata

diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index b001441..75e13ee 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -18,18 +18,4 @@ OVERRIDE_HELP = 'Ignore warnings'
SUBMODULE_SKIP_HELP = 'Skip the pull or sync of any submodules.'
COLOR_HELP = 'Force color output (useful with \'less -r\')'

-#Args for clone_command.py
-CLONE_COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace'
-WORKSPACE_DESCRIPTION = 'The workspace in which to clone.'
-WORKSPACE_HELP = 'The workspace in which to clone. This must refer to an empty directory. A value of "." indicates the current working directory \n'
-PROJECT_OR_MANIFEST_DESCRIPTION = 'The project name as listed in the CiIndex.xml file or the name of the manifest file'
-PROJECT_OR_MANIFEST_HELP = ('The project name as listed in the CiIndex.xml file or a path to a manifest file. If a relative path to a manifest file is provided ' +
- 'clone will attempt to find it by first searching relative to the current working directory and then searchting relative to the ' +
- 'global manifest repository \n')
-COMBINATION_DESCRIPTION = 'The combination to checkout'
-COMBINATION_HELP = 'The combination name to checkout if not specified the default combination is used.\n'
-SPARSE_DESCRIPTION = 'Enables sparse checkout support.'
-SPARSE_HELP = 'Enables a sparse checkout based on the contents of the DSC file(s) listed by the manifest.\n'
-NO_SPARSE_DESCRIPTION = 'Disables sparse checkout support.'
-NO_SPARSE_HELP = 'Disables sparse checkout if enabled by default in the manifest.\n'

--
2.16.2.windows.1