From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50017+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50017+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003566; cv=none; d=zoho.com; s=zohoarc; b=A85d2pSGTpExNkRZEoZmV2OLJnpSE/NEr0osnB19BqirC5vfXWhOqNYUyNCIS3N2AZhtlQMvuuMdQ5rcM6T5mFm1lIAHmHlEXFG0O//UlyBYl55eAfNzf/eihzgO6Rd9tGjPTV7cLi3h3w3NrzLixOE9ie1MiPNiBc0vPmszJI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003566; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=nBVwWZrKKidkadTeYdTb+rO4KpTb85R91E3vDJSrDIY=; b=mywi/8tKmcyrQoPUqUfKmrk/lt/2PQhOtIzrFWB/wr8o8k8TqQsXln03y+Y5zz30dun/KRAuVOA+Iw+SGIjnouWcP5KBriUZsIaZ+PLmG9BztcJoPgIIypsg6bOnPv1GJLIY99R3AFZI9sYbYF/KjzvEPkcEMohHBTNir/EcpXw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50017+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003566209908.3613367077106; Tue, 5 Nov 2019 17:26:06 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:05 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.2852.1573003564754808196 for ; Tue, 05 Nov 2019 17:26:05 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033083" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:03 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 1/9] BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid Date: Tue, 5 Nov 2019 17:25:55 -0800 Message-Id: <20191106012603.4724-2-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003565; bh=3bOXAQ8VJuJjhGa6pyR+enmRECYXjJtJEyLxLfru910=; h=Cc:Date:From:Reply-To:Subject:To; b=n35xzYvQDpv3jKsomSS1YXlrF83Nq5bUTFHpYk2ssM6yKbNsgyaHLRbGeidfWnBtRUT 1jYom50D4uX9dhVCms4aPtIq85B17ki+h+VUlad3ArdnfjvuUrUFrgTIN7siYp1BVa3fa 5NSNLHBM/3sKX+2/c1a2VkCj1HwWpykLhfE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Added gBoardModulePkgTokenSpaceGuid to BoardModulePkg Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/BoardModulePkg/BoardModulePkg.dec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dec index f461cc7cab..8a811602e6 100644 --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec @@ -42,3 +42,7 @@ =20 ## GUID to publish BIOS information HOB gBiosInfoGuid =3D { 0x09d0d15c, 0xe9f0, 0x4dfc, {0x9e, 0x0b, 0x39, 0x33,= 0x1f, 0xca, 0x66, 0x85} } + + ## {7F4EE1A3-C1F3-43E4-BA1A-39DCDE46C343} + gBoardModulePkgTokenSpaceGuid =3D { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba, = 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } } + --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50017): https://edk2.groups.io/g/devel/message/50017 Mute This Topic: https://groups.io/mt/42928921/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50018+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50018+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003567; cv=none; d=zoho.com; s=zohoarc; b=khgdY7dJ1LN0npgLQCTPBs9JsSCNrUEaUkIGB67t3cBgoxHXU5tBrjSOgvrX0BI9BGfa1ouVDQJILTbosFYbyNgm/6BUNIv2rYlNTETMajhpke0gCEASEknwg1UxsXb/ucAhXz7hmbA34ZKLnRu4oYMk6bIISsVEAMWxxObPZYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003567; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=3XBGTejZSqEIrRYiqeRtG+jAbCiqbsJ8z6L1Ddw1+qw=; b=F2Zz9AbF98BtFQCm1vr457XMvI4hC7LdV8z/sqCk8jvC+CpRgSiDKqbrRmjeUegiAOCzWjxcX6u06gOub0nQMsrTNkEooVdYW7p6pXVhFjqxBw3Bim57EttTCKvM/CHNpy2BIkELnO4TexJE4Q0bvxoIqUgEPn41/LBJRpGuc7w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50018+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003567243523.9748960086428; Tue, 5 Nov 2019 17:26:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:06 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.2852.1573003564754808196 for ; Tue, 05 Nov 2019 17:26:05 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033086" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:03 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 2/9] SimicsOpenBoardPkg: Remove Super I/O DXE driver Date: Tue, 5 Nov 2019 17:25:56 -0800 Message-Id: <20191106012603.4724-3-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003566; bh=ksPdPghM7iC3hSKj5ZYmryW+NlT68iUIlGsRkAjZiBw=; h=Cc:Date:From:Reply-To:Subject:To; b=bVZt1x3cVJnhhXwRp7zzyPLIsRUcivWCsq7TmXM8VLVfW2+nq3mBi3Mm8ZjegFMmX7V 7c79Xk0UaqSF2OX7MnixYpOpgI0C/KJGcP9nsvAeVSOS65VKK1WOwJk7gGA8qdLLX6rrS tfLBC81/IS+4EAh27sSvgkJbo7LGSFrvp+w= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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/Componen= tName.c delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/Componen= tName.h delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/LegacySi= oDxe.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/SioDrive= r.c delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDrive= r.h delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioServi= ce.c delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioServi= ce.h diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.d= sc 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.f= df 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 =20 -INF $(BOARD_PKG)/LegacySioDxe/LegacySioDxe.inf INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 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.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include "SioDriver.h" - -/// -/// Component Name Protocol instance -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mSioComponentNa= me =3D { - SioComponentNameGetDriverName, - SioComponentNameGetControllerName, - "eng" -}; - -/// -/// Component Name 2 Protocol instance -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mSioComponentNa= me2 =3D { - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SioComponentNameGetDriverName, - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)SioComponentNameGetControllerNa= me, - "en" -}; - -/// -/// Table of driver names -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioDriverNameTable= [] =3D { - { - "eng;en", - L"Super I/O Driver" - }, - { - NULL, - NULL - } -}; - -/// -/// Table of Controller names -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioControllerNameT= able[] =3D { - { - "eng;en", - L"Super I/O Controller" - }, - { - NULL, - NULL - } -}; - -/** - Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language A pointer to a three-character ISO 639-2 language ide= ntifier. - 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 suppo= rted by a - driver is up to the driver writer. - @param DriverName A pointer to the Unicode string to return. This Unic= ode string - is the name of the driver specified by This in the la= nguage - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d 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 supp= ort 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 =3D=3D &mSioComponentName) - ); -} - -/** - Retrieves a Unicode string that is the user readable name of the control= ler - that is being managed by an EFI Driver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL in= stance. - @param ControllerHandle The handle of a controller that the driver spec= ified by - This is managing. This handle specifies the co= ntroller - 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 nam= e of the - bus controller. It will not be NULL for a bus = driver - that wishes to retrieve the name of a child con= troller. - @param Language A pointer to a three character ISO 639-2 langua= ge - identifier. This is the language of the contro= ller name - that the caller is requesting, and it must matc= h one - of the languages specified in SupportedLanguage= s. The - number of languages supported by a driver is up= to the - driver writer. - @param ControllerName A pointer to the Unicode string to return. Thi= s Unicode - string is the name of the controller specified = by - ControllerHandle and ChildHandle in the languag= e specified - by Language, from the point of view of the driv= er specified - by This. - - @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the - language specified by Language for the dri= ver - specified by This was returned in DriverNa= me. - @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid 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 curren= tly managing - the controller specified by ControllerHand= le and - ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort 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 =3D EfiTestManagedDevice ( - ControllerHandle, - mSioDriver.DriverBindingHandle, - &gEfiPciIoProtocolGuid - ); - if (EFI_ERROR (Status)) { - return Status; - } - // - // ChildHandle must be NULL for a Device Driver - // - if (ChildHandle !=3D NULL) { - return EFI_UNSUPPORTED; - } - - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - mSioControllerNameTable, - ControllerName, - (BOOLEAN)(This =3D=3D &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.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -/** - Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language A pointer to a three-character ISO 639-2 language ide= ntifier. - 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 suppo= rted by a - driver is up to the driver writer. - @param DriverName A pointer to the Unicode string to return. This Unic= ode string - is the name of the driver specified by This in the la= nguage - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d 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 supp= ort 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 control= ler - that is being managed by an EFI Driver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL in= stance. - @param ControllerHandle The handle of a controller that the driver spec= ified by - This is managing. This handle specifies the co= ntroller - 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 nam= e of the - bus controller. It will not be NULL for a bus = driver - that wishes to retrieve the name of a child con= troller. - @param Language A pointer to a three character ISO 639-2 langua= ge - identifier. This is the language of the contro= ller name - that the caller is requesting, and it must matc= h one - of the languages specified in SupportedLanguage= s. The - number of languages supported by a driver is up= to the - driver writer. - @param ControllerName A pointer to the Unicode string to return. Thi= s Unicode - string is the name of the controller specified = by - ControllerHandle and ChildHandle in the languag= e specified - by Language, from the point of view of the driv= er specified - by This. - - @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the - language specified by Language for the dri= ver - specified by This was returned in DriverNa= me. - @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid 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 curren= tly managing - the controller specified by ControllerHand= le and - ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort 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.in= f 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.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010017 - BASE_NAME =3D HitachiH8s2113Dxe - FILE_GUID =3D 7807E404-8281-4FF1-8457-0B54BABE263F - VERSION_STRING =3D 1.0 - MODULE_TYPE =3D UEFI_DRIVER - ENTRY_POINT =3D SioDriverEntryPoint -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D 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/Pl= atform/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.
- - 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/Pla= tform/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.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include "SioDriver.h" -#include - -LOCAL_IO_WRITE8 mIoWrite8 =3D IoWrite8; -// -// System configuration (setup) information -// -// SYSTEM_CONFIGURATION mSystemConfiguration; - -// -// COM 1 UART Controller -// -ACPI_SIO_RESOURCES_IO_IRQ mCom1Resources =3D { - { - { 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 =3D { - { - { 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 =3D { - { - { 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[] =3D { - { - { - 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 =3D sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); - LocalDevices =3D AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceC= ount); - ASSERT (LocalDevices !=3D NULL); - if (LocalDevices =3D=3D NULL) { - return; - } - LocalCount =3D 0; - - for (Index =3D 0; Index < DeviceCount; Index++) { - CopyMem (&LocalDevices[LocalCount], &mDeviceInfo[Index].Device, sizeof= (EFI_SIO_ACPI_DEVICE_ID)); - LocalCount++; - } - - *Devices =3D LocalDevices; - *Count =3D LocalCount; -} - - -/** - Super I/O controller initialization. - - @retval EFI_SUCCESS The super I/O controller is found and init= ialized. - @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 =3D 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0])= ; Index++) { - if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) = =3D=3D 0) { - return &mDeviceInfo[Index]; - } - } - - ASSERT (FALSE); - return NULL; -} - - -/** - Program the SIO chip to enable the specified device using the default re= source. - - @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 =3D DeviceSearch (Device); - - *Resources =3D 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 =3D DeviceSearch (Device); - - *Resources =3D DeviceInfo->PossibleResources; - - return EFI_SUCCESS; -} diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioChip.h b/Pla= tform/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.
- - 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 re= source. - - @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/P= latform/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.
- - 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 =3D { - SioDriverSupported, - SioDriverStart, - SioDriverStop, - 1, - NULL, - NULL -}; - -// -// The list of the created SIO_DEV -// -LIST_ENTRY mSioDevPool =3D INITIALIZE_LIST_HEAD_VARIABLE = (mSioDevPool); - -// -// Template structure to create SIO_DEV -// -SIO_DEV mSioDevTemplate =3D { - 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 =3D { - { - 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 thi= s function. - - @param[in] ImageHandle The firmware allocated handle for the EFI ima= ge. - @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 p= oint. -**/ -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 specifi= c child - device to start. - - @retval EFI_SUCCESS This driver supports this device - @retval EFI_ALREADY_STARTED This driver is already running on this d= evice - @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 d= evice - // 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 !=3D NULL) { - if (!IsDevicePathEnd (RemainingDevicePath)) { - if ((RemainingDevicePath->Type !=3D ACPI_DEVICE_PATH) || - (((RemainingDevicePath->SubType !=3D ACPI_DP) || (DevicePathNode= Length (RemainingDevicePath) !=3D sizeof (ACPI_HID_DEVICE_PATH))) && - ((RemainingDevicePath->SubType !=3D ACPI_EXTENDED_DP) || (Device= PathNodeLength (RemainingDevicePath) !=3D sizeof (ACPI_EXTENDED_HID_DEVICE_= PATH)))) - ) { - return EFI_UNSUPPORTED; - } - - DeviceGetList (&Devices, &Count); - if (Devices =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - AcpiNode =3D (ACPI_HID_DEVICE_PATH *) RemainingDevicePath; - for (Index =3D 0; Index < Count; Index++) { - if ((AcpiNode->HID =3D=3D Devices[Index].HID) && - (AcpiNode->UID =3D=3D Devices[Index].UID)) { - break; - } - } - FreePool (Devices); - if (Index =3D=3D Count) { - return EFI_UNSUPPORTED; - } - } - } - - // - // See if the parent device path can be opened BY_DRIVER - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - (VOID **) &ParentDevicePath, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { - return Status; - } - - gBS->CloseProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - This->DriverBindingHandle, - Controller - ); - - // - // Get PciIo protocol instance - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - - if (!EFI_ERROR (Status)) { - Status =3D PciIo->Pci.Read ( - PciIo, - EfiPciIoWidthUint32, - 0, - sizeof (Pci) / sizeof (UINT32), - &Pci - ); - ASSERT_EFI_ERROR (Status); - - Status =3D EFI_UNSUPPORTED; - if ((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEM= ORY_SPACE)) - =3D=3D (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND= _MEMORY_SPACE) - ) { - if (Pci.Hdr.ClassCode[2] =3D=3D 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] =3D=3D PCI_CLASS_BRIDGE_ISA) { - Status =3D EFI_SUCCESS; - } - - // - // See if this is an Intel PCI to ISA Bridge in Positive Decode Mo= de - // - if ((Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA_PDECODE) && - (Pci.Hdr.VendorId =3D=3D 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 =3D PciIo->GetLocation ( - PciIo, - &SegmentNumber, - &BusNumber, - &DeviceNumber, - &FunctionNumber - ); - if (!EFI_ERROR (Status) && (FunctionNumber =3D=3D 0)) { - Status =3D EFI_SUCCESS; - } else { - Status =3D EFI_UNSUPPORTED; - } - } - } - } - - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - } - if (EFI_ERROR (Status) && (Status !=3D 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 succe= ssfully. -**/ -EFI_STATUS -SioDestroyDevice ( - IN EFI_HANDLE ChildHandle - ) -{ - EFI_STATUS Status; - SIO_DEV *SioDev; - EFI_SIO_PROTOCOL *Sio; - EFI_PCI_IO_PROTOCOL *PciIo; - - Status =3D gBS->HandleProtocol ( - ChildHandle, - &gEfiSioProtocolGuid, - (VOID **) &Sio - ); - ASSERT_EFI_ERROR (Status); - - SioDev =3D SIO_DEV_FROM_THIS (Sio); - - Status =3D gBS->CloseProtocol ( - SioDev->PciHandle, - &gEfiPciIoProtocolGuid, - mSioDriver.DriverBindingHandle, - ChildHandle - ); - ASSERT_EFI_ERROR (Status); - - Status =3D 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 =3D AllocateCopyPool (sizeof (SIO_DEV), &mSioDevTemplate); - ASSERT (SioDev !=3D NULL); - if (SioDev =3D=3D NULL) { - return; - } - InsertHeadList (&mSioDevPool, &SioDev->Link); - - SioDev->PciHandle =3D Controller; - - CopyMem (&SioDev->Device, Device, sizeof (*Device)); - - mAcpiNodeTemplate.HID =3D Device->HID; - mAcpiNodeTemplate.UID =3D Device->UID; - SioDev->DevicePath =3D AppendDevicePathNode (ParentDevicePath, (EFI_DEVI= CE_PATH_PROTOCOL *) &mAcpiNodeTemplate); - ASSERT (SioDev->DevicePath !=3D NULL); - - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &SioDev->Handle, - &gEfiSioProtocolGuid, &SioDev->Sio, - &gEfiDevicePathProtocolGuid, SioDev->DevicePath, - NULL - ); - ASSERT_EFI_ERROR (Status); - - Status =3D 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 specif= ic child - device to start. - - @retval EFI_SUCCESS This driver is added to ControllerHandle - @retval EFI_ALREADY_STARTED This driver is already running on Contr= ollerHandle - @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 =3D NULL; - RequestCreate =3D NULL; - // - // Get the ISA bridge's Device Path - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - (VOID **) &ParentDevicePath, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status) && Status !=3D EFI_ALREADY_STARTED) { - return Status; - } - - // - // Get Pci IO - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - - if (EFI_ERROR (Status) && Status !=3D EFI_ALREADY_STARTED) { - gBS->CloseProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - This->DriverBindingHandle, - Controller - ); - return Status; - } - - if ((RemainingDevicePath !=3D NULL) && IsDevicePathEnd (RemainingDeviceP= ath)) { - return EFI_SUCCESS; - } - - DeviceGetList (&Devices, &Count); - if (Devices =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Exit_Start; - } - HasCreated =3D AllocatePool (sizeof (BOOLEAN) * Count); - ASSERT (HasCreated !=3D NULL); - if (HasCreated =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Exit_Start; - } - RequestCreate =3D AllocatePool (sizeof (BOOLEAN) * Count); - ASSERT (RequestCreate !=3D NULL); - if (RequestCreate =3D=3D NULL) { - Status =3D 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 =3D=3D EFI_ALREADY_STARTED) { - for (Node =3D GetFirstNode (&mSioDevPool); - !IsNull (&mSioDevPool, Node); - Node =3D GetNextNode (&mSioDevPool, Node) - ) { - SioDev =3D CR (Node, SIO_DEV, Link, SIO_DEV_SIGNATURE); - Status =3D 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 (Dev= icePath)) =3D=3D 0) { - for (Index =3D 0; Index < Count; Index++) { - if (CompareMem (&SioDev->Device, &Devices[Index], sizeof (EFI_SI= O_ACPI_DEVICE_ID)) =3D=3D 0) { - HasCreated[Index] =3D TRUE; - break; - } - } - } - } - } - - AcpiNode =3D (ACPI_HID_DEVICE_PATH *) RemainingDevicePath; - for (Index =3D 0; Index < Count; Index++) { - if ((AcpiNode =3D=3D NULL) || - ((AcpiNode->HID =3D=3D Devices[Index].HID) && (AcpiNode->UID =3D= =3D Devices[Index].UID)) - ) { - RequestCreate[Index] =3D TRUE; - } else { - RequestCreate[Index] =3D FALSE; - } - } - - for (Index =3D 0; Index < Count; Index++) { - if (RequestCreate[Index] && !HasCreated[Index]) { - SioCreateDevice (Controller, &Devices[Index], ParentDevicePath, PciI= o); - } - } -Exit_Start: - if (Devices !=3D NULL) { - FreePool (Devices); - } - if (HasCreated !=3D NULL) { - FreePool (HasCreated); - } - if (RequestCreate !=3D 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 drive= r. - @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 devi= ce -**/ -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 =3D=3D 0) { - gBS->CloseProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - This->DriverBindingHandle, - Controller - ); - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - return EFI_SUCCESS; - } - - AllChildrenStopped =3D TRUE; - for (Index =3D 0; Index < NumberOfChildren; Index++) { - Status =3D SioDestroyDevice (ChildHandleBuffer[Index]); - if (EFI_ERROR (Status)) { - AllChildrenStopped =3D FALSE; - } - } - - if (AllChildrenStopped) { - return EFI_SUCCESS; - } else { - return EFI_DEVICE_ERROR; - } -} diff --git a/Platform/Intel/SimicsOpenBoardPkg/LegacySioDxe/SioDriver.h b/P= latform/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.
- - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#ifndef _SIO_DRIVER_H_ -#define _SIO_DRIVER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// -// Driver Consumed Protocol Prototypes -// -#include -#include -#include - -// -// Driver Produced Protocol Prototypes -// -#include - - -#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 specifi= c child - device to start. - - @retval EFI_SUCCESS This driver supports this device - @retval EFI_ALREADY_STARTED This driver is already running on this d= evice - @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 specif= ic child - device to start. - - @retval EFI_SUCCESS This driver is added to ControllerHandle - @retval EFI_ALREADY_STARTED This driver is already running on Contr= ollerHandle - @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 drive= r. - @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 devi= ce -**/ -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.
- - 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 dev= ice. 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 termina= ted with the 'End tag' - resource descriptor. - - @param[in] This Indicates a pointer to the calling con= text. - @param[out] ResourceList A pointer to an ACPI resource descript= or 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 =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - SioDev =3D SIO_DEV_FROM_THIS (This); - - return DeviceGetResources (&SioDev->Device, ResourceList); -} - - -/** - Provides a collection of resource descriptor lists. Each resource descri= ptor list in the collection - defines a combination of resources that can potentially be used by the d= evice. - - @param[in] This Indicates a pointer to the calling= context. - @param[out] ResourceCollection Collection of the resource descrip= tor lists. - - @retval EFI_SUCCESS The operation completed successful= ly - @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 =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - SioDev =3D 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 con= text. - @param[in] ResourceList Pointer to the ACPI resource descripto= r 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 =3D ResourceList; - SioDev =3D SIO_DEV_FROM_THIS (This); - - // - // Check whether the resource is in the possible resource collection - // - DevicePossibleResources (&SioDev->Device, &ResourceCollection); - - while (ResourcePtr.SmallHeader->Byte !=3D ACPI_END_TAG_DESCRIPTOR) { - - Found =3D FALSE; - ResourcePtr2 =3D ResourceCollection; - while (ResourcePtr2.SmallHeader->Byte !=3D ACPI_END_TAG_DESCRIPTOR) { - if (ResourcePtr2.SmallHeader->Bits.Type =3D=3D 0) { - // - // Small Header - // - if (CompareMem ( - ResourcePtr2.SmallHeader, - ResourcePtr.SmallHeader, - ResourcePtr2.SmallHeader->Bits.Length + sizeof (*ResourcePtr= 2.SmallHeader) - ) =3D=3D 0) { - Found =3D TRUE; - break; - } - - ResourcePtr2.SmallHeader =3D (ACPI_SMALL_RESOURCE_HEADER *) ((UINT= 8 *) ResourcePtr2.SmallHeader - + ResourcePtr2.SmallHeader->Bits.Length - + sizeof (*ResourcePtr2.SmallHeader)); - - } else { - // - // Large Header - // - if (CompareMem ( - ResourcePtr2.LargeHeader, - ResourcePtr.LargeHeader, - ResourcePtr2.LargeHeader->Length + sizeof (*ResourcePtr2.Lar= geHeader) - ) =3D=3D 0) { - Found =3D TRUE; - break; - } - - ResourcePtr2.LargeHeader =3D (ACPI_LARGE_RESOURCE_HEADER *) ((UINT= 8 *) ResourcePtr2.LargeHeader - + ResourcePtr2.LargeHeader->Length - + sizeof (*ResourcePtr2.LargeHeader)); - } - } - - if (!Found) { - return EFI_ACCESS_DENIED; - } - - if (ResourcePtr.SmallHeader->Bits.Type =3D=3D 0) { - ResourcePtr.SmallHeader =3D (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *= ) ResourcePtr.SmallHeader - + ResourcePtr.SmallHeader->Bits.Length - + sizeof (*ResourcePtr.SmallHeader)); - } else { - ResourcePtr.LargeHeader =3D (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 calli= ng context. - @param[in] Write Specifies the type of the regist= er 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, Valu= e is interpreted as an output parameter and the - operation is a register read. - @param[in] ExitCfgMode Exit Configuration Mode Indicato= r. If this parameter is set to TRUE, the - Super I/O driver will turn off c= onfiguration mode of the Super I/O prior to returning - from this function. If this para= meter is set to FALSE, the Super I/O driver will - leave Super I/O in the configura= tion 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 poi= nter to the buffer containing the byte of data to be - written to the Super I/O registe= r. 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 successf= ully - @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 =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - return EFI_SUCCESS; -} - - -/** - Provides an interface for a table based programming of the Super I/O reg= isters. - - 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 co= ntent is bitwise ANDed with - AndMask, and then ORed with OrMask before being written back to the Regi= ster. 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, t= he Super I/O device has to be - returned to the original state. - - @param[in] This Indicates a pointer to the calling cont= ext. - @param[in] Command A pointer to an array of NumberOfComman= ds 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 =3D=3D 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.
- - 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 dev= ice. 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 termina= ted with the 'End tag' - resource descriptor. - - @param[in] This Indicates a pointer to the calling c= ontext. - @param[out] ResourceList A pointer to an ACPI resource descri= ptor list that defines the current resources - used by the device. Type ACPI_RESOUR= CE_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 con= text. - @param[in] ResourceList Pointer to the ACPI resource descripto= r 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 descri= ptor list in the collection - defines a combination of resources that can potentially be used by the d= evice. - - @param[in] This Indicates a pointer to the calling= context. - @param[out] ResourceCollection Collection of the resource descrip= tor lists. - - @retval EFI_SUCCESS The operation completed successful= ly - @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 calli= ng context. - @param[in] Write Specifies the type of the regist= er 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, Valu= e is interpreted as an output parameter and the - operation is a register read. - @param[in] ExitCfgMode Exit Configuration Mode Indicato= r. If this parameter is set to TRUE, the=20 - Super I/O driver will turn off c= onfiguration mode of the Super I/O prior to returning - from this function. If this para= meter is set to FALSE, the Super I/O driver will - leave Super I/O in the configura= tion 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 poi= nter to the buffer containing the byte of data to be - written to the Super I/O registe= r. 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 successf= ully - @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 reg= isters. - - 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 co= ntent is bitwise ANDed with - AndMask, and then ORed with OrMask before being written back to the Regi= ster. 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, t= he Super I/O device has to be - returned to the original state. - - @param[in] This Indicates a pointer to the calling cont= ext. - @param[in] Command A pointer to an array of NumberOfComman= ds 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 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50018): https://edk2.groups.io/g/devel/message/50018 Mute This Topic: https://groups.io/mt/42928941/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50019+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50019+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003567; cv=none; d=zoho.com; s=zohoarc; b=L/YyL3YAL/9rZnGBUxhfaZi+uRS3Y/5UMjtfyGTmV/mP1JMThAB1ArRI8lp31nW5sVQBPocHrXKruXqmKYqQr0A4OZPBTvcAb6JdP8NznZ6elf6puYWAMkXc2gD+rhEt0x4siYENrnSfGacKb7b/Q/Q2fFZkHwXV0a5OcjCb6vk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003567; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=FMmGYluHyd26wtwQPW8g6lMc/qOlmHAIMeQ6HVRipJo=; b=Z96HW8PoMvcQIH9S3jq1sk8PRt1D5khT1BRD8YVNDuXaXDvMOiLlTC/jK1OHKMdl/mukUyKs7tV0jZIgNCxIKkH/u1+XuBs8CEMWdgqKi86ztNPRo5jCx7p0miTov+g+uJqLODxia6bbN+Dw1dLv4ATA2P2WS0qXiD2qo7ofOuY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50019+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157300356758915.522920403900798; Tue, 5 Nov 2019 17:26:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:06 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.2996.1573003565679869410 for ; Tue, 05 Nov 2019 17:26:05 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033089" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 3/9] BoardModulePkg: Add Super I/O driver Date: Tue, 5 Nov 2019 17:25:57 -0800 Message-Id: <20191106012603.4724-4-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003566; bh=2XechizANZaMR34scXC1PYiw0rwrWyv1g5GqrSHHVRE=; h=Cc:Date:From:Reply-To:Subject:To; b=SBNybfm5EqWTRNxaT2C+cxWu7hg64Xvkgy/nJKPBFN6E/OsnA73XEi6vFKRkSVAie+m 7adAss62mtoGffOWmYCawcKN6uxaq3tjnX1dPU2cNNm0wwTtqJwhTBuvw1JrM1oVTFiOB ShS31XJ4WmX3KYbMJIom3CjbDoS9QkENP5Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Added a generic Super I/O driver that produces the Sio protocol. This driver was moved from the SimicsOpenBoardPkg. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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/ComponentNam= e.c create mode 100644 Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentNam= e.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/In= tel/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/U= efiRuntimeServicesTableLib.inf =20 [LibraryClasses.common.PEIM] FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFi= rmwareBootMediaLib.inf @@ -76,6 +80,7 @@ =20 [Components] BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMediaInfoPei.inf + BoardModulePkg/LegacySioDxe/LegacySioDxe.inf BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLibNu= ll.inf =20 diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.c b/P= latform/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.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include "SioDriver.h" + +/// +/// Component Name Protocol instance +/// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mSioComponentNa= me =3D { + SioComponentNameGetDriverName, + SioComponentNameGetControllerName, + "eng" +}; + +/// +/// Component Name 2 Protocol instance +/// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mSioComponentNa= me2 =3D { + (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SioComponentNameGetDriverName, + (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)SioComponentNameGetControllerNa= me, + "en" +}; + +/// +/// Table of driver names +/// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioDriverNameTable= [] =3D { + { + "eng;en", + L"Super I/O Driver" + }, + { + NULL, + NULL + } +}; + +/// +/// Table of Controller names +/// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSioControllerNameT= able[] =3D { + { + "eng;en", + L"Super I/O Controller" + }, + { + NULL, + NULL + } +}; + +/** + Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. + + @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. + @param Language A pointer to a three-character ISO 639-2 language ide= ntifier. + 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 suppo= rted by a + driver is up to the driver writer. + @param DriverName A pointer to the Unicode string to return. This Unic= ode string + is the name of the driver specified by This in the la= nguage + specified by Language. + + @retval EFI_SUCCESS The Unicode string for the Driver specifie= d 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 supp= ort 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 =3D=3D &mSioComponentName) + ); +} + +/** + Retrieves a Unicode string that is the user readable name of the control= ler + that is being managed by an EFI Driver. + + @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL in= stance. + @param ControllerHandle The handle of a controller that the driver spec= ified by + This is managing. This handle specifies the co= ntroller + 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 nam= e of the + bus controller. It will not be NULL for a bus = driver + that wishes to retrieve the name of a child con= troller. + @param Language A pointer to a three character ISO 639-2 langua= ge + identifier. This is the language of the contro= ller name + that the caller is requesting, and it must matc= h one + of the languages specified in SupportedLanguage= s. The + number of languages supported by a driver is up= to the + driver writer. + @param ControllerName A pointer to the Unicode string to return. Thi= s Unicode + string is the name of the controller specified = by + ControllerHandle and ChildHandle in the languag= e specified + by Language, from the point of view of the driv= er specified + by This. + + @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the + language specified by Language for the dri= ver + specified by This was returned in DriverNa= me. + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. + @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid 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 curren= tly managing + the controller specified by ControllerHand= le and + ChildHandle. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort 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 =3D EfiTestManagedDevice ( + ControllerHandle, + mSioDriver.DriverBindingHandle, + &gEfiPciIoProtocolGuid + ); + if (EFI_ERROR (Status)) { + return Status; + } + // + // ChildHandle must be NULL for a Device Driver + // + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + + return LookupUnicodeString2 ( + Language, + This->SupportedLanguages, + mSioControllerNameTable, + ControllerName, + (BOOLEAN)(This =3D=3D &mSioComponentName) + ); +} diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/ComponentName.h b/P= latform/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.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +/** + Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. + + @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. + @param Language A pointer to a three-character ISO 639-2 language ide= ntifier. + 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 suppo= rted by a + driver is up to the driver writer. + @param DriverName A pointer to the Unicode string to return. This Unic= ode string + is the name of the driver specified by This in the la= nguage + specified by Language. + + @retval EFI_SUCCESS The Unicode string for the Driver specifie= d 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 supp= ort 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 control= ler + that is being managed by an EFI Driver. + + @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL in= stance. + @param ControllerHandle The handle of a controller that the driver spec= ified by + This is managing. This handle specifies the co= ntroller + 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 nam= e of the + bus controller. It will not be NULL for a bus = driver + that wishes to retrieve the name of a child con= troller. + @param Language A pointer to a three character ISO 639-2 langua= ge + identifier. This is the language of the contro= ller name + that the caller is requesting, and it must matc= h one + of the languages specified in SupportedLanguage= s. The + number of languages supported by a driver is up= to the + driver writer. + @param ControllerName A pointer to the Unicode string to return. Thi= s Unicode + string is the name of the controller specified = by + ControllerHandle and ChildHandle in the languag= e specified + by Language, from the point of view of the driv= er specified + by This. + + @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the + language specified by Language for the dri= ver + specified by This was returned in DriverNa= me. + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. + @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid 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 curren= tly managing + the controller specified by ControllerHand= le and + ChildHandle. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort 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.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010017 + BASE_NAME =3D LegacySioDxe + FILE_GUID =3D 7807E404-8281-4FF1-8457-0B54BABE263F + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D UEFI_DRIVER + ENTRY_POINT =3D SioDriverEntryPoint +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D 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/Platfo= rm/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.
+ + 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/Platfor= m/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.
+ + 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 =3D { + { + { 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 =3D { + { + { 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 =3D { + { + { 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[] =3D { + { + { + 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 =3D sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); + LocalDevices =3D AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceC= ount); + ASSERT (LocalDevices !=3D NULL); + if (LocalDevices =3D=3D NULL) { + return; + } + LocalCount =3D 0; + + for (Index =3D 0; Index < DeviceCount; Index++) { + CopyMem (&LocalDevices[LocalCount], &mDeviceInfo[Index].Device, sizeof= (EFI_SIO_ACPI_DEVICE_ID)); + LocalCount++; + } + + *Devices =3D LocalDevices; + *Count =3D LocalCount; +} + + +/** + Super I/O controller initialization. + + @retval EFI_SUCCESS The super I/O controller is found and init= ialized. + @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 =3D 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0])= ; Index++) { + if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) = =3D=3D 0) { + return &mDeviceInfo[Index]; + } + } + + ASSERT (FALSE); + return NULL; +} + + +/** + Program the SIO chip to enable the specified device using the default re= source. + + @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 =3D DeviceSearch (Device); + + *Resources =3D 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 =3D DeviceSearch (Device); + + *Resources =3D DeviceInfo->PossibleResources; + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h b/Platfor= m/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.
+ + 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 re= source. + + @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/Platf= orm/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.
+ + 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 =3D { + SioDriverSupported, + SioDriverStart, + SioDriverStop, + 1, + NULL, + NULL +}; + +// +// The list of the created SIO_DEV +// +LIST_ENTRY mSioDevPool =3D INITIALIZE_LIST_HEAD_VARIABLE = (mSioDevPool); + +// +// Template structure to create SIO_DEV +// +SIO_DEV mSioDevTemplate =3D { + 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 =3D { + { + 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 thi= s function. + + @param[in] ImageHandle The firmware allocated handle for the EFI ima= ge. + @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 p= oint. +**/ +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 specifi= c child + device to start. + + @retval EFI_SUCCESS This driver supports this device + @retval EFI_ALREADY_STARTED This driver is already running on this d= evice + @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 d= evice + // 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 !=3D NULL) { + if (!IsDevicePathEnd (RemainingDevicePath)) { + if ((RemainingDevicePath->Type !=3D ACPI_DEVICE_PATH) || + (((RemainingDevicePath->SubType !=3D ACPI_DP) || (DevicePathNode= Length (RemainingDevicePath) !=3D sizeof (ACPI_HID_DEVICE_PATH))) && + ((RemainingDevicePath->SubType !=3D ACPI_EXTENDED_DP) || (Device= PathNodeLength (RemainingDevicePath) !=3D sizeof (ACPI_EXTENDED_HID_DEVICE_= PATH)))) + ) { + return EFI_UNSUPPORTED; + } + + DeviceGetList (&Devices, &Count); + if (Devices =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + AcpiNode =3D (ACPI_HID_DEVICE_PATH *) RemainingDevicePath; + for (Index =3D 0; Index < Count; Index++) { + if ((AcpiNode->HID =3D=3D Devices[Index].HID) && + (AcpiNode->UID =3D=3D Devices[Index].UID)) { + break; + } + } + FreePool (Devices); + if (Index =3D=3D Count) { + return EFI_UNSUPPORTED; + } + } + } + + // + // See if the parent device path can be opened BY_DRIVER + // + Status =3D gBS->OpenProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + (VOID **) &ParentDevicePath, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { + return Status; + } + + gBS->CloseProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + This->DriverBindingHandle, + Controller + ); + + // + // Get PciIo protocol instance + // + Status =3D gBS->OpenProtocol ( + Controller, + &gEfiPciIoProtocolGuid, + (VOID **) &PciIo, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + + if (!EFI_ERROR (Status)) { + Status =3D PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint32, + 0, + sizeof (Pci) / sizeof (UINT32), + &Pci + ); + ASSERT_EFI_ERROR (Status); + + Status =3D EFI_UNSUPPORTED; + if ((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND_MEM= ORY_SPACE)) + =3D=3D (EFI_PCI_COMMAND_IO_SPACE | EFI_PCI_COMMAND= _MEMORY_SPACE) + ) { + if (Pci.Hdr.ClassCode[2] =3D=3D 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] =3D=3D PCI_CLASS_BRIDGE_ISA) { + Status =3D EFI_SUCCESS; + } + + // + // See if this is an Intel PCI to ISA Bridge in Positive Decode Mo= de + // + if ((Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA_PDECODE) && + (Pci.Hdr.VendorId =3D=3D 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 =3D PciIo->GetLocation ( + PciIo, + &SegmentNumber, + &BusNumber, + &DeviceNumber, + &FunctionNumber + ); + if (!EFI_ERROR (Status) && (FunctionNumber =3D=3D 0)) { + Status =3D EFI_SUCCESS; + } else { + Status =3D EFI_UNSUPPORTED; + } + } + } + } + + gBS->CloseProtocol ( + Controller, + &gEfiPciIoProtocolGuid, + This->DriverBindingHandle, + Controller + ); + } + if (EFI_ERROR (Status) && (Status !=3D 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 succe= ssfully. +**/ +EFI_STATUS +SioDestroyDevice ( + IN EFI_HANDLE ChildHandle + ) +{ + EFI_STATUS Status; + SIO_DEV *SioDev; + EFI_SIO_PROTOCOL *Sio; + EFI_PCI_IO_PROTOCOL *PciIo; + + Status =3D gBS->HandleProtocol ( + ChildHandle, + &gEfiSioProtocolGuid, + (VOID **) &Sio + ); + ASSERT_EFI_ERROR (Status); + + SioDev =3D SIO_DEV_FROM_THIS (Sio); + + Status =3D gBS->CloseProtocol ( + SioDev->PciHandle, + &gEfiPciIoProtocolGuid, + mSioDriver.DriverBindingHandle, + ChildHandle + ); + ASSERT_EFI_ERROR (Status); + + Status =3D 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 =3D AllocateCopyPool (sizeof (SIO_DEV), &mSioDevTemplate); + ASSERT (SioDev !=3D NULL); + if (SioDev =3D=3D NULL) { + return; + } + InsertHeadList (&mSioDevPool, &SioDev->Link); + + SioDev->PciHandle =3D Controller; + + CopyMem (&SioDev->Device, Device, sizeof (*Device)); + + mAcpiNodeTemplate.HID =3D Device->HID; + mAcpiNodeTemplate.UID =3D Device->UID; + SioDev->DevicePath =3D AppendDevicePathNode (ParentDevicePath, (EFI_DEVI= CE_PATH_PROTOCOL *) &mAcpiNodeTemplate); + ASSERT (SioDev->DevicePath !=3D NULL); + + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &SioDev->Handle, + &gEfiSioProtocolGuid, &SioDev->Sio, + &gEfiDevicePathProtocolGuid, SioDev->DevicePath, + NULL + ); + ASSERT_EFI_ERROR (Status); + + Status =3D 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 specif= ic child + device to start. + + @retval EFI_SUCCESS This driver is added to ControllerHandle + @retval EFI_ALREADY_STARTED This driver is already running on Contr= ollerHandle + @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 =3D NULL; + RequestCreate =3D NULL; + // + // Get the ISA bridge's Device Path + // + Status =3D gBS->OpenProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + (VOID **) &ParentDevicePath, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + if (EFI_ERROR (Status) && Status !=3D EFI_ALREADY_STARTED) { + return Status; + } + + // + // Get Pci IO + // + Status =3D gBS->OpenProtocol ( + Controller, + &gEfiPciIoProtocolGuid, + (VOID **) &PciIo, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + + if (EFI_ERROR (Status) && Status !=3D EFI_ALREADY_STARTED) { + gBS->CloseProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + This->DriverBindingHandle, + Controller + ); + return Status; + } + + if ((RemainingDevicePath !=3D NULL) && IsDevicePathEnd (RemainingDeviceP= ath)) { + return EFI_SUCCESS; + } + + DeviceGetList (&Devices, &Count); + if (Devices =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto Exit_Start; + } + HasCreated =3D AllocatePool (sizeof (BOOLEAN) * Count); + ASSERT (HasCreated !=3D NULL); + if (HasCreated =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto Exit_Start; + } + RequestCreate =3D AllocatePool (sizeof (BOOLEAN) * Count); + ASSERT (RequestCreate !=3D NULL); + if (RequestCreate =3D=3D NULL) { + Status =3D 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 =3D=3D EFI_ALREADY_STARTED) { + for (Node =3D GetFirstNode (&mSioDevPool); + !IsNull (&mSioDevPool, Node); + Node =3D GetNextNode (&mSioDevPool, Node) + ) { + SioDev =3D CR (Node, SIO_DEV, Link, SIO_DEV_SIGNATURE); + Status =3D 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 (Dev= icePath)) =3D=3D 0) { + for (Index =3D 0; Index < Count; Index++) { + if (CompareMem (&SioDev->Device, &Devices[Index], sizeof (EFI_SI= O_ACPI_DEVICE_ID)) =3D=3D 0) { + HasCreated[Index] =3D TRUE; + break; + } + } + } + } + } + + AcpiNode =3D (ACPI_HID_DEVICE_PATH *) RemainingDevicePath; + for (Index =3D 0; Index < Count; Index++) { + if ((AcpiNode =3D=3D NULL) || + ((AcpiNode->HID =3D=3D Devices[Index].HID) && (AcpiNode->UID =3D= =3D Devices[Index].UID)) + ) { + RequestCreate[Index] =3D TRUE; + } else { + RequestCreate[Index] =3D FALSE; + } + } + + for (Index =3D 0; Index < Count; Index++) { + if (RequestCreate[Index] && !HasCreated[Index]) { + SioCreateDevice (Controller, &Devices[Index], ParentDevicePath, PciI= o); + } + } +Exit_Start: + if (Devices !=3D NULL) { + FreePool (Devices); + } + if (HasCreated !=3D NULL) { + FreePool (HasCreated); + } + if (RequestCreate !=3D 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 drive= r. + @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 devi= ce +**/ +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 =3D=3D 0) { + gBS->CloseProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + This->DriverBindingHandle, + Controller + ); + gBS->CloseProtocol ( + Controller, + &gEfiPciIoProtocolGuid, + This->DriverBindingHandle, + Controller + ); + return EFI_SUCCESS; + } + + AllChildrenStopped =3D TRUE; + for (Index =3D 0; Index < NumberOfChildren; Index++) { + Status =3D SioDestroyDevice (ChildHandleBuffer[Index]); + if (EFI_ERROR (Status)) { + AllChildrenStopped =3D FALSE; + } + } + + if (AllChildrenStopped) { + return EFI_SUCCESS; + } else { + return EFI_DEVICE_ERROR; + } +} diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.h b/Platf= orm/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.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _SIO_DRIVER_H_ +#define _SIO_DRIVER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// Driver Consumed Protocol Prototypes +// +#include +#include +#include + +// +// Driver Produced Protocol Prototypes +// +#include + + +#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 specifi= c child + device to start. + + @retval EFI_SUCCESS This driver supports this device + @retval EFI_ALREADY_STARTED This driver is already running on this d= evice + @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 specif= ic child + device to start. + + @retval EFI_SUCCESS This driver is added to ControllerHandle + @retval EFI_ALREADY_STARTED This driver is already running on Contr= ollerHandle + @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 drive= r. + @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 devi= ce +**/ +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/Plat= form/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.
+ + 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 dev= ice. 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 termina= ted with the 'End tag' + resource descriptor. + + @param[in] This Indicates a pointer to the calling con= text. + @param[out] ResourceList A pointer to an ACPI resource descript= or 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 =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + SioDev =3D SIO_DEV_FROM_THIS (This); + + return DeviceGetResources (&SioDev->Device, ResourceList); +} + + +/** + Provides a collection of resource descriptor lists. Each resource descri= ptor list in the collection + defines a combination of resources that can potentially be used by the d= evice. + + @param[in] This Indicates a pointer to the calling= context. + @param[out] ResourceCollection Collection of the resource descrip= tor lists. + + @retval EFI_SUCCESS The operation completed successful= ly + @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 =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + SioDev =3D 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 con= text. + @param[in] ResourceList Pointer to the ACPI resource descripto= r 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 =3D ResourceList; + SioDev =3D SIO_DEV_FROM_THIS (This); + + // + // Check whether the resource is in the possible resource collection + // + DevicePossibleResources (&SioDev->Device, &ResourceCollection); + + while (ResourcePtr.SmallHeader->Byte !=3D ACPI_END_TAG_DESCRIPTOR) { + + Found =3D FALSE; + ResourcePtr2 =3D ResourceCollection; + while (ResourcePtr2.SmallHeader->Byte !=3D ACPI_END_TAG_DESCRIPTOR) { + if (ResourcePtr2.SmallHeader->Bits.Type =3D=3D 0) { + // + // Small Header + // + if (CompareMem ( + ResourcePtr2.SmallHeader, + ResourcePtr.SmallHeader, + ResourcePtr2.SmallHeader->Bits.Length + sizeof (*ResourcePtr= 2.SmallHeader) + ) =3D=3D 0) { + Found =3D TRUE; + break; + } + + ResourcePtr2.SmallHeader =3D (ACPI_SMALL_RESOURCE_HEADER *) ((UINT= 8 *) ResourcePtr2.SmallHeader + + ResourcePtr2.SmallHeader->Bits.Length + + sizeof (*ResourcePtr2.SmallHeader)); + + } else { + // + // Large Header + // + if (CompareMem ( + ResourcePtr2.LargeHeader, + ResourcePtr.LargeHeader, + ResourcePtr2.LargeHeader->Length + sizeof (*ResourcePtr2.Lar= geHeader) + ) =3D=3D 0) { + Found =3D TRUE; + break; + } + + ResourcePtr2.LargeHeader =3D (ACPI_LARGE_RESOURCE_HEADER *) ((UINT= 8 *) ResourcePtr2.LargeHeader + + ResourcePtr2.LargeHeader->Length + + sizeof (*ResourcePtr2.LargeHeader)); + } + } + + if (!Found) { + return EFI_ACCESS_DENIED; + } + + if (ResourcePtr.SmallHeader->Bits.Type =3D=3D 0) { + ResourcePtr.SmallHeader =3D (ACPI_SMALL_RESOURCE_HEADER *) ((UINT8 *= ) ResourcePtr.SmallHeader + + ResourcePtr.SmallHeader->Bits.Length + + sizeof (*ResourcePtr.SmallHeader)); + } else { + ResourcePtr.LargeHeader =3D (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 calli= ng context. + @param[in] Write Specifies the type of the regist= er 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, Valu= e is interpreted as an output parameter and the + operation is a register read. + @param[in] ExitCfgMode Exit Configuration Mode Indicato= r. If this parameter is set to TRUE, the + Super I/O driver will turn off c= onfiguration mode of the Super I/O prior to returning + from this function. If this para= meter is set to FALSE, the Super I/O driver will + leave Super I/O in the configura= tion 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 poi= nter to the buffer containing the byte of data to be + written to the Super I/O registe= r. 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 successf= ully + @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 =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + return EFI_SUCCESS; +} + + +/** + Provides an interface for a table based programming of the Super I/O reg= isters. + + 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 co= ntent is bitwise ANDed with + AndMask, and then ORed with OrMask before being written back to the Regi= ster. 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, t= he Super I/O device has to be + returned to the original state. + + @param[in] This Indicates a pointer to the calling cont= ext. + @param[in] Command A pointer to an array of NumberOfComman= ds 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 =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioService.h b/Plat= form/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.
+ + 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 dev= ice. 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 termina= ted with the 'End tag' + resource descriptor. + + @param[in] This Indicates a pointer to the calling c= ontext. + @param[out] ResourceList A pointer to an ACPI resource descri= ptor list that defines the current resources + used by the device. Type ACPI_RESOUR= CE_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 con= text. + @param[in] ResourceList Pointer to the ACPI resource descripto= r 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 descri= ptor list in the collection + defines a combination of resources that can potentially be used by the d= evice. + + @param[in] This Indicates a pointer to the calling= context. + @param[out] ResourceCollection Collection of the resource descrip= tor lists. + + @retval EFI_SUCCESS The operation completed successful= ly + @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 calli= ng context. + @param[in] Write Specifies the type of the regist= er 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, Valu= e is interpreted as an output parameter and the + operation is a register read. + @param[in] ExitCfgMode Exit Configuration Mode Indicato= r. If this parameter is set to TRUE, the + Super I/O driver will turn off c= onfiguration mode of the Super I/O prior to returning + from this function. If this para= meter is set to FALSE, the Super I/O driver will + leave Super I/O in the configura= tion 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 poi= nter to the buffer containing the byte of data to be + written to the Super I/O registe= r. 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 successf= ully + @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 reg= isters. + + 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 co= ntent is bitwise ANDed with + AndMask, and then ORed with OrMask before being written back to the Regi= ster. 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, t= he Super I/O device has to be + returned to the original state. + + @param[in] This Indicates a pointer to the calling cont= ext. + @param[in] Command A pointer to an array of NumberOfComman= ds 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 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50019): https://edk2.groups.io/g/devel/message/50019 Mute This Topic: https://groups.io/mt/42928945/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50020+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50020+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003568; cv=none; d=zoho.com; s=zohoarc; b=MZ+x/d9IrdmYqv/GQF82LdxRh3yLV9fuKyuCIQUuXQzLtMW/N7jPUO3DDY9oafI1edNi9gwuS8WBbSYOFqBOGDXnGCQ0WZoHRSaUlsY8k5NZwHzanptx+wvMSL5M6QSM/Gnj8PnFacq28+A4nY9FHAdwYiLHUWrucYG317VjOLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003568; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bpT8TBG/5WIJR8gf/yucbnKkF6wQ5AmPosB0KgbYueo=; b=CE2+ela4qZQSdIGI46zCFV2fmWFlKnk/JaYE9h665KcSakmp52HZxis2GH7umDKqs9qkybZWLY1j7klRLiJ3Foh3Z8t6qLSrxI6zGabxYDJA9gIW2JcHeFDbIKtdxpL1+AOLSYj4snV3Q3CYOpb1tE+jSIBflsf182JTlc4KPAI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50020+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003568773770.9590142859946; Tue, 5 Nov 2019 17:26:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:07 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.2852.1573003564754808196 for ; Tue, 05 Nov 2019 17:26:06 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033091" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 4/9] BoardModulePkg: Add fix at build Pcds Date: Tue, 5 Nov 2019 17:25:58 -0800 Message-Id: <20191106012603.4724-5-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003567; bh=u6JmaPER/YkNR90ap/8OKbDwxTngC7IXyVqPObBOvTU=; h=Cc:Date:From:Reply-To:Subject:To; b=WhuL8veIHmO+WwOLTmpypoyFE0jj9U5bruo2FJJm6Q3oINDPq8MqeAb9ifx4a5vk6kC Fs1bpxq9vCpI+BIWrWDy642mwKzmiQdKH+XqZRdJTTJuZFj1xZNE/ey5lgnjfpClgey3N h8EQV9/i+SJ51zGfX1kcBcBnqnpjBL8nDOQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" * Added ps2 keyboard and Uart enable PCDs. * Added PCDs to define IO ports for Uart1 and Uart2 Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../Intel/BoardModulePkg/BoardModulePkg.dec | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/In= tel/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 =3D { 0x7f4ee1a3, 0xc1f3, 0x43e4, { 0xba, = 0x1a, 0x39, 0xdc, 0xde, 0x46, 0xc3, 0x43 } } =20 +[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 seg= ment number, + # the second is the bus number, third byte is the device number, the fo= urth 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 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50020): https://edk2.groups.io/g/devel/message/50020 Mute This Topic: https://groups.io/mt/42928973/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50021+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50021+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003569; cv=none; d=zoho.com; s=zohoarc; b=JS0j2Th4nwocIsQ/e7OFjT9KPTV87oZKDOe957+ld9mtqPWblFiDVOm/Ikj9a4cA1upS9Hf6ip0rhy46npcrS9i/yB9cZJvsj9mhO34S43eG+iHR+avLCboas/Lx2Z3yu+QmTm3adUpdplaLFvvAR955+lXuMV0OgmX76EgdIQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003569; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=KSRzQSLZ1le93Sk+PU7fka7P4aIhQNXdfXTEWLlJc7Q=; b=jHIaedl7B0lTwhqfIZqP4sTHN//ezCvtsy1lKXKL4uWt+vcP6gHbIvhG/Pj08MBPQvGPPVHkhIXN46Rd4z5x0F04j1XMomTmV/T9U4lWe9Im24M3aDaCIBBKMpeODk9HHIzs4/tB85AolOx8p8Rb3h+NFgznxSyANGTVlVkUwTI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50021+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003569284883.015758376648; Tue, 5 Nov 2019 17:26:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:08 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.2958.1573003566641973092 for ; Tue, 05 Nov 2019 17:26:06 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033094" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 5/9] BoardModulePkg: Added Pcds to Super I/O driver Date: Tue, 5 Nov 2019 17:25:59 -0800 Message-Id: <20191106012603.4724-6-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003568; bh=MlJTn+mwQ+fSFiFq99wWsDY21Zutsdgo/CRgOR6rslI=; h=Cc:Date:From:Reply-To:Subject:To; b=wthSZ6vjpITGDutOHObLs2jX+sEry58xlUa4zFLVCZJ87UizMn4ltIJGmUffOyMf1tR VWJkOeHqV/wBS+0d7laKuyLuBNgJNB1qSOFbj1GLju4p9IfmRStIQk4FcmuO7pSOjusWI 1rNS7/jEPxOqf3uIyaKGdYZYO5kydZxa4nY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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 =20 [Sources] SioChip.c @@ -44,6 +45,17 @@ SioDriver.h ComponentName.c =20 +[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/Platfor= m/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 =3D { { { 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 =3D { + { + { 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 =3D { // Table of SIO Controllers // DEVICE_INFO mDeviceInfo[] =3D { +#if FixedPcdGet8 (PcdUart1Enable) =3D=3D DEVICE_ENABLED { { EISA_PNP_ID(0x501), @@ -84,6 +104,20 @@ DEVICE_INFO mDeviceInfo[] =3D { { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources }, { (ACPI_SMALL_RESOURCE_HEADER *) &mCom1Resources } }, // COM 1 UART Controller +#endif +#if FixedPcdGet8 (PcdUart2Enable) =3D=3D 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) =3D=3D DEVICE_ENABLED { { EISA_PNP_ID(0x303), @@ -103,10 +137,30 @@ DEVICE_INFO mDeviceInfo[] =3D { 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 }; =20 =20 + +/** + 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 =3D ARRAY_SIZE (mDeviceInfo) - 1; + return Count; +} + /** Return the supported devices. =20 @@ -128,7 +182,7 @@ DeviceGetList ( // // Allocate enough memory for simplicity // - DeviceCount =3D sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0]); + DeviceCount =3D GetDeviceCount (); LocalDevices =3D AllocatePool (sizeof (EFI_SIO_ACPI_DEVICE_ID) * DeviceC= ount); ASSERT (LocalDevices !=3D NULL); if (LocalDevices =3D=3D NULL) { @@ -175,8 +229,10 @@ DeviceSearch ( ) { UINTN Index; + UINTN DeviceCount; =20 - for (Index =3D 0; Index < sizeof (mDeviceInfo) / sizeof (mDeviceInfo[0])= ; Index++) { + DeviceCount =3D GetDeviceCount (); + for (Index =3D 0; Index < DeviceCount; Index++) { if (CompareMem (Device, &mDeviceInfo[Index].Device, sizeof (*Device)) = =3D=3D 0) { return &mDeviceInfo[Index]; } diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioChip.h b/Platfor= m/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 =20 +#define DEVICE_ENABLED 0x01 +#define DEVICE_INFO_END { { 0xFFFFFFFF, 0xFFFFFFFF } } #pragma pack(1) =20 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; =20 /** Return the supported devices. diff --git a/Platform/Intel/BoardModulePkg/LegacySioDxe/SioDriver.c b/Platf= orm/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 ( } =20 =20 +/** + 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 PcdSu= perIoPciIsaBridgeDevice information + @retval TRUE This device matches PcdSuperIoPciIsaBrid= geDevice values + @retval FALSE This device does not match the PcdSuperI= oPciIsaBridgeDevice values +**/ +BOOLEAN +EFIAPI +SioDeviceEnabled ( + IN SIO_PCI_ISA_BRIDGE_DEVICE_INFO *CurrentDevice +){ + SIO_PCI_ISA_BRIDGE_DEVICE_INFO *Device =3D \ + (SIO_PCI_ISA_BRIDGE_DEVICE_INFO *) FixedPcdGetPtr (PcdSuperIoPciIsaB= ridgeDevice); + if(CompareMem (Device, CurrentDevice, sizeof (SIO_PCI_ISA_BRIDGE_DEVIC= E_INFO)) =3D=3D 0) { + return TRUE; + } + return FALSE; +} + /** Test to see if this driver supports Controller Handle. =20 @@ -138,6 +159,7 @@ SioDriverSupported ( UINTN BusNumber; UINTN DeviceNumber; UINTN FunctionNumber; + SIO_PCI_ISA_BRIDGE_DEVICE_INFO SioDevice; =20 // // If RemainingDevicePath is not NULL, it should verify that the first d= evice @@ -250,6 +272,24 @@ SioDriverSupported ( Status =3D EFI_UNSUPPORTED; } } + if(!EFI_ERROR (Status)) { + Status =3D PciIo->GetLocation ( + PciIo, + &SegmentNumber, + &BusNumber, + &DeviceNumber, + &FunctionNumber + ); + if(!EFI_ERROR (Status)) { + SioDevice.Segment =3D (UINT8) SegmentNumber; + SioDevice.Bus =3D (UINT8) BusNumber; + SioDevice.Device =3D (UINT8) DeviceNumber; + SioDevice.Funtion =3D (UINT8) FunctionNumber; + if(!SioDeviceEnabled (&SioDevice)) { + Status =3D EFI_UNSUPPORTED; + } + } + } } } =20 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50021): https://edk2.groups.io/g/devel/message/50021 Mute This Topic: https://groups.io/mt/42928978/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50022+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50022+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003568; cv=none; d=zoho.com; s=zohoarc; b=W1UBvZCq0YeyQTcbV09RKcHC4pnKvzu6M8Om0j7H9yfkoz/v1iElitWDKNlt5vFGKsQbB9W2m8liwxypfeZXroGNIwADpg2CxXul28Db5s7m5cH3shUom5f/Es9GDTAxF8AAUAGBxU6PGd4DDmmuyIjAF3vBGVYSWRVdZIzmvBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003568; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qsNoIkqCZOsKDhssV0KsW7QqdqoRDuinMu5yx1uqMgM=; b=VfVKx1bgNFoX4uSVQ2Qq1g7BXvKmy1X5v9hD/1Ujw4mEkovg63xmX/bRtfzwQF6DwYRRlhatKvbvcp62rmkggkMERc8LeqQE9pILOgFCfJJA89lJwMtLuccZgbAHONHh8zOzbHh9O+uRVmZDSyWHzNjAlhlz9gF6cFLB2NR5xeI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50022+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003568908505.8472790414587; Tue, 5 Nov 2019 17:26:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:08 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web12.2996.1573003565679869410 for ; Tue, 05 Nov 2019 17:26:06 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033097" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 6/9] BoardModulePkg: Add Ps2 Keyboard Library Date: Tue, 5 Nov 2019 17:26:00 -0800 Message-Id: <20191106012603.4724-7-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003568; bh=8aZBhiSGKf3Zehv5uKRcY5ckD7yVjS5ofj/Bq+muRnc=; h=Cc:Date:From:Reply-To:Subject:To; b=c3FDNAMLLKjsS0Ns1ZAg/HOuEcYjgaSOctkNUtnS21Tpj4lKC2wzHRwT9M058iYp/a4 s1K9oYEJoKBIBeqIwVi18X8a8zovy+OF+jg+BaV1CtZGIykLp6raWAslm5lWJdZEdDEFP 0wCUbihI/hWDeNMuf8Sa3Zsp3smOQaX8Tc4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Added a generic Ps2 keyboard library that adds ps2 device path to ConIn and ConInDev Uefi variables Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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/BdsP= s2KbcLib.c create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsP= s2KbcLib.h create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsP= s2KbcLib.inf diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/In= tel/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 =20 BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMediaI= nfoLib.inf + BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLi= b.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.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BdsPs2KbcLib.h" + +GLOBAL_REMOVE_IF_UNREFERENCED PLATFORM_KEYBOARD_DEVICE_PATH gKeyboardDevi= cePath =3D { + 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 =3D 0; + RegEmptied =3D 0; + FoundPs2Kbc =3D FALSE; + + // + // Wait for input buffer empty + // + for (TimeOut =3D 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut +=3D 30) { + if ((IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x02) =3D=3D 0) { + FoundPs2Kbc =3D TRUE; + break; + } + MicroSecondDelay (30); + } + + if (FoundPs2Kbc =3D=3D FALSE) { + return FALSE; + } + + // + // Send echo command + // + IoWrite8 (KEYBOARD_8042_DATA_REGISTER, KBC_INPBUF_VIA60_KBECHO); + + // + // Init variables + // + FoundPs2Kbc =3D FALSE; + TimeOut =3D 0; + SumTimeOut =3D 0; + Data =3D 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 =3D 0; TimeOut < PS2_KEYBOARD_TIMEOUT; TimeOut +=3D 30) { + if (IoRead8 (KEYBOARD_8042_STATUS_REGISTER) & 0x01) { + Data =3D IoRead8 (KEYBOARD_8042_DATA_REGISTER); + break; + } + MicroSecondDelay (30); + } + + SumTimeOut +=3D TimeOut; + + if (Data =3D=3D KBC_INPBUF_VIA60_KBECHO) { + FoundPs2Kbc =3D TRUE; + break; + } + + if (SumTimeOut >=3D 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 =3D DetectPs2Keyboard (); + + if (Result =3D=3D FALSE) { + // + // If there is no ps2 keyboard detected for the 1st time, retry again. + // + Result =3D 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 =3D (SIO_PCI_ISA_BRIDGE_DEVICE_INFO*) FixedPcdGetPtr (PcdSupe= rIoPciIsaBridgeDevice); + + // + // patch IsaBridge device and and function + // + gKeyboardDevicePath.IsaBridge.Device =3D SioIsaInfo->Device; + gKeyboardDevicePath.IsaBridge.Function =3D 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 suc= essfully + @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 =3D PcdGet8 (PcdPs2KbMsEnable); + + if (Ps2KbMsEnable =3D=3D 0x1 + && IsPs2KeyboardConnected()) + { + // add ps2 device path to ConIn and ConInDev + AddPs2Keyboard (); + } + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLi= b.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.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _PS2_KBC_LIB_H +#define _PS2_KBC_LIB_H + +#include +#include +#include +#include +#include +#include +#include + +// +// 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_PAT= H_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/BdsPs2KbcLi= b.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.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +[Defines] + INF_VERSION =3D 0x00010006 + BASE_NAME =3D BdsPs2KbcLib + FILE_GUID =3D E94EA52E-E84C-42E7-B863-EA1327EFA265 + MODULE_TYPE =3D UEFI_DRIVER + VERSION_STRING =3D 1.2 + LIBRARY_CLASS =3D NULL|UEFI_DRIVER + CONSTRUCTOR =3D 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 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50022): https://edk2.groups.io/g/devel/message/50022 Mute This Topic: https://groups.io/mt/42928982/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50023+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50023+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003569; cv=none; d=zoho.com; s=zohoarc; b=CpNDIHMWEbfVIrzx+h5daH8XG91u5iBM2+AqiLXAGQfticOPReiQ0p8QkMHEP2kkBxPQGPj8sWEM0UXav2uxE/EQyJfHXAZLivZnnPCae0BvYKTIC/rREEX25qSa2coXhEnFQqk30Tp+DrfaOHWqQ8+D4CdTM+SNYD1b/BxIPA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003569; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=QQ4Nl1L/KUk1eCqB/es6wJmn26THz9Jk4EvVjwZnjo8=; b=TTDI7qM6KTVEYs745GDRIDzN2gdklUbevP1c+Lyzwwg9IFGTHOFZzBHkQ3eS+ooCf3zIxpWVAf43F5vwHvJ0jJ8V4W+FvqSMeApZ0H1zA0uuuq/ILQmcyrgSnUO2lm0/GW3fmQ+F1EwO44UU64MHQL2CTwTWbyVmpNgaAMKzs9U= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50023+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157300356919029.262341789837023; Tue, 5 Nov 2019 17:26:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:08 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web10.2852.1573003564754808196 for ; Tue, 05 Nov 2019 17:26:06 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033098" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Subject: [edk2-devel] [edk2-platforms] [Patch v2 7/9] KabylakeOpenBoardPkg: Add Ps2 Keyboard Support Date: Tue, 5 Nov 2019 17:26:01 -0800 Message-Id: <20191106012603.4724-8-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003568; bh=O2vdSnWJKqlMeew3dR6MlVDeTPmWlrbuQNiZkI7lBPQ=; h=Date:From:Reply-To:Subject:To; b=RTsog4XtNzCtn/EP42WmGC2Vw/qcynaHwsRTlppWa8/fWaScihbSVtmPS1g1t7CkWFT I0zxj/JsLKLYZNquCKK7egNeB3Kn4XTeV888NdRddsJj3HOvkXjKujJFEfaWykxYjY1wh 5zb3hwOOOIDFYslRzhX4P90LYpOZnRt/DqQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2228 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 Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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/BoardAc= piLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Galago= Pro3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf index a79bdcdbc6..35cd5c8fdb 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/D= xeBoardAcpiTableLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/D= xeBoardAcpiTableLib.inf @@ -33,9 +33,10 @@ MinPlatformPkg/MinPlatformPkg.dec KabylakeOpenBoardPkg/OpenBoardPkg.dec KabylakeSiliconPkg/SiPkg.dec + BoardModulePkg/BoardModulePkg.dec =20 [Pcd] - gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable gMinPlatformPkgTokenSpaceGuid.PcdPciExpNative gMinPlatformPkgTokenSpaceGuid.PcdNativeAspmEnable gMinPlatformPkgTokenSpaceGuid.PcdLowPowerS0Idle diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAc= piLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardPkg= /GalagoPro3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf index db8ba7a822..9fe27f9fda 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/D= xeMultiBoardAcpiSupportLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/D= xeMultiBoardAcpiSupportLib.inf @@ -34,9 +34,10 @@ MinPlatformPkg/MinPlatformPkg.dec KabylakeOpenBoardPkg/OpenBoardPkg.dec KabylakeSiliconPkg/SiPkg.dec + BoardModulePkg/BoardModulePkg.dec =20 [Pcd] - gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.ds= c 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{ + + NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf + } UefiCpuPkg/CpuDxe/CpuDxe.inf =20 ShellPkg/Application/Shell/Shell.inf { @@ -408,3 +413,5 @@ !endif } !endif + BoardModulePkg/LegacySioDxe/LegacySioDxe.inf + diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fd= f 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 =20 INF ShellPkg/Application/Shell/Shell.inf =20 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, 0= x00, 0x00} !endif =20 + ###################################### + # Board Configuration + ###################################### + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1 + gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, = 0x1F, 0x00} + [PcdsFixedAtBuild.IA32] ###################################### # Edk2 Configuration diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/Board= AcpiLib/DxeBoardAcpiTableLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Kaby= lakeRvp3/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 =20 [Pcd] - gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPciExpNative gKabylakeOpenBoardPkgTokenSpaceGuid.PcdNativeAspmEnable gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/Board= AcpiLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/KabylakeOpenBoardP= kg/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 =20 [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{ + + NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf + } UefiCpuPkg/CpuDxe/CpuDxe.inf =20 !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection =3D=3D 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/SataControl= lerDxe.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 =20 INF ShellPkg/Application/Shell/Shell.inf =20 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgP= cd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d= sc 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, 0= x00, 0x00} !endif =20 + + ###################################### + # Board Configuration + ###################################### + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1 + gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, = 0x1F, 0x00} + [PcdsFixedAtBuild.IA32] ###################################### # Edk2 Configuration diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec b/Platfor= m/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.PcdBoardUcmcGpioTab= leSize|0|UINT16|0x0000001 # Misc gKabylakeOpenBoardPkgTokenSpaceGuid.PcdIoExpanderPresent|FALSE|BOOLEAN|0x0= 00000EC =20 - gKabylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|1|UINT8|0x40000009 - gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40000002 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004 --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50023): https://edk2.groups.io/g/devel/message/50023 Mute This Topic: https://groups.io/mt/42928988/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50024+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50024+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003569; cv=none; d=zoho.com; s=zohoarc; b=GOEroJy9HSYYl5959hTG2ESxRTtQneSO3WBnlfr2f0P71m1cbjVn+tYdqGm40EAi7InkgDHXqZbEQtZr7ZivJ6w1MQO9csG9PiyqOmgvPF2hfCWDXwyfsu81+yWavOU5CY+WQ/Bk0i9Q9FcLnw+eYRlWep2abrRd1YSsnY1g4K8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003569; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BInsf2/u4rt3PFK2pROn6K27TCcVzjDksqyCqev6sOo=; b=eHrU5/tjA6LJbfQWtdRcii4jWE0ngKIPJDiIAdWSZx1cs07tx1V/sK6XvxVkzEAilyuof/Os3PYRscs40Cc1mTHiMlCOJcjzH1bguZ3lEwYH7INisZRMF5alS4mdD4e3l837VK3TsBS35UxyEWQgiR0a55XtIBtQGEYgGgQTk1c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50024+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003569315619.204463370992; Tue, 5 Nov 2019 17:26:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:08 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web11.2958.1573003566641973092 for ; Tue, 05 Nov 2019 17:26:07 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033102" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 8/9] SimicsOpenBoardPkg: Add Ps2 keyboard Support Date: Tue, 5 Nov 2019 17:26:02 -0800 Message-Id: <20191106012603.4724-9-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003568; bh=eSBWsT6XSY4iYj8jrY8QspPZWRMUFsvqK9ZLgEHs1uI=; h=Cc:Date:From:Reply-To:Subject:To; b=jPeOSyxh0iNGhq0+iOlHcdua5zQrk5ubXEYG76ghDfP/1Gak9sA+LDqZLjxv5iCJ0x7 8mNb3zeo4CwnnB8gEBbxfxFB/vP8eddGr4oPi7LMFO2hNkeecMZJ0nmcdqTnDS+cSvrUo XYE8w7krBtySb2fXQOHKGK5YYOKQFxmhw4E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- .../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.d= sc 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.f= df 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/AtaAtapiPass= Thru.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 =20 INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPc= d.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 =20 + ###################################### + # Board Configuration + ###################################### + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1 + gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, = 0x1F, 0x00} + [PcdsFixedAtBuild.X64] ###################################### # Edk2 Configuration --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50024): https://edk2.groups.io/g/devel/message/50024 Mute This Topic: https://groups.io/mt/42928995/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 10:02:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+50025+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50025+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1573003569; cv=none; d=zoho.com; s=zohoarc; b=kOZhNLKsSR1A1EameGjnU97nzCkPtfOVod2dIR/goR/fU49r6QXl6O01qrB9wLVVrmKEqsUeiL+h1uPSryE8hWmhw6fmOOGs4sxPcJhEIuZFpzRUF5qXV6Kj5DY2YVcVIYw4WE3N1KzpOkgLh/vrHy/iPB+G3rEbUsN002V9wBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573003569; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=G1v7DaOe+xHCJWUnsKqNW4KOdOKDY8+g8spEo8su/z4=; b=UBdNPm7QownfrPbatuefeFDvbdKIZyFxzMWEzIek7uyLZhvpDIS3FD75QXL6m0QW2/KH934WsOvZO2+9bYAZEOyMTvvWacWCqYLuSHxRkYAaFUtAvIqNyDB1s8zdVIDg0na1Liv8T2VScWsfUEI4GJ7mMV60VvtRpj8dXkcnW5I= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+50025+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1573003569000308.9312239478386; Tue, 5 Nov 2019 17:26:09 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Tue, 05 Nov 2019 17:26:08 -0800 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web12.2996.1573003565679869410 for ; Tue, 05 Nov 2019 17:26:07 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 17:26:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,272,1569308400"; d="scan'208";a="196033104" X-Received: from paagyema-desk2.amr.corp.intel.com ([10.24.15.58]) by orsmga008.jf.intel.com with ESMTP; 05 Nov 2019 17:26:04 -0800 From: "Agyeman, Prince" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms] [Patch v2 9/9] WhiskeylakeOpenBoardPkg: Add Ps2 Keyboard Support Date: Tue, 5 Nov 2019 17:26:03 -0800 Message-Id: <20191106012603.4724-10-prince.agyeman@intel.com> In-Reply-To: <20191106012603.4724-1-prince.agyeman@intel.com> References: <20191106012603.4724-1-prince.agyeman@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,prince.agyeman@intel.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1573003568; bh=h7OeIzSOKWy/n9AoCrDz9f/9yEo6WfZPnS33rsb/hGY=; h=Cc:Date:From:Reply-To:Subject:To; b=L3LKWNvY1xugp/+xa75PWtNPLy1rgvQH8YBUuy6USUgIVJS9ZDmPI9+GDG4/02J5MsO zTXmf1gnc9Vk/Dsx/L8eBUgnOqb7Kxdw7aoP3SdlB+bSvQJVCtR7G+bmB7ImiVeWYfrWr mQslg3W7G1CX/oU60tki4VYgBeP7UuyRCNQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Prince Agyeman Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Nate DeSimone --- 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/Plat= form/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|0x40000= 006 -gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdPs2KbMsEnable|0|UINT8|0x40000009 gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableActiveTripPoints|1|UINT8|= 0x4000000A gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisablePassiveTripPoints|0|UINT8= |0x4000000B gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDisableCriticalTripPoints|1|UINT= 8|0x4000000C diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoar= dPkg.dsc index 8e0ea2d5ce..1c7c12696c 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc @@ -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{ + + NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf + } UefiCpuPkg/CpuDxe/CpuDxe.inf =20 ShellPkg/Application/Shell/Shell.inf { @@ -428,3 +433,4 @@ !if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly =3D=3D FALSE $(PLATFORM_BOARD_PACKAGE)/Acpi/BoardAcpiDxe/BoardAcpiDxe.inf !endif + BoardModulePkg/LegacySioDxe/LegacySioDxe.inf diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkg.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoar= dPkg.fdf index 140e6260c9..8a4fd973b4 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.f= df +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.f= df @@ -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 =20 INF ShellPkg/Application/Shell/Shell.inf =20 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenB= oardPkgPcd.dsc index adbd48f6d7..52471cb25b 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPc= d.dsc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPc= d.dsc @@ -296,6 +296,12 @@ gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F= , 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0= x00, 0x00} !endif =20 + ###################################### + # Board Configuration + ###################################### + gBoardModulePkgTokenSpaceGuid.PcdPs2KbMsEnable|1 + gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, = 0x1F, 0x00} + [PcdsFixedAtBuild.IA32] ###################################### # Edk2 Configuration --=20 2.19.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50025): https://edk2.groups.io/g/devel/message/50025 Mute This Topic: https://groups.io/mt/42929001/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-