public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard
@ 2019-11-06  1:25 Agyeman, Prince
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
                   ` (8 more replies)
  0 siblings, 9 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
@ 2019-11-06  1:25 ` Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
                   ` (7 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
@ 2019-11-06  1:25 ` Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
                   ` (6 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
@ 2019-11-06  1:25 ` Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
                   ` (5 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (2 preceding siblings ...)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
@ 2019-11-06  1:25 ` Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
                   ` (4 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

* Added ps2 keyboard and Uart enable PCDs.
* Added PCDs to define IO ports for Uart1 and Uart2

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.dec   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
index 8a811602e6..26e662f711 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
@@ -46,3 +46,24 @@
   ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343}
   gBoardModulePkgTokenSpaceGuid = { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba, 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } }
 
+[PcdsFixedAtBuild]
+  ## PcdPs2KbMsEnable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|0x00|UINT8|0x00000001
+
+  ## SuperIo Pci ISA Bridge info. It is an array that contains the Segment, Bus, Device and Function
+  #  information describing the PCI Device Info. The first byte is the segment number,
+  #  the second is the bus number, third byte is the device number, the fourth byte
+  #  is the Function.
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0xFF, 0xFF, 0xFF, 0xFF}|VOID*|0x00000002
+
+  ## PcdUart1Enable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable|0x00|UINT8|0x00000003
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask|0x0010|UINT16|0x00000004
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort|0x03F8|UINT16|0x00000005
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Length|0x08|UINT8|0x00000006
+
+  ## PcdUart2Enable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable|0x00|UINT8|0x00000007
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask|0x0008|UINT16|0x00000008
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort|0x02F8|UINT16|0x00000009
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Length|0x08|UINT8|0x0000000A
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (3 preceding siblings ...)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
@ 2019-11-06  1:25 ` Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
                   ` (3 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:25 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

Included PCDs to the Super I/O DXE driver,
to allow the enable/disable of Ps2 keyboard/mouse,
UART1 and UART2 ports.

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>
---
 .../LegacySioDxe/LegacySioDxe.inf             | 12 ++++
 .../BoardModulePkg/LegacySioDxe/SioChip.c     | 68 +++++++++++++++++--
 .../BoardModulePkg/LegacySioDxe/SioChip.h     |  8 +++
 .../BoardModulePkg/LegacySioDxe/SioDriver.c   | 40 +++++++++++
 4 files changed, 122 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
index f01f63e69e..ccddc97e91 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
@@ -34,6 +34,7 @@
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Sources]
   SioChip.c
@@ -44,6 +45,17 @@
   SioDriver.h
   ComponentName.c
 
+[Pcd]
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Length
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Length
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
 [Protocols]
   gEfiPciIoProtocolGuid                         ## CONSUMES
   gEfiDevicePathProtocolGuid                    ## PRODUCES
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
index 81efe3c38b..e63977be60 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
@@ -19,12 +19,31 @@
 ACPI_SIO_RESOURCES_IO_IRQ      mCom1Resources = {
   {
     { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
-    0x3f8,
-    8
+      FixedPcdGet16 (PcdUart1IoPort),
+      FixedPcdGet8 (PcdUart1Length)
+    },
+    {
+      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
+      FixedPcdGet16 (PcdUart1IrqMask)
+    },
+    {
+      ACPI_END_TAG_DESCRIPTOR,
+      0
+    }
+};
+
+//
+// COM 2 UART Controller
+//
+ACPI_SIO_RESOURCES_IO_IRQ      mCom2Resources = {
+  {
+    { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
+    FixedPcdGet16 (PcdUart2IoPort),
+    FixedPcdGet8 (PcdUart2Length)
   },
   {
     { ACPI_IRQ_NOFLAG_DESCRIPTOR },
-    BIT4    // IRQ4
+    FixedPcdGet16 (PcdUart2IrqMask),
   },
   {
     ACPI_END_TAG_DESCRIPTOR,
@@ -74,6 +93,7 @@ ACPI_SIO_RESOURCES_IO_IRQ      mMouseResources = {
 // Table of SIO Controllers
 //
 DEVICE_INFO    mDeviceInfo[] = {
+#if FixedPcdGet8 (PcdUart1Enable) == DEVICE_ENABLED
   {
     {
       EISA_PNP_ID(0x501),
@@ -84,6 +104,20 @@ DEVICE_INFO    mDeviceInfo[] = {
     { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
     { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
   },  // COM 1 UART Controller
+#endif
+#if FixedPcdGet8 (PcdUart2Enable) == DEVICE_ENABLED
+  {
+    {
+      EISA_PNP_ID(0x501),
+      0
+    },
+    0,
+    RESOURCE_IO | RESOURCE_IRQ,
+    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources },
+    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources }
+  },  // COM 2 UART Controller
+#endif
+#if FixedPcdGet8 (PcdPs2KbMsEnable) == DEVICE_ENABLED
   {
     {
       EISA_PNP_ID(0x303),
@@ -103,10 +137,30 @@ DEVICE_INFO    mDeviceInfo[] = {
     0,  // Cannot change resource
     { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
     { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
-  }  // PS/2 Mouse Controller
+  },  // PS/2 Mouse Controller
+#endif
+  DEVICE_INFO_END
 };
 
 
+
+/**
+  Gets the number of devices in Table of SIO Controllers mDeviceInfo
+
+  @retval     Number of enabled devices in Table of SIO Controllers.
+**/
+UINTN
+EFIAPI
+GetDeviceCount (
+  VOID
+){
+   UINTN        Count;
+   // Get mDeviceInfo item count
+   // -1 to account for for the end device info
+   Count = ARRAY_SIZE (mDeviceInfo) - 1;
+   return Count;
+}
+
 /**
   Return the supported devices.
 
@@ -128,7 +182,7 @@ DeviceGetList (
   //
   // Allocate enough memory for simplicity
   //
-  DeviceCount =  sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
+  DeviceCount = GetDeviceCount ();
   LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceCount);
   ASSERT (LocalDevices != NULL);
   if (LocalDevices == NULL) {
@@ -175,8 +229,10 @@ DeviceSearch (
   )
 {
   UINTN       Index;
+  UINTN       DeviceCount;
 
-  for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); Index++) {
+  DeviceCount = GetDeviceCount ();
+  for (Index = 0; Index < DeviceCount; Index++) {
     if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) == 0) {
       return &mDeviceInfo[Index];
     }
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
index 9322365923..afff6fe7b5 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
@@ -24,6 +24,8 @@ UINT8
 #define RESOURCE_DMA   BIT2
 #define RESOURCE_MEM   BIT3
 
+#define DEVICE_ENABLED  0x01
+#define DEVICE_INFO_END { { 0xFFFFFFFF, 0xFFFFFFFF } }
 #pragma pack(1)
 
 typedef struct {
@@ -45,6 +47,12 @@ typedef struct {
   ACPI_RESOURCE_HEADER_PTR    Resources;
   ACPI_RESOURCE_HEADER_PTR    PossibleResources;
 } DEVICE_INFO;
+typedef struct {
+  UINT8 Segment;
+  UINT8 Bus;
+  UINT8 Device;
+  UINT8 Funtion;
+} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
 
 /**
   Return the supported devices.
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
index 408c6ff301..5bfdc94681 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
@@ -106,6 +106,27 @@ SioDriverEntryPoint (
 }
 
 
+/**
+  Compares a PCI to ISA bridge device segment, bus, device and function to the
+  PcdSuperIoPciIsaBridgeDevice values.
+
+  @param[in]  CurrentDevice       The device to be compared with the PcdSuperIoPciIsaBridgeDevice information
+  @retval     TRUE                This device matches PcdSuperIoPciIsaBridgeDevice values
+  @retval     FALSE               This device does not match the PcdSuperIoPciIsaBridgeDevice values
+**/
+BOOLEAN
+EFIAPI
+SioDeviceEnabled (
+  IN SIO_PCI_ISA_BRIDGE_DEVICE_INFO *CurrentDevice
+){
+    SIO_PCI_ISA_BRIDGE_DEVICE_INFO *Device = \
+      (SIO_PCI_ISA_BRIDGE_DEVICE_INFO *) FixedPcdGetPtr (PcdSuperIoPciIsaBridgeDevice);
+    if(CompareMem (Device, CurrentDevice, sizeof (SIO_PCI_ISA_BRIDGE_DEVICE_INFO)) == 0) {
+      return TRUE;
+    }
+    return FALSE;
+}
+
 /**
   Test to see if this driver supports Controller Handle.
 
@@ -138,6 +159,7 @@ SioDriverSupported (
   UINTN                     BusNumber;
   UINTN                     DeviceNumber;
   UINTN                     FunctionNumber;
+  SIO_PCI_ISA_BRIDGE_DEVICE_INFO  SioDevice;
 
   //
   // If RemainingDevicePath is not NULL, it should verify that the first device
@@ -250,6 +272,24 @@ SioDriverSupported (
             Status = EFI_UNSUPPORTED;
           }
         }
+        if(!EFI_ERROR (Status)) {
+          Status = PciIo->GetLocation (
+                            PciIo,
+                            &SegmentNumber,
+                            &BusNumber,
+                            &DeviceNumber,
+                            &FunctionNumber
+                            );
+          if(!EFI_ERROR (Status)) {
+            SioDevice.Segment = (UINT8) SegmentNumber;
+            SioDevice.Bus = (UINT8) BusNumber;
+            SioDevice.Device = (UINT8) DeviceNumber;
+            SioDevice.Funtion = (UINT8) FunctionNumber;
+            if(!SioDeviceEnabled (&SioDevice)) {
+              Status = EFI_UNSUPPORTED;
+            }
+          }
+        }
       }
     }
 
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (4 preceding siblings ...)
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
@ 2019-11-06  1:26 ` Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
                   ` (2 subsequent siblings)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:26 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

Added a generic Ps2 keyboard library
that adds ps2 device path to ConIn and ConInDev
Uefi variables

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   |   1 +
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.c       | 202 ++++++++++++++++++
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.h       |  65 ++++++
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.inf     |  38 ++++
 4 files changed, 306 insertions(+)
 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

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
index 5af26eb97e..bcc2dfbfeb 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
@@ -88,3 +88,4 @@
   BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
 
   BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMediaInfoLib.inf
+  BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
new file mode 100644
index 0000000000..3a885e0d71
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
@@ -0,0 +1,202 @@
+/** @file
+  Main file for Ps2 keyboard controller library.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "BdsPs2KbcLib.h"
+
+GLOBAL_REMOVE_IF_UNREFERENCED PLATFORM_KEYBOARD_DEVICE_PATH  gKeyboardDevicePath = {
+  gPciRootBridge,
+  {
+    {
+      HARDWARE_DEVICE_PATH,
+      HW_PCI_DP,
+      {
+        (UINT8) (sizeof (PCI_DEVICE_PATH)),
+        (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8)
+      }
+    },
+    0, // Function, patched in EnumPs2Keyboard
+    0  // Device, patched in EnumPs2Keyboard
+  },
+  {
+    {
+      ACPI_DEVICE_PATH,
+      ACPI_DP,
+      {
+        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),
+        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
+      }
+    },
+    EISA_PNP_ID(0x0303),
+    0
+  },
+  gEndEntire
+};
+
+/**
+  Check if PS2 keyboard is conntected, by sending ECHO command.
+  @retval                       TRUE if connected FALSE otherwise
+**/
+BOOLEAN
+DetectPs2Keyboard (
+  VOID
+  )
+{
+  UINT32                TimeOut;
+  UINT32                RegEmptied;
+  UINT8                 Data;
+  UINT32                SumTimeOut;
+  BOOLEAN               FoundPs2Kbc;
+
+  TimeOut     = 0;
+  RegEmptied  = 0;
+  FoundPs2Kbc       = FALSE;
+
+  //
+  // Wait for input buffer empty
+  //
+  for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
+    if ((IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x02) == 0) {
+      FoundPs2Kbc = TRUE;
+      break;
+    }
+    MicroSecondDelay (30);
+  }
+
+  if (FoundPs2Kbc == FALSE) {
+    return FALSE;
+  }
+
+  //
+  // Send echo command
+  //
+  IoWrite8 (KEYBOARD_8042_DATA_REGISTER, KBC_INPBUF_VIA60_KBECHO);
+
+  //
+  // Init variables
+  //
+  FoundPs2Kbc       = FALSE;
+  TimeOut     = 0;
+  SumTimeOut  = 0;
+  Data = 0;
+
+  //
+  // Read from 8042 (multiple times if needed)
+  // until the expected value appears
+  // use SumTimeOut to control the iteration
+  //
+  while (1) {
+    //
+    // Perform a read
+    //
+    for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
+      if (IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x01) {
+        Data = IoRead8 (KEYBOARD_8042_DATA_REGISTER);
+        break;
+      }
+      MicroSecondDelay (30);
+    }
+
+    SumTimeOut += TimeOut;
+
+    if (Data == KBC_INPBUF_VIA60_KBECHO) {
+      FoundPs2Kbc = TRUE;
+      break;
+    }
+
+    if (SumTimeOut >= PS2_KEYBOARD_WAITFORVALUE_TIMEOUT) {
+      break;
+    }
+  }
+  return FoundPs2Kbc;
+}
+
+/**
+  Check if PS2 keyboard is conntected. If the result of first time is
+  error, it will retry again.
+  @retval                       TRUE if connected FALSE otherwise
+**/
+BOOLEAN
+IsPs2KeyboardConnected (
+  VOID
+  )
+{
+  BOOLEAN Result;
+  Result = DetectPs2Keyboard ();
+
+  if (Result == FALSE) {
+    //
+    // If there is no ps2 keyboard detected for the 1st time, retry again.
+    //
+    Result = DetectPs2Keyboard ();
+  }
+  return Result;
+}
+
+
+/**
+  Updates the ConIn variable with Ps2 Keyboard device path,
+  if it doesn't already exists in ConIn and ConInDev
+**/
+VOID
+AddPs2Keyboard (
+  VOID
+  )
+{
+  SIO_PCI_ISA_BRIDGE_DEVICE_INFO *SioIsaInfo;
+
+  DEBUG ((DEBUG_INFO, "[AddPs2Keyboard]\n"));
+
+  SioIsaInfo = (SIO_PCI_ISA_BRIDGE_DEVICE_INFO*) FixedPcdGetPtr (PcdSuperIoPciIsaBridgeDevice);
+
+  //
+  // patch IsaBridge device and and function
+  //
+  gKeyboardDevicePath.IsaBridge.Device = SioIsaInfo->Device;
+  gKeyboardDevicePath.IsaBridge.Function = SioIsaInfo->Funtion;
+
+  //
+  // Append Ps2 Keyboard into "ConIn"
+  //
+  EfiBootManagerUpdateConsoleVariable (ConIn, (EFI_DEVICE_PATH_PROTOCOL *) &gKeyboardDevicePath, NULL);
+
+  //
+  // Append Ps2 Keyboard into "ConInDev"
+  //
+  EfiBootManagerUpdateConsoleVariable (ConInDev, (EFI_DEVICE_PATH_PROTOCOL *) &gKeyboardDevicePath, NULL);
+}
+
+
+/**
+  Constructor for the Ps2 keyboard controller library.
+
+  @param ImageHandle    the image handle of the process
+  @param SystemTable    the EFI System Table pointer
+
+  @retval EFI_SUCCESS        the shell command handlers were installed sucessfully
+  @retval EFI_UNSUPPORTED    the shell level required was not found.
+**/
+EFI_STATUS
+EFIAPI
+BdsPs2KbcLibConstructor (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  UINT8                               Ps2KbMsEnable;
+
+  Ps2KbMsEnable = PcdGet8 (PcdPs2KbMsEnable);
+
+  if (Ps2KbMsEnable == 0x1
+    && IsPs2KeyboardConnected())
+  {
+      // add ps2 device path to ConIn and ConInDev
+      AddPs2Keyboard ();
+  }
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
new file mode 100644
index 0000000000..d9a27e6681
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
@@ -0,0 +1,65 @@
+/** @file
+  Header file for the Ps2 keyboard controller library.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _PS2_KBC_LIB_H
+#define _PS2_KBC_LIB_H
+
+#include <Uefi.h>
+#include <Library/UefiLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/TimerLib.h>
+#include <Library/UefiBootManagerLib.h>
+
+//
+// Below is the platform console device path
+//
+typedef struct {
+  ACPI_HID_DEVICE_PATH      PciRootBridge;
+  PCI_DEVICE_PATH           IsaBridge;
+  ACPI_HID_DEVICE_PATH      Keyboard;
+  EFI_DEVICE_PATH_PROTOCOL  End;
+} PLATFORM_KEYBOARD_DEVICE_PATH;
+
+typedef struct {
+  UINT8 Segment;
+  UINT8 Bus;
+  UINT8 Device;
+  UINT8 Funtion;
+} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
+
+#define gPciRootBridge \
+  { \
+    { \
+      ACPI_DEVICE_PATH, \
+      ACPI_DP, \
+      { \
+        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
+        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
+      }, \
+    }, \
+    EISA_PNP_ID (0x0A03), \
+    0 \
+  }
+
+#define gEndEntire \
+  { \
+    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { END_DEVICE_PATH_LENGTH, 0 } \
+  }
+
+#define KBC_INPBUF_VIA60_KBECHO             0xEE
+#define KEYBOARD_8042_DATA_REGISTER         0x60
+#define KEYBOARD_8042_STATUS_REGISTER       0x64
+
+#define PS2_KEYBOARD_TIMEOUT                65536   // 0.07s
+#define PS2_KEYBOARD_WAITFORVALUE_TIMEOUT   1000000 // 1s
+#define PS2_KEYBOARD_KBEN                   0xF4
+#define PS2_KEYBOARD_CMDECHO_ACK            0xFA
+
+#endif
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
new file mode 100644
index 0000000000..e00638daa7
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
@@ -0,0 +1,38 @@
+## @file
+# Component information file for Ps2 keyboard controller library
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+[Defines]
+  INF_VERSION                    = 0x00010006
+  BASE_NAME                      = BdsPs2KbcLib
+  FILE_GUID                      = E94EA52E-E84C-42E7-B863-EA1327EFA265
+  MODULE_TYPE                    = UEFI_DRIVER
+  VERSION_STRING                 = 1.2
+  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
+  CONSTRUCTOR                    = BdsPs2KbcLibConstructor
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  BoardModulePkg/BoardModulePkg.dec
+
+[Sources]
+  BdsPs2KbcLib.c
+  BdsPs2KbcLib.h
+
+[LibraryClasses]
+  DevicePathLib
+  DebugLib
+  IoLib
+  UefiDriverEntryPoint
+  UefiBootManagerLib
+  UefiLib
+  TimerLib
+
+[Pcd]
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (5 preceding siblings ...)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
@ 2019-11-06  1:26 ` Agyeman, Prince
  2019-11-06  2:08   ` [edk2-devel] " Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:26 UTC (permalink / raw)
  To: devel

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

What was done:

* Added BDS Ps2 keyboard DXE driver.

* Added Super I/O DXE driver to publish the SIO protocol
needed by the Ps2 keyboard DXE driver.

* Included a Ps2 Library to BdsDxe driver
to add the Ps2 device path to ConIn and ConInDev
variables

* Configured the Super I/O Pci to Isa bridge bus,
device, function device info PCD. This will help the Super I/O
driver identify which bridge the Super I/O is connected to.

* Removed duplicate Ps2 enable PCDs

* Updated libraries to use Ps2 enable PCD defined in BoardModulePkg

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
 .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
 .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
 .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 7 +++++++
 .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf | 2 ++
 .../KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc    | 6 ++++++
 .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
 .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc     | 6 ++++++
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf     | 2 ++
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc  | 7 +++++++
 Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec       | 2 --
 11 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
index a79bdcdbc6..35cd5c8fdb 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
@@ -33,9 +33,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gMinPlatformPkgTokenSpaceGuid.PcdPciExpNative
   gMinPlatformPkgTokenSpaceGuid.PcdNativeAspmEnable
   gMinPlatformPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
index db8ba7a822..9fe27f9fda 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
@@ -34,9 +34,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index f59248bba4..55edc1a2f8 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -311,6 +311,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf {
@@ -408,3 +413,5 @@
       !endif
   }
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
index 80efab1aad..d58466d390 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
@@ -335,6 +335,8 @@ INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
index c68b8a49cf..c6f5ae7534 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
@@ -308,6 +308,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 !endif
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
index bfb58e868f..e0bf5823d8 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
@@ -33,9 +33,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
index 00cdbe80ce..e5de9268e7 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
@@ -34,9 +34,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index 7e65eeda6f..e7f5ed39d2 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -381,6 +381,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
 !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
@@ -485,3 +490,4 @@
       !endif
   }
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
index dbd6f2aa10..98eb7dcb5a 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
@@ -336,6 +336,8 @@ INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
index 34cc731313..580504cbc1 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
@@ -324,6 +324,13 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 !endif
 
+
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
index 9680e63bad..01d6116616 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
@@ -288,8 +288,6 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdBoardUcmcGpioTableSize|0|UINT16|0x0000001
 # Misc
 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdIoExpanderPresent|FALSE|BOOLEAN|0x000000EC
 
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|1|UINT8|0x40000009
-
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40000002
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (6 preceding siblings ...)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
@ 2019-11-06  1:26 ` Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
                     ` (2 more replies)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:26 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

Added BIOS keyboard support to BoardX58Ich10

* Included BoardModulePkg's generic Super I/O DXE driver
* Configured Super I/O and Ps2 keyboard related PCD
to enable Ps2 keyboard

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/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 2 ++
 .../Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf | 1 +
 .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc    | 6 ++++++
 3 files changed, 9 insertions(+)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index e0a02b4efc..7329b19e8e 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -283,3 +283,5 @@
   $(BOARD_PKG)/SimicsDxe/SimicsDxe.inf
   $(BOARD_PKG)/SimicsVideoDxe/SimicsVideoDxe.inf
   $(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
index 6dc7b4aa56..ef6b35c92f 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
@@ -212,6 +212,7 @@ INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
 
 INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
index 0298e4b12d..cd95755f91 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
@@ -196,6 +196,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|4
   gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicAddressBase|0xFEC01000
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.X64]
   ######################################
   # Edk2 Configuration
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
                   ` (7 preceding siblings ...)
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
@ 2019-11-06  1:26 ` Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
                     ` (2 more replies)
  8 siblings, 3 replies; 37+ messages in thread
From: Agyeman, Prince @ 2019-11-06  1:26 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Chasel Chiu, Nate DeSimone

What was done:

* Added BDS Ps2 keyboard DXE driver.

* Included Super I/O DXE driver to publish the SIO protocol
needed by the Ps2 keyboard DXE driver.

* Included a Ps2 Library to BdsDxe driver
 to add the Ps2 device path to ConIn and ConInDev
 variables

* Configured the Super I/O Pci to Isa bridge bus,
 device, function device info PCD. This will help the Super I/O
 driver identify which bridge the Super I/O is connected to.

 * Removed duplicate Ps2 enable PCDs

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/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec     | 1 -
 .../WhiskeylakeURvp/OpenBoardPkg.dsc                        | 6 ++++++
 .../WhiskeylakeURvp/OpenBoardPkg.fdf                        | 2 ++
 .../WhiskeylakeURvp/OpenBoardPkgPcd.dsc                     | 6 ++++++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
index 34494d0168..fbb9549e44 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
@@ -271,7 +271,6 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative|0|UINT8|0x40000005
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable|1|UINT8|0x40000006
-gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|0|UINT8|0x40000009
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableActiveTripPoints|1|UINT8|0x4000000A
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisablePassiveTripPoints|0|UINT8|0x4000000B
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableCriticalTripPoints|1|UINT8|0x4000000C
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
index 8e0ea2d5ce..1c7c12696c 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
@@ -335,6 +335,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf {
@@ -428,3 +433,4 @@
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
   $(PLATFORM_BOARD_PACKAGE)/Acpi/BoardAcpiDxe/BoardAcpiDxe.inf
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
index 140e6260c9..8a4fd973b4 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
@@ -340,6 +340,8 @@ INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
index adbd48f6d7..52471cb25b 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
@@ -296,6 +296,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 !endif
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
-- 
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
@ 2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:38   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:07 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add
> gBoardModulePkgTokenSpaceGuid
> 
> 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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
@ 2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:07 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super
> I/O DXE driver
> 
> 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)SioComponentNameG
> etControllerName,
> -  "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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
@ 2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:07 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O
> driver
> 
> 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/UefiDriverEntryP
> oint.inf
> +
> UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/
> UefiRuntimeServicesTableLib.inf
> 
>  [LibraryClasses.common.PEIM]
> 
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Pe
> iFirmwareBootMediaLib.inf
> @@ -76,6 +80,7 @@
> 
>  [Components]
> 
> BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMediaInfoPei.inf
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
>    BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
> 
> BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLi
> bNull.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)SioComponentNameG
> etControllerName,
> +  "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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
@ 2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:07 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build
> Pcds
> 
> * Added ps2 keyboard and Uart enable PCDs.
> * Added PCDs to define IO ports for Uart1 and Uart2
> 
> 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.dec   | 21
> +++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> index 8a811602e6..26e662f711 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> @@ -46,3 +46,24 @@
>    ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343}
>    gBoardModulePkgTokenSpaceGuid = { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba,
> 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } }
> 
> +[PcdsFixedAtBuild]
> +  ## PcdPs2KbMsEnable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|0x00|UINT8|0x00000
> 001
> +
> +  ## SuperIo Pci ISA Bridge info. It is an array that contains the
> + Segment, Bus, Device and Function  #  information describing the PCI
> + Device Info. The first byte is the segment number,  #  the second is
> + the bus number, third byte is the device number, the fourth byte  #  is
> the Function.
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0xFF,
> + 0xFF, 0xFF, 0xFF}|VOID*|0x00000002
> +
> +  ## PcdUart1Enable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1Enable|0x00|UINT8|0x0000000
> 3
> +
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask|0x0010|UINT16|0x000
> 00004
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort|0x03F8|UINT16|0x00000
> 005
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1Length|0x08|UINT8|0x00000006
> +
> +  ## PcdUart2Enable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2Enable|0x00|UINT8|0x0000000
> 7
> +
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask|0x0008|UINT16|0x000
> 00008
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort|0x02F8|UINT16|0x00000
> 009
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2Length|0x08|UINT8|0x0000000
> A
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
@ 2019-11-06  2:08   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:08 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to
> Super I/O driver
> 
> Included PCDs to the Super I/O DXE driver, to allow the enable/disable of
> Ps2 keyboard/mouse,
> UART1 and UART2 ports.
> 
> 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>
> ---
>  .../LegacySioDxe/LegacySioDxe.inf             | 12 ++++
>  .../BoardModulePkg/LegacySioDxe/SioChip.c     | 68
> +++++++++++++++++--
>  .../BoardModulePkg/LegacySioDxe/SioChip.h     |  8 +++
>  .../BoardModulePkg/LegacySioDxe/SioDriver.c   | 40 +++++++++++
>  4 files changed, 122 insertions(+), 6 deletions(-)
> 
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> index f01f63e69e..ccddc97e91 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> @@ -34,6 +34,7 @@
>  [Packages]
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Sources]
>    SioChip.c
> @@ -44,6 +45,17 @@
>    SioDriver.h
>    ComponentName.c
> 
> +[Pcd]
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1Length
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2Length
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
>  [Protocols]
>    gEfiPciIoProtocolGuid                         ## CONSUMES
>    gEfiDevicePathProtocolGuid                    ## PRODUCES
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> index 81efe3c38b..e63977be60 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> @@ -19,12 +19,31 @@
>  ACPI_SIO_RESOURCES_IO_IRQ      mCom1Resources = {
>    {
>      { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
> -    0x3f8,
> -    8
> +      FixedPcdGet16 (PcdUart1IoPort),
> +      FixedPcdGet8 (PcdUart1Length)
> +    },
> +    {
> +      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
> +      FixedPcdGet16 (PcdUart1IrqMask)
> +    },
> +    {
> +      ACPI_END_TAG_DESCRIPTOR,
> +      0
> +    }
> +};
> +
> +//
> +// COM 2 UART Controller
> +//
> +ACPI_SIO_RESOURCES_IO_IRQ      mCom2Resources = {
> +  {
> +    { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
> +    FixedPcdGet16 (PcdUart2IoPort),
> +    FixedPcdGet8 (PcdUart2Length)
>    },
>    {
>      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
> -    BIT4    // IRQ4
> +    FixedPcdGet16 (PcdUart2IrqMask),
>    },
>    {
>      ACPI_END_TAG_DESCRIPTOR,
> @@ -74,6 +93,7 @@ ACPI_SIO_RESOURCES_IO_IRQ
> mMouseResources = {
>  // Table of SIO Controllers
>  //
>  DEVICE_INFO    mDeviceInfo[] = {
> +#if FixedPcdGet8 (PcdUart1Enable) == DEVICE_ENABLED
>    {
>      {
>        EISA_PNP_ID(0x501),
> @@ -84,6 +104,20 @@ DEVICE_INFO    mDeviceInfo[] = {
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
>    },  // COM 1 UART Controller
> +#endif
> +#if FixedPcdGet8 (PcdUart2Enable) == DEVICE_ENABLED
> +  {
> +    {
> +      EISA_PNP_ID(0x501),
> +      0
> +    },
> +    0,
> +    RESOURCE_IO | RESOURCE_IRQ,
> +    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources },
> +    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources }
> +  },  // COM 2 UART Controller
> +#endif
> +#if FixedPcdGet8 (PcdPs2KbMsEnable) == DEVICE_ENABLED
>    {
>      {
>        EISA_PNP_ID(0x303),
> @@ -103,10 +137,30 @@ DEVICE_INFO    mDeviceInfo[] = {
>      0,  // Cannot change resource
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
> -  }  // PS/2 Mouse Controller
> +  },  // PS/2 Mouse Controller
> +#endif
> +  DEVICE_INFO_END
>  };
> 
> 
> +
> +/**
> +  Gets the number of devices in Table of SIO Controllers mDeviceInfo
> +
> +  @retval     Number of enabled devices in Table of SIO Controllers.
> +**/
> +UINTN
> +EFIAPI
> +GetDeviceCount (
> +  VOID
> +){
> +   UINTN        Count;
> +   // Get mDeviceInfo item count
> +   // -1 to account for for the end device info
> +   Count = ARRAY_SIZE (mDeviceInfo) - 1;
> +   return Count;
> +}
> +
>  /**
>    Return the supported devices.
> 
> @@ -128,7 +182,7 @@ DeviceGetList (
>    //
>    // Allocate enough memory for simplicity
>    //
> -  DeviceCount =  sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
> +  DeviceCount = GetDeviceCount ();
>    LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) *
> DeviceCount);
>    ASSERT (LocalDevices != NULL);
>    if (LocalDevices == NULL) {
> @@ -175,8 +229,10 @@ DeviceSearch (
>    )
>  {
>    UINTN       Index;
> +  UINTN       DeviceCount;
> 
> -  for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
> Index++) {
> +  DeviceCount = GetDeviceCount ();
> +  for (Index = 0; Index < DeviceCount; Index++) {
>      if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device))
> == 0) {
>        return &mDeviceInfo[Index];
>      }
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> index 9322365923..afff6fe7b5 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> @@ -24,6 +24,8 @@ UINT8
>  #define RESOURCE_DMA   BIT2
>  #define RESOURCE_MEM   BIT3
> 
> +#define DEVICE_ENABLED  0x01
> +#define DEVICE_INFO_END { { 0xFFFFFFFF, 0xFFFFFFFF } }
>  #pragma pack(1)
> 
>  typedef struct {
> @@ -45,6 +47,12 @@ typedef struct {
>    ACPI_RESOURCE_HEADER_PTR    Resources;
>    ACPI_RESOURCE_HEADER_PTR    PossibleResources;
>  } DEVICE_INFO;
> +typedef struct {
> +  UINT8 Segment;
> +  UINT8 Bus;
> +  UINT8 Device;
> +  UINT8 Funtion;
> +} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
> 
>  /**
>    Return the supported devices.
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> index 408c6ff301..5bfdc94681 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> @@ -106,6 +106,27 @@ SioDriverEntryPoint (  }
> 
> 
> +/**
> +  Compares a PCI to ISA bridge device segment, bus, device and function
> +to the
> +  PcdSuperIoPciIsaBridgeDevice values.
> +
> +  @param[in]  CurrentDevice       The device to be compared with the
> PcdSuperIoPciIsaBridgeDevice information
> +  @retval     TRUE                This device matches
> PcdSuperIoPciIsaBridgeDevice values
> +  @retval     FALSE               This device does not match the
> PcdSuperIoPciIsaBridgeDevice values
> +**/
> +BOOLEAN
> +EFIAPI
> +SioDeviceEnabled (
> +  IN SIO_PCI_ISA_BRIDGE_DEVICE_INFO *CurrentDevice ){
> +    SIO_PCI_ISA_BRIDGE_DEVICE_INFO *Device = \
> +      (SIO_PCI_ISA_BRIDGE_DEVICE_INFO *) FixedPcdGetPtr
> (PcdSuperIoPciIsaBridgeDevice);
> +    if(CompareMem (Device, CurrentDevice, sizeof
> (SIO_PCI_ISA_BRIDGE_DEVICE_INFO)) == 0) {
> +      return TRUE;
> +    }
> +    return FALSE;
> +}
> +
>  /**
>    Test to see if this driver supports Controller Handle.
> 
> @@ -138,6 +159,7 @@ SioDriverSupported (
>    UINTN                     BusNumber;
>    UINTN                     DeviceNumber;
>    UINTN                     FunctionNumber;
> +  SIO_PCI_ISA_BRIDGE_DEVICE_INFO  SioDevice;
> 
>    //
>    // If RemainingDevicePath is not NULL, it should verify that the first
> device @@ -250,6 +272,24 @@ SioDriverSupported (
>              Status = EFI_UNSUPPORTED;
>            }
>          }
> +        if(!EFI_ERROR (Status)) {
> +          Status = PciIo->GetLocation (
> +                            PciIo,
> +                            &SegmentNumber,
> +                            &BusNumber,
> +                            &DeviceNumber,
> +                            &FunctionNumber
> +                            );
> +          if(!EFI_ERROR (Status)) {
> +            SioDevice.Segment = (UINT8) SegmentNumber;
> +            SioDevice.Bus = (UINT8) BusNumber;
> +            SioDevice.Device = (UINT8) DeviceNumber;
> +            SioDevice.Funtion = (UINT8) FunctionNumber;
> +            if(!SioDeviceEnabled (&SioDevice)) {
> +              Status = EFI_UNSUPPORTED;
> +            }
> +          }
> +        }
>        }
>      }
> 
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
@ 2019-11-06  2:08   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:08 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard
> Library
> 
> Added a generic Ps2 keyboard library
> that adds ps2 device path to ConIn and ConInDev Uefi variables
> 
> 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   |   1 +
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.c       | 202 ++++++++++++++++++
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.h       |  65 ++++++
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.inf     |  38 ++++
>  4 files changed, 306 insertions(+)
>  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
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> index 5af26eb97e..bcc2dfbfeb 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> @@ -88,3 +88,4 @@
>    BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
> 
> 
> BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootM
> ediaInfoLib.inf
> +  BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> new file mode 100644
> index 0000000000..3a885e0d71
> --- /dev/null
> +++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> @@ -0,0 +1,202 @@
> +/** @file
> +  Main file for Ps2 keyboard controller library.
> +
> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include "BdsPs2KbcLib.h"
> +
> +GLOBAL_REMOVE_IF_UNREFERENCED PLATFORM_KEYBOARD_DEVICE_PATH
> +gKeyboardDevicePath = {
> +  gPciRootBridge,
> +  {
> +    {
> +      HARDWARE_DEVICE_PATH,
> +      HW_PCI_DP,
> +      {
> +        (UINT8) (sizeof (PCI_DEVICE_PATH)),
> +        (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    0, // Function, patched in EnumPs2Keyboard
> +    0  // Device, patched in EnumPs2Keyboard
> +  },
> +  {
> +    {
> +      ACPI_DEVICE_PATH,
> +      ACPI_DP,
> +      {
> +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),
> +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    EISA_PNP_ID(0x0303),
> +    0
> +  },
> +  gEndEntire
> +};
> +
> +/**
> +  Check if PS2 keyboard is conntected, by sending ECHO command.
> +  @retval                       TRUE if connected FALSE otherwise
> +**/
> +BOOLEAN
> +DetectPs2Keyboard (
> +  VOID
> +  )
> +{
> +  UINT32                TimeOut;
> +  UINT32                RegEmptied;
> +  UINT8                 Data;
> +  UINT32                SumTimeOut;
> +  BOOLEAN               FoundPs2Kbc;
> +
> +  TimeOut     = 0;
> +  RegEmptied  = 0;
> +  FoundPs2Kbc       = FALSE;
> +
> +  //
> +  // Wait for input buffer empty
> +  //
> +  for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
> +    if ((IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x02) == 0) {
> +      FoundPs2Kbc = TRUE;
> +      break;
> +    }
> +    MicroSecondDelay (30);
> +  }
> +
> +  if (FoundPs2Kbc == FALSE) {
> +    return FALSE;
> +  }
> +
> +  //
> +  // Send echo command
> +  //
> +  IoWrite8 (KEYBOARD_8042_DATA_REGISTER,
> KBC_INPBUF_VIA60_KBECHO);
> +
> +  //
> +  // Init variables
> +  //
> +  FoundPs2Kbc       = FALSE;
> +  TimeOut     = 0;
> +  SumTimeOut  = 0;
> +  Data = 0;
> +
> +  //
> +  // Read from 8042 (multiple times if needed)  // until the expected
> + value appears  // use SumTimeOut to control the iteration  //  while
> + (1) {
> +    //
> +    // Perform a read
> +    //
> +    for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30)
> {
> +      if (IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x01) {
> +        Data = IoRead8 (KEYBOARD_8042_DATA_REGISTER);
> +        break;
> +      }
> +      MicroSecondDelay (30);
> +    }
> +
> +    SumTimeOut += TimeOut;
> +
> +    if (Data == KBC_INPBUF_VIA60_KBECHO) {
> +      FoundPs2Kbc = TRUE;
> +      break;
> +    }
> +
> +    if (SumTimeOut >= PS2_KEYBOARD_WAITFORVALUE_TIMEOUT) {
> +      break;
> +    }
> +  }
> +  return FoundPs2Kbc;
> +}
> +
> +/**
> +  Check if PS2 keyboard is conntected. If the result of first time is
> +  error, it will retry again.
> +  @retval                       TRUE if connected FALSE otherwise
> +**/
> +BOOLEAN
> +IsPs2KeyboardConnected (
> +  VOID
> +  )
> +{
> +  BOOLEAN Result;
> +  Result = DetectPs2Keyboard ();
> +
> +  if (Result == FALSE) {
> +    //
> +    // If there is no ps2 keyboard detected for the 1st time, retry again.
> +    //
> +    Result = DetectPs2Keyboard ();
> +  }
> +  return Result;
> +}
> +
> +
> +/**
> +  Updates the ConIn variable with Ps2 Keyboard device path,
> +  if it doesn't already exists in ConIn and ConInDev **/ VOID
> +AddPs2Keyboard (
> +  VOID
> +  )
> +{
> +  SIO_PCI_ISA_BRIDGE_DEVICE_INFO *SioIsaInfo;
> +
> +  DEBUG ((DEBUG_INFO, "[AddPs2Keyboard]\n"));
> +
> +  SioIsaInfo = (SIO_PCI_ISA_BRIDGE_DEVICE_INFO*) FixedPcdGetPtr
> + (PcdSuperIoPciIsaBridgeDevice);
> +
> +  //
> +  // patch IsaBridge device and and function  //
> + gKeyboardDevicePath.IsaBridge.Device = SioIsaInfo->Device;
> + gKeyboardDevicePath.IsaBridge.Function = SioIsaInfo->Funtion;
> +
> +  //
> +  // Append Ps2 Keyboard into "ConIn"
> +  //
> +  EfiBootManagerUpdateConsoleVariable (ConIn,
> (EFI_DEVICE_PATH_PROTOCOL
> + *) &gKeyboardDevicePath, NULL);
> +
> +  //
> +  // Append Ps2 Keyboard into "ConInDev"
> +  //
> +  EfiBootManagerUpdateConsoleVariable (ConInDev,
> +(EFI_DEVICE_PATH_PROTOCOL *) &gKeyboardDevicePath, NULL); }
> +
> +
> +/**
> +  Constructor for the Ps2 keyboard controller library.
> +
> +  @param ImageHandle    the image handle of the process
> +  @param SystemTable    the EFI System Table pointer
> +
> +  @retval EFI_SUCCESS        the shell command handlers were
> installed sucessfully
> +  @retval EFI_UNSUPPORTED    the shell level required was not found.
> +**/
> +EFI_STATUS
> +EFIAPI
> +BdsPs2KbcLibConstructor (
> +  IN EFI_HANDLE        ImageHandle,
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  UINT8                               Ps2KbMsEnable;
> +
> +  Ps2KbMsEnable = PcdGet8 (PcdPs2KbMsEnable);
> +
> +  if (Ps2KbMsEnable == 0x1
> +    && IsPs2KeyboardConnected())
> +  {
> +      // add ps2 device path to ConIn and ConInDev
> +      AddPs2Keyboard ();
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> new file mode 100644
> index 0000000000..d9a27e6681
> --- /dev/null
> +++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> @@ -0,0 +1,65 @@
> +/** @file
> +  Header file for the Ps2 keyboard controller library.
> +
> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef _PS2_KBC_LIB_H
> +#define _PS2_KBC_LIB_H
> +
> +#include <Uefi.h>
> +#include <Library/UefiLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/IoLib.h>
> +#include <Library/TimerLib.h>
> +#include <Library/UefiBootManagerLib.h>
> +
> +//
> +// Below is the platform console device path // typedef struct {
> +  ACPI_HID_DEVICE_PATH      PciRootBridge;
> +  PCI_DEVICE_PATH           IsaBridge;
> +  ACPI_HID_DEVICE_PATH      Keyboard;
> +  EFI_DEVICE_PATH_PROTOCOL  End;
> +} PLATFORM_KEYBOARD_DEVICE_PATH;
> +
> +typedef struct {
> +  UINT8 Segment;
> +  UINT8 Bus;
> +  UINT8 Device;
> +  UINT8 Funtion;
> +} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
> +
> +#define gPciRootBridge \
> +  { \
> +    { \
> +      ACPI_DEVICE_PATH, \
> +      ACPI_DP, \
> +      { \
> +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> +      }, \
> +    }, \
> +    EISA_PNP_ID (0x0A03), \
> +    0 \
> +  }
> +
> +#define gEndEntire \
> +  { \
> +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {
> +END_DEVICE_PATH_LENGTH, 0 } \
> +  }
> +
> +#define KBC_INPBUF_VIA60_KBECHO             0xEE
> +#define KEYBOARD_8042_DATA_REGISTER         0x60
> +#define KEYBOARD_8042_STATUS_REGISTER       0x64
> +
> +#define PS2_KEYBOARD_TIMEOUT                65536   // 0.07s
> +#define PS2_KEYBOARD_WAITFORVALUE_TIMEOUT   1000000 // 1s
> +#define PS2_KEYBOARD_KBEN                   0xF4
> +#define PS2_KEYBOARD_CMDECHO_ACK            0xFA
> +
> +#endif
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> new file mode 100644
> index 0000000000..e00638daa7
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.in
> +++ f
> @@ -0,0 +1,38 @@
> +## @file
> +# Component information file for Ps2 keyboard controller library # #
> +Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ## [Defines]
> +  INF_VERSION                    = 0x00010006
> +  BASE_NAME                      = BdsPs2KbcLib
> +  FILE_GUID                      =
> E94EA52E-E84C-42E7-B863-EA1327EFA265
> +  MODULE_TYPE                    = UEFI_DRIVER
> +  VERSION_STRING                 = 1.2
> +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
> +  CONSTRUCTOR                    = BdsPs2KbcLibConstructor
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> +
> +[Sources]
> +  BdsPs2KbcLib.c
> +  BdsPs2KbcLib.h
> +
> +[LibraryClasses]
> +  DevicePathLib
> +  DebugLib
> +  IoLib
> +  UefiDriverEntryPoint
> +  UefiBootManagerLib
> +  UefiLib
> +  TimerLib
> +
> +[Pcd]
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
@ 2019-11-06  2:08   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:08 UTC (permalink / raw)
  To: devel@edk2.groups.io, Agyeman, Prince


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Agyeman,
> Prince
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg:
> Add Ps2 Keyboard Support
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2228
> 
> What was done:
> 
> * Added BDS Ps2 keyboard DXE driver.
> 
> * Added Super I/O DXE driver to publish the SIO protocol needed by the Ps2
> keyboard DXE driver.
> 
> * Included a Ps2 Library to BdsDxe driver to add the Ps2 device path to
> ConIn and ConInDev variables
> 
> * Configured the Super I/O Pci to Isa bridge bus, device, function device info
> PCD. This will help the Super I/O driver identify which bridge the Super I/O is
> connected to.
> 
> * Removed duplicate Ps2 enable PCDs
> 
> * Updated libraries to use Ps2 enable PCD defined in BoardModulePkg
> 
> Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
>  .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
>  .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 7
> +++++++  .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf |
> 2 ++
>  .../KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc    | 6
> ++++++
>  .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
>  .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc     | 6
> ++++++
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf     | 2 ++
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc  | 7
> +++++++
>  Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec       | 2 --
>  11 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> index a79bdcdbc6..35cd5c8fdb 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
> +++ b/DxeBoardAcpiTableLib.inf
> @@ -33,9 +33,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gMinPlatformPkgTokenSpaceGuid.PcdPciExpNative
>    gMinPlatformPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gMinPlatformPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> index db8ba7a822..9fe27f9fda 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
> +++ b/DxeMultiBoardAcpiSupportLib.inf
> @@ -34,9 +34,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index f59248bba4..55edc1a2f8 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -311,6 +311,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>    ShellPkg/Application/Shell/Shell.inf { @@ -408,3 +413,5 @@
>        !endif
>    }
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> index 80efab1aad..d58466d390 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> @@ -335,6 +335,8 @@ INF
> MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> index c68b8a49cf..c6f5ae7534 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> @@ -308,6 +308,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeBoardAcpiTableLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeBoardAcpiTableLib.inf
> index bfb58e868f..e0bf5823d8 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeBoardAcpiTableLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
> +++ Lib/DxeBoardAcpiTableLib.inf
> @@ -33,9 +33,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeMultiBoardAcpiSupportLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeMultiBoardAcpiSupportLib.inf
> index 00cdbe80ce..e5de9268e7 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeMultiBoardAcpiSupportLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
> +++ Lib/DxeMultiBoardAcpiSupportLib.inf
> @@ -34,9 +34,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> index 7e65eeda6f..e7f5ed39d2 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> @@ -381,6 +381,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>  !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1 @@
> -485,3 +490,4 @@
>        !endif
>    }
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> index dbd6f2aa10..98eb7dcb5a 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> @@ -336,6 +336,8 @@ INF
> MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> index 34cc731313..580504cbc1 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> +++ sc
> @@ -324,6 +324,13 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> index 9680e63bad..01d6116616 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> @@ -288,8 +288,6 @@
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdBoardUcmcGpioTableSize|0|UI
> NT16|0x0000001
>  # Misc
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdIoExpanderPresent|FALSE|BOOL
> EAN|0x000000EC
> 
> -
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|1|UINT8|0x40
> 000009
> -
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x400
> 00002
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x4000
> 0003
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40
> 000004
> --
> 2.19.1.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
@ 2019-11-06  2:09   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:09 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2
> keyboard Support
> 
> Added BIOS keyboard support to BoardX58Ich10
> 
> * Included BoardModulePkg's generic Super I/O DXE driver
> * Configured Super I/O and Ps2 keyboard related PCD to enable Ps2
> keyboard
> 
> 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/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 2
> ++  .../Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf | 1 +
>  .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc    | 6
> ++++++
>  3 files changed, 9 insertions(+)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> index e0a02b4efc..7329b19e8e 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> @@ -283,3 +283,5 @@
>    $(BOARD_PKG)/SimicsDxe/SimicsDxe.inf
>    $(BOARD_PKG)/SimicsVideoDxe/SimicsVideoDxe.inf
>    $(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> index 6dc7b4aa56..ef6b35c92f 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> @@ -212,6 +212,7 @@ INF
> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> 
>  INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> index 0298e4b12d..cd95755f91 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> +++ c
> @@ -196,6 +196,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|4
>    gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicAddressBase|0xFEC01000
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.X64]
>    ######################################
>    # Edk2 Configuration
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
@ 2019-11-06  2:09   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Chiu, Chasel @ 2019-11-06  2:09 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io
  Cc: Kubacki, Michael A, Desimone, Nathaniel L


Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, November 6, 2019 9:26 AM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2
> Keyboard Support
> 
> What was done:
> 
> * Added BDS Ps2 keyboard DXE driver.
> 
> * Included Super I/O DXE driver to publish the SIO protocol needed by the
> Ps2 keyboard DXE driver.
> 
> * Included a Ps2 Library to BdsDxe driver  to add the Ps2 device path to
> ConIn and ConInDev  variables
> 
> * Configured the Super I/O Pci to Isa bridge bus,  device, function device
> info PCD. This will help the Super I/O  driver identify which bridge the
> Super I/O is connected to.
> 
>  * Removed duplicate Ps2 enable PCDs
> 
> 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/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec     | 1 -
>  .../WhiskeylakeURvp/OpenBoardPkg.dsc                        | 6
> ++++++
>  .../WhiskeylakeURvp/OpenBoardPkg.fdf                        | 2 ++
>  .../WhiskeylakeURvp/OpenBoardPkgPcd.dsc                     | 6
> ++++++
>  4 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> index 34494d0168..fbb9549e44 100644
> --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> @@ -271,7 +271,6 @@
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x4
> 0000003
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0
> x40000004
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative|0|UINT8|0x40
> 000005
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable|1|UINT8
> |0x40000006
> -gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|0|UINT8|0
> x40000009
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableActiveTripPoints|1|U
> INT8|0x4000000A
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisablePassiveTripPoints|0|
> UINT8|0x4000000B
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableCriticalTripPoints|1|
> UINT8|0x4000000C
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> index 8e0ea2d5ce..1c7c12696c 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> k
> +++ g.dsc
> @@ -335,6 +335,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>    ShellPkg/Application/Shell/Shell.inf { @@ -428,3 +433,4 @@  !if
> gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
>    $(PLATFORM_BOARD_PACKAGE)/Acpi/BoardAcpiDxe/BoardAcpiDxe.inf
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> index 140e6260c9..8a4fd973b4 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> k
> +++ g.fdf
> @@ -340,6 +340,8 @@ INF
> MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.
> inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> index adbd48f6d7..52471cb25b 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> k
> +++ gPcd.dsc
> @@ -296,6 +296,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
@ 2019-11-06 22:38   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:38 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver

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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds

* Added ps2 keyboard and Uart enable PCDs.
* Added PCDs to define IO ports for Uart1 and Uart2

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.dec   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
index 8a811602e6..26e662f711 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
@@ -46,3 +46,24 @@
   ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343}
   gBoardModulePkgTokenSpaceGuid = { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba, 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } }
 
+[PcdsFixedAtBuild]
+  ## PcdPs2KbMsEnable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|0x00|UINT8|0x00000001
+
+  ## SuperIo Pci ISA Bridge info. It is an array that contains the 
+ Segment, Bus, Device and Function  #  information describing the PCI 
+ Device Info. The first byte is the segment number,  #  the second is 
+ the bus number, third byte is the device number, the fourth byte  #  is the Function.
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0xFF, 
+ 0xFF, 0xFF, 0xFF}|VOID*|0x00000002
+
+  ## PcdUart1Enable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable|0x00|UINT8|0x00000003
+  
+ gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask|0x0010|UINT16|0x00000004
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort|0x03F8|UINT16|0x00000005
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Length|0x08|UINT8|0x00000006
+
+  ## PcdUart2Enable 0x0:Disable, 0x1:Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable|0x00|UINT8|0x00000007
+  
+ gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask|0x0008|UINT16|0x00000008
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort|0x02F8|UINT16|0x00000009
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Length|0x08|UINT8|0x0000000A
--
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver

Included PCDs to the Super I/O DXE driver, to allow the enable/disable of Ps2 keyboard/mouse,
UART1 and UART2 ports.

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>
---
 .../LegacySioDxe/LegacySioDxe.inf             | 12 ++++
 .../BoardModulePkg/LegacySioDxe/SioChip.c     | 68 +++++++++++++++++--
 .../BoardModulePkg/LegacySioDxe/SioChip.h     |  8 +++
 .../BoardModulePkg/LegacySioDxe/SioDriver.c   | 40 +++++++++++
 4 files changed, 122 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
index f01f63e69e..ccddc97e91 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
@@ -34,6 +34,7 @@
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Sources]
   SioChip.c
@@ -44,6 +45,17 @@
   SioDriver.h
   ComponentName.c
 
+[Pcd]
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask
+  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort
+  gBoardModulePkgTokenSpaceGuid.PcdUart1Length
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask
+  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort
+  gBoardModulePkgTokenSpaceGuid.PcdUart2Length
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
 [Protocols]
   gEfiPciIoProtocolGuid                         ## CONSUMES
   gEfiDevicePathProtocolGuid                    ## PRODUCES
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
index 81efe3c38b..e63977be60 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
@@ -19,12 +19,31 @@
 ACPI_SIO_RESOURCES_IO_IRQ      mCom1Resources = {
   {
     { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
-    0x3f8,
-    8
+      FixedPcdGet16 (PcdUart1IoPort),
+      FixedPcdGet8 (PcdUart1Length)
+    },
+    {
+      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
+      FixedPcdGet16 (PcdUart1IrqMask)
+    },
+    {
+      ACPI_END_TAG_DESCRIPTOR,
+      0
+    }
+};
+
+//
+// COM 2 UART Controller
+//
+ACPI_SIO_RESOURCES_IO_IRQ      mCom2Resources = {
+  {
+    { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
+    FixedPcdGet16 (PcdUart2IoPort),
+    FixedPcdGet8 (PcdUart2Length)
   },
   {
     { ACPI_IRQ_NOFLAG_DESCRIPTOR },
-    BIT4    // IRQ4
+    FixedPcdGet16 (PcdUart2IrqMask),
   },
   {
     ACPI_END_TAG_DESCRIPTOR,
@@ -74,6 +93,7 @@ ACPI_SIO_RESOURCES_IO_IRQ      mMouseResources = {
 // Table of SIO Controllers
 //
 DEVICE_INFO    mDeviceInfo[] = {
+#if FixedPcdGet8 (PcdUart1Enable) == DEVICE_ENABLED
   {
     {
       EISA_PNP_ID(0x501),
@@ -84,6 +104,20 @@ DEVICE_INFO    mDeviceInfo[] = {
     { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
     { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
   },  // COM 1 UART Controller
+#endif
+#if FixedPcdGet8 (PcdUart2Enable) == DEVICE_ENABLED
+  {
+    {
+      EISA_PNP_ID(0x501),
+      0
+    },
+    0,
+    RESOURCE_IO | RESOURCE_IRQ,
+    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources },
+    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources }
+  },  // COM 2 UART Controller
+#endif
+#if FixedPcdGet8 (PcdPs2KbMsEnable) == DEVICE_ENABLED
   {
     {
       EISA_PNP_ID(0x303),
@@ -103,10 +137,30 @@ DEVICE_INFO    mDeviceInfo[] = {
     0,  // Cannot change resource
     { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
     { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
-  }  // PS/2 Mouse Controller
+  },  // PS/2 Mouse Controller
+#endif
+  DEVICE_INFO_END
 };
 
 
+
+/**
+  Gets the number of devices in Table of SIO Controllers mDeviceInfo
+
+  @retval     Number of enabled devices in Table of SIO Controllers.
+**/
+UINTN
+EFIAPI
+GetDeviceCount (
+  VOID
+){
+   UINTN        Count;
+   // Get mDeviceInfo item count
+   // -1 to account for for the end device info
+   Count = ARRAY_SIZE (mDeviceInfo) - 1;
+   return Count;
+}
+
 /**
   Return the supported devices.
 
@@ -128,7 +182,7 @@ DeviceGetList (
   //
   // Allocate enough memory for simplicity
   //
-  DeviceCount =  sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
+  DeviceCount = GetDeviceCount ();
   LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceCount);
   ASSERT (LocalDevices != NULL);
   if (LocalDevices == NULL) {
@@ -175,8 +229,10 @@ DeviceSearch (
   )
 {
   UINTN       Index;
+  UINTN       DeviceCount;
 
-  for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); Index++) {
+  DeviceCount = GetDeviceCount ();
+  for (Index = 0; Index < DeviceCount; Index++) {
     if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) == 0) {
       return &mDeviceInfo[Index];
     }
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
index 9322365923..afff6fe7b5 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
@@ -24,6 +24,8 @@ UINT8
 #define RESOURCE_DMA   BIT2
 #define RESOURCE_MEM   BIT3
 
+#define DEVICE_ENABLED  0x01
+#define DEVICE_INFO_END { { 0xFFFFFFFF, 0xFFFFFFFF } }
 #pragma pack(1)
 
 typedef struct {
@@ -45,6 +47,12 @@ typedef struct {
   ACPI_RESOURCE_HEADER_PTR    Resources;
   ACPI_RESOURCE_HEADER_PTR    PossibleResources;
 } DEVICE_INFO;
+typedef struct {
+  UINT8 Segment;
+  UINT8 Bus;
+  UINT8 Device;
+  UINT8 Funtion;
+} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
 
 /**
   Return the supported devices.
diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
index 408c6ff301..5bfdc94681 100644
--- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
+++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
@@ -106,6 +106,27 @@ SioDriverEntryPoint (  }
 
 
+/**
+  Compares a PCI to ISA bridge device segment, bus, device and function 
+to the
+  PcdSuperIoPciIsaBridgeDevice values.
+
+  @param[in]  CurrentDevice       The device to be compared with the PcdSuperIoPciIsaBridgeDevice information
+  @retval     TRUE                This device matches PcdSuperIoPciIsaBridgeDevice values
+  @retval     FALSE               This device does not match the PcdSuperIoPciIsaBridgeDevice values
+**/
+BOOLEAN
+EFIAPI
+SioDeviceEnabled (
+  IN SIO_PCI_ISA_BRIDGE_DEVICE_INFO *CurrentDevice ){
+    SIO_PCI_ISA_BRIDGE_DEVICE_INFO *Device = \
+      (SIO_PCI_ISA_BRIDGE_DEVICE_INFO *) FixedPcdGetPtr (PcdSuperIoPciIsaBridgeDevice);
+    if(CompareMem (Device, CurrentDevice, sizeof (SIO_PCI_ISA_BRIDGE_DEVICE_INFO)) == 0) {
+      return TRUE;
+    }
+    return FALSE;
+}
+
 /**
   Test to see if this driver supports Controller Handle.
 
@@ -138,6 +159,7 @@ SioDriverSupported (
   UINTN                     BusNumber;
   UINTN                     DeviceNumber;
   UINTN                     FunctionNumber;
+  SIO_PCI_ISA_BRIDGE_DEVICE_INFO  SioDevice;
 
   //
   // If RemainingDevicePath is not NULL, it should verify that the first device @@ -250,6 +272,24 @@ SioDriverSupported (
             Status = EFI_UNSUPPORTED;
           }
         }
+        if(!EFI_ERROR (Status)) {
+          Status = PciIo->GetLocation (
+                            PciIo,
+                            &SegmentNumber,
+                            &BusNumber,
+                            &DeviceNumber,
+                            &FunctionNumber
+                            );
+          if(!EFI_ERROR (Status)) {
+            SioDevice.Segment = (UINT8) SegmentNumber;
+            SioDevice.Bus = (UINT8) BusNumber;
+            SioDevice.Device = (UINT8) DeviceNumber;
+            SioDevice.Funtion = (UINT8) FunctionNumber;
+            if(!SioDeviceEnabled (&SioDevice)) {
+              Status = EFI_UNSUPPORTED;
+            }
+          }
+        }
       }
     }
 
--
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library

Added a generic Ps2 keyboard library
that adds ps2 device path to ConIn and ConInDev Uefi variables

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   |   1 +
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.c       | 202 ++++++++++++++++++
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.h       |  65 ++++++
 .../Library/BdsPs2KbcLib/BdsPs2KbcLib.inf     |  38 ++++
 4 files changed, 306 insertions(+)
 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

diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
index 5af26eb97e..bcc2dfbfeb 100644
--- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
+++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
@@ -88,3 +88,4 @@
   BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
 
   BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMediaInfoLib.inf
+  BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
new file mode 100644
index 0000000000..3a885e0d71
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
@@ -0,0 +1,202 @@
+/** @file
+  Main file for Ps2 keyboard controller library.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "BdsPs2KbcLib.h"
+
+GLOBAL_REMOVE_IF_UNREFERENCED PLATFORM_KEYBOARD_DEVICE_PATH  
+gKeyboardDevicePath = {
+  gPciRootBridge,
+  {
+    {
+      HARDWARE_DEVICE_PATH,
+      HW_PCI_DP,
+      {
+        (UINT8) (sizeof (PCI_DEVICE_PATH)),
+        (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8)
+      }
+    },
+    0, // Function, patched in EnumPs2Keyboard
+    0  // Device, patched in EnumPs2Keyboard
+  },
+  {
+    {
+      ACPI_DEVICE_PATH,
+      ACPI_DP,
+      {
+        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),
+        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
+      }
+    },
+    EISA_PNP_ID(0x0303),
+    0
+  },
+  gEndEntire
+};
+
+/**
+  Check if PS2 keyboard is conntected, by sending ECHO command.
+  @retval                       TRUE if connected FALSE otherwise
+**/
+BOOLEAN
+DetectPs2Keyboard (
+  VOID
+  )
+{
+  UINT32                TimeOut;
+  UINT32                RegEmptied;
+  UINT8                 Data;
+  UINT32                SumTimeOut;
+  BOOLEAN               FoundPs2Kbc;
+
+  TimeOut     = 0;
+  RegEmptied  = 0;
+  FoundPs2Kbc       = FALSE;
+
+  //
+  // Wait for input buffer empty
+  //
+  for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
+    if ((IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x02) == 0) {
+      FoundPs2Kbc = TRUE;
+      break;
+    }
+    MicroSecondDelay (30);
+  }
+
+  if (FoundPs2Kbc == FALSE) {
+    return FALSE;
+  }
+
+  //
+  // Send echo command
+  //
+  IoWrite8 (KEYBOARD_8042_DATA_REGISTER, KBC_INPBUF_VIA60_KBECHO);
+
+  //
+  // Init variables
+  //
+  FoundPs2Kbc       = FALSE;
+  TimeOut     = 0;
+  SumTimeOut  = 0;
+  Data = 0;
+
+  //
+  // Read from 8042 (multiple times if needed)  // until the expected 
+ value appears  // use SumTimeOut to control the iteration  //  while 
+ (1) {
+    //
+    // Perform a read
+    //
+    for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
+      if (IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x01) {
+        Data = IoRead8 (KEYBOARD_8042_DATA_REGISTER);
+        break;
+      }
+      MicroSecondDelay (30);
+    }
+
+    SumTimeOut += TimeOut;
+
+    if (Data == KBC_INPBUF_VIA60_KBECHO) {
+      FoundPs2Kbc = TRUE;
+      break;
+    }
+
+    if (SumTimeOut >= PS2_KEYBOARD_WAITFORVALUE_TIMEOUT) {
+      break;
+    }
+  }
+  return FoundPs2Kbc;
+}
+
+/**
+  Check if PS2 keyboard is conntected. If the result of first time is
+  error, it will retry again.
+  @retval                       TRUE if connected FALSE otherwise
+**/
+BOOLEAN
+IsPs2KeyboardConnected (
+  VOID
+  )
+{
+  BOOLEAN Result;
+  Result = DetectPs2Keyboard ();
+
+  if (Result == FALSE) {
+    //
+    // If there is no ps2 keyboard detected for the 1st time, retry again.
+    //
+    Result = DetectPs2Keyboard ();
+  }
+  return Result;
+}
+
+
+/**
+  Updates the ConIn variable with Ps2 Keyboard device path,
+  if it doesn't already exists in ConIn and ConInDev **/ VOID 
+AddPs2Keyboard (
+  VOID
+  )
+{
+  SIO_PCI_ISA_BRIDGE_DEVICE_INFO *SioIsaInfo;
+
+  DEBUG ((DEBUG_INFO, "[AddPs2Keyboard]\n"));
+
+  SioIsaInfo = (SIO_PCI_ISA_BRIDGE_DEVICE_INFO*) FixedPcdGetPtr 
+ (PcdSuperIoPciIsaBridgeDevice);
+
+  //
+  // patch IsaBridge device and and function  //  
+ gKeyboardDevicePath.IsaBridge.Device = SioIsaInfo->Device;  
+ gKeyboardDevicePath.IsaBridge.Function = SioIsaInfo->Funtion;
+
+  //
+  // Append Ps2 Keyboard into "ConIn"
+  //
+  EfiBootManagerUpdateConsoleVariable (ConIn, (EFI_DEVICE_PATH_PROTOCOL 
+ *) &gKeyboardDevicePath, NULL);
+
+  //
+  // Append Ps2 Keyboard into "ConInDev"
+  //
+  EfiBootManagerUpdateConsoleVariable (ConInDev, 
+(EFI_DEVICE_PATH_PROTOCOL *) &gKeyboardDevicePath, NULL); }
+
+
+/**
+  Constructor for the Ps2 keyboard controller library.
+
+  @param ImageHandle    the image handle of the process
+  @param SystemTable    the EFI System Table pointer
+
+  @retval EFI_SUCCESS        the shell command handlers were installed sucessfully
+  @retval EFI_UNSUPPORTED    the shell level required was not found.
+**/
+EFI_STATUS
+EFIAPI
+BdsPs2KbcLibConstructor (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  UINT8                               Ps2KbMsEnable;
+
+  Ps2KbMsEnable = PcdGet8 (PcdPs2KbMsEnable);
+
+  if (Ps2KbMsEnable == 0x1
+    && IsPs2KeyboardConnected())
+  {
+      // add ps2 device path to ConIn and ConInDev
+      AddPs2Keyboard ();
+  }
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
new file mode 100644
index 0000000000..d9a27e6681
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
@@ -0,0 +1,65 @@
+/** @file
+  Header file for the Ps2 keyboard controller library.
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _PS2_KBC_LIB_H
+#define _PS2_KBC_LIB_H
+
+#include <Uefi.h>
+#include <Library/UefiLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/TimerLib.h>
+#include <Library/UefiBootManagerLib.h>
+
+//
+// Below is the platform console device path // typedef struct {
+  ACPI_HID_DEVICE_PATH      PciRootBridge;
+  PCI_DEVICE_PATH           IsaBridge;
+  ACPI_HID_DEVICE_PATH      Keyboard;
+  EFI_DEVICE_PATH_PROTOCOL  End;
+} PLATFORM_KEYBOARD_DEVICE_PATH;
+
+typedef struct {
+  UINT8 Segment;
+  UINT8 Bus;
+  UINT8 Device;
+  UINT8 Funtion;
+} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
+
+#define gPciRootBridge \
+  { \
+    { \
+      ACPI_DEVICE_PATH, \
+      ACPI_DP, \
+      { \
+        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
+        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
+      }, \
+    }, \
+    EISA_PNP_ID (0x0A03), \
+    0 \
+  }
+
+#define gEndEntire \
+  { \
+    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { 
+END_DEVICE_PATH_LENGTH, 0 } \
+  }
+
+#define KBC_INPBUF_VIA60_KBECHO             0xEE
+#define KEYBOARD_8042_DATA_REGISTER         0x60
+#define KEYBOARD_8042_STATUS_REGISTER       0x64
+
+#define PS2_KEYBOARD_TIMEOUT                65536   // 0.07s
+#define PS2_KEYBOARD_WAITFORVALUE_TIMEOUT   1000000 // 1s
+#define PS2_KEYBOARD_KBEN                   0xF4
+#define PS2_KEYBOARD_CMDECHO_ACK            0xFA
+
+#endif
diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
new file mode 100644
index 0000000000..e00638daa7
--- /dev/null
+++ b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.in
+++ f
@@ -0,0 +1,38 @@
+## @file
+# Component information file for Ps2 keyboard controller library # # 
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ## [Defines]
+  INF_VERSION                    = 0x00010006
+  BASE_NAME                      = BdsPs2KbcLib
+  FILE_GUID                      = E94EA52E-E84C-42E7-B863-EA1327EFA265
+  MODULE_TYPE                    = UEFI_DRIVER
+  VERSION_STRING                 = 1.2
+  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
+  CONSTRUCTOR                    = BdsPs2KbcLibConstructor
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  BoardModulePkg/BoardModulePkg.dec
+
+[Sources]
+  BdsPs2KbcLib.c
+  BdsPs2KbcLib.h
+
+[LibraryClasses]
+  DevicePathLib
+  DebugLib
+  IoLib
+  UefiDriverEntryPoint
+  UefiBootManagerLib
+  UefiLib
+  TimerLib
+
+[Pcd]
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
--
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  2019-11-06  2:08   ` [edk2-devel] " Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: devel@edk2.groups.io, Agyeman, Prince

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Agyeman, Prince
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support

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

What was done:

* Added BDS Ps2 keyboard DXE driver.

* Added Super I/O DXE driver to publish the SIO protocol needed by the Ps2 keyboard DXE driver.

* Included a Ps2 Library to BdsDxe driver to add the Ps2 device path to ConIn and ConInDev variables

* Configured the Super I/O Pci to Isa bridge bus, device, function device info PCD. This will help the Super I/O driver identify which bridge the Super I/O is connected to.

* Removed duplicate Ps2 enable PCDs

* Updated libraries to use Ps2 enable PCD defined in BoardModulePkg

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
 .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
 .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
 .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 7 +++++++  .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf | 2 ++
 .../KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc    | 6 ++++++
 .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
 .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc     | 6 ++++++
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf     | 2 ++
 .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc  | 7 +++++++
 Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec       | 2 --
 11 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
index a79bdcdbc6..35cd5c8fdb 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
+++ b/DxeBoardAcpiTableLib.inf
@@ -33,9 +33,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gMinPlatformPkgTokenSpaceGuid.PcdPciExpNative
   gMinPlatformPkgTokenSpaceGuid.PcdNativeAspmEnable
   gMinPlatformPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
index db8ba7a822..9fe27f9fda 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
+++ b/DxeMultiBoardAcpiSupportLib.inf
@@ -34,9 +34,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index f59248bba4..55edc1a2f8 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -311,6 +311,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf { @@ -408,3 +413,5 @@
       !endif
   }
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
index 80efab1aad..d58466d390 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
@@ -335,6 +335,8 @@ INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
index c68b8a49cf..c6f5ae7534 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
@@ -308,6 +308,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}  !endif
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 
+ 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
index bfb58e868f..e0bf5823d8 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
+++ Lib/DxeBoardAcpiTableLib.inf
@@ -33,9 +33,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
index 00cdbe80ce..e5de9268e7 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
+++ Lib/DxeMultiBoardAcpiSupportLib.inf
@@ -34,9 +34,10 @@
   MinPlatformPkg/MinPlatformPkg.dec
   KabylakeOpenBoardPkg/OpenBoardPkg.dec
   KabylakeSiliconPkg/SiPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
 
 [Pcd]
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index 7e65eeda6f..e7f5ed39d2 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -381,6 +381,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
 !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1 @@ -485,3 +490,4 @@
       !endif
   }
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
index dbd6f2aa10..98eb7dcb5a 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
@@ -336,6 +336,8 @@ INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
index 34cc731313..580504cbc1 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
+++ sc
@@ -324,6 +324,13 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}  !endif
 
+
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 
+ 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
index 9680e63bad..01d6116616 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
@@ -288,8 +288,6 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdBoardUcmcGpioTableSize|0|UINT16|0x0000001
 # Misc
 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdIoExpanderPresent|FALSE|BOOLEAN|0x000000EC
 
-  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|1|UINT8|0x40000009
-
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40000002
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004
--
2.19.1.windows.1





^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support

Added BIOS keyboard support to BoardX58Ich10

* Included BoardModulePkg's generic Super I/O DXE driver
* Configured Super I/O and Ps2 keyboard related PCD to enable Ps2 keyboard

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/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 2 ++  .../Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf | 1 +
 .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc    | 6 ++++++
 3 files changed, 9 insertions(+)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index e0a02b4efc..7329b19e8e 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -283,3 +283,5 @@
   $(BOARD_PKG)/SimicsDxe/SimicsDxe.inf
   $(BOARD_PKG)/SimicsVideoDxe/SimicsVideoDxe.inf
   $(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
index 6dc7b4aa56..ef6b35c92f 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
@@ -212,6 +212,7 @@ INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
 
 INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
index 0298e4b12d..cd95755f91 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
+++ c
@@ -196,6 +196,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|4
   gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicAddressBase|0xFEC01000
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 
+ 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.X64]
   ######################################
   # Edk2 Configuration
--
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
@ 2019-11-06 22:39   ` Nate DeSimone
  2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Nate DeSimone @ 2019-11-06 22:39 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Kubacki, Michael A, Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Tuesday, November 5, 2019 5:26 PM
To: devel@edk2.groups.io
Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support

What was done:

* Added BDS Ps2 keyboard DXE driver.

* Included Super I/O DXE driver to publish the SIO protocol needed by the Ps2 keyboard DXE driver.

* Included a Ps2 Library to BdsDxe driver  to add the Ps2 device path to ConIn and ConInDev  variables

* Configured the Super I/O Pci to Isa bridge bus,  device, function device info PCD. This will help the Super I/O  driver identify which bridge the Super I/O is connected to.

 * Removed duplicate Ps2 enable PCDs

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/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec     | 1 -
 .../WhiskeylakeURvp/OpenBoardPkg.dsc                        | 6 ++++++
 .../WhiskeylakeURvp/OpenBoardPkg.fdf                        | 2 ++
 .../WhiskeylakeURvp/OpenBoardPkgPcd.dsc                     | 6 ++++++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
index 34494d0168..fbb9549e44 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
@@ -271,7 +271,6 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative|0|UINT8|0x40000005
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable|1|UINT8|0x40000006
-gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|0|UINT8|0x40000009
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableActiveTripPoints|1|UINT8|0x4000000A
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisablePassiveTripPoints|0|UINT8|0x4000000B
 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableCriticalTripPoints|1|UINT8|0x4000000C
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
index 8e0ea2d5ce..1c7c12696c 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
+++ g.dsc
@@ -335,6 +335,11 @@
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
+  }
   UefiCpuPkg/CpuDxe/CpuDxe.inf
 
   ShellPkg/Application/Shell/Shell.inf { @@ -428,3 +433,4 @@  !if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
   $(PLATFORM_BOARD_PACKAGE)/Acpi/BoardAcpiDxe/BoardAcpiDxe.inf
 !endif
+  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
index 140e6260c9..8a4fd973b4 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
+++ g.fdf
@@ -340,6 +340,8 @@ INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
+INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 
 INF  ShellPkg/Application/Shell/Shell.inf
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
index adbd48f6d7..52471cb25b 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
+++ gPcd.dsc
@@ -296,6 +296,12 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}  !endif
 
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
+  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 
+ 0x00, 0x1F, 0x00}
+
 [PcdsFixedAtBuild.IA32]
   ######################################
   # Edk2 Configuration
--
2.19.1.windows.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:38   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add
> gBoardModulePkgTokenSpaceGuid
> 
> 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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Typo "BoardModulePky" -> "BoardModulePkg". Can be fixed before pushed.

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove
> Super I/O DXE driver
> 
> 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)SioComponentName
> GetControllerName,
> -  "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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O
> driver
> 
> 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/UefiDriverEntry
> Point.inf
> +
> UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib
> /UefiRuntimeServicesTableLib.inf
> 
>  [LibraryClasses.common.PEIM]
> 
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/P
> eiFirmwareBootMediaLib.inf
> @@ -76,6 +80,7 @@
> 
>  [Components]
>    BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMediaInfoPei.inf
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
>    BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
> 
> BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessL
> ibNull.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)SioComponentName
> GetControllerName,
> +  "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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
  2019-11-06  2:07   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build
> Pcds
> 
> * Added ps2 keyboard and Uart enable PCDs.
> * Added PCDs to define IO ports for Uart1 and Uart2
> 
> 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.dec   | 21
> +++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> index 8a811602e6..26e662f711 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> @@ -46,3 +46,24 @@
>    ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343}
>    gBoardModulePkgTokenSpaceGuid = { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba,
> 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } }
> 
> +[PcdsFixedAtBuild]
> +  ## PcdPs2KbMsEnable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|0x00|UINT8|0x0000
> 0001
> +
> +  ## SuperIo Pci ISA Bridge info. It is an array that contains the
> + Segment, Bus, Device and Function  #  information describing the PCI
> + Device Info. The first byte is the segment number,  #  the second is
> + the bus number, third byte is the device number, the fourth byte  #  is the
> Function.
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0xFF,
> + 0xFF, 0xFF, 0xFF}|VOID*|0x00000002
> +
> +  ## PcdUart1Enable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1Enable|0x00|UINT8|0x0000000
> 3
> +
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask|0x0010|UINT16|0x000
> 00004
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort|0x03F8|UINT16|0x0000
> 0005
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart1Length|0x08|UINT8|0x0000000
> 6
> +
> +  ## PcdUart2Enable 0x0:Disable, 0x1:Enable
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2Enable|0x00|UINT8|0x0000000
> 7
> +
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask|0x0008|UINT16|0x000
> 00008
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort|0x02F8|UINT16|0x0000
> 0009
> +
> gBoardModulePkgTokenSpaceGuid.PcdUart2Length|0x08|UINT8|0x0000000
> A
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver
  2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

There was a whitespace between line 58 and 59 in LegacySioDxe.inf that was removed in V2 causing
these sections to run together I'd prefer to be added back before being pushed.

gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
[Protocols]

With that change:
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to
> Super I/O driver
> 
> Included PCDs to the Super I/O DXE driver, to allow the enable/disable of Ps2
> keyboard/mouse,
> UART1 and UART2 ports.
> 
> 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>
> ---
>  .../LegacySioDxe/LegacySioDxe.inf             | 12 ++++
>  .../BoardModulePkg/LegacySioDxe/SioChip.c     | 68 +++++++++++++++++--
>  .../BoardModulePkg/LegacySioDxe/SioChip.h     |  8 +++
>  .../BoardModulePkg/LegacySioDxe/SioDriver.c   | 40 +++++++++++
>  4 files changed, 122 insertions(+), 6 deletions(-)
> 
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> index f01f63e69e..ccddc97e91 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> @@ -34,6 +34,7 @@
>  [Packages]
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Sources]
>    SioChip.c
> @@ -44,6 +45,17 @@
>    SioDriver.h
>    ComponentName.c
> 
> +[Pcd]
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1Enable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1IrqMask
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1IoPort
> +  gBoardModulePkgTokenSpaceGuid.PcdUart1Length
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2Enable
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2IrqMask
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2IoPort
> +  gBoardModulePkgTokenSpaceGuid.PcdUart2Length
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
>  [Protocols]
>    gEfiPciIoProtocolGuid                         ## CONSUMES
>    gEfiDevicePathProtocolGuid                    ## PRODUCES
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> index 81efe3c38b..e63977be60 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.c
> @@ -19,12 +19,31 @@
>  ACPI_SIO_RESOURCES_IO_IRQ      mCom1Resources = {
>    {
>      { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
> -    0x3f8,
> -    8
> +      FixedPcdGet16 (PcdUart1IoPort),
> +      FixedPcdGet8 (PcdUart1Length)
> +    },
> +    {
> +      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
> +      FixedPcdGet16 (PcdUart1IrqMask)
> +    },
> +    {
> +      ACPI_END_TAG_DESCRIPTOR,
> +      0
> +    }
> +};
> +
> +//
> +// COM 2 UART Controller
> +//
> +ACPI_SIO_RESOURCES_IO_IRQ      mCom2Resources = {
> +  {
> +    { ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR },
> +    FixedPcdGet16 (PcdUart2IoPort),
> +    FixedPcdGet8 (PcdUart2Length)
>    },
>    {
>      { ACPI_IRQ_NOFLAG_DESCRIPTOR },
> -    BIT4    // IRQ4
> +    FixedPcdGet16 (PcdUart2IrqMask),
>    },
>    {
>      ACPI_END_TAG_DESCRIPTOR,
> @@ -74,6 +93,7 @@ ACPI_SIO_RESOURCES_IO_IRQ      mMouseResources =
> {
>  // Table of SIO Controllers
>  //
>  DEVICE_INFO    mDeviceInfo[] = {
> +#if FixedPcdGet8 (PcdUart1Enable) == DEVICE_ENABLED
>    {
>      {
>        EISA_PNP_ID(0x501),
> @@ -84,6 +104,20 @@ DEVICE_INFO    mDeviceInfo[] = {
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources },
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }
>    },  // COM 1 UART Controller
> +#endif
> +#if FixedPcdGet8 (PcdUart2Enable) == DEVICE_ENABLED
> +  {
> +    {
> +      EISA_PNP_ID(0x501),
> +      0
> +    },
> +    0,
> +    RESOURCE_IO | RESOURCE_IRQ,
> +    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources },
> +    { (ACPI_SMALL_RESOURCE_HEADER *) &mCom2Resources }
> +  },  // COM 2 UART Controller
> +#endif
> +#if FixedPcdGet8 (PcdPs2KbMsEnable) == DEVICE_ENABLED
>    {
>      {
>        EISA_PNP_ID(0x303),
> @@ -103,10 +137,30 @@ DEVICE_INFO    mDeviceInfo[] = {
>      0,  // Cannot change resource
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources },
>      { (ACPI_SMALL_RESOURCE_HEADER *) &mMouseResources }
> -  }  // PS/2 Mouse Controller
> +  },  // PS/2 Mouse Controller
> +#endif
> +  DEVICE_INFO_END
>  };
> 
> 
> +
> +/**
> +  Gets the number of devices in Table of SIO Controllers mDeviceInfo
> +
> +  @retval     Number of enabled devices in Table of SIO Controllers.
> +**/
> +UINTN
> +EFIAPI
> +GetDeviceCount (
> +  VOID
> +){
> +   UINTN        Count;
> +   // Get mDeviceInfo item count
> +   // -1 to account for for the end device info
> +   Count = ARRAY_SIZE (mDeviceInfo) - 1;
> +   return Count;
> +}
> +
>  /**
>    Return the supported devices.
> 
> @@ -128,7 +182,7 @@ DeviceGetList (
>    //
>    // Allocate enough memory for simplicity
>    //
> -  DeviceCount =  sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
> +  DeviceCount = GetDeviceCount ();
>    LocalDevices = AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) *
> DeviceCount);
>    ASSERT (LocalDevices != NULL);
>    if (LocalDevices == NULL) {
> @@ -175,8 +229,10 @@ DeviceSearch (
>    )
>  {
>    UINTN       Index;
> +  UINTN       DeviceCount;
> 
> -  for (Index = 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]);
> Index++) {
> +  DeviceCount = GetDeviceCount ();
> +  for (Index = 0; Index < DeviceCount; Index++) {
>      if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device))
> == 0) {
>        return &mDeviceInfo[Index];
>      }
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> index 9322365923..afff6fe7b5 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h
> @@ -24,6 +24,8 @@ UINT8
>  #define RESOURCE_DMA   BIT2
>  #define RESOURCE_MEM   BIT3
> 
> +#define DEVICE_ENABLED  0x01
> +#define DEVICE_INFO_END { { 0xFFFFFFFF, 0xFFFFFFFF } }
>  #pragma pack(1)
> 
>  typedef struct {
> @@ -45,6 +47,12 @@ typedef struct {
>    ACPI_RESOURCE_HEADER_PTR    Resources;
>    ACPI_RESOURCE_HEADER_PTR    PossibleResources;
>  } DEVICE_INFO;
> +typedef struct {
> +  UINT8 Segment;
> +  UINT8 Bus;
> +  UINT8 Device;
> +  UINT8 Funtion;
> +} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
> 
>  /**
>    Return the supported devices.
> diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> index 408c6ff301..5bfdc94681 100644
> --- a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> +++ b/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c
> @@ -106,6 +106,27 @@ SioDriverEntryPoint (  }
> 
> 
> +/**
> +  Compares a PCI to ISA bridge device segment, bus, device and function
> +to the
> +  PcdSuperIoPciIsaBridgeDevice values.
> +
> +  @param[in]  CurrentDevice       The device to be compared with the
> PcdSuperIoPciIsaBridgeDevice information
> +  @retval     TRUE                This device matches PcdSuperIoPciIsaBridgeDevice
> values
> +  @retval     FALSE               This device does not match the
> PcdSuperIoPciIsaBridgeDevice values
> +**/
> +BOOLEAN
> +EFIAPI
> +SioDeviceEnabled (
> +  IN SIO_PCI_ISA_BRIDGE_DEVICE_INFO *CurrentDevice ){
> +    SIO_PCI_ISA_BRIDGE_DEVICE_INFO *Device = \
> +      (SIO_PCI_ISA_BRIDGE_DEVICE_INFO *) FixedPcdGetPtr
> (PcdSuperIoPciIsaBridgeDevice);
> +    if(CompareMem (Device, CurrentDevice, sizeof
> (SIO_PCI_ISA_BRIDGE_DEVICE_INFO)) == 0) {
> +      return TRUE;
> +    }
> +    return FALSE;
> +}
> +
>  /**
>    Test to see if this driver supports Controller Handle.
> 
> @@ -138,6 +159,7 @@ SioDriverSupported (
>    UINTN                     BusNumber;
>    UINTN                     DeviceNumber;
>    UINTN                     FunctionNumber;
> +  SIO_PCI_ISA_BRIDGE_DEVICE_INFO  SioDevice;
> 
>    //
>    // If RemainingDevicePath is not NULL, it should verify that the first device
> @@ -250,6 +272,24 @@ SioDriverSupported (
>              Status = EFI_UNSUPPORTED;
>            }
>          }
> +        if(!EFI_ERROR (Status)) {
> +          Status = PciIo->GetLocation (
> +                            PciIo,
> +                            &SegmentNumber,
> +                            &BusNumber,
> +                            &DeviceNumber,
> +                            &FunctionNumber
> +                            );
> +          if(!EFI_ERROR (Status)) {
> +            SioDevice.Segment = (UINT8) SegmentNumber;
> +            SioDevice.Bus = (UINT8) BusNumber;
> +            SioDevice.Device = (UINT8) DeviceNumber;
> +            SioDevice.Funtion = (UINT8) FunctionNumber;
> +            if(!SioDeviceEnabled (&SioDevice)) {
> +              Status = EFI_UNSUPPORTED;
> +            }
> +          }
> +        }
>        }
>      }
> 
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
  2019-11-06  2:08   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:49   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:49 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2
> Keyboard Library
> 
> Added a generic Ps2 keyboard library
> that adds ps2 device path to ConIn and ConInDev Uefi variables
> 
> 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   |   1 +
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.c       | 202 ++++++++++++++++++
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.h       |  65 ++++++
>  .../Library/BdsPs2KbcLib/BdsPs2KbcLib.inf     |  38 ++++
>  4 files changed, 306 insertions(+)
>  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
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> index 5af26eb97e..bcc2dfbfeb 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> @@ -88,3 +88,4 @@
>    BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
> 
> 
> BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBoot
> MediaInfoLib.inf
> +  BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> new file mode 100644
> index 0000000000..3a885e0d71
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.c
> @@ -0,0 +1,202 @@
> +/** @file
> +  Main file for Ps2 keyboard controller library.
> +
> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include "BdsPs2KbcLib.h"
> +
> +GLOBAL_REMOVE_IF_UNREFERENCED
> PLATFORM_KEYBOARD_DEVICE_PATH
> +gKeyboardDevicePath = {
> +  gPciRootBridge,
> +  {
> +    {
> +      HARDWARE_DEVICE_PATH,
> +      HW_PCI_DP,
> +      {
> +        (UINT8) (sizeof (PCI_DEVICE_PATH)),
> +        (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    0, // Function, patched in EnumPs2Keyboard
> +    0  // Device, patched in EnumPs2Keyboard
> +  },
> +  {
> +    {
> +      ACPI_DEVICE_PATH,
> +      ACPI_DP,
> +      {
> +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),
> +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    EISA_PNP_ID(0x0303),
> +    0
> +  },
> +  gEndEntire
> +};
> +
> +/**
> +  Check if PS2 keyboard is conntected, by sending ECHO command.
> +  @retval                       TRUE if connected FALSE otherwise
> +**/
> +BOOLEAN
> +DetectPs2Keyboard (
> +  VOID
> +  )
> +{
> +  UINT32                TimeOut;
> +  UINT32                RegEmptied;
> +  UINT8                 Data;
> +  UINT32                SumTimeOut;
> +  BOOLEAN               FoundPs2Kbc;
> +
> +  TimeOut     = 0;
> +  RegEmptied  = 0;
> +  FoundPs2Kbc       = FALSE;
> +
> +  //
> +  // Wait for input buffer empty
> +  //
> +  for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
> +    if ((IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x02) == 0) {
> +      FoundPs2Kbc = TRUE;
> +      break;
> +    }
> +    MicroSecondDelay (30);
> +  }
> +
> +  if (FoundPs2Kbc == FALSE) {
> +    return FALSE;
> +  }
> +
> +  //
> +  // Send echo command
> +  //
> +  IoWrite8 (KEYBOARD_8042_DATA_REGISTER,
> KBC_INPBUF_VIA60_KBECHO);
> +
> +  //
> +  // Init variables
> +  //
> +  FoundPs2Kbc       = FALSE;
> +  TimeOut     = 0;
> +  SumTimeOut  = 0;
> +  Data = 0;
> +
> +  //
> +  // Read from 8042 (multiple times if needed)  // until the expected
> + value appears  // use SumTimeOut to control the iteration  //  while
> + (1) {
> +    //
> +    // Perform a read
> +    //
> +    for (TimeOut = 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut += 30) {
> +      if (IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x01) {
> +        Data = IoRead8 (KEYBOARD_8042_DATA_REGISTER);
> +        break;
> +      }
> +      MicroSecondDelay (30);
> +    }
> +
> +    SumTimeOut += TimeOut;
> +
> +    if (Data == KBC_INPBUF_VIA60_KBECHO) {
> +      FoundPs2Kbc = TRUE;
> +      break;
> +    }
> +
> +    if (SumTimeOut >= PS2_KEYBOARD_WAITFORVALUE_TIMEOUT) {
> +      break;
> +    }
> +  }
> +  return FoundPs2Kbc;
> +}
> +
> +/**
> +  Check if PS2 keyboard is conntected. If the result of first time is
> +  error, it will retry again.
> +  @retval                       TRUE if connected FALSE otherwise
> +**/
> +BOOLEAN
> +IsPs2KeyboardConnected (
> +  VOID
> +  )
> +{
> +  BOOLEAN Result;
> +  Result = DetectPs2Keyboard ();
> +
> +  if (Result == FALSE) {
> +    //
> +    // If there is no ps2 keyboard detected for the 1st time, retry again.
> +    //
> +    Result = DetectPs2Keyboard ();
> +  }
> +  return Result;
> +}
> +
> +
> +/**
> +  Updates the ConIn variable with Ps2 Keyboard device path,
> +  if it doesn't already exists in ConIn and ConInDev **/ VOID
> +AddPs2Keyboard (
> +  VOID
> +  )
> +{
> +  SIO_PCI_ISA_BRIDGE_DEVICE_INFO *SioIsaInfo;
> +
> +  DEBUG ((DEBUG_INFO, "[AddPs2Keyboard]\n"));
> +
> +  SioIsaInfo = (SIO_PCI_ISA_BRIDGE_DEVICE_INFO*) FixedPcdGetPtr
> + (PcdSuperIoPciIsaBridgeDevice);
> +
> +  //
> +  // patch IsaBridge device and and function  //
> + gKeyboardDevicePath.IsaBridge.Device = SioIsaInfo->Device;
> + gKeyboardDevicePath.IsaBridge.Function = SioIsaInfo->Funtion;
> +
> +  //
> +  // Append Ps2 Keyboard into "ConIn"
> +  //
> +  EfiBootManagerUpdateConsoleVariable (ConIn,
> (EFI_DEVICE_PATH_PROTOCOL
> + *) &gKeyboardDevicePath, NULL);
> +
> +  //
> +  // Append Ps2 Keyboard into "ConInDev"
> +  //
> +  EfiBootManagerUpdateConsoleVariable (ConInDev,
> +(EFI_DEVICE_PATH_PROTOCOL *) &gKeyboardDevicePath, NULL); }
> +
> +
> +/**
> +  Constructor for the Ps2 keyboard controller library.
> +
> +  @param ImageHandle    the image handle of the process
> +  @param SystemTable    the EFI System Table pointer
> +
> +  @retval EFI_SUCCESS        the shell command handlers were installed
> sucessfully
> +  @retval EFI_UNSUPPORTED    the shell level required was not found.
> +**/
> +EFI_STATUS
> +EFIAPI
> +BdsPs2KbcLibConstructor (
> +  IN EFI_HANDLE        ImageHandle,
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  UINT8                               Ps2KbMsEnable;
> +
> +  Ps2KbMsEnable = PcdGet8 (PcdPs2KbMsEnable);
> +
> +  if (Ps2KbMsEnable == 0x1
> +    && IsPs2KeyboardConnected())
> +  {
> +      // add ps2 device path to ConIn and ConInDev
> +      AddPs2Keyboard ();
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> new file mode 100644
> index 0000000000..d9a27e6681
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.h
> @@ -0,0 +1,65 @@
> +/** @file
> +  Header file for the Ps2 keyboard controller library.
> +
> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef _PS2_KBC_LIB_H
> +#define _PS2_KBC_LIB_H
> +
> +#include <Uefi.h>
> +#include <Library/UefiLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/IoLib.h>
> +#include <Library/TimerLib.h>
> +#include <Library/UefiBootManagerLib.h>
> +
> +//
> +// Below is the platform console device path // typedef struct {
> +  ACPI_HID_DEVICE_PATH      PciRootBridge;
> +  PCI_DEVICE_PATH           IsaBridge;
> +  ACPI_HID_DEVICE_PATH      Keyboard;
> +  EFI_DEVICE_PATH_PROTOCOL  End;
> +} PLATFORM_KEYBOARD_DEVICE_PATH;
> +
> +typedef struct {
> +  UINT8 Segment;
> +  UINT8 Bus;
> +  UINT8 Device;
> +  UINT8 Funtion;
> +} SIO_PCI_ISA_BRIDGE_DEVICE_INFO;
> +
> +#define gPciRootBridge \
> +  { \
> +    { \
> +      ACPI_DEVICE_PATH, \
> +      ACPI_DP, \
> +      { \
> +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> +      }, \
> +    }, \
> +    EISA_PNP_ID (0x0A03), \
> +    0 \
> +  }
> +
> +#define gEndEntire \
> +  { \
> +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {
> +END_DEVICE_PATH_LENGTH, 0 } \
> +  }
> +
> +#define KBC_INPBUF_VIA60_KBECHO             0xEE
> +#define KEYBOARD_8042_DATA_REGISTER         0x60
> +#define KEYBOARD_8042_STATUS_REGISTER       0x64
> +
> +#define PS2_KEYBOARD_TIMEOUT                65536   // 0.07s
> +#define PS2_KEYBOARD_WAITFORVALUE_TIMEOUT   1000000 // 1s
> +#define PS2_KEYBOARD_KBEN                   0xF4
> +#define PS2_KEYBOARD_CMDECHO_ACK            0xFA
> +
> +#endif
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> new file mode 100644
> index 0000000000..e00638daa7
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.in
> +++ f
> @@ -0,0 +1,38 @@
> +## @file
> +# Component information file for Ps2 keyboard controller library # #
> +Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ## [Defines]
> +  INF_VERSION                    = 0x00010006
> +  BASE_NAME                      = BdsPs2KbcLib
> +  FILE_GUID                      = E94EA52E-E84C-42E7-B863-EA1327EFA265
> +  MODULE_TYPE                    = UEFI_DRIVER
> +  VERSION_STRING                 = 1.2
> +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
> +  CONSTRUCTOR                    = BdsPs2KbcLibConstructor
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> +
> +[Sources]
> +  BdsPs2KbcLib.c
> +  BdsPs2KbcLib.h
> +
> +[LibraryClasses]
> +  DevicePathLib
> +  DebugLib
> +  IoLib
> +  UefiDriverEntryPoint
> +  UefiBootManagerLib
> +  UefiLib
> +  TimerLib
> +
> +[Pcd]
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  2019-11-06  2:08   ` [edk2-devel] " Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:50 UTC (permalink / raw)
  To: devel@edk2.groups.io, Agyeman, Prince

This patch is missing the Cc. Please make sure to check it in the future.

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Agyeman, Prince
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [edk2-platforms] [Patch v2 7/9]
> KabylakeOpenBoardPkg: Add Ps2 Keyboard Support
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2228
> 
> What was done:
> 
> * Added BDS Ps2 keyboard DXE driver.
> 
> * Added Super I/O DXE driver to publish the SIO protocol needed by the Ps2
> keyboard DXE driver.
> 
> * Included a Ps2 Library to BdsDxe driver to add the Ps2 device path to ConIn
> and ConInDev variables
> 
> * Configured the Super I/O Pci to Isa bridge bus, device, function device info
> PCD. This will help the Super I/O driver identify which bridge the Super I/O is
> connected to.
> 
> * Removed duplicate Ps2 enable PCDs
> 
> * Updated libraries to use Ps2 enable PCD defined in BoardModulePkg
> 
> Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
>  .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
>  .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 7
> +++++++  .../Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf |
> 2 ++
>  .../KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc    | 6 ++++++
>  .../Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf          | 3 ++-
>  .../Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf   | 3 ++-
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc     | 6 ++++++
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf     | 2 ++
>  .../KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc  | 7
> +++++++
>  Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec       | 2 --
>  11 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> index a79bdcdbc6..35cd5c8fdb 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeBoardAcpiTableLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
> +++ b/DxeBoardAcpiTableLib.inf
> @@ -33,9 +33,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gMinPlatformPkgTokenSpaceGuid.PcdPciExpNative
>    gMinPlatformPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gMinPlatformPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> index db8ba7a822..9fe27f9fda 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/
> DxeMultiBoardAcpiSupportLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLi
> +++ b/DxeMultiBoardAcpiSupportLib.inf
> @@ -34,9 +34,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index f59248bba4..55edc1a2f8 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -311,6 +311,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>    ShellPkg/Application/Shell/Shell.inf { @@ -408,3 +413,5 @@
>        !endif
>    }
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> index 80efab1aad..d58466d390 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
> @@ -335,6 +335,8 @@ INF
> MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
> c
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
> c
> index c68b8a49cf..c6f5ae7534 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
> c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
> c
> @@ -308,6 +308,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeBoardAcpiTableLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeBoardAcpiTableLib.inf
> index bfb58e868f..e0bf5823d8 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeBoardAcpiTableLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
> +++ Lib/DxeBoardAcpiTableLib.inf
> @@ -33,9 +33,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeMultiBoardAcpiSupportLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeMultiBoardAcpiSupportLib.inf
> index 00cdbe80ce..e5de9268e7 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLi
> b/DxeMultiBoardAcpiSupportLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpi
> +++ Lib/DxeMultiBoardAcpiSupportLib.inf
> @@ -34,9 +34,10 @@
>    MinPlatformPkg/MinPlatformPkg.dec
>    KabylakeOpenBoardPkg/OpenBoardPkg.dec
>    KabylakeSiliconPkg/SiPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> 
>  [Pcd]
> -  gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> index 7e65eeda6f..e7f5ed39d2 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> @@ -381,6 +381,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>  !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1 @@ -
> 485,3 +490,4 @@
>        !endif
>    }
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> index dbd6f2aa10..98eb7dcb5a 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
> @@ -336,6 +336,8 @@ INF
> MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
> dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
> dsc
> index 34cc731313..580504cbc1 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
> dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
> d
> +++ sc
> @@ -324,6 +324,13 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> index 9680e63bad..01d6116616 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec
> @@ -288,8 +288,6 @@
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdBoardUcmcGpioTableSize|0|U
> INT16|0x0000001
>  # Misc
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdIoExpanderPresent|FALSE|BO
> OLEAN|0x000000EC
> 
> -
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|1|UINT8|0x4
> 0000009
> -
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40
> 000002
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40
> 000003
> 
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x
> 40000004
> --
> 2.19.1.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:50 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2
> keyboard Support
> 
> Added BIOS keyboard support to BoardX58Ich10
> 
> * Included BoardModulePkg's generic Super I/O DXE driver
> * Configured Super I/O and Ps2 keyboard related PCD to enable Ps2
> keyboard
> 
> 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/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 2 ++
> .../Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf | 1 +
>  .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc    | 6 ++++++
>  3 files changed, 9 insertions(+)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> index e0a02b4efc..7329b19e8e 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> @@ -283,3 +283,5 @@
>    $(BOARD_PKG)/SimicsDxe/SimicsDxe.inf
>    $(BOARD_PKG)/SimicsVideoDxe/SimicsVideoDxe.inf
>    $(BOARD_PKG)/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> index 6dc7b4aa56..ef6b35c92f 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> @@ -212,6 +212,7 @@ INF
> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> 
>  INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> index 0298e4b12d..cd95755f91 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> +++ c
> @@ -196,6 +196,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|4
>    gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicAddressBase|0xFEC01000
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.X64]
>    ######################################
>    # Edk2 Configuration
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support
  2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
  2019-11-06  2:09   ` Chiu, Chasel
  2019-11-06 22:39   ` Nate DeSimone
@ 2019-11-07  0:50   ` Kubacki, Michael A
  2 siblings, 0 replies; 37+ messages in thread
From: Kubacki, Michael A @ 2019-11-07  0:50 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, November 5, 2019 5:26 PM
> To: devel@edk2.groups.io
> Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add
> Ps2 Keyboard Support
> 
> What was done:
> 
> * Added BDS Ps2 keyboard DXE driver.
> 
> * Included Super I/O DXE driver to publish the SIO protocol needed by the
> Ps2 keyboard DXE driver.
> 
> * Included a Ps2 Library to BdsDxe driver  to add the Ps2 device path to ConIn
> and ConInDev  variables
> 
> * Configured the Super I/O Pci to Isa bridge bus,  device, function device info
> PCD. This will help the Super I/O  driver identify which bridge the Super I/O is
> connected to.
> 
>  * Removed duplicate Ps2 enable PCDs
> 
> 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/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec     | 1 -
>  .../WhiskeylakeURvp/OpenBoardPkg.dsc                        | 6 ++++++
>  .../WhiskeylakeURvp/OpenBoardPkg.fdf                        | 2 ++
>  .../WhiskeylakeURvp/OpenBoardPkgPcd.dsc                     | 6 ++++++
>  4 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> index 34494d0168..fbb9549e44 100644
> --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
> @@ -271,7 +271,6 @@
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0
> x40000003
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8
> |0x40000004
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative|0|UINT8|0x
> 40000005
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable|1|UIN
> T8|0x40000006
> -
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|0|UINT8|
> 0x40000009
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableActiveTripPoints|1|
> UINT8|0x4000000A
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisablePassiveTripPoints|0
> |UINT8|0x4000000B
> 
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableCriticalTripPoints|1
> |UINT8|0x4000000C
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> index 8e0ea2d5ce..1c7c12696c 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pk
> +++ g.dsc
> @@ -335,6 +335,11 @@
>    MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>    MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
> +  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> +    <LibraryClasses>
> +      NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf
> +  }
>    UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
>    ShellPkg/Application/Shell/Shell.inf { @@ -428,3 +433,4 @@  !if
> gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
>    $(PLATFORM_BOARD_PACKAGE)/Acpi/BoardAcpiDxe/BoardAcpiDxe.inf
>  !endif
> +  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.fdf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.fdf
> index 140e6260c9..8a4fd973b4 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.fdf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pk
> +++ g.fdf
> @@ -340,6 +340,8 @@ INF
> MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
>  INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF
> MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDx
> e.inf
>  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf
> +INF  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  INF  ShellPkg/Application/Shell/Shell.inf
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> PkgPcd.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> PkgPcd.dsc
> index adbd48f6d7..52471cb25b 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> PkgPcd.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pk
> +++ gPcd.dsc
> @@ -296,6 +296,12 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03,
> 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00}  !endif
> 
> +  ######################################
> +  # Board Configuration
> +  ######################################
> +  gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1
> +  gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00,
> + 0x00, 0x1F, 0x00}
> +
>  [PcdsFixedAtBuild.IA32]
>    ######################################
>    # Edk2 Configuration
> --
> 2.19.1.windows.1


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2019-11-07  0:50 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-06  1:25 [edk2-platforms] [Patch v2 0/9] Enable Ps2 keyboard Agyeman, Prince
2019-11-06  1:25 ` [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Agyeman, Prince
2019-11-06  2:07   ` Chiu, Chasel
2019-11-06 22:38   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:25 ` [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Agyeman, Prince
2019-11-06  2:07   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:25 ` [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Agyeman, Prince
2019-11-06  2:07   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:25 ` [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Agyeman, Prince
2019-11-06  2:07   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:25 ` [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Agyeman, Prince
2019-11-06  2:08   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:26 ` [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Agyeman, Prince
2019-11-06  2:08   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:49   ` Kubacki, Michael A
2019-11-06  1:26 ` [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
2019-11-06  2:08   ` [edk2-devel] " Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:50   ` Kubacki, Michael A
2019-11-06  1:26 ` [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Agyeman, Prince
2019-11-06  2:09   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:50   ` Kubacki, Michael A
2019-11-06  1:26 ` [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Agyeman, Prince
2019-11-06  2:09   ` Chiu, Chasel
2019-11-06 22:39   ` Nate DeSimone
2019-11-07  0:50   ` Kubacki, Michael A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox