From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.2323.1588985160856128074 for ; Fri, 08 May 2020 17:46:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: eric.dong@intel.com) IronPort-SDR: aEpQvWjCIijzSIf7QagSPmygjuYkEDnap73H+8UtS1xa6jb0Ut65dThywiaSXicY7jYcWFucRu Tco+cIbO33pA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 17:45:59 -0700 IronPort-SDR: IHKOfZytKtHEEQYG0NDHnb1gb6ADv/RRsgQ80UUl5EUUPDADkJVC81F+9jfQZXtGoNCOZC21MC UUsbhY7uVr9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,369,1583222400"; d="scan'208";a="250613882" Received: from ydong10-desktop.ccr.corp.intel.com ([10.239.158.133]) by fmsmga007.fm.intel.com with ESMTP; 08 May 2020 17:45:56 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Subject: [edk2-platform][PATCH] Platform/Intel: Remove deprecated packages Date: Sat, 9 May 2020 08:45:48 +0800 Message-Id: <20200509004548.1535-1-eric.dong@intel.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable After moving the AdvancedFeaturePkg, UserInterfaceFeaturePkg and DebugFeaturePkg to Features/Intel Package, remove deprecated packages in Platform/Intel folder. Signed-off-by: Eric Dong --- .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec | 153 --- .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 165 ---- .../Include/Dsc/CoreAdvancedDxeInclude.dsc | 19 - .../Include/Dsc/CoreAdvancedPeiInclude.dsc | 9 - .../Include/Fdf/CoreAdvancedLateInclude.fdf | 20 - .../Fdf/CoreAdvancedPostMemoryInclude.fdf | 8 - .../Fdf/CoreAdvancedPreMemoryInclude.fdf | 9 - .../AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c | 257 ----- .../Ipmi/BmcAcpi/BmcAcpi.inf | 48 - .../Ipmi/BmcAcpi/BmcSsdt/BmcSsdt.asl | 28 - .../Ipmi/BmcAcpi/BmcSsdt/IpmiOprRegions.asi | 58 -- .../AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 236 ----- .../Ipmi/BmcElog/BmcElog.inf | 34 - .../AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.c | 236 ----- .../AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf | 37 - .../AdvancedFeaturePkg/Ipmi/Frb/FrbPei.c | 84 -- .../AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf | 37 - .../Ipmi/Include/Library/IpmiCommandLib.h | 235 ----- .../Include/Library/IpmiPlatformHookLib.h | 23 - .../AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.c | 67 -- .../Ipmi/IpmiFru/IpmiFru.inf | 35 - .../Ipmi/IpmiInit/DxeIpmiInit.c | 150 --- .../Ipmi/IpmiInit/DxeIpmiInit.inf | 34 - .../Ipmi/IpmiInit/PeiIpmiInit.c | 96 -- .../Ipmi/IpmiInit/PeiIpmiInit.inf | 32 - .../Library/IpmiCommandLib/IpmiCommandLib.inf | 32 - .../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 248 ----- .../IpmiCommandLibNetFnChassis.c | 101 -- .../IpmiCommandLibNetFnStorage.c | 275 ------ .../IpmiCommandLibNetFnTransport.c | 81 -- .../Ipmi/Library/IpmiLibNull/IpmiLibNull.c | 45 - .../Ipmi/Library/IpmiLibNull/IpmiLibNull.inf | 28 - .../IpmiPlatformHookLibNull.c | 36 - .../IpmiPlatformHookLibNull.inf | 29 - .../AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c | 112 --- .../AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf | 34 - .../Ipmi/SolStatus/SolStatus.c | 164 ---- .../Ipmi/SolStatus/SolStatus.inf | 38 - Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c | 36 - .../Intel/AdvancedFeaturePkg/S3/S3Pei.inf | 31 - .../Smbios/SmbiosBasicDxe/SmbiosBasic.h | 45 - .../Smbios/SmbiosBasicDxe/SmbiosBasicDxe.inf | 83 -- .../SmbiosBasicDxe/SmbiosBasicEntryPoint.c | 125 --- .../SmbiosBasicDxe/Type0BiosVendorFunction.c | 81 -- .../Type1SystemManufacturerFunction.c | 114 --- .../Type2BaseBoardManufacturerFunction.c | 131 --- .../Type32BootInformationFunction.c | 56 -- .../Type3ChassisManufacturerFunction.c | 125 --- .../DebugFeaturePkg/AcpiDebug/AcpiDebug.asl | 103 -- .../DebugFeaturePkg/AcpiDebug/AcpiDebug.c | 523 ---------- .../AcpiDebug/AcpiDebugDxe.inf | 57 -- .../AcpiDebug/AcpiDebugSmm.inf | 59 -- .../DebugFeaturePkg/AcpiDebug/Readme.txt | 31 - .../Intel/DebugFeaturePkg/DebugFeaturePkg.dec | 66 -- .../Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 120 --- .../Include/Library/Usb3DebugPortLib.h | 71 -- .../Library/Usb3DebugPortParameterLib.h | 56 -- .../Library/Usb3DebugPortLib/MiscServices.c | 385 -------- .../Usb3DebugPortDataTransfer.c | 892 ------------------ .../Usb3DebugPortInitialize.c | 726 -------------- .../Usb3DebugPortLib/Usb3DebugPortLibDxe.c | 454 --------- .../Usb3DebugPortLib/Usb3DebugPortLibDxe.inf | 55 -- .../Usb3DebugPortLibDxeIoMmu.c | 828 ---------------- .../Usb3DebugPortLibDxeIoMmu.inf | 63 -- .../Usb3DebugPortLibInternal.h | 887 ----------------- .../Usb3DebugPortLib/Usb3DebugPortLibNull.c | 103 -- .../Usb3DebugPortLib/Usb3DebugPortLibNull.inf | 28 - .../Usb3DebugPortLib/Usb3DebugPortLibPei.c | 236 ----- .../Usb3DebugPortLib/Usb3DebugPortLibPei.inf | 48 - .../Usb3DebugPortLibPeiIoMmu.c | 440 --------- .../Usb3DebugPortLibPeiIoMmu.inf | 51 - .../Usb3DebugPortParameterLibPcd.c | 58 -- .../Usb3DebugPortParameterLibPcd.inf | 31 - .../Include/Guid/UserAuthentication.h | 45 - .../Include/Library/PlatformPasswordLib.h | 48 - .../Include/Library/UserPasswordLib.h | 70 -- .../Include/Library/UserPasswordUiLib.h | 37 - .../PlatformPasswordLibNull.c | 78 -- .../PlatformPasswordLibNull.inf | 39 - .../PlatformPasswordLibNull.uni | 19 - .../Library/UserPasswordLib/UserPasswordLib.c | 274 ------ .../UserPasswordLib/UserPasswordLib.inf | 37 - .../UserPasswordUiLib/UserPasswordUiLib.c | 522 ---------- .../UserPasswordUiLib/UserPasswordUiLib.inf | 41 - .../UserAuthentication/KeyService.c | 133 --- .../UserAuthentication/KeyService.h | 88 -- .../UserAuthentication2Dxe.c | 484 ---------- .../UserAuthentication2Dxe.h | 55 -- .../UserAuthentication2Dxe.inf | 53 -- .../UserAuthenticationDxe.c | 780 --------------- .../UserAuthenticationDxe.h | 138 --- .../UserAuthenticationDxe.inf | 63 -- .../UserAuthenticationDxeFormset.h | 23 - .../UserAuthenticationDxePassword.c | 319 ------- .../UserAuthenticationDxeStrings.uni | 30 - .../UserAuthenticationDxeVfr.vfr | 39 - .../UserAuthenticationSmm.c | 674 ------------- .../UserAuthenticationSmm.h | 52 - .../UserAuthenticationSmm.inf | 53 -- .../UserInterfaceFeaturePkg.dec | 45 - .../UserInterfaceFeaturePkg.dsc | 101 -- 101 files changed, 14871 deletions(-) delete mode 100644 Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec delete mode 100644 Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvan= cedDxeInclude.dsc delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvan= cedPeiInclude.dsc delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvan= cedLateInclude.fdf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvan= cedPostMemoryInclude.fdf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvan= cedPreMemoryInclude.fdf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.= inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/= BmcSsdt.asl delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/= IpmiOprRegions.asi delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.= inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/= IpmiCommandLib.h delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/= IpmiPlatformHookLib.h delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.= inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmi= Init.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmi= Init.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmi= Init.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmi= Init.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiComm= andLib/IpmiCommandLib.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiComm= andLib/IpmiCommandLibNetFnApp.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiComm= andLib/IpmiCommandLibNetFnChassis.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiComm= andLib/IpmiCommandLibNetFnStorage.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiComm= andLib/IpmiCommandLibNetFnTransport.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibN= ull/IpmiLibNull.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibN= ull/IpmiLibNull.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlat= formHookLibNull/IpmiPlatformHookLibNull.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlat= formHookLibNull/IpmiPlatformHookLibNull.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolSta= tus.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolSta= tus.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /SmbiosBasic.h delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /SmbiosBasicDxe.inf delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /SmbiosBasicEntryPoint.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /Type0BiosVendorFunction.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /Type1SystemManufacturerFunction.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /Type2BaseBoardManufacturerFunction.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /Type32BootInformationFunction.c delete mode 100644 Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /Type3ChassisManufacturerFunction.c delete mode 100644 Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl delete mode 100644 Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c delete mode 100644 Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.i= nf delete mode 100644 Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.i= nf delete mode 100644 Platform/Intel/DebugFeaturePkg/AcpiDebug/Readme.txt delete mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec delete mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc delete mode 100644 Platform/Intel/DebugFeaturePkg/Include/Library/Usb3Debu= gPortLib.h delete mode 100644 Platform/Intel/DebugFeaturePkg/Include/Library/Usb3Debu= gPortParameterLib.h delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /MiscServices.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortDataTransfer.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortInitialize.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibDxe.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibDxe.inf delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibDxeIoMmu.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibDxeIoMmu.inf delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibInternal.h delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibNull.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibNull.inf delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibPei.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibPei.inf delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibPeiIoMmu.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibPeiIoMmu.inf delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortPar= ameterLibPcd/Usb3DebugPortParameterLibPcd.c delete mode 100644 Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortPar= ameterLibPcd/Usb3DebugPortParameterLibPcd.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Include/Guid/Use= rAuthentication.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Include/Library/= PlatformPasswordLib.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Include/Library/= UserPasswordLib.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Include/Library/= UserPasswordUiLib.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/Platform= PasswordLibNull/PlatformPasswordLibNull.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/Platform= PasswordLibNull/PlatformPasswordLibNull.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/Platform= PasswordLibNull/PlatformPasswordLibNull.uni delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/UserPass= wordLib/UserPasswordLib.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/UserPass= wordLib/UserPasswordLib.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/UserPass= wordUiLib/UserPasswordUiLib.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/Library/UserPass= wordUiLib/UserPasswordUiLib.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/KeyService.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/KeyService.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthentication2Dxe.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthentication2Dxe.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthentication2Dxe.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxe.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxe.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxe.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxeFormset.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxePassword.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxeStrings.uni delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationDxeVfr.vfr delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationSmm.c delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationSmm.h delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserAuthenticati= on/UserAuthenticationSmm.inf delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFea= turePkg.dec delete mode 100644 Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFea= turePkg.dsc diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec b/Pla= tform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec deleted file mode 100644 index 44e5de64db..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec +++ /dev/null @@ -1,153 +0,0 @@ -## @file=0D -# This package provides the modules that build for a full feature platform= .=0D -# This AdvancedFeaturePkg should only depend on EDKII Core packages and Mi= nPlatformPkg.=0D -#=0D -# The DEC files are used by the utilities that parse DSC and=0D -# INF files to generate AutoGen.c and AutoGen.h files=0D -# for the build infrastructure.=0D -#=0D -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -=0D -[Defines]=0D -DEC_SPECIFICATION =3D 0x00010017=0D -PACKAGE_NAME =3D AdvancedFeaturePkg=0D -PACKAGE_VERSION =3D 0.1=0D -PACKAGE_GUID =3D 290127D9-ABED-4DD8-A35D-73DCB4261BCB=0D -=0D -=0D -[Includes]=0D -Include=0D -Ipmi/Include=0D -=0D -[Guids]=0D -gAdvancedFeaturePkgTokenSpaceGuid =3D {0xa8514688, 0x6693, 0x4ab5= , {0xaa, 0xc8, 0xcc, 0xa9, 0x8d, 0xde, 0x90, 0xe1}}=0D -=0D -[PcdsDynamic, PcdsDynamicEx]=0D -=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation|{0x0}|SM= BIOS_TABLE_TYPE0|0x80010000 {=0D - =0D - IndustryStandard/SmBios.h=0D - =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - }=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0= x1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVers= ion|0x2=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSegm= ent|0xF000=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosRele= aseDate|0x3=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSize= |0xFF=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.PciIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.PlugAndPlayIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.BiosIsUpgradable|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.BiosShadowingAllowed|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.BootFromCdIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.SelectableBootIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.EDDSpecificationIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.Floppy525_12IsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.Floppy35_720IsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.Floppy35_288IsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.PrintScreenIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.Keyboard8042IsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.SerialIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.PrinterIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosChar= acteristics.CgaMonoIsSupported|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSChar= acteristicsExtensionBytes[0]|0x33=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSChar= acteristicsExtensionBytes[1]|0x0F=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor|"Intel Corp= oration"|VOID*|0x80010001=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"PURLE= Y CV/CRB BIOS Internal"|VOID*|0x80010002=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"2= 008-12-23"|VOID*|0x80010003=0D -=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation|{0x0}|= SMBIOS_TABLE_TYPE1|0x80010100 {=0D - =0D - IndustryStandard/SmBios.h=0D - =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - }=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Manufa= cturer|0x1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Produc= tName|0x2=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Versio= n|0x3=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Serial= Number|0x4=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Uuid|{= GUID("88888888-8887-8888-8888-878888888888")}=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.WakeUp= Type|SystemWakeupTypePowerSwitch=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.SKUNum= ber|0x5=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Family= |0x6=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer|"Inte= l Corporation"|VOID*|0x80010101=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"PURLE= Y"|VOID*|0x80010102=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion|"1.0"|VOID= *|0x80010103=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSerialNumber|"UNKN= OWN"|VOID*|0x80010104=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber|"SKU Num= ber"|VOID*|0x80010105=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily|"Family"|VO= ID*|0x80010106=0D -=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation|{0x= 0}|SMBIOS_TABLE_TYPE2|0x80010200 {=0D - =0D - IndustryStandard/SmBios.h=0D - =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - }=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Man= ufacturer|0x1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Pro= ductName|0x2=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Ver= sion|0x3=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Ser= ialNumber|0x4=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Ass= etTag|0x5=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Fea= tureFlag.Motherboard|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Fea= tureFlag.Replaceable|1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Loc= ationInChassis|0x6=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Boa= rdType|BaseBoardTypeMotherBoard=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer|"Inte= l Corporation"|VOID*|0x80010201=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"PURLE= Y"|VOID*|0x80010202=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion|"E63448-40= 0"|VOID*|0x80010203=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber|"SPRO= 03200016"|VOID*|0x80010204=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringAssetTag|"Base Boa= rd Asset Tag"|VOID*|0x80010205=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringLocationInChassis|= "Part Component"|VOID*|0x80010206=0D -=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis|{= 0x0}|SMBIOS_TABLE_TYPE3|0x80010300 {=0D - =0D - IndustryStandard/SmBios.h=0D - =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - }=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.M= anufacturer|0x1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.T= ype|MiscChassisTypeRackMountChassis=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.V= ersion|0x2=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.S= erialNumber|0x3=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.A= ssetTag|0x4=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.B= ootupState|ChassisStateSafe=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.P= owerSupplyState|ChassisStateSafe=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.T= hermalState|ChassisStateSafe=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.S= ecurityStatus|ChassisSecurityStatusNone=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer|"Inte= l Corporation"|VOID*|0x80010301=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion|"0.1"|VOID= *|0x80010302=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSerialNumber|"UNKN= OWN"|VOID*|0x80010303=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringAssetTag|"Chassis = Asset Tag"|VOID*|0x80010304=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber|"SKU Num= ber"|VOID*|0x80010305=0D -=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation|{= 0x0}|SMBIOS_TABLE_TYPE32|0x80012000 {=0D - =0D - IndustryStandard/SmBios.h=0D - =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - }=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation.B= ootStatus|BootInformationStatusNoError=0D -=0D -[PcdsFixedAtBuild]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels|0x3|UINT8|0x40000009= =0D -=0D -[PcdsDynamic, PcdsDynamicEx]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress|0xCA2|UINT16|0x90= 000022=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x1000= 0030=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0x100000= 40=0D -=0D -[PcdsFeatureFlag]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdNetworkEnable |FALSE|BOOLE= AN|0xF00000A1=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable |FALSE|BOOLE= AN|0xF00000A2=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdIpmiEnable |FALSE|BOOLE= AN|0xF00000A3=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Pla= tform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc deleted file mode 100644 index b83e72b48c..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ /dev/null @@ -1,165 +0,0 @@ -## @file=0D -# Advanced Feature Package build description file.=0D -#=0D -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -##########################################################################= ######=0D -#=0D -# Defines Section - statements that will be processed to create a Makefile= .=0D -#=0D -##########################################################################= ######=0D -[Defines]=0D - PLATFORM_NAME =3D AdvancedFeaturePkg=0D - PLATFORM_GUID =3D 5E4C05BC-C5F0-4843-BAE1-3AAFE269= DB8F=0D - PLATFORM_VERSION =3D 0.1=0D - DSC_SPECIFICATION =3D 0x00010005=0D - OUTPUT_DIRECTORY =3D Build/AdvancedFeaturePkg=0D - SUPPORTED_ARCHITECTURES =3D IA32|X64=0D - BUILD_TARGETS =3D DEBUG|RELEASE=0D - SKUID_IDENTIFIER =3D DEFAULT=0D -=0D -##########################################################################= ######=0D -#=0D -# SKU Identification section - list of all SKU IDs supported.=0D -#=0D -##########################################################################= ######=0D -[SkuIds]=0D - 0|DEFAULT # The entry: 0|DEFAULT is reserved and always req= uired.=0D -=0D -##########################################################################= ######=0D -#=0D -# Pcd Section - list of all EDK II PCD Entries defined by this package.=0D -#=0D -##########################################################################= ######=0D -=0D -[PcdsFeatureFlag]=0D -=0D -##########################################################################= ######=0D -#=0D -# Library Class section - list of all Library Classes needed by this packa= ge.=0D -#=0D -##########################################################################= ######=0D -=0D -[LibraryClasses.common]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf= =0D - BasePciLibPciExpress|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciEx= press.inf=0D - CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf=0D - CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf=0D - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf=0D - DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf=0D - DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf=0D - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf=0D - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf=0D - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf=0D - PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf=0D - PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf=0D - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf=0D - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf=0D - PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf=0D - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf=0D - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf=0D - PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf= =0D - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf=0D - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf=0D - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf=0D - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf=0D - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf=0D - SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf=0D - SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf=0D - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplat= e.inf=0D - UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf=0D - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf=0D - UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf=0D - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf=0D - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf=0D - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf=0D - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf=0D - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf=0D - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf=0D -=0D - #######################################=0D - # Advanced Feature Package=0D - #######################################=0D - IpmiCommandLib|AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiComman= dLib.inf=0D - IpmiLib|AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/IpmiLibNull.inf=0D - IpmiPlatformHookLib|AdvancedFeaturePkg/Ipmi/Library/IpmiPlatformHookLibN= ull/IpmiPlatformHookLibNull.inf=0D -=0D -[LibraryClasses.common.SEC,LibraryClasses.common.PEI_CORE,LibraryClasses.c= ommon.PEIM]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf=0D - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf=0D -=0D - #######################################=0D - # Silicon Initialization Package=0D - #######################################=0D - SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/P= eiSmmAccessLib.inf=0D -=0D -[LibraryClasses.common.DXE_CORE,LibraryClasses.common.DXE_SMM_DRIVER,Libra= ryClasses.common.SMM_CORE,LibraryClasses.common.DXE_DRIVER,LibraryClasses.c= ommon.DXE_RUNTIME_DRIVER,LibraryClasses.common.UEFI_DRIVER,LibraryClasses.c= ommon.UEFI_APPLICATION]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D -=0D -[LibraryClasses.common.DXE_SMM_DRIVER,LibraryClasses.common.SMM_CORE]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf=0D -=0D -##########################################################################= #########################=0D -#=0D -# Components Section - list of the modules and components that will be pro= cessed by compilation=0D -# tools and the EDK II tools to generate PE32/PE32+/C= off image files.=0D -#=0D -# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed=0D -# into firmware volume images. This section is just a list of module= s to compile from=0D -# source into UEFI-compliant binaries.=0D -# It is the FDF file that contains information on combining binary f= iles into firmware=0D -# volume images, whose concept is beyond UEFI and is described in PI= specification.=0D -# Binary modules do not need to be listed in this section, as they s= hould be=0D -# specified in the FDF file. For example: Shell binary (Shell_Full.e= fi), FAT binary (Fat.efi),=0D -# Logo (Logo.bmp), and etc.=0D -# There may also be modules listed in this section that are not requ= ired in the FDF file,=0D -# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be=0D -# generated for it, but the binary will not be put into any firmware= volume.=0D -#=0D -##########################################################################= #########################=0D -=0D -[Components]=0D - #######################################=0D - # Advanced Feature Package=0D - #######################################=0D -=0D - # Add library instances here that are not included in package components= and should be tested=0D - # in the package build.=0D -=0D - # Add components here that should be included in the package build.=0D - AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.inf=0D - AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.inf=0D - AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf=0D - AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf=0D - AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.inf=0D - AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.inf=0D - AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.inf=0D - AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf=0D - AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.inf=0D - AdvancedFeaturePkg/S3/S3Pei.inf=0D - AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasicDxe.inf=0D -=0D -[BuildOptions]=0D - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeI= nclude.dsc b/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeI= nclude.dsc deleted file mode 100644 index fceaadc100..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.= dsc +++ /dev/null @@ -1,19 +0,0 @@ -## @file=0D -# Platform description.=0D -#=0D -# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -=0D - #=0D - # UEFI network modules=0D - #=0D - !include NetworkPkg/NetworkComponents.dsc.inc=0D -=0D -!if gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable =3D=3D TRUE=0D - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf=0D -!endif=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedPeiI= nclude.dsc b/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedPeiI= nclude.dsc deleted file mode 100644 index 86b1ebfed0..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedPeiInclude.= dsc +++ /dev/null @@ -1,9 +0,0 @@ -## @file=0D -# Platform description.=0D -#=0D -# Copyright (c) 2017, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLate= Include.fdf b/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLat= eInclude.fdf deleted file mode 100644 index d980e673a8..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude= .fdf +++ /dev/null @@ -1,20 +0,0 @@ -## @file=0D -# FDF file of Platform.=0D -#=0D -# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -=0D -#=0D -# UEFI network modules=0D -#=0D -!include NetworkPkg/Network.fdf.inc=0D -=0D -!if gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable =3D=3D TRUE=0D -INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf=0D -!endif=0D -=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPost= MemoryInclude.fdf b/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvan= cedPostMemoryInclude.fdf deleted file mode 100644 index 3c2716d672..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPostMemoryI= nclude.fdf +++ /dev/null @@ -1,8 +0,0 @@ -## @file=0D -# FDF file of Platform.=0D -#=0D -# Copyright (c) 2017, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPreM= emoryInclude.fdf b/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvanc= edPreMemoryInclude.fdf deleted file mode 100644 index 5b21f781a7..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPreMemoryIn= clude.fdf +++ /dev/null @@ -1,9 +0,0 @@ -## @file=0D -# FDF file of Platform.=0D -#=0D -# Copyright (c) 2017, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c b/Pla= tform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c deleted file mode 100644 index 990b4b9e83..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.c +++ /dev/null @@ -1,257 +0,0 @@ -/** @file=0D - BMC ACPI.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -//=0D -// Statements that include other header files=0D -//=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#ifndef EFI_ACPI_CREATOR_ID=0D -#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('M', 'S', 'F', 'T')=0D -#endif=0D -#ifndef EFI_ACPI_CREATOR_REVISION=0D -#define EFI_ACPI_CREATOR_REVISION 0x0100000D=0D -#endif=0D -=0D -/**=0D -=0D - Locate the first instance of a protocol. If the protocol requested is a= n=0D - FV protocol, then it will return the first FV that contains the ACPI tab= le=0D - storage file.=0D -=0D - @param Protocol - The protocol to find.=0D - Instance - Return pointer to the first instance of the protocol.=0D - Type - The type of protocol to locate.=0D -=0D - @retval EFI_SUCCESS - The function completed successfully.=0D - @retval EFI_NOT_FOUND - The protocol could not be located.=0D - @retval EFI_OUT_OF_RESOURCES - There are not enough resources to find = the protocol.=0D -=0D -**/=0D -EFI_STATUS=0D -LocateSupportProtocol (=0D - IN EFI_GUID *Protocol,=0D - OUT VOID **Instance,=0D - IN UINT32 Type=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_HANDLE *HandleBuffer;=0D - UINTN NumberOfHandles;=0D - EFI_FV_FILETYPE FileType;=0D - UINT32 FvStatus =3D 0;=0D - EFI_FV_FILE_ATTRIBUTES Attributes;=0D - UINTN Size;=0D - UINTN Index;=0D -=0D - Status =3D gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, &NumberO= fHandles, &HandleBuffer);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D - //=0D - // Looking for FV with ACPI storage file=0D - //=0D - for (Index =3D 0; Index < NumberOfHandles; Index++) {=0D - Status =3D gBS->HandleProtocol (HandleBuffer[Index], Protocol, Instanc= e);=0D - ASSERT (!EFI_ERROR (Status));=0D -=0D - if (!Type) {=0D - //=0D - // Not looking for the FV protocol, so find the first instance of th= e=0D - // protocol. There should not be any errors because our handle buff= er=0D - // should always contain at least one or LocateHandleBuffer would ha= ve=0D - // returned not found.=0D - //=0D - break;=0D - }=0D - //=0D - // See if it has the ACPI storage file=0D - //=0D - Status =3D ((EFI_FIRMWARE_VOLUME2_PROTOCOL *) (*Instance))->ReadFile (= =0D - *Instance,=0D - &gEfiCallerI= dGuid,=0D - NULL,=0D - &Size,=0D - &FileType,=0D - &Attributes,= =0D - &FvStatus=0D - );=0D -=0D - //=0D - // If we found it, then we are done=0D - //=0D - if (!EFI_ERROR (Status)) {=0D - break;=0D - }=0D - }=0D -=0D - gBS->FreePool (HandleBuffer);=0D - return Status;=0D -}=0D -=0D -=0D -EFI_STATUS=0D -UpdateDeviceSsdtTable (=0D - IN OUT EFI_ACPI_COMMON_HEADER *Table=0D - )=0D -{=0D - EFI_ACPI_DESCRIPTION_HEADER *TableHeader =3D NULL;=0D - UINT64 TempOemTableId;=0D - UINT8 *DataPtr;=0D - EFI_ACPI_IO_PORT_DESCRIPTOR *IoRsc;=0D -=0D - TableHeader =3D (EFI_ACPI_DESCRIPTION_HEADER *)Table;=0D -=0D - //=0D - // Update the OEMID and OEM Table ID.=0D - //=0D - CopyMem (&TableHeader->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof(Ta= bleHeader->OemId));=0D - TempOemTableId =3D PcdGet64 (PcdAcpiDefaultOemTableId);=0D - CopyMem (&TableHeader->OemTableId, &TempOemTableId, sizeof(UINT64));=0D - TableHeader->CreatorId =3D EFI_ACPI_CREATOR_ID;=0D - TableHeader->CreatorRevision =3D EFI_ACPI_CREATOR_REVISION;=0D -=0D - //=0D - // Update IO(Decode16, 0xCA2, 0xCA2, 0, 2)=0D - //=0D - DEBUG ((DEBUG_INFO, "UpdateDeviceSsdtTable - IPMI\n"));=0D - for (DataPtr =3D (UINT8 *)(Table + 1);=0D - DataPtr < (UINT8 *) ((UINT8 *) Table + Table->Length - 4);=0D - DataPtr++) {=0D - if (CompareMem(DataPtr, "_CRS", 4) =3D=3D 0) {=0D - DataPtr +=3D 4; // Skip _CRS=0D - ASSERT (*DataPtr =3D=3D AML_BUFFER_OP);=0D - DataPtr ++; // Skip AML_BUFFER_OP=0D - ASSERT ((*DataPtr & (BIT7|BIT6)) =3D=3D 0);=0D - DataPtr ++; // Skip PkgLength - 0xD=0D - ASSERT ((*DataPtr) =3D=3D AML_BYTE_PREFIX);=0D - DataPtr ++; // Skip BufferSize OpCode=0D - DataPtr ++; // Skip BufferSize - 0xA=0D - IoRsc =3D (VOID *)DataPtr;=0D - ASSERT (IoRsc->Header.Bits.Type =3D=3D ACPI_SMALL_ITEM_FLAG);=0D - ASSERT (IoRsc->Header.Bits.Name =3D=3D ACPI_SMALL_IO_PORT_DESCRIPTOR= _NAME);=0D - ASSERT (IoRsc->Header.Bits.Length =3D=3D sizeof(EFI_ACPI_IO_PORT_DES= CRIPTOR) - sizeof(ACPI_SMALL_RESOURCE_HEADER));=0D - DEBUG ((DEBUG_INFO, "IPMI IO Base in ASL update - 0x%04x <=3D 0x%04x= \n", IoRsc->BaseAddressMin, PcdGet16(PcdIpmiIoBaseAddress)));=0D - IoRsc->BaseAddressMin =3D PcdGet16(PcdIpmiIoBaseAddress);=0D - IoRsc->BaseAddressMax =3D PcdGet16(PcdIpmiIoBaseAddress);=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D -=0D - Entry point for Acpi platform driver.=0D -=0D - @param ImageHandle - A handle for the image that is initializing this = driver.=0D - @param SystemTable - A pointer to the EFI system table.=0D -=0D - @retval EFI_SUCCESS - Driver initialized successfully.=0D - @retval EFI_LOAD_ERROR - Failed to Initialize or has been loaded= .=0D - @retval EFI_OUT_OF_RESOURCES - Could not allocate needed resources.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -BmcAcpiEntryPoint (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_STATUS AcpiStatus;=0D -=0D - EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol;=0D - INTN Instance =3D 0;=0D - EFI_ACPI_COMMON_HEADER *CurrentTable =3D NULL;=0D - UINTN TableHandle =3D 0;=0D - UINT32 FvStatus;=0D - UINT32 Size;=0D -=0D - EFI_ACPI_TABLE_PROTOCOL *AcpiTable;=0D - UINTN TableSize;=0D -=0D -=0D - //=0D - // Find the AcpiTable protocol=0D - //=0D - Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID*= *)&AcpiTable);=0D - if (EFI_ERROR (Status)) {=0D - return EFI_ABORTED;=0D - }=0D -=0D - //=0D - // Locate the firmware volume protocol=0D - //=0D - Status =3D LocateSupportProtocol (&gEfiFirmwareVolume2ProtocolGuid, (VOI= D **) &FwVol, 1);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - Status =3D EFI_SUCCESS;=0D - Instance =3D 0;=0D -=0D - //=0D - // Read tables from the storage file.=0D - //=0D - while (!EFI_ERROR (Status)) {=0D - CurrentTable =3D NULL;=0D -=0D - Status =3D FwVol->ReadSection (=0D - FwVol,=0D - &gEfiCallerIdGuid,=0D - EFI_SECTION_RAW,=0D - Instance,=0D - (VOID **) &CurrentTable,=0D - (UINTN *) &Size,=0D - &FvStatus=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - //=0D - // Perform any table specific updates.=0D - //=0D - AcpiStatus =3D UpdateDeviceSsdtTable (CurrentTable);=0D - if (!EFI_ERROR (AcpiStatus)) {=0D -=0D - TableHandle =3D 0;=0D - TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Leng= th;=0D - ASSERT (Size >=3D TableSize);=0D -=0D - Status =3D AcpiTable->InstallAcpiTable (=0D - AcpiTable,=0D - CurrentTable,=0D - TableSize,=0D - &TableHandle=0D - );=0D -=0D - ASSERT_EFI_ERROR (Status);=0D - }=0D -=0D - //=0D - // Increment the instance=0D - //=0D - Instance++;=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.inf b/P= latform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.inf deleted file mode 100644 index 17b75dfbcc..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.inf +++ /dev/null @@ -1,48 +0,0 @@ -### @file=0D -# Component description file for BMC ACPI.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D BmcAcpi=0D - FILE_GUID =3D F59DAA23-D5D5-4d16-91FC-D03ABDC12FFE=0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D BmcAcpiEntryPoint=0D -=0D -[Sources]=0D - BmcAcpi.c=0D - BmcSsdt/BmcSsdt.asl=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - BaseMemoryLib=0D - DebugLib=0D - UefiLib=0D -=0D -[Protocols]=0D - gEfiFirmwareVolume2ProtocolGuid=0D - gEfiAcpiTableProtocolGuid=0D -=0D -[Pcd]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId=0D - gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId=0D -=0D -[Depex]=0D - gEfiAcpiTableProtocolGuid=0D -=0D -[BuildOptions] =0D - *_*_*_ASL_FLAGS =3D -oi=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/BmcSsdt= .asl b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/BmcSsdt.asl deleted file mode 100644 index 0daa175205..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/BmcSsdt.asl +++ /dev/null @@ -1,28 +0,0 @@ -/** @file=0D - BMC ACPI SSDT.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -DefinitionBlock (=0D - "BmcSsdt.aml",=0D - "SSDT",=0D - 0x02, // SSDT revision.=0D - // A Revision field value greater than or equal to 2 sig= nifies that integers =0D - // declared within the Definition Block are to be evalua= ted as 64-bit values=0D - "INTEL", // OEM ID (6 byte string)=0D - "BMCACPI", // OEM table ID (8 byte string)=0D - 0x0 // OEM version of DSDT table (4 byte Integer)=0D - )=0D -{=0D -=0D - External(\_SB.PC00.LPC0, DeviceObj)=0D - =0D - Scope (\_SB.PC00.LPC0) =0D - {=0D - #include "IpmiOprRegions.asi"=0D - } =0D -=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/IpmiOpr= Regions.asi b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/IpmiOp= rRegions.asi deleted file mode 100644 index d2ae5fc40a..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcSsdt/IpmiOprRegions= .asi +++ /dev/null @@ -1,58 +0,0 @@ -/** @file=0D - IPMI ACPI SSDT.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -Device(IPMC)=0D -{=0D - // Config DWord, modified during POST=0D - // Bit definitions are the same as PPMFlags:=0D - // [00] =3D Plug and Play BMC Detection enabled in setup=0D - // [31:01] =3D Reserved =3D 0=0D - =0D - Name(ECFL, 0x80000000)=0D - =0D - // Return the interface specification revision=0D - Method(_SRV)=0D - {=0D - // IPMI Specification Revision v2.0=0D - Return(0x0200) =0D - }=0D -=0D - Method(_STA, 0) =0D - { =0D - //=0D - // Assume OK=0D - //=0D - Store (0xF, Local0)=0D -=0D - Return(Local0)=0D -=0D - // Bit 0 - Set if the device is present.=0D - // Bit 1 - Set if the device is enabled and decoding its resources= .=0D - // Bit 2 - Set if the device should be shown in the UI.=0D - // Bit 3 - Set if the device is functioning properly (cleared if t= he device failed its diagnostics).=0D - // Bit 4 - Set if the battery is present.=0D - // Bit 5 - Reserved (must be cleared).=0D - } // end of _STA=0D -=0D - // Return the x86 resources consumed by BMC=0D - Name(_CRS, ResourceTemplate()=0D - {=0D - // Uses 8-bit ports 0xCA2-0xCA5=0D - IO(Decode16, 0xCA2, 0xCA2, 0, 2)=0D - })=0D -=0D - Name(_HID, "IPI0001") // IPMI device=0D - Name(_IFT, 0x1) // KCS system interface type=0D - Name(_STR, Unicode("IPMI_KCS"))=0D -=0D - Name(_UID, 0) // First interface.=0D -=0D -=0D -} // end of Device(IPMC)=0D -=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c b/Pla= tform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c deleted file mode 100644 index a6d075b19c..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c +++ /dev/null @@ -1,236 +0,0 @@ -/** @file=0D - BMC Event Log functions.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -EFI_STATUS=0D -EFIAPI=0D -CheckIfSelIsFull (=0D - VOID=0D - );=0D -=0D -/*++=0D -=0D - Routine Description:=0D - This function verifies the BMC SEL is full and When it is reports the = error to the Error Manager.=0D -=0D - Arguments:=0D - None=0D -=0D - Returns:=0D - EFI_SUCCESS=0D - EFI_DEVICE_ERROR=0D -=0D ---*/=0D -EFI_STATUS=0D -WaitTillErased (=0D - UINT8 *ResvId=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D -Arguments:=0D -=0D - BmcElogPrivateData - Bmc event log instance=0D - ResvId - Reserved ID=0D -=0D -Returns:=0D -=0D - EFI_SUCCESS=0D - EFI_NO_RESPONSE=0D -=0D ---*/=0D -{=0D - INTN Counter;=0D - IPMI_CLEAR_SEL_REQUEST ClearSel;=0D - IPMI_CLEAR_SEL_RESPONSE ClearSelResponse;=0D -=0D - Counter =3D 0x200;=0D - ZeroMem (&ClearSelResponse, sizeof(ClearSelResponse));=0D -=0D - while (TRUE) {=0D - ZeroMem (&ClearSel, sizeof(ClearSel));=0D - ClearSel.Reserve[0] =3D ResvId[0];=0D - ClearSel.Reserve[1] =3D ResvId[1];=0D - ClearSel.AscC =3D 0x43;=0D - ClearSel.AscL =3D 0x4C;=0D - ClearSel.AscR =3D 0x52;=0D - ClearSel.Erase =3D 0x00;=0D -=0D - IpmiClearSel (=0D - &ClearSel,=0D - &ClearSelResponse=0D - );=0D -=0D - if ((ClearSelResponse.ErasureProgress & 0xf) =3D=3D 1) {=0D - return EFI_SUCCESS;=0D - }=0D - //=0D - // If there is not a response from the BMC controller we need to retu= rn and not hang.=0D - //=0D - --Counter;=0D - if (Counter =3D=3D 0x0) {=0D - return EFI_NO_RESPONSE;=0D - }=0D - }=0D -}=0D -=0D -EFI_STATUS=0D -EfiActivateBmcElog (=0D - IN BOOLEAN *EnableElog,=0D - OUT BOOLEAN *ElogStatus=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D -Arguments:=0D -=0D - This - Protocol pointer=0D - DataType - indicate event log type=0D - EnableElog - Enable/Disable event log=0D - ElogStatus - return log status=0D -=0D -Returns:=0D -=0D - EFI_STATUS=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - UINT8 ElogStat;=0D - IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST SetBmcGlobalEnables;=0D - IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE GetBmcGlobalEnables;=0D - UINT8 CompletionCode;=0D -=0D - Status =3D EFI_SUCCESS;=0D - ElogStat =3D 0;=0D -=0D - Status =3D IpmiGetBmcGlobalEnables (&GetBmcGlobalEnables);=0D - if (EFI_ERROR(Status)) {=0D - return Status;=0D - }=0D -=0D - if (EnableElog =3D=3D NULL) {=0D - *ElogStatus =3D GetBmcGlobalEnables.GetEnables.Bits.SystemEventLogging= ;=0D - } else {=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - if (*EnableElog) {=0D - ElogStat =3D 1;=0D - }=0D -=0D - CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + 1, si= zeof(UINT8));=0D - SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging =3D ElogStat;= =0D -=0D - Status =3D IpmiSetBmcGlobalEnables (&SetBmcGlobalEnables, &Completio= nCode);=0D - }=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -SetElogRedirInstall (=0D - VOID=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D -Arguments:=0D -=0D - None=0D -=0D -Returns:=0D -=0D - EFI_SUCCESS=0D -=0D ---*/=0D -{=0D - BOOLEAN EnableElog;=0D - BOOLEAN ElogStatus;=0D -=0D - //=0D - // Activate the Event Log (This should depend upon Setup).=0D - //=0D - EfiActivateBmcElog (&EnableElog, &ElogStatus);=0D - return EFI_SUCCESS;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeBmcElogLayer (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D -Arguments:=0D -=0D - ImageHandle - ImageHandle of the loaded driver=0D - SystemTable - Pointer to the System Table=0D -=0D -Returns:=0D -=0D - EFI_STATUS=0D -=0D ---*/=0D -{=0D - SetElogRedirInstall ();=0D -=0D - CheckIfSelIsFull ();=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -CheckIfSelIsFull (=0D - VOID=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - This function verifies the BMC SEL is full and When it is reports the = error to the Error Manager.=0D -=0D - Arguments:=0D - None=0D -=0D - Returns:=0D - EFI_SUCCESS=0D - EFI_DEVICE_ERROR=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - UINT8 SelIsFull;=0D - IPMI_GET_SEL_INFO_RESPONSE SelInfo;=0D -=0D - Status =3D IpmiGetSelInfo (&SelInfo);=0D - if (EFI_ERROR (Status)) {=0D - return EFI_DEVICE_ERROR;=0D - }=0D -=0D - //=0D - // Check the Bit7 of the OperationByte if SEL is OverFlow.=0D - //=0D - SelIsFull =3D (SelInfo.OperationSupport & 0x80);=0D - DEBUG ((DEBUG_INFO, "SelIsFull - 0x%x\n", SelIsFull));=0D -=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.inf b/P= latform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.inf deleted file mode 100644 index 85591efb5d..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.inf +++ /dev/null @@ -1,34 +0,0 @@ -### @file=0D -# Component description file for BMC ELOG.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D BmcElog=0D - FILE_GUID =3D 8A17F6CA-BF1A-45C4-FFFF-FFFF0C829DDD=0D - MODULE_TYPE =3D DXE_DRIVER=0D - PI_SPECIFICATION_VERSION =3D 0x0001000A=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D InitializeBmcElogLayer=0D -=0D -[Sources]=0D - BmcElog.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiDriverEntryPoint=0D - DebugLib=0D - UefiBootServicesTableLib=0D - IpmiCommandLib=0D -=0D -[Depex]=0D - TRUE=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.c b/Platform= /Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.c deleted file mode 100644 index 74c52a74eb..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.c +++ /dev/null @@ -1,236 +0,0 @@ -/** @file=0D - IPMI FRB Driver.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -EFI_STATUS=0D -EfiDisableFrb (=0D - VOID=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - This routine disables the specified FRB timer.=0D -=0D - Arguments:=0D - This - This pointer=0D - FrbType - Type of FRB timer to get data on=0D -=0D - Returns:=0D - EFI_SUCCESS - FRB timer was disabled=0D - EFI_ABORTED - Timer was already stopped=0D - EFI_UNSUPPORTED - This type of FRB timer is not supported.=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer;=0D - UINT8 CompletionCode;=0D - IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer;=0D -=0D - Status =3D IpmiGetWatchdogTimer (&GetWatchdogTimer);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - //=0D - // Check if timer is still running, if not abort disable routine.=0D - //=0D - if (GetWatchdogTimer.TimerUse.Bits.TimerRunning =3D=3D 0) {=0D - return EFI_ABORTED;=0D - }=0D -=0D - ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer));=0D - //=0D - // Just flip the Timer Use bit. This should release the timer.=0D - //=0D - SetWatchdogTimer.TimerUse.Bits.TimerRunning =3D 0;=0D - SetWatchdogTimer.TimerUse.Bits.TimerUse =3D IPMI_WATCHDOG_TIMER_B= IOS_FRB2;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear &=3D ~BIT2;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear |=3D BIT1 | BIT4;=0D -=0D - Status =3D IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode);=0D - return Status;=0D -}=0D -=0D -VOID=0D -EFIAPI=0D -DisableFRB2Handler (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - Disables FRB2. This function gets called each time the=0D - EFI_EVENT_SIGNAL_READY_TO_BOOT gets signaled=0D -=0D - Arguments:=0D - Standard event notification function arguments:=0D - Event - the event that is signaled.=0D - Context - not used here.=0D -=0D - Returns:=0D -=0D ---*/=0D -{=0D - DEBUG((EFI_D_ERROR, "!!! enter DisableFRB2Handler()!!!\n"));=0D -=0D - EfiDisableFrb ();=0D -}=0D -=0D -EFI_STATUS=0D -CheckForAndReportErrors(=0D - VOID=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - Check the Watchdog timer expiration flags and report the kind of watch= dog=0D - timeout occurred to the Error Manager.=0D -=0D - Arguments:=0D -=0D - Returns:=0D - EFI_SUCCESS - Errors retrieved and reported=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer;=0D - IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer;=0D - UINT8 CompletionCode;=0D -=0D - //=0D - // Get the Watchdog timer info to find out what kind of timer expiration= occurred.=0D - //=0D - Status =3D IpmiGetWatchdogTimer (&GetWatchdogTimer);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D - //=0D - // If FRB2 Failure occurred, report it to the error manager and log a SE= L.=0D - //=0D - if ((GetWatchdogTimer.TimerUseExpirationFlagsClear & BIT1) !=3D 0) {=0D - //=0D - // Report the FRB2 time-out error=0D - //=0D - } else if ((GetWatchdogTimer.TimerUseExpirationFlagsClear & BIT3) !=3D 0= ) {=0D - //=0D - // Report the OS Watchdog timer failure=0D - //=0D - }=0D -=0D - //=0D - // Need to clear Timer expiration flags after checking.=0D - //=0D - ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer));=0D - SetWatchdogTimer.TimerUse =3D GetWatchdogTimer.Tim= erUse;=0D - SetWatchdogTimer.TimerActions =3D GetWatchdogTimer.Tim= erActions;=0D - SetWatchdogTimer.PretimeoutInterval =3D GetWatchdogTimer.Pre= timeoutInterval;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear =3D GetWatchdogTimer.Tim= erUseExpirationFlagsClear;=0D - SetWatchdogTimer.InitialCountdownValue =3D GetWatchdogTimer.Ini= tialCountdownValue;=0D - SetWatchdogTimer.TimerUse.Bits.TimerRunning =3D 1;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear |=3D BIT1 | BIT2 | BIT3;= =0D -=0D - Status =3D IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode);=0D -=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -ReportFrb2Status (=0D - VOID=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - This routine is built only when DEBUG_MODE is enabled. It is used=0D - to report the status of FRB2 when the FRB2 driver is installed.=0D -=0D - Arguments:=0D - none=0D -=0D - Returns:=0D - EFI_SUCCESS: All info was retrieved and reported=0D - EFI_ERROR: There was an error during info retrieval=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer;=0D -=0D - //=0D - // Get the Watchdog timer info to find out what kind of timer expiration= occurred.=0D - //=0D - Status =3D IpmiGetWatchdogTimer (&GetWatchdogTimer);=0D - if (EFI_ERROR (Status)) {=0D - DEBUG ((DEBUG_INFO, "Failed to get Watchdog Timer info from BMC.\n"));= =0D - return Status;=0D - }=0D -=0D - //=0D - // Check if timer is running, report status to DEBUG_MODE output.=0D - //=0D - if (GetWatchdogTimer.TimerUse.Bits.TimerRunning =3D=3D 1) {=0D - DEBUG ((DEBUG_INFO, "FRB2 Timer is running.\n"));=0D - } else {=0D - DEBUG ((DEBUG_INFO, "FRB2 Timer is not running.\n"));=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -FrbDxeEntryPoint (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - This is the standard EFI driver point. This function intitializes=0D - the private data required for creating FRB Driver.=0D -=0D - Arguments:=0D - ImageHandle - Handle for the image of this driver=0D - SystemTable - Pointer to the EFI System Table=0D -=0D - Returns:=0D - EFI_SUCCESS - Protocol successfully started and installed=0D - EFI_UNSUPPORTED - Protocol can't be started=0D -=0D ---*/=0D -{=0D - EFI_EVENT ReadyToBootEvent;=0D - EFI_STATUS Status;=0D -=0D - CheckForAndReportErrors();=0D - ReportFrb2Status ();=0D -=0D - //=0D - // Register the event to Disable FRB2 before Boot.=0D - //=0D - Status =3D EfiCreateEventReadyToBootEx (=0D - TPL_NOTIFY,=0D - DisableFRB2Handler,=0D - NULL,=0D - &ReadyToBootEvent=0D - );=0D -=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf b/Platfo= rm/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf deleted file mode 100644 index 3aa29889b1..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbDxe.inf +++ /dev/null @@ -1,37 +0,0 @@ -### @file=0D -# Component description file for IPMI FRB.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D FrbDxe=0D - FILE_GUID =3D F6C7812D-81BF-4e6d-A87D-E75AF17BD511=0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D FrbDxeEntryPoint=0D -=0D -[Sources]=0D - FrbDxe.c=0D - =0D -[Packages] =0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - MemoryAllocationLib=0D - UefiLib=0D - DebugLib=0D - BaseMemoryLib=0D - IpmiCommandLib=0D - PcdLib=0D - =0D -[Depex]=0D - TRUE=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.c b/Platform= /Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.c deleted file mode 100644 index 5d33df0103..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.c +++ /dev/null @@ -1,84 +0,0 @@ -/** @file=0D - IPMI FRB PEIM.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -VOID=0D -SetWatchDogTimer (=0D - IN BOOLEAN Frb2Enabled=0D - ) =0D -{=0D - EFI_STATUS Status;=0D - IPMI_SET_WATCHDOG_TIMER_REQUEST FrbTimer;=0D - IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer;=0D - UINT8 CompletionCode;=0D -=0D - Status =3D IpmiGetWatchdogTimer (&GetWatchdogTimer);=0D - if (EFI_ERROR(Status)) {=0D - return ;=0D - }=0D -=0D - if (Frb2Enabled) {=0D - ZeroMem (&FrbTimer, sizeof(FrbTimer));=0D - //Byte 1=0D - FrbTimer.TimerUse.Bits.TimerUse =3D IPMI_WATCHDOG_TIMER_BIOS_FRB2;=0D - //Byte 2 =0D - FrbTimer.TimerActions.Uint8 =3D 0; //NormalBoot, NoTimeOutInterrupt= . i.e no action when BMC watchdog timeout=0D - //Byte 3=0D - FrbTimer.PretimeoutInterval =3D 0;=0D - //Byte 4=0D - FrbTimer.TimerUseExpirationFlagsClear |=3D BIT1; //set Frb2Expiration= Flag=0D -=0D - //Data Byte 5/6=0D - FrbTimer.InitialCountdownValue =3D PcdGet16(PcdFRBTimeoutValue) * 10;= =0D -=0D - //Set BMC watchdog timer=0D - Status =3D IpmiSetWatchdogTimer (&FrbTimer, &CompletionCode);=0D - Status =3D IpmiResetWatchdogTimer (&CompletionCode);=0D - }=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeFrbPei (=0D - IN EFI_PEI_FILE_HANDLE FileHandle,=0D - IN CONST EFI_PEI_SERVICES **PeiServices=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D -Arguments:=0D -=0D - FfsHeader=0D - PeiServices=0D -=0D -Returns:=0D -=0D - EFI_SUCCESS=0D -=0D ---*/=0D -{=0D - BOOLEAN Frb2Enabled;=0D -=0D - //=0D - // If we are booting with defaults, then make sure FRB2 is enabled.=0D - //=0D - Frb2Enabled =3D PcdGetBool (PcdFRB2EnabledFlag);=0D -=0D - SetWatchDogTimer (Frb2Enabled);=0D -=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf b/Platfo= rm/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf deleted file mode 100644 index 1882453ffe..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Frb/FrbPei.inf +++ /dev/null @@ -1,37 +0,0 @@ -### @file=0D -# Component description file for IPMI FRB PEIM.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D FrbPei=0D - FILE_GUID =3D 7F9F9788-9F1F-4725-895C-3932F1A04DE8=0D - MODULE_TYPE =3D PEIM=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D InitializeFrbPei=0D -=0D -[Sources]=0D - FrbPei.c=0D -=0D -[Packages] =0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - PeimEntryPoint=0D - DebugLib=0D - BaseMemoryLib=0D - PcdLib=0D - IpmiCommandLib=0D -=0D -[Pcd]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue =0D -=0D -[Depex]=0D - TRUE=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/IpmiCom= mandLib.h b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/IpmiComm= andLib.h deleted file mode 100644 index 9b761717d4..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/IpmiCommandLib= .h +++ /dev/null @@ -1,235 +0,0 @@ -/** @file=0D - This library abstract how to send/receive IPMI command.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _IPMI_COMMAND_LIB_H_=0D -#define _IPMI_COMMAND_LIB_H_=0D -=0D -#include =0D -#include =0D -=0D -//=0D -// NetFnApp=0D -//=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetDeviceId (=0D - OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelfTestResult (=0D - OUT IPMI_SELF_TEST_RESULT_RESPONSE *SelfTestResult=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiResetWatchdogTimer (=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetWatchdogTimer (=0D - IN IPMI_SET_WATCHDOG_TIMER_REQUEST *SetWatchdogTimer,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetWatchdogTimer (=0D - OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE *GetWatchdogTimer=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetBmcGlobalEnables (=0D - IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST *SetBmcGlobalEnables,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetBmcGlobalEnables (=0D - OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE *GetBmcGlobalEnables=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiClearMessageFlags (=0D - IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST *ClearMessageFlagsRequest,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetMessageFlags (=0D - OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE *GetMessageFlagsResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetMessage (=0D - OUT IPMI_GET_MESSAGE_RESPONSE *GetMessageResponse,=0D - IN OUT UINT32 *GetMessageResponseSize=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSendMessage (=0D - IN IPMI_SEND_MESSAGE_REQUEST *SendMessageRequest,=0D - IN UINT32 SendMessageRequestSize,=0D - OUT IPMI_SEND_MESSAGE_RESPONSE *SendMessageResponse,=0D - IN OUT UINT32 *SendMessageResponseSize=0D - );=0D -=0D -//=0D -// NetFnTransport=0D -//=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSolActivating (=0D - IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetSolConfigurationParameters (=0D - IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST *SetConfigurationPara= metersRequest,=0D - IN UINT32 SetConfigurationParam= etersRequestSize,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSolConfigurationParameters (=0D - IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST *GetConfigurationPara= metersRequest,=0D - OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPara= metersResponse,=0D - IN OUT UINT32 *GetConfigurationPara= metersResponseSize=0D - );=0D -=0D -//=0D -// NetFnChasis=0D -//=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetChassisCapabilities (=0D - OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE *GetChassisCapabilitiesRespo= nse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetChassisStatus (=0D - OUT IPMI_GET_CHASSIS_STATUS_RESPONSE *GetChassisStatusResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiChassisControl (=0D - IN IPMI_CHASSIS_CONTROL_REQUEST *ChassisControlRequest,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetPowerRestorePolicy (=0D - IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST *ChassisControlRequest,=0D - OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE *ChassisControlResponse=0D - );=0D -=0D -//=0D -// NetFnStorage=0D -//=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetFruInventoryAreaInfo (=0D - IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoR= equest,=0D - OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE *GetFruInventoryAreaInfoR= esponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiReadFruData (=0D - IN IPMI_READ_FRU_DATA_REQUEST *ReadFruDataRequest,=0D - OUT IPMI_READ_FRU_DATA_RESPONSE *ReadFruDataResponse,=0D - IN OUT UINT32 *ReadFruDataResponseSize=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiWriteFruData (=0D - IN IPMI_WRITE_FRU_DATA_REQUEST *WriteFruDataRequest,=0D - IN UINT32 WriteFruDataRequestSize,=0D - OUT IPMI_WRITE_FRU_DATA_RESPONSE *WriteFruDataResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelInfo (=0D - OUT IPMI_GET_SEL_INFO_RESPONSE *GetSelInfoResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelEntry (=0D - IN IPMI_GET_SEL_ENTRY_REQUEST *GetSelEntryRequest,=0D - OUT IPMI_GET_SEL_ENTRY_RESPONSE *GetSelEntryResponse,=0D - IN OUT UINT32 *GetSelEntryResponseSize=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiAddSelEntry (=0D - IN IPMI_ADD_SEL_ENTRY_REQUEST *AddSelEntryRequest,=0D - OUT IPMI_ADD_SEL_ENTRY_RESPONSE *AddSelEntryResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiPartialAddSelEntry (=0D - IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST *PartialAddSelEntryRequest,=0D - IN UINT32 PartialAddSelEntryRequestSize,= =0D - OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE *PartialAddSelEntryResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiClearSel (=0D - IN IPMI_CLEAR_SEL_REQUEST *ClearSelRequest,=0D - OUT IPMI_CLEAR_SEL_RESPONSE *ClearSelResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelTime (=0D - OUT IPMI_GET_SEL_TIME_RESPONSE *GetSelTimeResponse=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetSelTime (=0D - IN IPMI_SET_SEL_TIME_REQUEST *SetSelTimeRequest,=0D - OUT UINT8 *CompletionCode=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSdrRepositoryInfo (=0D - OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE *GetSdrRepositoryInfoResp=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSdr (=0D - IN IPMI_GET_SDR_REQUEST *GetSdrRequest,=0D - OUT IPMI_GET_SDR_RESPONSE *GetSdrResponse,=0D - IN OUT UINT32 *GetSdrResponseSize=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/IpmiPla= tformHookLib.h b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/Ipm= iPlatformHookLib.h deleted file mode 100644 index 8359e3f38b..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Include/Library/IpmiPlatformHo= okLib.h +++ /dev/null @@ -1,23 +0,0 @@ -/** @file=0D - This library abstract the platform specific hook for IPMI.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _IPMI_PLATFORM_UPDATE_LIB_H_=0D -#define _IPMI_PLATFORM_UPDATE_LIB_H_=0D -=0D -#include =0D -#include =0D -#include =0D -=0D -EFI_STATUS=0D -EFIAPI=0D -PlatformIpmiIoRangeSet(=0D - UINT16 IpmiIoBase=0D - );=0D -=0D -#endif=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.c b/Pla= tform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.c deleted file mode 100644 index 58e1fb4d7e..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.c +++ /dev/null @@ -1,67 +0,0 @@ -/** @file=0D - IPMI FRU Driver.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeFru (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D - Initialize SM Redirection Fru Layer=0D -=0D -Arguments:=0D -=0D - ImageHandle - ImageHandle of the loaded driver=0D - SystemTable - Pointer to the System Table=0D -=0D -Returns:=0D -=0D - EFI_STATUS=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_GET_DEVICE_ID_RESPONSE ControllerInfo;=0D - IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST GetFruInventoryAreaInfoReques= t;=0D - IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE GetFruInventoryAreaInfoRespon= se;=0D -=0D - //=0D - // Get all the SDR Records from BMC and retrieve the Record ID from the= structure for future use.=0D - //=0D - Status =3D IpmiGetDeviceId (&ControllerInfo);=0D - if (EFI_ERROR (Status)) {=0D - DEBUG((DEBUG_ERROR, "!!! IpmiFru IpmiGetDeviceId Status=3D%x\n", Stat= us));=0D - return Status;=0D - }=0D -=0D - DEBUG((DEBUG_ERROR, "!!! IpmiFru FruInventorySupport %x\n", ControllerI= nfo.DeviceSupport.Bits.FruInventorySupport));=0D -=0D - if (ControllerInfo.DeviceSupport.Bits.FruInventorySupport) {=0D - GetFruInventoryAreaInfoRequest.DeviceId =3D 0;=0D - Status =3D IpmiGetFruInventoryAreaInfo (&GetFruInventoryAreaInfoReques= t, &GetFruInventoryAreaInfoResponse);=0D - if (EFI_ERROR (Status)) {=0D - DEBUG((DEBUG_ERROR, "!!! IpmiFru IpmiGetFruInventoryAreaInfo Status= =3D%x\n", Status));=0D - return Status;=0D - }=0D - DEBUG((DEBUG_ERROR, "!!! IpmiFru InventoryAreaSize=3D%x\n", GetFruInv= entoryAreaInfoResponse.InventoryAreaSize));=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.inf b/P= latform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.inf deleted file mode 100644 index a2556e92d2..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.inf +++ /dev/null @@ -1,35 +0,0 @@ -### @file=0D -# Component description file for IPMI FRU.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D IpmiFru=0D - FILE_GUID =3D 3F1D6464-2B4C-4640-BAC4-3DD905D26CDA=0D - MODULE_TYPE =3D DXE_DRIVER=0D - PI_SPECIFICATION_VERSION =3D 0x0001000A=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D InitializeFru=0D -=0D -[Sources]=0D - IpmiFru.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiDriverEntryPoint=0D - UefiLib=0D - DebugLib=0D - UefiBootServicesTableLib=0D - BaseMemoryLib=0D - IpmiCommandLib=0D -=0D -[Depex]=0D - TRUE=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.c = b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.c deleted file mode 100644 index fccbb3b5dc..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.c +++ /dev/null @@ -1,150 +0,0 @@ -/** @file=0D - IPMI stack initialization.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#define BMC_TIMEOUT 30 // [s] How long shall BIOS wait for BMC=0D -#define BMC_KCS_TIMEOUT 5 // [s] Single KSC request timeout=0D -=0D -EFI_STATUS=0D -GetSelfTest (=0D - VOID=0D - )=0D -/*++=0D -=0D -Routine Description:=0D -=0D - Execute the Get Self Test results command to determine whether or not th= e BMC self tests=0D - have passed=0D -=0D -Arguments:=0D -=0D - mIpmiInstance - Data structure describing BMC variables and used for s= ending commands=0D - StatusCodeValue - An array used to accumulate error codes for later repo= rting.=0D - ErrorCount - Counter used to keep track of error codes in StatusCod= eValue=0D -=0D -Returns: =0D -=0D - EFI_SUCCESS - BMC Self test results are retrieved and saved into B= mcStatus=0D - EFI_DEVICE_ERROR - BMC failed to return self test results.=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_SELF_TEST_RESULT_RESPONSE TestResult;=0D -=0D - //=0D - // Get the SELF TEST Results.=0D - //=0D - Status =3D IpmiGetSelfTestResult (&TestResult);=0D - if (EFI_ERROR(Status)) {=0D - DEBUG((DEBUG_ERROR, "\n[IPMI] BMC does not respond (status: %r)!\n\n",= Status));=0D - return Status;=0D - }=0D -=0D - DEBUG((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", TestResul= t.Result, TestResult.Param));=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -EFI_STATUS=0D -GetDeviceId (=0D - OUT BOOLEAN *UpdateMode=0D - )=0D -/*++=0D -=0D -Routine Description:=0D - Execute the Get Device ID command to determine whether or not the BMC is= in Force Update=0D - Mode. If it is, then report it to the error manager.=0D -=0D -Arguments:=0D -=0D -Returns: =0D - Status=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_GET_DEVICE_ID_RESPONSE BmcInfo;=0D - UINT32 Retries;=0D - =0D - //=0D - // Set up a loop to retry for up to 30 seconds. Calculate retries not ti= meout=0D - // so that in case KCS is not enabled and EfiIpmiSendCommand() returns=0D - // immediately we will not wait all the 30 seconds.=0D - //=0D - Retries =3D BMC_TIMEOUT / BMC_KCS_TIMEOUT + 1;=0D - //=0D - // Get the device ID information for the BMC.=0D - //=0D - do {=0D - Status =3D IpmiGetDeviceId (&BmcInfo);=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - DEBUG ((DEBUG_ERROR, "[IPMI] BMC does not respond (status: %r), %d ret= ries left\n", Status, Retries));=0D - MicroSecondDelay(50 * 1000);=0D - if (Retries-- =3D=3D 0) {=0D - return Status;=0D - }=0D - } while (TRUE);=0D -=0D - DEBUG((=0D - DEBUG_INFO,=0D - "[IPMI] BMC Device ID: 0x%02X, firmware version: %d.%02X\n",=0D - BmcInfo.DeviceId,=0D - BmcInfo.FirmwareRev1.Bits.MajorFirmwareRev,=0D - BmcInfo.MinorFirmwareRev=0D - ));=0D - *UpdateMode =3D (BOOLEAN)BmcInfo.FirmwareRev1.Bits.UpdateMode;=0D - return Status;=0D -}=0D -=0D -/**=0D - The entry point of the Ipmi DXE.=0D -=0D -@param[in] ImageHandle - Handle of this driver image=0D -@param[in] SystemTable - Table containing standard EFI services=0D -=0D -@retval EFI_SUCCESS - Always success is returned even if KCS does not func= tion=0D -=0D - **/=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiInterfaceInit (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - BOOLEAN UpdateMode;=0D - EFI_STATUS Status;=0D -=0D - DEBUG((EFI_D_ERROR,"IPMI Dxe:Get BMC Device Id\n"));=0D -=0D - //=0D - // Get the Device ID and check if the system is in Force Update mode.=0D - //=0D - Status =3D GetDeviceId (&UpdateMode);=0D - //=0D - // Do not continue initialization if the BMC is in Force Update Mode.=0D - //=0D - if (!EFI_ERROR(Status) && !UpdateMode) {=0D - //=0D - // Get the SELF TEST Results.=0D - //=0D - GetSelfTest ();=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.in= f b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.inf deleted file mode 100644 index 2e544270a3..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/DxeIpmiInit.inf +++ /dev/null @@ -1,34 +0,0 @@ -### @file=0D -# Component description file for IPMI initialization.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D DxeIpmiInit=0D - FILE_GUID =3D 07A01ACF-46D5-48de-A63D-74FA92AA8450= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D IpmiInterfaceInit=0D -=0D -[Sources]=0D - DxeIpmiInit.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - DebugLib=0D - UefiDriverEntryPoint=0D - IpmiCommandLib=0D - TimerLib=0D -=0D -[Depex]=0D - TRUE \ No newline at end of file diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c = b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c deleted file mode 100644 index 062d20c44e..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.c +++ /dev/null @@ -1,96 +0,0 @@ -/** @file=0D - IPMI stack initialization in PEI.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#define BMC_TIMEOUT_PEI 50 // [s] How long shall BIOS wait for BMC=0D -#define BMC_KCS_TIMEOUT 5 // [s] Single KSC request timeout=0D -=0D -EFI_STATUS=0D -GetDeviceId (=0D - OUT BOOLEAN *UpdateMode=0D - )=0D -/*++=0D -=0D -Routine Description:=0D - Execute the Get Device ID command to determine whether or not the BMC is= in Force Update=0D - Mode. If it is, then report it to the error manager.=0D -=0D -Arguments:=0D -=0D -Returns:=0D - Status=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_GET_DEVICE_ID_RESPONSE BmcInfo;=0D - UINT32 Retries;=0D -=0D - //=0D - // Set up a loop to retry for up to 30 seconds. Calculate retries not ti= meout=0D - // so that in case KCS is not enabled and EfiIpmiSendCommand() returns=0D - // immediately we will not wait all the 30 seconds.=0D - //=0D - Retries =3D BMC_TIMEOUT_PEI/ BMC_KCS_TIMEOUT + 1;=0D - //=0D - // Get the device ID information for the BMC.=0D - //=0D - do {=0D - Status =3D IpmiGetDeviceId (&BmcInfo);=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - DEBUG ((DEBUG_ERROR, "[IPMI] BMC does not respond (status: %r), %d ret= ries left\n", Status, Retries));=0D - if (Retries-- =3D=3D 0) {=0D - return Status;=0D - }=0D - } while (TRUE);=0D -=0D - DEBUG((=0D - DEBUG_INFO,=0D - "[IPMI] BMC Device ID: 0x%02X, firmware version: %d.%02X\n",=0D - BmcInfo.DeviceId,=0D - BmcInfo.FirmwareRev1.Bits.MajorFirmwareRev,=0D - BmcInfo.MinorFirmwareRev=0D - ));=0D - *UpdateMode =3D (BOOLEAN)BmcInfo.FirmwareRev1.Bits.UpdateMode;=0D - return Status;=0D -}=0D -=0D -/**=0D - The entry point of the Ipmi PEIM.=0D -=0D - @param FileHandle Handle of the file being invoked.=0D - @param PeiServices Describes the list of possible PEI Services.=0D -=0D - @retval EFI_SUCCESS Indicates that Ipmi initialization completed succe= ssfully.=0D - @retval Others Indicates that Ipmi initialization could not compl= ete successfully.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -PeimIpmiInterfaceInit (=0D - IN EFI_PEI_FILE_HANDLE FileHandle,=0D - IN CONST EFI_PEI_SERVICES **PeiServices=0D - )=0D -{=0D - BOOLEAN UpdateMode;=0D - EFI_STATUS Status;=0D -=0D - DEBUG ((DEBUG_INFO, "IPMI Peim:Get BMC Device Id\n"));=0D -=0D - //=0D - // Get the Device ID and check if the system is in Force Update mode.=0D - //=0D - Status =3D GetDeviceId (&UpdateMode);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.in= f b/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.inf deleted file mode 100644 index 5e00f4bd33..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.inf +++ /dev/null @@ -1,32 +0,0 @@ -### @file=0D -# Component description file for IPMI initialization in PEI.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D PeiIpmiInit=0D - FILE_GUID =3D D8F57F4E-D67D-4f2c-8351-C7092986542F= =0D - MODULE_TYPE =3D PEIM=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D PeimIpmiInterfaceInit=0D -=0D -[Sources]=0D - PeiIpmiInit.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - PeimEntryPoint=0D - DebugLib=0D - IpmiCommandLib=0D -=0D -[Depex]=0D - TRUE \ No newline at end of file diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/= IpmiCommandLib.inf b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCom= mandLib/IpmiCommandLib.inf deleted file mode 100644 index 89e7a66f60..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiCom= mandLib.inf +++ /dev/null @@ -1,32 +0,0 @@ -### @file=0D -# Component description file for IPMI Command Library.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D IpmiCommandLib=0D - FILE_GUID =3D E599C9C7-5913-40A0-8669-67282E2BEC53= =0D - MODULE_TYPE =3D UEFI_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D IpmiCommandLib=0D -=0D -[sources]=0D - IpmiCommandLibNetFnApp.c=0D - IpmiCommandLibNetFnTransport.c=0D - IpmiCommandLibNetFnChassis.c=0D - IpmiCommandLibNetFnStorage.c=0D - =0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseMemoryLib=0D - DebugLib=0D - IpmiLib=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/= IpmiCommandLibNetFnApp.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/I= pmiCommandLib/IpmiCommandLibNetFnApp.c deleted file mode 100644 index b57db50610..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiCom= mandLibNetFnApp.c +++ /dev/null @@ -1,248 +0,0 @@ -/** @file=0D - IPMI Command - NetFnApp.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetDeviceId (=0D - OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*DeviceId);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_DEVICE_ID,=0D - NULL,=0D - 0,=0D - (VOID *)DeviceId,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelfTestResult (=0D - OUT IPMI_SELF_TEST_RESULT_RESPONSE *SelfTestResult=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*SelfTestResult);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_SELFTEST_RESULTS,=0D - NULL,=0D - 0,=0D - (VOID *)SelfTestResult,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiResetWatchdogTimer (=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_RESET_WATCHDOG_TIMER,=0D - NULL,=0D - 0,=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetWatchdogTimer (=0D - IN IPMI_SET_WATCHDOG_TIMER_REQUEST *SetWatchdogTimer,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_SET_WATCHDOG_TIMER,=0D - (VOID *)SetWatchdogTimer,=0D - sizeof(*SetWatchdogTimer),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetWatchdogTimer (=0D - OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE *GetWatchdogTimer=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetWatchdogTimer);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_WATCHDOG_TIMER,=0D - NULL,=0D - 0,=0D - (VOID *)GetWatchdogTimer,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetBmcGlobalEnables (=0D - IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST *SetBmcGlobalEnables,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_SET_BMC_GLOBAL_ENABLES,=0D - (VOID *)SetBmcGlobalEnables,=0D - sizeof(*SetBmcGlobalEnables),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetBmcGlobalEnables (=0D - OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE *GetBmcGlobalEnables=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetBmcGlobalEnables);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_BMC_GLOBAL_ENABLES,=0D - NULL,=0D - 0,=0D - (VOID *)GetBmcGlobalEnables,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiClearMessageFlags (=0D - IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST *ClearMessageFlagsRequest,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_CLEAR_MESSAGE_FLAGS,=0D - (VOID *)ClearMessageFlagsRequest,=0D - sizeof(*ClearMessageFlagsRequest),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetMessageFlags (=0D - OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE *GetMessageFlagsResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetMessageFlagsResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_MESSAGE_FLAGS,=0D - NULL,=0D - 0,=0D - (VOID *)GetMessageFlagsResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetMessage (=0D - OUT IPMI_GET_MESSAGE_RESPONSE *GetMessageResponse,=0D - IN OUT UINT32 *GetMessageResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_GET_MESSAGE,=0D - NULL,=0D - 0,=0D - (VOID *)GetMessageResponse,=0D - GetMessageResponseSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSendMessage (=0D - IN IPMI_SEND_MESSAGE_REQUEST *SendMessageRequest,=0D - IN UINT32 SendMessageRequestSize,=0D - OUT IPMI_SEND_MESSAGE_RESPONSE *SendMessageResponse,=0D - IN OUT UINT32 *SendMessageResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_APP,=0D - IPMI_APP_SEND_MESSAGE,=0D - (VOID *)SendMessageRequest,=0D - SendMessageRequestSize,=0D - (VOID *)SendMessageResponse,=0D - SendMessageResponseSize=0D - );=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/= IpmiCommandLibNetFnChassis.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Libra= ry/IpmiCommandLib/IpmiCommandLibNetFnChassis.c deleted file mode 100644 index 1b86aa888e..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiCom= mandLibNetFnChassis.c +++ /dev/null @@ -1,101 +0,0 @@ -/** @file=0D - IPMI Command - NetFnChassis.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetChassisCapabilities (=0D - OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE *GetChassisCapabilitiesRespo= nse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetChassisCapabilitiesResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_CHASSIS,=0D - IPMI_CHASSIS_GET_CAPABILITIES,=0D - NULL,=0D - 0,=0D - (VOID *)GetChassisCapabilitiesResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetChassisStatus (=0D - OUT IPMI_GET_CHASSIS_STATUS_RESPONSE *GetChassisStatusResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetChassisStatusResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_CHASSIS,=0D - IPMI_CHASSIS_GET_STATUS,=0D - NULL,=0D - 0,=0D - (VOID *)GetChassisStatusResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiChassisControl (=0D - IN IPMI_CHASSIS_CONTROL_REQUEST *ChassisControlRequest,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_CHASSIS,=0D - IPMI_CHASSIS_CONTROL,=0D - (VOID *)ChassisControlRequest,=0D - sizeof(*ChassisControlRequest),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetPowerRestorePolicy (=0D - IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST *ChassisControlRequest,=0D - OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE *ChassisControlResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*ChassisControlResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_CHASSIS,=0D - IPMI_CHASSIS_SET_POWER_RESTORE_POLICY,=0D - (VOID *)ChassisControlRequest,=0D - sizeof(*ChassisControlRequest),=0D - (VOID *)ChassisControlResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/= IpmiCommandLibNetFnStorage.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Libra= ry/IpmiCommandLib/IpmiCommandLibNetFnStorage.c deleted file mode 100644 index 8e892c5f84..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiCom= mandLibNetFnStorage.c +++ /dev/null @@ -1,275 +0,0 @@ -/** @file=0D - IPMI Command - NetFnStorage.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetFruInventoryAreaInfo (=0D - IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoR= equest,=0D - OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE *GetFruInventoryAreaInfoR= esponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetFruInventoryAreaInfoResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO,=0D - (VOID *)GetFruInventoryAreaInfoRequest,=0D - sizeof(*GetFruInventoryAreaInfoRequest),=0D - (VOID *)GetFruInventoryAreaInfoResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiReadFruData (=0D - IN IPMI_READ_FRU_DATA_REQUEST *ReadFruDataRequest,=0D - OUT IPMI_READ_FRU_DATA_RESPONSE *ReadFruDataResponse,=0D - IN OUT UINT32 *ReadFruDataResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_READ_FRU_DATA,=0D - (VOID *)ReadFruDataRequest,=0D - sizeof(*ReadFruDataRequest),=0D - (VOID *)ReadFruDataResponse,=0D - ReadFruDataResponseSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiWriteFruData (=0D - IN IPMI_WRITE_FRU_DATA_REQUEST *WriteFruDataRequest,=0D - IN UINT32 WriteFruDataRequestSize,=0D - OUT IPMI_WRITE_FRU_DATA_RESPONSE *WriteFruDataResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*WriteFruDataResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_WRITE_FRU_DATA,=0D - (VOID *)WriteFruDataRequest,=0D - WriteFruDataRequestSize,=0D - (VOID *)WriteFruDataResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelInfo (=0D - OUT IPMI_GET_SEL_INFO_RESPONSE *GetSelInfoResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetSelInfoResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_SEL_INFO,=0D - NULL,=0D - 0,=0D - (VOID *)GetSelInfoResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelEntry (=0D - IN IPMI_GET_SEL_ENTRY_REQUEST *GetSelEntryRequest,=0D - OUT IPMI_GET_SEL_ENTRY_RESPONSE *GetSelEntryResponse,=0D - IN OUT UINT32 *GetSelEntryResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_SEL_ENTRY,=0D - (VOID *)GetSelEntryRequest,=0D - sizeof(*GetSelEntryRequest),=0D - (VOID *)GetSelEntryResponse,=0D - GetSelEntryResponseSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiAddSelEntry (=0D - IN IPMI_ADD_SEL_ENTRY_REQUEST *AddSelEntryRequest,=0D - OUT IPMI_ADD_SEL_ENTRY_RESPONSE *AddSelEntryResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*AddSelEntryResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_ADD_SEL_ENTRY,=0D - (VOID *)AddSelEntryRequest,=0D - sizeof(*AddSelEntryRequest),=0D - (VOID *)AddSelEntryResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiPartialAddSelEntry (=0D - IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST *PartialAddSelEntryRequest,=0D - IN UINT32 PartialAddSelEntryRequestSize,= =0D - OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE *PartialAddSelEntryResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*PartialAddSelEntryResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY,=0D - (VOID *)PartialAddSelEntryRequest,=0D - PartialAddSelEntryRequestSize,=0D - (VOID *)PartialAddSelEntryResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiClearSel (=0D - IN IPMI_CLEAR_SEL_REQUEST *ClearSelRequest,=0D - OUT IPMI_CLEAR_SEL_RESPONSE *ClearSelResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*ClearSelResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_CLEAR_SEL,=0D - (VOID *)ClearSelRequest,=0D - sizeof(*ClearSelRequest),=0D - (VOID *)ClearSelResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSelTime (=0D - OUT IPMI_GET_SEL_TIME_RESPONSE *GetSelTimeResponse=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetSelTimeResponse);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_SEL_TIME,=0D - NULL,=0D - 0,=0D - (VOID *)GetSelTimeResponse,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetSelTime (=0D - IN IPMI_SET_SEL_TIME_REQUEST *SetSelTimeRequest,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_SET_SEL_TIME,=0D - (VOID *)SetSelTimeRequest,=0D - sizeof(*SetSelTimeRequest),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSdrRepositoryInfo (=0D - OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE *GetSdrRepositoryInfoResp=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*GetSdrRepositoryInfoResp);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_SDR_REPOSITORY_INFO,=0D - NULL,=0D - 0,=0D - (VOID *)GetSdrRepositoryInfoResp,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSdr (=0D - IN IPMI_GET_SDR_REQUEST *GetSdrRequest,=0D - OUT IPMI_GET_SDR_RESPONSE *GetSdrResponse,=0D - IN OUT UINT32 *GetSdrResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_STORAGE,=0D - IPMI_STORAGE_GET_SDR,=0D - (VOID *)GetSdrRequest,=0D - sizeof(*GetSdrRequest),=0D - (VOID *)GetSdrResponse,=0D - GetSdrResponseSize=0D - );=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/= IpmiCommandLibNetFnTransport.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Lib= rary/IpmiCommandLib/IpmiCommandLibNetFnTransport.c deleted file mode 100644 index 3b9b17b909..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiCommandLib/IpmiCom= mandLibNetFnTransport.c +++ /dev/null @@ -1,81 +0,0 @@ -/** @file=0D - IPMI Command - NetFnTransport.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSolActivating (=0D - IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_TRANSPORT,=0D - IPMI_TRANSPORT_SOL_ACTIVATING,=0D - (VOID *)SolActivatingRequest,=0D - sizeof(*SolActivatingRequest),=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSetSolConfigurationParameters (=0D - IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST *SetConfigurationPara= metersRequest,=0D - IN UINT32 SetConfigurationParam= etersRequestSize,=0D - OUT UINT8 *CompletionCode=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINT32 DataSize;=0D -=0D - DataSize =3D sizeof(*CompletionCode);=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_TRANSPORT,=0D - IPMI_TRANSPORT_SET_SOL_CONFIG_PARAM,=0D - (VOID *)SetConfigurationParametersRequest,=0D - SetConfigurationParametersRequestSize,=0D - (VOID *)CompletionCode,=0D - &DataSize=0D - );=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiGetSolConfigurationParameters (=0D - IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST *GetConfigurationPara= metersRequest,=0D - OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPara= metersResponse,=0D - IN OUT UINT32 *GetConfigurationPara= metersResponseSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D IpmiSubmitCommand (=0D - IPMI_NETFN_TRANSPORT,=0D - IPMI_TRANSPORT_GET_SOL_CONFIG_PARAM,=0D - (VOID *)GetConfigurationParametersRequest,=0D - sizeof(*GetConfigurationParametersRequest),=0D - (VOID *)GetConfigurationParametersResponse,=0D - GetConfigurationParametersResponseSize=0D - );=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/Ipm= iLibNull.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/Ipm= iLibNull.c deleted file mode 100644 index db4c7ada7e..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/IpmiLibNul= l.c +++ /dev/null @@ -1,45 +0,0 @@ -/** @file=0D - IPMI library.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -=0D -#include =0D -=0D -/**=0D - This service enables submitting commands via Ipmi.=0D -=0D - @param[in] NetFunction Net function of the command.=0D - @param[in] Command IPMI Command.=0D - @param[in] RequestData Command Request Data.=0D - @param[in] RequestDataSize Size of Command Request Data.=0D - @param[out] ResponseData Command Response Data. The completi= on code is the first byte of response data.=0D - @param[in, out] ResponseDataSize Size of Command Response Data.=0D -=0D - @retval EFI_SUCCESS The command byte stream was successfully = submit to the device and a response was successfully received.=0D - @retval EFI_NOT_FOUND The command was not successfully sent to = the device or a response was not successfully received from the device.=0D - @retval EFI_NOT_READY Ipmi Device is not ready for Ipmi command= access.=0D - @retval EFI_DEVICE_ERROR Ipmi Device hardware error.=0D - @retval EFI_TIMEOUT The command time out.=0D - @retval EFI_UNSUPPORTED The command was not successfully sent to = the device.=0D - @retval EFI_OUT_OF_RESOURCES The resource allcation is out of resource= or data size error.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -IpmiSubmitCommand (=0D - IN UINT8 NetFunction,=0D - IN UINT8 Command,=0D - IN UINT8 *RequestData,=0D - IN UINT32 RequestDataSize,=0D - OUT UINT8 *ResponseData,=0D - IN OUT UINT32 *ResponseDataSize=0D - )=0D -{=0D - return EFI_UNSUPPORTED;=0D -}=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/Ipm= iLibNull.inf b/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/I= pmiLibNull.inf deleted file mode 100644 index c042b8beed..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiLibNull/IpmiLibNul= l.inf +++ /dev/null @@ -1,28 +0,0 @@ -### @file=0D -# Component description file for IPMI NULL Library.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D IpmiLibNull=0D - FILE_GUID =3D DDF0E1D9-F53F-429A-BD9C-5D12A321E625= =0D - MODULE_TYPE =3D UEFI_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D IpmiLib=0D -=0D -[sources]=0D - IpmiLibNull.c=0D - =0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D -=0D -[Pcd]=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlatformHoo= kLibNull/IpmiPlatformHookLibNull.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi= /Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.c deleted file mode 100644 index bdc8d23827..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlatformHookLibNul= l/IpmiPlatformHookLibNull.c +++ /dev/null @@ -1,36 +0,0 @@ -/** @file=0D - IPMI platform hook library.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -//=0D -// Prototype definitions for IPMI Platform Update Library=0D -//=0D -EFI_STATUS=0D -EFIAPI=0D -PlatformIpmiIoRangeSet(=0D - UINT16 IpmiIoBase=0D - )=0D -/*++=0D -=0D - Routine Description:=0D -=0D - This function sets IPMI Io range=0D -=0D - Arguments:=0D -=0D - IpmiIoBase=0D -=0D - Returns:=0D -=0D - Status=0D -=0D ---*/=0D -{=0D - return EFI_SUCCESS;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlatformHoo= kLibNull/IpmiPlatformHookLibNull.inf b/Platform/Intel/AdvancedFeaturePkg/Ip= mi/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf deleted file mode 100644 index 458b40f626..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/Library/IpmiPlatformHookLibNul= l/IpmiPlatformHookLibNull.inf +++ /dev/null @@ -1,29 +0,0 @@ -### @file=0D -# Component description file for IPMI platform Library.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D IpmiPlatformHookLibNull=0D - FILE_GUID =3D C31A5B17-81DB-4D86-B376-17711BB6E0A5= =0D - MODULE_TYPE =3D BASE=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D IpmiPlatformHookLib=0D -=0D -[sources]=0D - IpmiPlatformHookLibNull.c=0D - =0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - DebugLib=0D - =0D -[Protocols]=0D - gEfiIpmiTransportProtocolGuid=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c b/Platfor= m/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c deleted file mode 100644 index 25139eadba..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.c +++ /dev/null @@ -1,112 +0,0 @@ -/** @file=0D - IPMI Os watchdog timer Driver.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -BOOLEAN mOsWdtFlag =3D FALSE;=0D -=0D -EFI_EVENT mExitBootServicesEvent;=0D -=0D -VOID=0D -EFIAPI=0D -EnableEfiOsBootWdtHandler (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -/*++=0D -=0D -Routine Description:=0D - Enable the OS Boot Watchdog Timer.=0D - Is called only on legacy or EFI OS boot.=0D -=0D -Arguments:=0D - Event - Event type=0D - *Context - Context for the event=0D -=0D -Returns:=0D - None=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D - IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer;=0D - UINT8 CompletionCode;=0D - IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer;=0D - static BOOLEAN OsWdtEventHandled =3D FALSE;=0D -=0D - DEBUG((EFI_D_ERROR, "!!! EnableEfiOsBootWdtHandler()!!!\n"));=0D -=0D - //=0D - // Make sure it processes once only. And proceess it only if OsWdtFlag= =3D=3DTRUE;=0D - //=0D - if (OsWdtEventHandled || !mOsWdtFlag) {=0D - return ;=0D - }=0D -=0D - OsWdtEventHandled =3D TRUE;=0D -=0D - Status =3D IpmiGetWatchdogTimer (&GetWatchdogTimer);=0D - if (EFI_ERROR (Status)) {=0D - return ;=0D - }=0D -=0D - ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer));=0D - //=0D - // Just flip the Timer Use bit. This should release the timer.=0D - //=0D - SetWatchdogTimer.TimerUse.Bits.TimerRunning =3D 1;=0D - SetWatchdogTimer.TimerUse.Bits.TimerUse =3D IPMI_WATCHDOG_TIMER_O= S_LOADER;=0D - SetWatchdogTimer.TimerActions.Uint8 =3D IPMI_WATCHDOG_TIMER_A= CTION_HARD_RESET;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear &=3D ~BIT4;=0D - SetWatchdogTimer.TimerUseExpirationFlagsClear |=3D BIT1 | BIT2;=0D - SetWatchdogTimer.InitialCountdownValue =3D 600; // 100ms / count= =0D -=0D - Status =3D IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode);=0D - return ;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -DriverInit (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -/*++=0D -=0D -Routine Description:=0D - This is the standard EFI driver point. This function intitializes=0D - the private data required for creating ASRR Driver.=0D -=0D -Arguments:=0D - As required for DXE driver enrty routine.=0D - ImageHandle - ImageHandle of the loaded driver=0D - SystemTable - Pointer to the System Table=0D -=0D -Returns:=0D - @retval EFI_SUCCESS Protocol successfully started and installe= d.=0D - @retval EFI_OUT_OF_RESOURCES The event could not be allocated.=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status;=0D -=0D - Status =3D gBS->CreateEvent (=0D - EVT_SIGNAL_EXIT_BOOT_SERVICES,=0D - TPL_NOTIFY,=0D - EnableEfiOsBootWdtHandler,=0D - NULL,=0D - &mExitBootServicesEvent=0D - );=0D -=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf b/Platf= orm/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf deleted file mode 100644 index e49942c198..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf +++ /dev/null @@ -1,34 +0,0 @@ -### @file=0D -# Component description file for IPMI OS watch dog timer driver.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D OsWdt=0D - FILE_GUID =3D BE9B694A-B5D9-48e0-A527-6E1A49EB7028= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D DriverInit=0D -=0D -[Sources]=0D - OsWdt.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiDriverEntryPoint=0D - DebugLib=0D - UefiBootServicesTableLib=0D - BaseMemoryLib=0D - IpmiCommandLib=0D - =0D -[Depex]=0D - TRUE=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c b= /Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c deleted file mode 100644 index 47bec1975a..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.c +++ /dev/null @@ -1,164 +0,0 @@ -/** @file=0D - IPMI Serial Over Lan Driver.=0D -=0D -Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#define SOL_CMD_RETRY_COUNT 10=0D -=0D -/*++=0D -=0D -Routine Description:=0D -=0D - This routine gets the SOL payload status or settings for a specific ch= annel.=0D -=0D -Arguments:=0D - Channel - LAN channel naumber.=0D - ParamSel - Configuration parameter selection.=0D - Data - Information returned from BMC.=0D -Returns:=0D - EFI_SUCCESS - SOL configuration parameters are successfully read f= rom BMC.=0D - Others - SOL configuration parameters could not be read from = BMC.=0D -=0D ---*/=0D -EFI_STATUS=0D -GetSOLStatus (=0D - IN UINT8 Channel,=0D - IN UINT8 ParamSel,=0D - IN OUT UINT8 *Data=0D - )=0D -{=0D - EFI_STATUS Status =3D EFI_SUCCESS;=0D - IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST GetConfigurationParameter= sRequest;=0D - IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE GetConfigurationParameter= sResponse;=0D - UINT32 DataSize;=0D - UINT8 RetryCount;=0D -=0D - for (RetryCount =3D 0; RetryCount < SOL_CMD_RETRY_COUNT; RetryCount++) {= =0D - ZeroMem (&GetConfigurationParametersRequest, sizeof(GetConfigurationPa= rametersRequest));=0D - GetConfigurationParametersRequest.ChannelNumber.Bits.ChannelNumber =3D= Channel;=0D - GetConfigurationParametersRequest.ParameterSelector =3D= ParamSel;=0D -=0D - ZeroMem (&GetConfigurationParametersResponse, sizeof(GetConfigurationP= arametersResponse));=0D -=0D - DataSize =3D sizeof(GetConfigurationParametersResponse);=0D - Status =3D IpmiGetSolConfigurationParameters (=0D - &GetConfigurationParametersRequest,=0D - &GetConfigurationParametersResponse,=0D - &DataSize=0D - );=0D -=0D - if (Status =3D=3D EFI_SUCCESS){=0D - break;=0D - } else {=0D - gBS->Stall(100000);=0D - }=0D - }=0D -=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - *Data =3D GetConfigurationParametersResponse.ParameterData[0];=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/*++=0D -=0D -Routine Description:=0D -=0D - This routine sets the SOL payload configuration parameters for a speci= fic channel.=0D -=0D -Arguments:=0D - Channel - LAN channel naumber.=0D - ParamSel - Configuration parameter selection.=0D - Data - Configuration parameter values.=0D -Returns:=0D - EFI_SUCCESS - SOL configuration parameters are sent to BMC.=0D - Others - SOL configuration parameters could not be sent to BM= C.=0D -=0D ---*/=0D -EFI_STATUS=0D -SetSOLParams (=0D - IN UINT8 Channel,=0D - IN UINT8 ParamSel,=0D - IN UINT8 Data=0D - )=0D -{=0D - EFI_STATUS Status =3D EFI_SUCCESS;=0D - IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST SetConfigurationParameter= sRequest;=0D - UINT8 CompletionCode;=0D - UINT8 RetryCount;=0D -=0D - for (RetryCount =3D 0; RetryCount < SOL_CMD_RETRY_COUNT; RetryCount++) {= =0D - ZeroMem (&SetConfigurationParametersRequest, sizeof(SetConfigurationPa= rametersRequest));=0D - SetConfigurationParametersRequest.ChannelNumber.Bits.ChannelNumber =3D= Channel;=0D - SetConfigurationParametersRequest.ParameterSelector =3D= ParamSel;=0D - SetConfigurationParametersRequest.ParameterData[0] =3D= Data;=0D -=0D - CompletionCode =3D 0;=0D -=0D - Status =3D IpmiSetSolConfigurationParameters (=0D - &SetConfigurationParametersRequest,=0D - sizeof(SetConfigurationParametersRequest),=0D - &CompletionCode=0D - );=0D -=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - break;=0D - } else {=0D - gBS->Stall(100000);=0D - }=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -SolStatusEntryPoint (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -/*++=0D -=0D - Routine Description:=0D - This is the standard EFI driver point. This function intitializes=0D - the private data required for creating SOL Status Driver.=0D -=0D - Arguments:=0D - ImageHandle - Handle for the image of this driver=0D - SystemTable - Pointer to the EFI System Table=0D -=0D - Returns:=0D - EFI_SUCCESS - Protocol successfully installed=0D - EFI_UNSUPPORTED - Protocol can't be installed.=0D -=0D ---*/=0D -{=0D - EFI_STATUS Status =3D EFI_SUCCESS;=0D - UINT8 Channel;=0D - BOOLEAN SolEnabled =3D FALSE;=0D -=0D - for (Channel =3D 1; Channel <=3D PcdGet8 (PcdMaxSOLChannels); Channel++)= {=0D - Status =3D GetSOLStatus (Channel, IPMI_SOL_CONFIGURATION_PARAMETER_SOL= _ENABLE, &SolEnabled);=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - DEBUG ((DEBUG_ERROR, "SOL enabling status for channel %x is %x\n", C= hannel, SolEnabled));=0D - } else {=0D - DEBUG ((DEBUG_ERROR, "Failed to get channel %x SOL status from BMC!,= status is %x\n", Channel, Status));=0D - }=0D - }=0D -=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.inf= b/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.inf deleted file mode 100644 index 07f2c03f6a..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.inf +++ /dev/null @@ -1,38 +0,0 @@ -### @file=0D -# Component description file for IPMI Serial Over LAN driver.=0D -#=0D -# Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D SolStatus=0D - FILE_GUID =3D F9887B5E-2D46-4213-8794-14F1FD39F6B8=0D - MODULE_TYPE =3D DXE_DRIVER=0D - PI_SPECIFICATION_VERSION =3D 0x0001000A=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D SolStatusEntryPoint=0D -=0D -[Sources]=0D - SolStatus.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D - =0D -[Pcd]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels=0D - =0D -[LibraryClasses]=0D - UefiDriverEntryPoint=0D - DebugLib=0D - UefiBootServicesTableLib=0D - IpmiCommandLib=0D - PcdLib=0D -=0D -[Depex]=0D - TRUE=0D -=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c b/Platform/Intel/= AdvancedFeaturePkg/S3/S3Pei.c deleted file mode 100644 index b0aaa04962..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c +++ /dev/null @@ -1,36 +0,0 @@ -/** @file=0D - Source code file for S3 PEI module=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -=0D -/**=0D - S3 PEI module entry point=0D -=0D - @param[in] FileHandle Not used.=0D - @param[in] PeiServices General purpose services available to e= very PEIM.=0D -=0D - @retval EFI_SUCCESS The function completes successfully=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to create databa= se=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -S3PeiEntryPoint (=0D - IN EFI_PEI_FILE_HANDLE FileHandle,=0D - IN CONST EFI_PEI_SERVICES **PeiServices=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - //=0D - // Install EFI_PEI_MM_ACCESS_PPI for S3 resume case=0D - //=0D - Status =3D PeiInstallSmmAccessPpi ();=0D -=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf b/Platform/Inte= l/AdvancedFeaturePkg/S3/S3Pei.inf deleted file mode 100644 index 847edd20c0..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf +++ /dev/null @@ -1,31 +0,0 @@ -### @file=0D -# Component information file for the S3 PEI module.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010017=0D - BASE_NAME =3D S3Pei=0D - FILE_GUID =3D 8683EFB2-FDE1-4AFF-B2DB-E96449FDD4E9= =0D - VERSION_STRING =3D 1.0=0D - MODULE_TYPE =3D PEIM=0D - ENTRY_POINT =3D S3PeiEntryPoint=0D -=0D -[LibraryClasses]=0D - PeimEntryPoint=0D - PeiServicesLib=0D - SmmAccessLib=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - IntelSiliconPkg/IntelSiliconPkg.dec=0D -=0D -[Sources]=0D - S3Pei.c=0D -=0D -[Depex]=0D - gEfiPeiMemoryDiscoveredPpiGuid=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Smbios= Basic.h b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBas= ic.h deleted file mode 100644 index 944946b5b8..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasic.h +++ /dev/null @@ -1,45 +0,0 @@ -/** @file=0D - Smbios basic header file.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _SMBIOS_BASIC_DRIVER_H=0D -#define _SMBIOS_BASIC_DRIVER_H=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Add an SMBIOS record.=0D -=0D - @param Smbios The EFI_SMBIOS_PROTOCOL instance.=0D - @param SmbiosHandle A unique handle will be assigned to the SM= BIOS record.=0D - @param Record The data for the fixed portion of the SMBI= OS record. The format of the record is=0D - determined by EFI_SMBIOS_TABLE_HEADER.Type= . The size of the formatted area is defined =0D - by EFI_SMBIOS_TABLE_HEADER.Length and eith= er followed by a double-null (0x0000) or =0D - a set of null terminated strings and a nul= l.=0D -=0D - @retval EFI_SUCCESS Record was added.=0D - @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system= resources.=0D -=0D -**/=0D -EFI_STATUS=0D -AddSmbiosRecord (=0D - IN EFI_SMBIOS_PROTOCOL *Smbios,=0D - OUT EFI_SMBIOS_HANDLE *SmbiosHandle,=0D - IN EFI_SMBIOS_TABLE_HEADER *Record=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Smbios= BasicDxe.inf b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Smbi= osBasicDxe.inf deleted file mode 100644 index c3ec4f7885..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasicDx= e.inf +++ /dev/null @@ -1,83 +0,0 @@ -### @file=0D -# Component description file for Smbios Misc module.=0D -#=0D -# Copyright (c) 2018-2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D SmbiosBasic=0D - FILE_GUID =3D 03ADF4A1-A27A-45E3-B211-3177C6C2E7ED= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D SmbiosBasicEntryPoint=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC=0D -#=0D -=0D -[Sources]=0D - SmbiosBasicEntryPoint.c=0D - SmbiosBasic.h=0D - Type0BiosVendorFunction.c=0D - Type1SystemManufacturerFunction.c=0D - Type2BaseBoardManufacturerFunction.c=0D - Type3ChassisManufacturerFunction.c=0D - Type32BootInformationFunction.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - AdvancedFeaturePkg/AdvancedFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - PcdLib=0D - MemoryAllocationLib=0D - DevicePathLib=0D - BaseMemoryLib=0D - BaseLib=0D - DebugLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - UefiLib=0D - HobLib=0D -=0D -[Protocols]=0D - gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED= =0D - gEfiVariableArchProtocolGuid=0D - =0D -[Pcd]=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSerialNumber=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringAssetTag=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringLocationInChassis= =0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSerialNumber=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringAssetTag=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber=0D - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation=0D -=0D -[Depex]=0D - gEfiSmbiosProtocolGuid AND=0D - gEfiVariableArchProtocolGuid=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Smbios= BasicEntryPoint.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe= /SmbiosBasicEntryPoint.c deleted file mode 100644 index 8e68629ef6..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasicEn= tryPoint.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file=0D - Smbios basic entry point.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -BiosVendorFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -SystemManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -BaseBoardManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -ChassisManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -EFI_STATUS=0D -EFIAPI=0D -BootInfoStatusFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -typedef=0D -EFI_STATUS=0D -(EFIAPI EFI_BASIC_SMBIOS_DATA_FUNCTION) (=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - );=0D -=0D -typedef struct {=0D - EFI_BASIC_SMBIOS_DATA_FUNCTION *Function;=0D -} EFI_BASIC_SMBIOS_DATA;=0D -=0D -EFI_BASIC_SMBIOS_DATA mSmbiosBasicDataFuncTable[] =3D {=0D - {&BiosVendorFunction},=0D - {&SystemManufacturerFunction},=0D - {&BaseBoardManufacturerFunction},=0D - {&ChassisManufacturerFunction},=0D - {&BootInfoStatusFunction},=0D -};=0D -=0D -/**=0D - Standard EFI driver point. This driver parses the mSmbiosMiscDataTable= =0D - structure and reports any generated data using SMBIOS protocol.=0D -=0D - @param ImageHandle Handle for the image of this driver=0D - @param SystemTable Pointer to the EFI System Table=0D -=0D - @retval EFI_SUCCESS The data was successfully stored.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -SmbiosBasicEntryPoint(=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - UINTN Index;=0D - EFI_STATUS EfiStatus;=0D - EFI_SMBIOS_PROTOCOL *Smbios;=0D -=0D - EfiStatus =3D gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**= )&Smbios);=0D - if (EFI_ERROR(EfiStatus)) {=0D - DEBUG((EFI_D_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStat= us));=0D - return EfiStatus;=0D - }=0D -=0D - for (Index =3D 0; Index < sizeof(mSmbiosBasicDataFuncTable)/sizeof(mSmbi= osBasicDataFuncTable[0]); ++Index) {=0D - EfiStatus =3D (*mSmbiosBasicDataFuncTable[Index].Function) (Smbios);=0D - if (EFI_ERROR(EfiStatus)) {=0D - DEBUG((EFI_D_ERROR, "Basic smbios store error. Index=3D%d, ReturnSt= atus=3D%r\n", Index, EfiStatus));=0D - return EfiStatus;=0D - }=0D - }=0D -=0D - return EfiStatus;=0D -}=0D -=0D -/**=0D - Add an SMBIOS record.=0D -=0D - @param Smbios The EFI_SMBIOS_PROTOCOL instance.=0D - @param SmbiosHandle A unique handle will be assigned to the SM= BIOS record.=0D - @param Record The data for the fixed portion of the SMBI= OS record. The format of the record is=0D - determined by EFI_SMBIOS_TABLE_HEADER.Type= . The size of the formatted area is defined =0D - by EFI_SMBIOS_TABLE_HEADER.Length and eith= er followed by a double-null (0x0000) or =0D - a set of null terminated strings and a nul= l.=0D -=0D - @retval EFI_SUCCESS Record was added.=0D - @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system= resources.=0D -=0D -**/=0D -EFI_STATUS=0D -AddSmbiosRecord (=0D - IN EFI_SMBIOS_PROTOCOL *Smbios,=0D - OUT EFI_SMBIOS_HANDLE *SmbiosHandle,=0D - IN EFI_SMBIOS_TABLE_HEADER *Record=0D - )=0D -{=0D - *SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED;=0D - return Smbios->Add (=0D - Smbios,=0D - NULL,=0D - SmbiosHandle,=0D - Record=0D - );=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type0B= iosVendorFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicD= xe/Type0BiosVendorFunction.c deleted file mode 100644 index 331efc8614..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type0BiosVend= orFunction.c +++ /dev/null @@ -1,81 +0,0 @@ -/** @file=0D - Smbios type 0.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -/**=0D - This function makes boot time changes to the contents of the=0D - BiosVendor (Type 0).=0D -=0D - @retval EFI_SUCCESS All parameters were valid.=0D - @retval EFI_UNSUPPORTED Unexpected RecordType value.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter was found.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -BiosVendorFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - )=0D -{=0D - EFI_STATUS Status; =0D - CHAR8 *VendorStr;=0D - UINTN VendorStrLen;=0D - CHAR8 *VersionStr;=0D - UINTN VerStrLen;=0D - CHAR8 *DateStr;=0D - UINTN DateStrLen;=0D - SMBIOS_TABLE_TYPE0 *SmbiosRecord;=0D - SMBIOS_TABLE_TYPE0 *PcdSmbiosRecord;=0D - EFI_SMBIOS_HANDLE SmbiosHandle;=0D - UINTN StringOffset;=0D -=0D - PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType0BiosInformation);=0D -=0D - VendorStr =3D PcdGetPtr (PcdSmbiosType0StringVendor);=0D - VendorStrLen =3D AsciiStrLen (VendorStr);=0D - ASSERT (VendorStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - VersionStr =3D PcdGetPtr (PcdSmbiosType0StringBiosVersion);=0D - VerStrLen =3D AsciiStrLen (VersionStr);=0D - ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - DateStr =3D PcdGetPtr (PcdSmbiosType0StringBiosReleaseDate);=0D - DateStrLen =3D AsciiStrLen (DateStr);=0D - ASSERT (DateStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Two zeros following the last string.=0D - //=0D - SmbiosRecord =3D AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE0) + VendorS= trLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);=0D - if (SmbiosRecord =3D=3D NULL) {=0D - ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE0));=0D -=0D - SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_BIOS_INFORMATION;=0D - SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE0);=0D - SmbiosRecord->Hdr.Handle =3D 0;=0D -=0D - StringOffset =3D SmbiosRecord->Hdr.Length;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VendorStr, VendorStrLen);= =0D - StringOffset +=3D VendorStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen);=0D - StringOffset +=3D VerStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, DateStr, DateStrLen);=0D -=0D - //=0D - // Now we have got the full smbios record, call smbios protocol to add t= his record.=0D - //=0D - Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord);=0D -=0D - FreePool (SmbiosRecord);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type1S= ystemManufacturerFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/Smbi= osBasicDxe/Type1SystemManufacturerFunction.c deleted file mode 100644 index 2314d09695..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type1SystemMa= nufacturerFunction.c +++ /dev/null @@ -1,114 +0,0 @@ -/** @file=0D - Smbios type 1.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -/**=0D - This function makes boot time changes to the contents of the=0D - SystemManufacturer (Type 1).=0D -=0D - @retval EFI_SUCCESS All parameters were valid.=0D - @retval EFI_UNSUPPORTED Unexpected RecordType value.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter was found.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -SystemManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - )=0D -{=0D - EFI_STATUS Status; =0D - CHAR8 *ManufacturerStr;=0D - CHAR8 *ProductNameStr;=0D - CHAR8 *VersionStr;=0D - CHAR8 *SerialNumberStr;=0D - CHAR8 *SKUNumberStr;=0D - CHAR8 *FamilyStr;=0D - UINTN ManufacturerStrLen;=0D - UINTN ProductNameStrLen;=0D - UINTN VersionStrLen;=0D - UINTN SerialNumberStrLen;=0D - UINTN SKUNumberStrLen;=0D - UINTN FamilyStrLen;=0D - UINTN TableSize;=0D - SMBIOS_TABLE_TYPE1 *PcdSmbiosRecord;=0D - SMBIOS_TABLE_TYPE1 *SmbiosRecord;=0D - EFI_SMBIOS_HANDLE SmbiosHandle;=0D - UINTN StringOffset;=0D -=0D - PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType1SystemInformation);=0D -=0D - ManufacturerStr =3D PcdGetPtr (PcdSmbiosType1StringManufacturer);=0D - ManufacturerStrLen =3D AsciiStrLen (ManufacturerStr);=0D - ASSERT (ManufacturerStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - ProductNameStr =3D PcdGetPtr (PcdSmbiosType1StringProductName);=0D - ProductNameStrLen =3D AsciiStrLen (ProductNameStr);=0D - ASSERT (ProductNameStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - VersionStr =3D PcdGetPtr (PcdSmbiosType1StringVersion);=0D - VersionStrLen =3D AsciiStrLen (VersionStr);=0D - ASSERT (VersionStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - SerialNumberStr =3D PcdGetPtr (PcdSmbiosType1StringSerialNumber);=0D - SerialNumberStrLen =3D AsciiStrLen (SerialNumberStr);=0D - ASSERT (SerialNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - SKUNumberStr =3D PcdGetPtr (PcdSmbiosType1StringSKUNumber);=0D - SKUNumberStrLen =3D AsciiStrLen (SKUNumberStr);=0D - ASSERT (SKUNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - FamilyStr =3D PcdGetPtr (PcdSmbiosType1StringFamily);=0D - FamilyStrLen =3D AsciiStrLen (FamilyStr);=0D - ASSERT (FamilyStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Create table size based on string lengths=0D - //=0D - TableSize =3D sizeof (SMBIOS_TABLE_TYPE1) + ManufacturerStrLen + 1 + Pro= ductNameStrLen + 1 + VersionStrLen + 1 + SerialNumberStrLen + 1 + SKUNumber= StrLen + 1 + FamilyStrLen + 1 + 1;=0D - SmbiosRecord =3D AllocateZeroPool (TableSize);=0D - if (SmbiosRecord =3D=3D NULL) {=0D - ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE1));=0D -=0D - //=0D - // Fill in Type 1 fields=0D - //=0D -=0D - SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_SYSTEM_INFORMATION;=0D - SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE1);=0D - SmbiosRecord->Hdr.Handle =3D 0;=0D -=0D - //=0D - // Add strings to bottom of data block=0D - //=0D - StringOffset =3D SmbiosRecord->Hdr.Length;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, Manufact= urerStrLen);=0D - StringOffset +=3D ManufacturerStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ProductNameStr, ProductNa= meStrLen);=0D - StringOffset +=3D ProductNameStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VersionStrLen= );=0D - StringOffset +=3D VersionStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mberStrLen);=0D - StringOffset +=3D SerialNumberStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SKUNumberStr, SKUNumberSt= rLen);=0D - StringOffset +=3D SKUNumberStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, FamilyStr, FamilyStrLen);= =0D -=0D - //=0D - // Now we have got the full smbios record, call smbios protocol to add t= his record.=0D - //=0D - Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord);=0D -=0D - FreePool(SmbiosRecord);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type2B= aseBoardManufacturerFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/S= mbiosBasicDxe/Type2BaseBoardManufacturerFunction.c deleted file mode 100644 index 9193cb0be7..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type2BaseBoar= dManufacturerFunction.c +++ /dev/null @@ -1,131 +0,0 @@ -/** @file=0D - Smbios type 2.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -/**=0D - This function makes boot time changes to the contents of the=0D - BaseBoardManufacturer (Type 2).=0D -=0D - @retval EFI_SUCCESS All parameters were valid.=0D - @retval EFI_UNSUPPORTED Unexpected RecordType value.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter was found.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -BaseBoardManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR8 *ManufacturerStr;=0D - CHAR8 *ProductStr;=0D - CHAR8 *VersionStr;=0D - CHAR8 *SerialNumberStr;=0D - CHAR8 *AssertTagStr;=0D - CHAR8 *ChassisStr;=0D - UINTN ManuStrLen;=0D - UINTN ProductStrLen;=0D - UINTN VerStrLen;=0D - UINTN AssertTagStrLen;=0D - UINTN SerialNumStrLen;=0D - UINTN ChassisStrLen;=0D - EFI_SMBIOS_HANDLE SmbiosHandle;=0D - SMBIOS_TABLE_TYPE2 *PcdSmbiosRecord;=0D - SMBIOS_TABLE_TYPE2 *SmbiosRecord;=0D - UINTN SourceSize;=0D - UINTN TotalSize;=0D - UINTN StringOffset;=0D -=0D - PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType2BaseBoardInformation);=0D -=0D - //=0D - // Get BoardManufacturer String.=0D - //=0D - ManufacturerStr =3D PcdGetPtr (PcdSmbiosType2StringManufacturer);=0D - ManuStrLen =3D AsciiStrLen (ManufacturerStr);=0D - ASSERT (ManuStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get Board ProductName String.=0D - //=0D - ProductStr =3D PcdGetPtr (PcdSmbiosType2StringProductName);=0D - ProductStrLen =3D AsciiStrLen (ProductStr);=0D - ASSERT (ProductStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get Board Version String.=0D - //=0D - VersionStr =3D PcdGetPtr (PcdSmbiosType2StringVersion);=0D - VerStrLen =3D AsciiStrLen (VersionStr);=0D - ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get Board Serial Number String.=0D - //=0D - SerialNumberStr =3D PcdGetPtr (PcdSmbiosType2StringSerialNumber);=0D - SerialNumStrLen =3D AsciiStrLen (SerialNumberStr);=0D - ASSERT (SerialNumStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get Board Asset Tag String.=0D - //=0D - AssertTagStr =3D PcdGetPtr (PcdSmbiosType2StringAssetTag);=0D - AssertTagStrLen =3D AsciiStrLen (AssertTagStr);=0D - ASSERT (AssertTagStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get Board Chassis Location Tag String.=0D - //=0D - ChassisStr =3D PcdGetPtr (PcdSmbiosType2StringLocationInChassis);=0D - ChassisStrLen =3D AsciiStrLen (ChassisStr);=0D - ASSERT (ChassisStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Two zeros following the last string.=0D - //=0D - SourceSize =3D PcdGetSize (PcdSmbiosType2BaseBoardInformation);=0D - TotalSize =3D SourceSize + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLe= n + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen + 1 + 1;= =0D - SmbiosRecord =3D AllocateZeroPool(TotalSize);=0D - if (SmbiosRecord =3D=3D NULL) {=0D - ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - CopyMem (SmbiosRecord, PcdSmbiosRecord, SourceSize);=0D -=0D - SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_BASEBOARD_INFORMATION;=0D - SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE2);=0D - if (PcdSmbiosRecord->NumberOfContainedObjectHandles >=3D 2) {=0D - SmbiosRecord->Hdr.Length +=3D (PcdSmbiosRecord->NumberOfContainedObjec= tHandles - 1) * sizeof(PcdSmbiosRecord->ContainedObjectHandles);=0D - }=0D - ASSERT(SourceSize >=3D SmbiosRecord->Hdr.Length);=0D - SmbiosRecord->Hdr.Handle =3D 0;=0D -=0D - StringOffset =3D SmbiosRecord->Hdr.Length;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, ManuStrL= en);=0D - StringOffset +=3D ManuStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ProductStr, ProductStrLen= );=0D - StringOffset +=3D ProductStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen);=0D - StringOffset +=3D VerStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mStrLen);=0D - StringOffset +=3D SerialNumStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, AssertTagStr, AssertTagSt= rLen);=0D - StringOffset +=3D AssertTagStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ChassisStr, ChassisStrLen= );=0D -=0D - //=0D - // Now we have got the full smbios record, call smbios protocol to add t= his record.=0D - //=0D - Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord);=0D -=0D - FreePool(SmbiosRecord);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32= BootInformationFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/Smbios= BasicDxe/Type32BootInformationFunction.c deleted file mode 100644 index 87bfd045da..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type32BootInf= ormationFunction.c +++ /dev/null @@ -1,56 +0,0 @@ -/** @file=0D - Smbios type 32.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -=0D -/**=0D - This function makes boot time changes to the contents of the=0D - BootInformation (Type 32).=0D -=0D - @retval EFI_SUCCESS All parameters were valid.=0D - @retval EFI_UNSUPPORTED Unexpected RecordType value.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter was found.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -BootInfoStatusFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_SMBIOS_HANDLE SmbiosHandle;=0D - SMBIOS_TABLE_TYPE32 *PcdSmbiosRecord;=0D - SMBIOS_TABLE_TYPE32 *SmbiosRecord;=0D -=0D - PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType32SystemBootInformation);=0D -=0D - //=0D - // Two zeros following the last string.=0D - //=0D - SmbiosRecord =3D AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);= =0D - if (SmbiosRecord =3D=3D NULL) {=0D - ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE32));=0D -=0D - SmbiosRecord->Hdr.Type =3D EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;=0D - SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE32);=0D - SmbiosRecord->Hdr.Handle =3D 0;=0D -=0D - //=0D - // Now we have got the full smbios record, call smbios protocol to add t= his record.=0D - //=0D - Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord);=0D -=0D - FreePool(SmbiosRecord);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type3C= hassisManufacturerFunction.c b/Platform/Intel/AdvancedFeaturePkg/Smbios/Smb= iosBasicDxe/Type3ChassisManufacturerFunction.c deleted file mode 100644 index 33732bc9ca..0000000000 --- a/Platform/Intel/AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/Type3ChassisM= anufacturerFunction.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file=0D - Smbios type 3.=0D -=0D -Copyright (c) 2018, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "SmbiosBasic.h"=0D -=0D -/**=0D - This function makes boot time changes to the contents of the=0D - ChassisManufacturer (Type 3).=0D -=0D - @retval EFI_SUCCESS All parameters were valid.=0D - @retval EFI_UNSUPPORTED Unexpected RecordType value.=0D - @retval EFI_INVALID_PARAMETER Invalid parameter was found.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -ChassisManufacturerFunction(=0D - IN EFI_SMBIOS_PROTOCOL *Smbios=0D - )=0D -{=0D - UINTN ManuStrLen;=0D - UINTN VerStrLen;=0D - UINTN AssertTagStrLen;=0D - UINTN SerialNumStrLen;=0D - UINTN SKUNumberStrLen;=0D - EFI_STATUS Status;=0D - CHAR8 *ManufacturerStr;=0D - CHAR8 *VersionStr;=0D - CHAR8 *SerialNumberStr;=0D - CHAR8 *AssertTagStr;=0D - CHAR8 *SKUNumberStr;=0D - SMBIOS_TABLE_STRING *SKUNumberPtr;=0D - EFI_SMBIOS_HANDLE SmbiosHandle;=0D - SMBIOS_TABLE_TYPE3 *SmbiosRecord;=0D - SMBIOS_TABLE_TYPE3 *PcdSmbiosRecord;=0D - UINTN SourceSize;=0D - UINTN TotalSize;=0D - UINTN StringOffset;=0D -=0D - PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType3SystemEnclosureChassis);=0D -=0D - //=0D - // Get ChassisManufacturer String.=0D - //=0D - ManufacturerStr =3D PcdGetPtr (PcdSmbiosType3StringManufacturer);=0D - ManuStrLen =3D AsciiStrLen (ManufacturerStr);=0D - ASSERT (ManuStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get ChassisVersion String.=0D - //=0D - VersionStr =3D PcdGetPtr (PcdSmbiosType3StringVersion);=0D - VerStrLen =3D AsciiStrLen (VersionStr);=0D - ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get ChassisSerialNumber String.=0D - //=0D - SerialNumberStr =3D PcdGetPtr (PcdSmbiosType3StringSerialNumber);=0D - SerialNumStrLen =3D AsciiStrLen (SerialNumberStr);=0D - ASSERT (SerialNumStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get ChassisAssetTag String.=0D - //=0D - AssertTagStr =3D PcdGetPtr (PcdSmbiosType3StringAssetTag);=0D - AssertTagStrLen =3D AsciiStrLen (AssertTagStr);=0D - ASSERT (AssertTagStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Get ChassisSKUNumber String.=0D - //=0D - SKUNumberStr =3D PcdGetPtr (PcdSmbiosType3StringSKUNumber);=0D - SKUNumberStrLen =3D AsciiStrLen (SKUNumberStr);=0D - ASSERT (SKUNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH);=0D -=0D - //=0D - // Two zeros following the last string.=0D - //=0D - SourceSize =3D PcdGetSize(PcdSmbiosType3SystemEnclosureChassis);=0D - TotalSize =3D SourceSize + sizeof(SMBIOS_TABLE_STRING) + ManuStrLen + 1 = + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + SKUNumberStrL= en + 1 + 1;=0D - SmbiosRecord =3D AllocateZeroPool(TotalSize);=0D - if (SmbiosRecord =3D=3D NULL) {=0D - ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - CopyMem (SmbiosRecord, PcdSmbiosRecord, SourceSize);=0D -=0D - SmbiosRecord->Hdr.Type =3D EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE;=0D - SmbiosRecord->Hdr.Length =3D OFFSET_OF (SMBIOS_TABLE_TYPE3, ContainedEle= ments) + sizeof(SMBIOS_TABLE_STRING);=0D - if (PcdSmbiosRecord->ContainedElementCount >=3D 1) {=0D - SmbiosRecord->Hdr.Length +=3D PcdSmbiosRecord->ContainedElementCount *= PcdSmbiosRecord->ContainedElementRecordLength;=0D - }=0D - SmbiosRecord->Hdr.Handle =3D 0;=0D -=0D - if ((PcdSmbiosRecord->ContainedElementCount =3D=3D 0) || (SourceSize < (= UINTN)SmbiosRecord + SmbiosRecord->Hdr.Length)) {=0D - SKUNumberPtr =3D (SMBIOS_TABLE_STRING *)((UINTN)SmbiosRecord + SmbiosR= ecord->Hdr.Length - sizeof(SMBIOS_TABLE_STRING));=0D - *SKUNumberPtr =3D 5;=0D - }=0D -=0D - StringOffset =3D SmbiosRecord->Hdr.Length;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, ManuStrL= en);=0D - StringOffset +=3D ManuStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen);=0D - StringOffset +=3D VerStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mStrLen);=0D - StringOffset +=3D SerialNumStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, AssertTagStr, AssertTagSt= rLen);=0D - StringOffset +=3D AssertTagStrLen + 1;=0D - CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SKUNumberStr, SKUNumberSt= rLen);=0D -=0D - //=0D - // Now we have got the full smbios record, call smbios protocol to add t= his record.=0D - //=0D - Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord);=0D -=0D - FreePool(SmbiosRecord);=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl b/Platf= orm/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl deleted file mode 100644 index cbfe085b56..0000000000 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl +++ /dev/null @@ -1,103 +0,0 @@ -/** @file=0D - Acpi Debug ASL code.=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -DefinitionBlock (=0D - "AcpiDebug.aml",=0D - "SSDT",=0D - 2,=0D - "Intel ",=0D - "ADebTabl",=0D - 0x1000=0D - )=0D -{=0D - Scope(\)=0D - {=0D - //=0D - // These pointers are patched during POST.=0D - //=0D - Name (DPTR, 0x80000000) // Address of Acpi debug memory buffer, fixed = up during POST=0D - Name (EPTR, 0x80000000) // End of Acpi debug memory buffer, fixed up d= uring POST=0D - Name (CPTR, 0x80000000) // Current pointer used as an index into the b= uffer(starts after the Acpi Debug head), fixed up during POST=0D -=0D - //=0D - // Use a Mutex to prevent multiple calls from simutaneously writing to= the same memory.=0D - //=0D - Mutex (MMUT, 0)=0D -=0D - //=0D - // Operational region for SMI port access=0D - //=0D - OperationRegion (ADBP, SystemIO, 0xB2, 2)=0D - Field (ADBP, ByteAcc, NoLock, Preserve)=0D - {=0D - B2PT, 8,=0D - B3PT, 8,=0D - }=0D -=0D - //=0D - // Write a string to a memory buffer=0D - //=0D - Method (MDBG, 1, Serialized)=0D - {=0D - OperationRegion (ADHD, SystemMemory, DPTR, 32) // Operation region f= or Acpi Debug buffer first 0x20 bytes=0D - Field (ADHD, ByteAcc, NoLock, Preserve)=0D - {=0D - Offset (0x0),=0D - ASIG, 128, // 16 bytes is Signature=0D - Offset (0x10),=0D - ASIZ, 32, // 4 bytes is buffer size=0D - ACHP, 32, // 4 bytes is current head pointer, normally is DP= TR + 0x20,=0D - // if there's SMM handler to print, then it's th= e starting of the info hasn't been printed yet.=0D - ACTP, 32, // 4 bytes is current tail pointer, is the same as= CPTR=0D - SMIN, 8, // 1 byte of SMI Number for trigger callback=0D - WRAP, 8, // 1 byte of wrap status=0D - SMMV, 8, // 1 byte of SMM version status=0D - TRUN, 8 // 1 byte of truncate status=0D - }=0D -=0D - Store (Acquire (MMUT, 1000), Local0) // save Acquire result so we ca= n check for Mutex acquired=0D - If (LEqual (Local0, Zero)) // check for Mutex acquired=0D - {=0D - OperationRegion (ABLK, SystemMemory, CPTR, 32) // Operation region= to allow writes to ACPI debug buffer=0D - Field (ABLK, ByteAcc, NoLock, Preserve)=0D - {=0D - Offset (0x0),=0D - AAAA, 256 // 32 bytes is max size for string or data=0D - }=0D - ToHexString (Arg0, Local1) // convert argument to Hexadecimal Stri= ng=0D - Store (0, TRUN)=0D - If (LGreaterEqual (SizeOf (Local1), 32))=0D - {=0D - Store (1, TRUN) // the input from ASL >=3D 32=0D - }=0D - Mid (Local1, 0, 31, AAAA) // extract the input to current buffer=0D -=0D - Add (CPTR, 32, CPTR) // advance current pointer to next string loc= ation in memory buffer=0D - If (LGreaterEqual (CPTR, EPTR) ) // check for end of 64kb Acpi deb= ug buffer=0D - {=0D - Add (DPTR, 32, CPTR) // wrap around to beginning of buffer if th= e end has been reached=0D - Store (1, WRAP)=0D - }=0D - Store (CPTR, ACTP)=0D -=0D - If (SMMV)=0D - {=0D - //=0D - // Trigger the SMI to print=0D - //=0D - Store (SMIN, B2PT)=0D - }=0D - Release (MMUT)=0D - }=0D -=0D - Return (Local0) // return error code indicating whether Mutex was ac= quired=0D - }=0D -=0D - } // End Scope=0D -} // End SSDT=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c b/Platfor= m/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c deleted file mode 100644 index f99d80f687..0000000000 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c +++ /dev/null @@ -1,523 +0,0 @@ -/** @file=0D - Acpi Debug driver code.=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -=0D -#define ACPI_DEBUG_STR "INTEL ACPI DEBUG"=0D -=0D -//=0D -// ASL NAME structure=0D -//=0D -#pragma pack(1)=0D -typedef struct {=0D - UINT8 NameOp; // Byte [0]=3D0x08:NameOp.=0D - UINT32 NameString; // Byte [4:1]=3DName of object.=0D - UINT8 DWordPrefix; // Byte [5]=3D0x0C:DWord Prefix.=0D - UINT32 Value; // 0 ; Value of named object.=0D -} NAME_LAYOUT;=0D -#pragma pack()=0D -=0D -#pragma pack(1)=0D -typedef struct {=0D - UINT8 Signature[16]; // "INTEL ACPI DEBUG"=0D - UINT32 BufferSize; // Total size of Acpi Debug buffer including h= eader structure=0D - UINT32 Head; // Current buffer pointer for SMM to print out= =0D - UINT32 Tail; // Current buffer pointer for ASL to input=0D - UINT8 SmiTrigger; // Value to trigger the SMI via B2 port=0D - UINT8 Wrap; // If current Tail < Head=0D - UINT8 SmmVersion; // If SMM version=0D - UINT8 Truncate; // If the input from ASL > MAX_BUFFER_SIZE=0D -} ACPI_DEBUG_HEAD;=0D -#pragma pack()=0D -=0D -#define AD_SIZE sizeof (ACPI_DEBUG_HEAD) // This is 0x20=0D -=0D -#define MAX_BUFFER_SIZE 32=0D -=0D -UINT32 mBufferEnd =3D 0;=0D -ACPI_DEBUG_HEAD *mAcpiDebug =3D NULL;=0D -=0D -EFI_SMM_SYSTEM_TABLE2 *mSmst =3D NULL;=0D -=0D -/**=0D - Patch and load ACPI table.=0D -=0D - @param[in] AcpiDebugAddress Address of Acpi debug memory buffer.=0D - @param[in] BufferIndex Index that starts after the Acpi Debug hea= d.=0D - @param[in] BufferEnd End of Acpi debug memory buffer.=0D -=0D -**/=0D -VOID=0D -PatchAndLoadAcpiTable (=0D - IN ACPI_DEBUG_HEAD *AcpiDebugAddress,=0D - IN UINT32 BufferIndex,=0D - IN UINT32 BufferEnd=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_ACPI_TABLE_PROTOCOL *AcpiTable;=0D - UINTN Size;=0D - EFI_ACPI_DESCRIPTION_HEADER *TableHeader;=0D - UINTN TableKey;=0D - UINT8 *CurrPtr;=0D - UINT32 *Signature;=0D - NAME_LAYOUT *NamePtr;=0D - UINT8 UpdateCounter;=0D -=0D - Status =3D GetSectionFromFv (=0D - &gEfiCallerIdGuid,=0D - EFI_SECTION_RAW,=0D - 0,=0D - (VOID **) &TableHeader,=0D - &Size=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return;=0D - }=0D -=0D - //=0D - // This is Acpi Debug SSDT. Acpi Debug should be enabled if we reach her= e so load the table.=0D - //=0D - ASSERT (((EFI_ACPI_DESCRIPTION_HEADER *) TableHeader)->OemTableId =3D=3D= SIGNATURE_64 ('A', 'D', 'e', 'b', 'T', 'a', 'b', 'l'));=0D -=0D - //=0D - // Patch some pointers for the ASL code before loading the SSDT.=0D - //=0D -=0D - //=0D - // Count pointer updates, so we can stop after all three pointers are pa= tched.=0D - //=0D - UpdateCounter =3D 1;=0D - for (CurrPtr =3D (UINT8 *) TableHeader; CurrPtr <=3D ((UINT8 *) TableHea= der + TableHeader->Length) && UpdateCounter < 4; CurrPtr++) {=0D - Signature =3D (UINT32 *) (CurrPtr + 1);=0D - //=0D - // patch DPTR (address of Acpi debug memory buffer)=0D - //=0D - if ((*CurrPtr =3D=3D AML_NAME_OP) && *Signature =3D=3D SIGNATURE_32 ('= D', 'P', 'T', 'R')) {=0D - NamePtr =3D (NAME_LAYOUT *) CurrPtr;=0D - NamePtr->Value =3D (UINT32) (UINTN) AcpiDebugAddress;=0D - UpdateCounter++;=0D - }=0D - //=0D - // patch EPTR (end of Acpi debug memory buffer)=0D - //=0D - if ((*CurrPtr =3D=3D AML_NAME_OP) && *Signature =3D=3D SIGNATURE_32 ('= E', 'P', 'T', 'R')) {=0D - NamePtr =3D (NAME_LAYOUT *) CurrPtr;=0D - NamePtr->Value =3D BufferEnd;=0D - UpdateCounter++;=0D - }=0D - //=0D - // patch CPTR (used as an index that starts after the Acpi Debug head)= =0D - //=0D - if ((*CurrPtr =3D=3D AML_NAME_OP) && *Signature =3D=3D SIGNATURE_32 ('= C', 'P', 'T', 'R')) {=0D - NamePtr =3D (NAME_LAYOUT *) CurrPtr;=0D - NamePtr->Value =3D BufferIndex;=0D - UpdateCounter++;=0D - }=0D - }=0D -=0D - //=0D - // Add the table=0D - //=0D - Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **)&AcpiTable);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - goto Done;=0D - }=0D -=0D - TableKey =3D 0;=0D - Status =3D AcpiTable->InstallAcpiTable (=0D - AcpiTable,=0D - TableHeader,=0D - Size,=0D - &TableKey=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - goto Done;=0D - }=0D -=0D -Done:=0D - gBS->FreePool (TableHeader);=0D - return ;=0D -}=0D -=0D -/**=0D - Allocate Acpi Debug memory.=0D -=0D - @param[out] BufferSize Pointer to Acpi debug memory buffer size.=0D -=0D - @return Address of Acpi debug memory buffer. 0 if PcdAcpiDebugEnable is = FALSE.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -AllocateAcpiDebugMemory (=0D - OUT UINT32 *BufferSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_PHYSICAL_ADDRESS AcpiDebugAddress;=0D - UINTN PagesNum;=0D -=0D - AcpiDebugAddress =3D 0;=0D - *BufferSize =3D 0;=0D -=0D - if (PcdGetBool (PcdAcpiDebugEnable)) {=0D - //=0D - // Reserve memory to store Acpi Debug data.=0D - //=0D - AcpiDebugAddress =3D 0xFFFFFFFF;=0D - PagesNum =3D EFI_SIZE_TO_PAGES (PcdGet32 (PcdAcpiDebugBufferSize));=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,=0D - EfiReservedMemoryType,=0D - PagesNum,=0D - &AcpiDebugAddress=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return 0;=0D - }=0D -=0D - DEBUG ((DEBUG_INFO, "AcpiDebugAddress - 0x%08x\n", AcpiDebugAddress));= =0D -=0D - Status =3D PcdSet32S (PcdAcpiDebugAddress, (UINT32) AcpiDebugAddress);= =0D - ASSERT_EFI_ERROR (Status);=0D -=0D - if (EFI_ERROR (Status)) {=0D - gBS->FreePages (AcpiDebugAddress, PagesNum);=0D - return 0;=0D - }=0D -=0D - *BufferSize =3D PcdGet32 (PcdAcpiDebugBufferSize);=0D - }=0D -=0D - return AcpiDebugAddress;=0D -}=0D -=0D -/**=0D - Acpi Debug EndOfDxe notification.=0D -=0D - @param[in] Event Event whose notification function is being invoked= .=0D - @param[in] Context Pointer to the notification function's context.=0D -=0D -**/=0D -VOID=0D -EFIAPI=0D -AcpiDebugEndOfDxeNotification (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -{=0D - UINT32 BufferSize;=0D - UINT32 BufferIndex;=0D -=0D - mAcpiDebug =3D (ACPI_DEBUG_HEAD *) (UINTN) AllocateAcpiDebugMemory (&Buf= ferSize);=0D - if (mAcpiDebug !=3D NULL) {=0D - //=0D - // Init ACPI DEBUG buffer to lower case 'x'.=0D - //=0D - SetMem ((VOID *) mAcpiDebug, BufferSize, 0x78);=0D -=0D - //=0D - // Clear header of AD_SIZE bytes.=0D - //=0D - ZeroMem ((VOID *) mAcpiDebug, AD_SIZE);=0D -=0D - //=0D - // Write a signature to the first line of the buffer, "INTEL ACPI DEBU= G".=0D - //=0D - CopyMem ((VOID *) mAcpiDebug, ACPI_DEBUG_STR, sizeof (ACPI_DEBUG_STR) = - 1);=0D -=0D - BufferIndex =3D (UINT32) (UINTN) mAcpiDebug;=0D - mBufferEnd =3D BufferIndex + BufferSize;=0D -=0D - //=0D - // Leave the Index after the Acpi Debug head.=0D - //=0D - BufferIndex +=3D AD_SIZE;=0D -=0D - //=0D - // Patch and Load the SSDT ACPI Tables.=0D - //=0D - PatchAndLoadAcpiTable (mAcpiDebug, BufferIndex, mBufferEnd);=0D -=0D - mAcpiDebug->Head =3D BufferIndex;=0D - mAcpiDebug->Tail =3D BufferIndex;=0D - mAcpiDebug->BufferSize =3D BufferSize;=0D - }=0D -=0D - //=0D - // Close event, so it will not be invoked again.=0D - //=0D - gBS->CloseEvent (Event);=0D -=0D - return ;=0D -}=0D -=0D -/**=0D - Initialize ACPI Debug.=0D -=0D - @param[in] ImageHandle The firmware allocated handle for the EFI imag= e.=0D - @param[in] SystemTable A pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS The driver initializes correctly.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeAcpiDebugDxe (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_EVENT EndOfDxeEvent;=0D -=0D - //=0D - // Register EndOfDxe notification=0D - // that point could ensure the Acpi Debug related PCDs initialized.=0D - //=0D - Status =3D gBS->CreateEventEx (=0D - EVT_NOTIFY_SIGNAL,=0D - TPL_CALLBACK,=0D - AcpiDebugEndOfDxeNotification,=0D - NULL,=0D - &gEfiEndOfDxeEventGroupGuid,=0D - &EndOfDxeEvent=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Software SMI callback for ACPI Debug which is called from ACPI method.=0D -=0D - @param[in] DispatchHandle The unique handle assigned to this han= dler by SmiHandlerRegister().=0D - @param[in] Context Points to an optional handler context = which was specified when the=0D - handler was registered.=0D - @param[in, out] CommBuffer A pointer to a collection of data in m= emory that will=0D - be conveyed from a non-SMM environment= into an SMM environment.=0D - @param[in, out] CommBufferSize The size of the CommBuffer.=0D -=0D - @retval EFI_SUCCESS The interrupt was handled successfully= .=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -AcpiDebugSmmCallback (=0D - IN EFI_HANDLE DispatchHandle,=0D - IN CONST VOID *Context,=0D - IN OUT VOID *CommBuffer,=0D - IN OUT UINTN *CommBufferSize=0D - )=0D -{=0D - UINT8 Buffer[MAX_BUFFER_SIZE];=0D -=0D - //=0D - // Validate the fields in mAcpiDebug to ensure there is no harm to SMI h= andler.=0D - // mAcpiDebug is below 4GB and the start address of whole buffer.=0D - //=0D - if ((mAcpiDebug->BufferSize !=3D (mBufferEnd - (UINT32) (UINTN) mAcpiDeb= ug)) ||=0D - (mAcpiDebug->Head < (UINT32) ((UINTN) mAcpiDebug + AD_SIZE)) ||=0D - (mAcpiDebug->Head > mBufferEnd) ||=0D - (mAcpiDebug->Tail < (UINT32) ((UINTN) mAcpiDebug + AD_SIZE)) ||=0D - (mAcpiDebug->Tail > mBufferEnd)) {=0D - //=0D - // If some fields in mAcpiDebug are invaid, return directly.=0D - //=0D - return EFI_SUCCESS;=0D - }=0D -=0D - if (!(BOOLEAN)mAcpiDebug->Wrap && ((mAcpiDebug->Head >=3D (UINT32) ((UIN= TN) mAcpiDebug + AD_SIZE))=0D - && (mAcpiDebug->Head < mAcpiDebug->Tail))){=0D - //=0D - // If curent ----- buffer + 020=0D - // ...=0D - // ... Head=0D - // ... Data for SMM print=0D - // ... Tail=0D - // ... Vacant for ASL input=0D - // ----- buffer end=0D - //=0D - // skip NULL block=0D - //=0D - while ((*(CHAR8 *) (UINTN) mAcpiDebug->Head =3D=3D '\0') && (mAcpiDebu= g->Head < mAcpiDebug->Tail)) {=0D - mAcpiDebug->Head ++;=0D - }=0D -=0D - if (mAcpiDebug->Head < mAcpiDebug->Tail) {=0D - ZeroMem (Buffer, MAX_BUFFER_SIZE);=0D - AsciiStrnCpyS ((CHAR8 *) Buffer, MAX_BUFFER_SIZE, (CHAR8 *) (UINTN) = mAcpiDebug->Head, MAX_BUFFER_SIZE - 1);=0D -=0D - DEBUG ((DEBUG_INFO | DEBUG_ERROR, "%a%a\n", Buffer, (BOOLEAN) mAcpiD= ebug->Truncate ? "..." : ""));=0D - mAcpiDebug->Head +=3D MAX_BUFFER_SIZE;=0D -=0D - if (mAcpiDebug->Head >=3D (mAcpiDebug->Tail)) {=0D - //=0D - // When head =3D=3D tail, we do nothing in handler.=0D - //=0D - mAcpiDebug->Head =3D mAcpiDebug->Tail;=0D - }=0D - }=0D - } else if ((BOOLEAN) mAcpiDebug->Wrap && ((mAcpiDebug->Head > mAcpiDebug= ->Tail)=0D - && (mAcpiDebug->Head < (UINT32) ((UINTN) mAcpiDebug + mAcpiDebug->Buff= erSize)))){=0D - //=0D - // If curent ----- buffer + 020=0D - // ... Tail=0D - // ... Vacant for ASL input=0D - // ... Head=0D - // ... Data for SMM print=0D - // ----- buffer end=0D - //=0D - while ((*(CHAR8 *) (UINTN) mAcpiDebug->Head =3D=3D '\0') && (mAcpiDebu= g->Head < (UINT32) ((UINTN) mAcpiDebug + mAcpiDebug->BufferSize))) {=0D - mAcpiDebug->Head ++;=0D - }=0D - if (mAcpiDebug->Head < (UINT32) ((UINTN) mAcpiDebug + mAcpiDebug->Buff= erSize)){=0D - ZeroMem (Buffer, MAX_BUFFER_SIZE);=0D - AsciiStrnCpyS ((CHAR8 *) Buffer, MAX_BUFFER_SIZE, (CHAR8 *) (UINTN) = mAcpiDebug->Head, MAX_BUFFER_SIZE - 1);=0D - DEBUG ((DEBUG_INFO | DEBUG_ERROR, "%a%a\n", Buffer, (BOOLEAN) mAcpiD= ebug->Truncate ? "..." : ""));=0D - mAcpiDebug->Head +=3D MAX_BUFFER_SIZE;=0D -=0D - if (mAcpiDebug->Head >=3D (UINT32) ((UINTN) mAcpiDebug + mAcpiDebug-= >BufferSize)) {=0D - //=0D - // We met end of buffer.=0D - //=0D - mAcpiDebug->Wrap =3D 0;=0D - mAcpiDebug->Head =3D (UINT32) ((UINTN) mAcpiDebug + AD_SIZE);=0D - }=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Acpi Debug SmmEndOfDxe notification.=0D -=0D - @param[in] Protocol Points to the protocol's unique identifier.=0D - @param[in] Interface Points to the interface instance.=0D - @param[in] Handle The handle on which the interface was installed.=0D -=0D - @retval EFI_SUCCESS Notification runs successfully.=0D -=0D - **/=0D -EFI_STATUS=0D -EFIAPI=0D -AcpiDebugSmmEndOfDxeNotification (=0D - IN CONST EFI_GUID *Protocol,=0D - IN VOID *Interface,=0D - IN EFI_HANDLE Handle=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_SMM_SW_DISPATCH2_PROTOCOL *SwDispatch;=0D - EFI_SMM_SW_REGISTER_CONTEXT SwContext;=0D - EFI_HANDLE SwHandle;=0D -=0D - AcpiDebugEndOfDxeNotification (NULL, NULL);=0D -=0D - if (mAcpiDebug !=3D NULL) {=0D - //=0D - // Get the Sw dispatch protocol and register SMI callback function.=0D - //=0D - SwDispatch =3D NULL;=0D - Status =3D mSmst->SmmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, = NULL, (VOID **) &SwDispatch);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - SwContext.SwSmiInputValue =3D (UINTN) -1;=0D - Status =3D SwDispatch->Register (SwDispatch, AcpiDebugSmmCallback, &Sw= Context, &SwHandle);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - mAcpiDebug->SmiTrigger =3D (UINT8) SwContext.SwSmiInputValue;=0D - mAcpiDebug->SmmVersion =3D 1;=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize ACPI Debug.=0D -=0D - @param[in] ImageHandle The firmware allocated handle for the EFI imag= e.=0D - @param[in] SystemTable A pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS The driver initializes correctly.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeAcpiDebugSmm (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Registration;=0D - EFI_SMM_BASE2_PROTOCOL *SmmBase2;=0D - BOOLEAN InSmm;=0D -=0D - Status =3D gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID *= *) &SmmBase2);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - Status =3D SmmBase2->InSmm (SmmBase2, &InSmm);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - ASSERT (InSmm);=0D -=0D - if (!InSmm) {=0D - return EFI_UNSUPPORTED;=0D - }=0D -=0D - Status =3D SmmBase2->GetSmstLocation (SmmBase2, &mSmst);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - //=0D - // Register SmmEndOfDxe notification=0D - // that point could ensure the Acpi Debug related PCDs initialized.=0D - //=0D - Registration =3D NULL;=0D - Status =3D mSmst->SmmRegisterProtocolNotify (=0D - &gEfiSmmEndOfDxeProtocolGuid,=0D - AcpiDebugSmmEndOfDxeNotification,=0D - &Registration=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return Status;=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf b/Pl= atform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf deleted file mode 100644 index 7473126b11..0000000000 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf +++ /dev/null @@ -1,57 +0,0 @@ -### @file=0D -# Component description file for Acpi debug module.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D AcpiDebugDxe=0D - FILE_GUID =3D EC98FF95-242C-4513-B1BC-69FA24111C58= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - ENTRY_POINT =3D InitializeAcpiDebugDxe=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - BaseMemoryLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - DebugLib=0D - PcdLib=0D - DxeServicesLib=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress ## PRODUCES=0D -=0D -[Sources]=0D - AcpiDebug.c=0D - AcpiDebug.asl=0D -=0D -[Protocols]=0D - gEfiAcpiTableProtocolGuid ## CONSUMES=0D - gEfiSmmBase2ProtocolGuid ## CONSUMES # only for SMM version=0D - gEfiSmmSwDispatch2ProtocolGuid ## CONSUMES # only for SMM version=0D - gEfiSmmEndOfDxeProtocolGuid ## NOTIFY # only for SMM version=0D -=0D -[Guids]=0D - gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event=0D -=0D -[Depex]=0D - gEfiAcpiTableProtocolGuid=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf b/Pl= atform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf deleted file mode 100644 index 679f9eb014..0000000000 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf +++ /dev/null @@ -1,59 +0,0 @@ -### @file=0D -# Component description file for Acpi Debug module.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -###=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D AcpiDebugSmm=0D - FILE_GUID =3D 9069C144-0A7E-41ef-9C07-418BCA9BF939= =0D - MODULE_TYPE =3D DXE_SMM_DRIVER=0D - VERSION_STRING =3D 1.0=0D - PI_SPECIFICATION_VERSION =3D 0x0001000A=0D - ENTRY_POINT =3D InitializeAcpiDebugSmm=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - BaseMemoryLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - DebugLib=0D - PcdLib=0D - DxeServicesLib=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress ## PRODUCES=0D -=0D -[Sources]=0D - AcpiDebug.c=0D - AcpiDebug.asl=0D -=0D -[Protocols]=0D - gEfiAcpiTableProtocolGuid ## CONSUMES=0D - gEfiSmmBase2ProtocolGuid ## CONSUMES=0D - gEfiSmmSwDispatch2ProtocolGuid ## CONSUMES=0D - gEfiSmmEndOfDxeProtocolGuid ## NOTIFY=0D -=0D -[Guids]=0D - gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event # only for DXE ve= rsion=0D -=0D -[Depex]=0D - gEfiAcpiTableProtocolGuid AND=0D - gEfiSmmBase2ProtocolGuid AND=0D - gEfiSmmSwDispatch2ProtocolGuid=0D diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/Readme.txt b/Platform= /Intel/DebugFeaturePkg/AcpiDebug/Readme.txt deleted file mode 100644 index 71284ec77f..0000000000 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/Readme.txt +++ /dev/null @@ -1,31 +0,0 @@ -ACPI Debug feature - an alternative to Port 80 and WinDBG=0D -=0D -How it works:=0D - Acpi Debug does this:=0D - Opens a 64kb memory buffer during POST.=0D - Patches the buffer address in SSDT ASL code.=0D - Save the address in gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddres= s for user reference.=0D - Write strings or numbers to the buffer from ASL code with the ADBG metho= d.=0D -=0D -How to use it:=0D - 1. Enable it by set gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable= to TRUE.=0D - 2. The ACPI ASL code must be instrumented with the debug method.=0D - Strings up to 32 characters (shorter strings will be padded with Zero= 's, longer strings will be truncated)=0D - Examples:=0D - ADBG("This is a test.")=0D - ADBG(Arg0)=0D -=0D - DXE version: The bios engineer will read the strings from the buffer on = the target machine with read/write memory utility.=0D - SMM version: Check debug serial that would show debug strings.=0D -=0D - Sample code for ADBG:=0D - External (MDBG, MethodObj)=0D - Method (ADBG, 1, Serialized)=0D - {=0D - If (CondRefOf (MDBG)) // Check if ACPI Debug SSDT is loaded=0D - {=0D - Return (MDBG (Arg0))=0D - }=0D - Return (0)=0D - }=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec b/Platform/= Intel/DebugFeaturePkg/DebugFeaturePkg.dec deleted file mode 100644 index 37ebe6da4d..0000000000 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec +++ /dev/null @@ -1,66 +0,0 @@ -## @file=0D -# This package provides the modules that build for debug feature.=0D -# This DebugFeaturePkg should only depend on EDKII Core packages and MinPl= atformPkg.=0D -#=0D -# The DEC files are used by the utilities that parse DSC and=0D -# INF files to generate AutoGen.c and AutoGen.h files=0D -# for the build infrastructure.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - DEC_SPECIFICATION =3D 0x00010005=0D - PACKAGE_NAME =3D DebugFeaturePkg=0D - PACKAGE_GUID =3D 58B6F2BB-A94F-4EB9-89DA-2F06ED59CE39= =0D - PACKAGE_VERSION =3D 0.1=0D -=0D -[Includes]=0D - Include=0D -=0D -[LibraryClasses]=0D - ## @libraryclass Provide capability to get/set USB3 debug port param= eter.=0D - Usb3DebugPortParameterLib|Include/Library/Usb3DebugPortParameterLib.h=0D -=0D - ## @libraryclass Provide common USB3 debug port functions.=0D - Usb3DebugPortLib|Include/Library/Usb3DebugPortLib.h=0D -=0D -[Guids]=0D - gDebugFeaturePkgTokenSpaceGuid =3D { 0xdbf3ac70, 0x3f73, 0x40aa, { = 0xbd, 0xd6, 0xac, 0xf2, 0x1a, 0x1b, 0x2f, 0xe2 } }=0D -=0D -[PcdsFixedAtBuild]=0D - ## These PCD specify XHCI controller Bus/Device/Function, which are used= to enable=0D - # XHCI debug device.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciBus|0x00|UINT8|0x00000001= =0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciDev|0x14|UINT8|0x00000002= =0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciFunc|0x00|UINT8|0x0000000= 3=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress|0xFEA10000|UINT= 32|0x00000004=0D -=0D - ## This PCD specifies the wait timeout value in microsecond if USB debug= cable is detected but host not connected.=0D - # Default timeout value is 2000000 microseconds.=0D - # If user does not want system stall for long time, it can be set to sm= all value.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout|2000000|UINT64|0x0= 0000005=0D -=0D - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes sp= ace.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortBusIndex|0x59|UINT8|0x000= 00006=0D - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes sp= ace.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortDeviceIndex|0x5A|UINT8|0x= 00000007=0D - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes sp= ace.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortFunctionIndex|0x5B|UINT8|= 0x00000008=0D -=0D -[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]=0D - ## This PCD specifies AcpiDebug feature is enable/disable.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable|FALSE|BOOLEAN|0x000000= 09=0D - ## This PCD specifies AcpiDebug buffer size.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize|0x10000|UINT32|0x0= 000000A=0D -=0D -[PcdsDynamic, PcdsDynamicEx]=0D - ## This PCD specifies AcpiDebug buffer address=0D - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress|0|UINT32|0x0000000B=0D -=0D -[PcdsFeatureFlag]=0D - ## This PCD specifies whether StatusCode is reported via USB3 Serial por= t.=0D - gDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseUsb3Serial|TRUE|BOOLEAN|0= x0000000C=0D diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc b/Platform/= Intel/DebugFeaturePkg/DebugFeaturePkg.dsc deleted file mode 100644 index efe705bd76..0000000000 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc +++ /dev/null @@ -1,120 +0,0 @@ -## @file=0D -# This package provides the modules that build for debug feature.=0D -# This package should only depend on EDKII Core packages and MinPlatformPk= g.=0D -#=0D -# The DEC files are used by the utilities that parse DSC and=0D -# INF files to generate AutoGen.c and AutoGen.h files=0D -# for the build infrastructure.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - PLATFORM_NAME =3D DebugFeaturePkg=0D - PLATFORM_GUID =3D 3A0DBEF4-3C16-4F6B-8B55-BABB260D30B9= =0D - PLATFORM_VERSION =3D 0.1=0D - DSC_SPECIFICATION =3D 0x00010005=0D - OUTPUT_DIRECTORY =3D Build/DebugFeaturePkg=0D - SUPPORTED_ARCHITECTURES =3D IA32|X64=0D - BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT=0D - SKUID_IDENTIFIER =3D DEFAULT=0D -=0D -[LibraryClasses]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf=0D - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf=0D - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf=0D - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf=0D - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf=0D - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf=0D - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf=0D - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplat= e.inf=0D - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf=0D - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf=0D - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf=0D - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf=0D -=0D -[LibraryClasses.common.PEIM]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf=0D - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf=0D -=0D -[LibraryClasses.common.DXE_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D -=0D -[LibraryClasses.common.UEFI_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D -=0D -[LibraryClasses.common.DXE_RUNTIME_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf=0D -=0D -[LibraryClasses.common.DXE_SMM_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAlloc= ationLib.inf=0D - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf=0D -=0D -##########################################################################= #########################=0D -#=0D -# Components Section - list of the modules and components that will be pro= cessed by compilation=0D -# tools and the EDK II tools to generate PE32/PE32+/C= off image files.=0D -#=0D -# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed=0D -# into firmware volume images. This section is just a list of module= s to compile from=0D -# source into UEFI-compliant binaries.=0D -# It is the FDF file that contains information on combining binary f= iles into firmware=0D -# volume images, whose concept is beyond UEFI and is described in PI= specification.=0D -# Binary modules do not need to be listed in this section, as they s= hould be=0D -# specified in the FDF file. For example: Shell binary (Shell_Full.e= fi), FAT binary (Fat.efi),=0D -# Logo (Logo.bmp), and etc.=0D -# There may also be modules listed in this section that are not requ= ired in the FDF file,=0D -# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be=0D -# generated for it, but the binary will not be put into any firmware= volume.=0D -#=0D -##########################################################################= #########################=0D -=0D -[Components]=0D - #######################################=0D - # Debug Feature Package=0D - #######################################=0D -=0D - # Add library instances here that are not included in package components= and should be tested=0D - # in the package build.=0D - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.inf=0D - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.inf=0D - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf=0D - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.inf=0D - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf=0D - DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/Usb3DebugPortParame= terLibPcd.inf=0D -=0D - # Add components here that should be included in the package build.=0D - DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf=0D - DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf=0D -=0D -[BuildOptions]=0D - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=0D diff --git a/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortLi= b.h b/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortLib.h deleted file mode 100644 index 0bee2b63dd..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortLib.h +++ /dev/null @@ -1,71 +0,0 @@ -/** @file=0D - This library class provides common USB3 debug port functions.=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USB3_DEBUG_PORT_LIB__=0D -#define __USB3_DEBUG_PORT_LIB__=0D -=0D -/**=0D - Initialize the USB3 debug port hardware.=0D -=0D - If no initialization is required, then return RETURN_SUCCESS.=0D - If the serial device was successfully initialized, then return RETURN_SU= CCESS.=0D - If the serial device could not be initialized, then return RETURN_DEVICE= _ERROR.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D - @retval RETURN_DEVICE_ERROR The serial device could not be initialized= .=0D -=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -Usb3DebugPortInitialize (=0D - VOID=0D - );=0D -=0D -/**=0D - Write data from buffer to USB3 debug port.=0D -=0D - Writes NumberOfBytes data bytes from Buffer to the serial device.=0D - The number of bytes actually written to the serial device is returned.=0D - If the return value is less than NumberOfBytes, then the write operation= failed.=0D - If Buffer is NULL, then ASSERT().=0D - If NumberOfBytes is zero, then return 0.=0D -=0D - @param Buffer Pointer to the data buffer to be written.=0D - @param NumberOfBytes Number of bytes to written to the serial device= .=0D -=0D - @retval 0 NumberOfBytes is 0.=0D - @retval >0 The number of bytes written to the serial devic= e.=0D - If this value is less than NumberOfBytes, then = the read operation failed.=0D -=0D -**/=0D -UINTN=0D -EFIAPI=0D -Usb3DebugPortWrite (=0D - IN UINT8 *Buffer,=0D - IN UINTN NumberOfBytes=0D - );=0D -=0D -=0D -/**=0D - Polls a USB3 debug port to see if there is any data waiting to be read.= =0D -=0D - Polls a serial device to see if there is any data waiting to be read.=0D - If there is data waiting to be read from the serial device, then TRUE is= returned.=0D - If there is no data waiting to be read from the serial device, then FALS= E is returned.=0D -=0D - @retval TRUE Data is waiting to be read from the serial devi= ce.=0D - @retval FALSE There is no data waiting to be read from the se= rial device.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -Usb3DebugPortPoll (=0D - VOID=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortPa= rameterLib.h b/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPort= ParameterLib.h deleted file mode 100644 index 167c607e9f..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortParameter= Lib.h +++ /dev/null @@ -1,56 +0,0 @@ -/** @file=0D - This library class provides capability to get/set usb3 debug port parame= ter.=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USB3_DEBUG_PORT_PARAMETER_LIB__=0D -#define __USB3_DEBUG_PORT_PARAMETER_LIB__=0D -=0D -typedef struct {=0D - UINT8 Function;=0D - UINT8 Device;=0D - UINT8 Bus;=0D -} PCI_ADDRESS;=0D -=0D -typedef union {=0D - UINT32 Controller;=0D - PCI_ADDRESS PciAddress;=0D -} USB3_DEBUG_PORT_CONTROLLER;=0D -=0D -/**=0D - Returns the USB debug port controller.=0D - bit: 0~ 7: Function=0D - bit: 8~15: Device=0D - bit: 16~24: Bus=0D -=0D - @return Controller information of USB debug port.=0D -=0D -**/=0D -UINT32=0D -EFIAPI=0D -GetUsb3DebugPortController (=0D - VOID=0D - );=0D -=0D -/**=0D - Sets the USB debug port controller.=0D - bit: 0~ 7: Function=0D - bit: 8~15: Device=0D - bit: 16~24: Bus=0D -=0D - @param[in] Controller information of USB debug port value to be set.= =0D -=0D - @retval TRUE The controller of USB debug port was sucessfully= set.=0D - @retval FALSE The controller of USB debug port could not be se= t.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -SetUsb3DebugPortController (=0D - UINT32 Controller=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/MiscSe= rvices.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/MiscServ= ices.c deleted file mode 100644 index cb29a880e6..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/MiscServices.c +++ /dev/null @@ -1,385 +0,0 @@ -/** @file=0D - Miscellaneous services internal to USB debug port implementation.=0D -=0D - Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -/**=0D - Verifies if the bit positions specified by a mask are set in a register.= =0D -=0D - @param[in, out] Register UNITN register=0D - @param[in] BitMask 32-bit mask=0D -=0D - @return BOOLEAN - TRUE if all bits specified by the mask are enabled.= =0D - - FALSE even if one of the bits specified by the mask= =0D - is not enabled.=0D -**/=0D -BOOLEAN=0D -XhcIsBitSet(=0D - IN OUT UINTN Register,=0D - IN UINT32 BitMask=0D - )=0D -{=0D - if ((MmioRead32 (Register) & (BitMask)) !=3D 0) {=0D - return TRUE;=0D - }=0D - return FALSE;=0D -}=0D -=0D -/**=0D - Sets bits as per the enabled bit positions in the mask.=0D -=0D - @param[in, out] Register UINTN register=0D - @param[in] BitMask 32-bit mask=0D -**/=0D -VOID=0D -XhcSetR32Bit(=0D - IN OUT UINTN Register,=0D - IN UINT32 BitMask=0D - )=0D -{=0D - UINT32 RegisterValue;=0D -=0D - RegisterValue =3D MmioRead32 (Register);=0D - RegisterValue |=3D (UINT32)(BitMask);=0D - MmioWrite32 (Register, RegisterValue);=0D -}=0D -=0D -/**=0D - Clears bits as per the enabled bit positions in the mask.=0D -=0D - @param[in, out] Register UINTN register=0D - @param[in] BitMask 32-bit mask=0D -**/=0D -VOID=0D -XhcClrR32Bit(=0D - IN OUT UINTN Register,=0D - IN UINT32 BitMask=0D - )=0D -{=0D - UINT32 RegisterValue;=0D -=0D - RegisterValue =3D MmioRead32 (Register);=0D - RegisterValue &=3D (UINT32)(~(BitMask));=0D - MmioWrite32 (Register, RegisterValue);=0D -}=0D -=0D -/**=0D - Initialize the USB debug port hardware.=0D -=0D - If no initialization is required, then return RETURN_SUCCESS.=0D - If the serial device was successfully initialized, then return RETURN_SU= CCESS.=0D - If the serial device could not be initialized, then return RETURN_DEVICE= _ERROR.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D - @retval RETURN_DEVICE_ERROR The serial device could not be initialized= .=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -Usb3DebugPortInitialize (=0D - VOID=0D - )=0D -{=0D - USB3Initialize ();=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Write data from buffer to USB debug port.=0D -=0D - Writes NumberOfBytes data bytes from Buffer to the serial device.=0D - The number of bytes actually written to the serial device is returned.=0D - If the return value is less than NumberOfBytes, then the write operation= failed.=0D - If Buffer is NULL, then ASSERT().=0D - If NumberOfBytes is zero, then return 0.=0D -=0D - @param Buffer Pointer to the data buffer to be written.=0D - @param NumberOfBytes Number of bytes to written to the serial device= .=0D -=0D - @retval 0 NumberOfBytes is 0.=0D - @retval >0 The number of bytes written to the serial devic= e.=0D - If this value is less than NumberOfBytes, then = the read operation failed.=0D -**/=0D -UINTN=0D -EFIAPI=0D -Usb3DebugPortWrite (=0D - IN UINT8 *Buffer,=0D - IN UINTN NumberOfBytes=0D - )=0D -{=0D - Usb3DbgOut (Buffer, &NumberOfBytes);=0D - return NumberOfBytes;=0D -}=0D -=0D -/**=0D - Read data from USB debug port and save the datas in buffer.=0D -=0D - Reads NumberOfBytes data bytes from a serial device into the buffer=0D - specified by Buffer. The number of bytes actually read is returned.=0D - If the return value is less than NumberOfBytes, then the rest operation = failed.=0D - If Buffer is NULL, then ASSERT().=0D - If NumberOfBytes is zero, then return 0.=0D -=0D - @param Buffer Pointer to the data buffer to store the data re= ad from the serial device.=0D - @param NumberOfBytes Number of bytes which will be read.=0D -=0D - @retval 0 Read data failed, no data is to be read.=0D - @retval >0 Actual number of bytes read from serial device.= =0D -**/=0D -UINTN=0D -EFIAPI=0D -Usb3DebugPortRead (=0D - OUT UINT8 *Buffer,=0D - IN UINTN NumberOfBytes=0D - )=0D -{=0D - Usb3DbgIn (Buffer, &NumberOfBytes);=0D - return NumberOfBytes;=0D -}=0D -=0D -/**=0D - Polls a USB debug port to see if there is any data waiting to be read.=0D -=0D - Polls a serial device to see if there is any data waiting to be read.=0D - If there is data waiting to be read from the serial device, then TRUE is= returned.=0D - If there is no data waiting to be read from the serial device, then FALS= E is returned.=0D -=0D - @retval TRUE Data is waiting to be read from the serial devi= ce.=0D - @retval FALSE There is no data waiting to be read from the se= rial device.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -Usb3DebugPortPoll (=0D - VOID=0D - )=0D -{=0D - return FALSE;=0D -}=0D -=0D -/**=0D - Write the data to the XHCI debug register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the runtime register.=0D - @param Data The data to write.=0D -=0D -**/=0D -VOID=0D -XhcWriteDebugReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Data=0D - )=0D -{=0D - EFI_PHYSICAL_ADDRESS DebugCapabilityBase;=0D -=0D - DebugCapabilityBase =3D Xhc->DebugCapabilityBase;=0D -=0D - MmioWrite32 ((UINTN)(DebugCapabilityBase + Offset), Data);=0D -=0D - return;=0D -}=0D -=0D -/**=0D - Read XHCI debug register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D -=0D - @return The register content read=0D -=0D -**/=0D -UINT32=0D -XhcReadDebugReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset=0D - )=0D -{=0D - UINT32 Data;=0D - EFI_PHYSICAL_ADDRESS DebugCapabilityBase;=0D -=0D - DebugCapabilityBase =3D Xhc->DebugCapabilityBase;=0D -=0D - Data =3D MmioRead32 ((UINTN)(DebugCapabilityBase + Offset));=0D -=0D - return Data;=0D -}=0D -=0D -/**=0D - Set one bit of the debug register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcSetDebugRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - )=0D -{=0D - UINT32 Data;=0D -=0D - Data =3D XhcReadDebugReg (Xhc, Offset);=0D - Data |=3D Bit;=0D - XhcWriteDebugReg (Xhc, Offset, Data);=0D -}=0D -=0D -/**=0D - Clear one bit of the debug register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcClearDebugRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - )=0D -{=0D - UINT32 Data;=0D -=0D - Data =3D XhcReadDebugReg (Xhc, Offset);=0D - Data &=3D ~Bit;=0D - XhcWriteDebugReg (Xhc, Offset, Data);=0D -}=0D -=0D -/**=0D - Write the data to the XHCI MMIO register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the runtime register.=0D - @param Data The data to write.=0D -=0D -**/=0D -VOID=0D -XhcWriteMmioReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Data=0D - )=0D -{=0D - EFI_PHYSICAL_ADDRESS MmioBase;=0D -=0D - MmioBase =3D Xhc->XhcMmioBase;=0D - MmioWrite32 ((UINTN)(MmioBase + Offset), Data);=0D -=0D - return;=0D -}=0D -=0D -/**=0D - Read XHCI MMIO register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the runtime register.=0D -=0D - @return The register content read=0D -=0D -**/=0D -UINT32=0D -XhcReadMmioReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset=0D - )=0D -{=0D - UINT32 Data;=0D - EFI_PHYSICAL_ADDRESS MmioBase;=0D -=0D - MmioBase =3D Xhc->XhcMmioBase;=0D -=0D - Data =3D MmioRead32 ((UINTN)(MmioBase + Offset));=0D -=0D - return Data;=0D -}=0D -=0D -/**=0D - Set one bit of the operational register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the runtime register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcSetMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - )=0D -{=0D - UINT32 Data;=0D -=0D - Data =3D XhcReadMmioReg (Xhc, Offset);=0D - Data |=3D Bit;=0D - XhcWriteMmioReg (Xhc, Offset, Data);=0D -}=0D -=0D -/**=0D - Clear one bit of the operational register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the runtime register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcClearMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - )=0D -{=0D - UINT32 Data;=0D -=0D - Data =3D XhcReadMmioReg (Xhc, Offset);=0D - Data &=3D ~Bit;=0D - XhcWriteMmioReg (Xhc, Offset, Data);=0D -}=0D -=0D -/**=0D - Wait the operation register's bit as specified by Bit=0D - to be set (or clear).=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the operational register.=0D - @param Bit The bit of the register to wait for.=0D - @param WaitToSet Wait the bit to set or clear.=0D - @param Timeout The time to wait before abort (in millisecond, ms).= =0D -=0D - @retval EFI_SUCCESS The bit successfully changed by host controller.=0D - @retval EFI_TIMEOUT The time out occurred.=0D -=0D -**/=0D -EFI_STATUS=0D -XhcWaitMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit,=0D - IN BOOLEAN WaitToSet,=0D - IN UINT32 Timeout=0D - )=0D -{=0D - UINT32 Index;=0D - UINTN Loop;=0D -=0D - Loop =3D (Timeout * XHC_1_MILLISECOND / XHC_POLL_DELAY) + 1;=0D -=0D - for (Index =3D 0; Index < Loop; Index++) {=0D - if (XHC_REG_BIT_IS_SET (Xhc, Offset, Bit) =3D=3D WaitToSet) {=0D - return EFI_SUCCESS;=0D - }=0D -=0D - MicroSecondDelay (XHC_POLL_DELAY);=0D - }=0D -=0D - return EFI_TIMEOUT;=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortDataTransfer.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPor= tLib/Usb3DebugPortDataTransfer.c deleted file mode 100644 index 53478a49b8..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= DataTransfer.c +++ /dev/null @@ -1,892 +0,0 @@ -/** @file=0D - Usb3 Debug Port library instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -EFI_SMRAM_DESCRIPTOR mSmramCheckRanges[MAX_SMRAM_RANGE];=0D -UINTN mSmramCheckRangeCount =3D 0;=0D -BOOLEAN mUsb3InSmm =3D FALSE;=0D -UINT64 mUsb3MmioSize =3D 0;=0D -=0D -/**=0D - Synchronize the specified transfer ring to update the enqueue and dequeu= e pointer.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param TrsRing The transfer ring to sync.=0D -=0D - @retval EFI_SUCCESS The transfer ring is synchronized successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcSyncTrsRing (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN TRANSFER_RING *TrsRing=0D - )=0D -{=0D - UINTN Index;=0D - TRB_TEMPLATE *TrsTrb;=0D -=0D - ASSERT (TrsRing !=3D NULL);=0D -=0D - //=0D - // Calculate the latest RingEnqueue and RingPCS=0D - //=0D - TrsTrb =3D (TRB_TEMPLATE *)(UINTN) TrsRing->RingEnqueue;=0D -=0D - ASSERT (TrsTrb !=3D NULL);=0D -=0D - for (Index =3D 0; Index < TrsRing->TrbNumber; Index++) {=0D - if (TrsTrb->CycleBit !=3D (TrsRing->RingPCS & BIT0)) {=0D - break;=0D - }=0D - TrsTrb++;=0D - if ((UINT8) TrsTrb->Type =3D=3D TRB_TYPE_LINK) {=0D - ASSERT (((LINK_TRB*)TrsTrb)->TC !=3D 0);=0D - //=0D - // set cycle bit in Link TRB as normal=0D - //=0D - ((LINK_TRB*)TrsTrb)->CycleBit =3D TrsRing->RingPCS & BIT0;=0D - //=0D - // Toggle PCS maintained by software=0D - //=0D - TrsRing->RingPCS =3D (TrsRing->RingPCS & BIT0) ? 0 : 1;=0D - TrsTrb =3D (TRB_TEMPLATE *)(UINTN)((TrsTrb->Parameter1 | L= ShiftU64 ((UINT64)TrsTrb->Parameter2, 32)) & ~0x0F);=0D - }=0D - }=0D - ASSERT (Index !=3D TrsRing->TrbNumber);=0D -=0D - if ((EFI_PHYSICAL_ADDRESS)(UINTN) TrsTrb !=3D TrsRing->RingEnqueue) {=0D - TrsRing->RingEnqueue =3D (EFI_PHYSICAL_ADDRESS)(UINTN) TrsTrb;=0D - }=0D -=0D - //=0D - // Clear the Trb context for enqueue, but reserve the PCS bit=0D - //=0D - TrsTrb->Parameter1 =3D 0;=0D - TrsTrb->Parameter2 =3D 0;=0D - TrsTrb->Status =3D 0;=0D - TrsTrb->RsvdZ1 =3D 0;=0D - TrsTrb->Type =3D 0;=0D - TrsTrb->Control =3D 0;=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Synchronize the specified event ring to update the enqueue and dequeue p= ointer.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param EvtRing The event ring to sync.=0D -=0D - @retval EFI_SUCCESS The event ring is synchronized successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcSyncEventRing (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN EVENT_RING *EvtRing=0D - )=0D -{=0D - UINTN Index;=0D - TRB_TEMPLATE *EvtTrb1;=0D -=0D - ASSERT (EvtRing !=3D NULL);=0D -=0D - //=0D - // Calculate the EventRingEnqueue and EventRingCCS.=0D - // Note: only support single Segment=0D - //=0D - EvtTrb1 =3D (TRB_TEMPLATE *)(UINTN) EvtRing->EventRingDequeue;=0D -=0D - for (Index =3D 0; Index < EvtRing->TrbNumber; Index++) {=0D - if (EvtTrb1->CycleBit !=3D EvtRing->EventRingCCS) {=0D - break;=0D - }=0D -=0D - EvtTrb1++;=0D -=0D - if ((UINTN)EvtTrb1 >=3D ((UINTN) EvtRing->EventRingSeg0 + sizeof (TRB_= TEMPLATE) * EvtRing->TrbNumber)) {=0D - EvtTrb1 =3D (TRB_TEMPLATE *)(UINTN) EvtRing->EventRingSeg0;=0D - EvtRing->EventRingCCS =3D (EvtRing->EventRingCCS) ? 0 : 1;=0D - }=0D - }=0D -=0D - if (Index < EvtRing->TrbNumber) {=0D - EvtRing->EventRingEnqueue =3D (EFI_PHYSICAL_ADDRESS)(UINTN)EvtTrb1;=0D - } else {=0D - ASSERT (FALSE);=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Check if there is a new generated event.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param EvtRing The event ring to check.=0D - @param NewEvtTrb The new event TRB found.=0D -=0D - @retval EFI_SUCCESS Found a new event TRB at the event ring.=0D - @retval EFI_NOT_READY The event ring has no new event.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcCheckNewEvent (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN EVENT_RING *EvtRing,=0D - OUT TRB_TEMPLATE **NewEvtTrb=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - ASSERT (EvtRing !=3D NULL);=0D -=0D - *NewEvtTrb =3D (TRB_TEMPLATE *)(UINTN) EvtRing->EventRingDequeue;=0D -=0D - if (EvtRing->EventRingDequeue =3D=3D EvtRing->EventRingEnqueue) {=0D - return EFI_NOT_READY;=0D - }=0D -=0D - Status =3D EFI_SUCCESS;=0D -=0D - EvtRing->EventRingDequeue +=3D sizeof (TRB_TEMPLATE);=0D - //=0D - // If the dequeue pointer is beyond the ring, then roll-back it to the b= egining of the ring.=0D - //=0D - if ((UINTN)EvtRing->EventRingDequeue >=3D ((UINTN) EvtRing->EventRingSeg= 0 + sizeof (TRB_TEMPLATE) * EvtRing->TrbNumber)) {=0D - EvtRing->EventRingDequeue =3D EvtRing->EventRingSeg0;=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Check if the Trb is a transaction of the URB.=0D -=0D - @param Trb The TRB to be checked=0D - @param Urb The transfer ring to be checked.=0D -=0D - @retval TRUE It is a transaction of the URB.=0D - @retval FALSE It is not any transaction of the URB.=0D -=0D -**/=0D -BOOLEAN=0D -IsTransferRingTrb (=0D - IN TRB_TEMPLATE *Trb,=0D - IN URB *Urb=0D - )=0D -{=0D - TRB_TEMPLATE *CheckedTrb;=0D - TRANSFER_RING *Ring;=0D - UINTN Index;=0D -=0D - Ring =3D (TRANSFER_RING *)(UINTN) Urb->Ring;=0D - CheckedTrb =3D (TRB_TEMPLATE *)(UINTN) Ring->RingSeg0;=0D -=0D - ASSERT (Ring->TrbNumber =3D=3D CMD_RING_TRB_NUMBER || Ring->TrbNumber = =3D=3D TR_RING_TRB_NUMBER);=0D -=0D - for (Index =3D 0; Index < Ring->TrbNumber; Index++) {=0D - if (Trb =3D=3D CheckedTrb) {=0D - return TRUE;=0D - }=0D - CheckedTrb++;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D -/**=0D - Check the URB's execution result and update the URB's=0D - result accordingly.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Urb The URB to check result.=0D -=0D - @return Whether the result of URB transfer is finialized.=0D -=0D -**/=0D -EFI_STATUS=0D -XhcCheckUrbResult (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN URB *Urb=0D - )=0D -{=0D - EVT_TRB_TRANSFER *EvtTrb;=0D - TRB_TEMPLATE *TRBPtr;=0D - UINTN Index;=0D - UINT8 TRBType;=0D - EFI_STATUS Status;=0D - URB *CheckedUrb;=0D - UINT64 XhcDequeue;=0D - UINT32 High;=0D - UINT32 Low;=0D -=0D - ASSERT ((Xhc !=3D NULL) && (Urb !=3D NULL));=0D -=0D - Status =3D EFI_SUCCESS;=0D -=0D - if (Urb->Finished) {=0D - goto EXIT;=0D - }=0D -=0D - EvtTrb =3D NULL;=0D -=0D - //=0D - // Traverse the event ring to find out all new events from the previous = check.=0D - //=0D - XhcSyncEventRing (Xhc, &Xhc->EventRing);=0D -=0D - for (Index =3D 0; Index < Xhc->EventRing.TrbNumber; Index++) {=0D - Status =3D XhcCheckNewEvent (Xhc, &Xhc->EventRing, ((TRB_TEMPLATE **)&= EvtTrb));=0D - if (Status =3D=3D EFI_NOT_READY) {=0D - //=0D - // All new events are handled, return directly.=0D - //=0D - goto EXIT;=0D - }=0D - //=0D - // Only handle COMMAND_COMPLETETION_EVENT and TRANSFER_EVENT.=0D - //=0D - if ((EvtTrb->Type !=3D TRB_TYPE_COMMAND_COMPLT_EVENT) && (EvtTrb->Type= !=3D TRB_TYPE_TRANS_EVENT)) {=0D - continue;=0D - }=0D -=0D - TRBPtr =3D (TRB_TEMPLATE *)(UINTN)(EvtTrb->TRBPtrLo | LShiftU64 ((UINT= 64) EvtTrb->TRBPtrHi, 32));=0D -=0D - //=0D - // Update the status of Urb according to the finished event regardless= of whether=0D - // the urb is current checked one or in the XHCI's async transfer list= .=0D - // This way is used to avoid that those completed async transfer event= s don't get=0D - // handled in time and are flushed by newer coming events.=0D - //=0D - if (IsTransferRingTrb (TRBPtr, Urb)) {=0D - CheckedUrb =3D Urb;=0D - } else {=0D - continue;=0D - }=0D - switch (EvtTrb->Completecode) {=0D - case TRB_COMPLETION_STALL_ERROR:=0D - CheckedUrb->Result |=3D EFI_USB_ERR_STALL;=0D - CheckedUrb->Finished =3D TRUE;=0D - break;=0D -=0D - case TRB_COMPLETION_BABBLE_ERROR:=0D - CheckedUrb->Result |=3D EFI_USB_ERR_BABBLE;=0D - CheckedUrb->Finished =3D TRUE;=0D - break;=0D -=0D - case TRB_COMPLETION_DATA_BUFFER_ERROR:=0D - CheckedUrb->Result |=3D EFI_USB_ERR_BUFFER;=0D - CheckedUrb->Finished =3D TRUE;=0D - break;=0D -=0D - case TRB_COMPLETION_USB_TRANSACTION_ERROR:=0D - CheckedUrb->Result |=3D EFI_USB_ERR_TIMEOUT;=0D - CheckedUrb->Finished =3D TRUE;=0D - break;=0D -=0D - case TRB_COMPLETION_SHORT_PACKET:=0D - case TRB_COMPLETION_SUCCESS:=0D - if (EvtTrb->Completecode =3D=3D TRB_COMPLETION_SHORT_PACKET) {=0D - }=0D -=0D - TRBType =3D (UINT8) (TRBPtr->Type);=0D - if ((TRBType =3D=3D TRB_TYPE_DATA_STAGE) ||=0D - (TRBType =3D=3D TRB_TYPE_NORMAL) ||=0D - (TRBType =3D=3D TRB_TYPE_ISOCH)) {=0D - CheckedUrb->Completed +=3D (CheckedUrb->DataLen - EvtTrb->Length= );=0D - }=0D -=0D - break;=0D -=0D - default:=0D - CheckedUrb->Result |=3D EFI_USB_ERR_TIMEOUT;=0D - CheckedUrb->Finished =3D TRUE;=0D - break;=0D - }=0D -=0D - //=0D - // Only check first and end Trb event address=0D - //=0D -=0D - if ((EFI_PHYSICAL_ADDRESS)(UINTN) TRBPtr =3D=3D CheckedUrb->TrbStart) = {=0D - CheckedUrb->StartDone =3D TRUE;=0D - }=0D -=0D - if ((EFI_PHYSICAL_ADDRESS)(UINTN) TRBPtr =3D=3D CheckedUrb->TrbEnd) {= =0D - CheckedUrb->EndDone =3D TRUE;=0D - }=0D -=0D - if (CheckedUrb->StartDone && CheckedUrb->EndDone) {=0D - CheckedUrb->Finished =3D TRUE;=0D - }=0D -=0D - }=0D -=0D -EXIT:=0D - //=0D - // Advance event ring to last available entry=0D - //=0D - // Some 3rd party XHCI external cards don't support single 64-bytes widt= h register access,=0D - // So divide it to two 32-bytes width register access.=0D - //=0D - Low =3D XhcReadDebugReg (Xhc, XHC_DC_DCERDP);=0D - High =3D XhcReadDebugReg (Xhc, XHC_DC_DCERDP + 4);=0D - XhcDequeue =3D (UINT64)(LShiftU64((UINT64)High, 32) | Low);=0D -=0D - if ((XhcDequeue & (~0x0F)) !=3D ((UINT64)(UINTN)Xhc->EventRing.EventRing= Dequeue & (~0x0F))) {=0D - //=0D - // Some 3rd party XHCI external cards don't support single 64-bytes wi= dth register access,=0D - // So divide it to two 32-bytes width register access.=0D - //=0D - XhcWriteDebugReg (Xhc, XHC_DC_DCERDP, XHC_LOW_32BIT (Xhc->EventRing.Ev= entRingDequeue));=0D - XhcWriteDebugReg (Xhc, XHC_DC_DCERDP + 4, XHC_HIGH_32BIT (Xhc->EventRi= ng.EventRingDequeue));=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Ring the door bell to notify XHCI there is a transaction to be executed.= =0D -=0D - @param Xhc The XHCI Instance.=0D - @param Urb The pointer to URB.=0D -=0D - @retval EFI_SUCCESS Successfully ring the door bell.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcRingDoorBell (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN URB *Urb=0D - )=0D -{=0D - UINT32 Dcdb;=0D -=0D - //=0D - // 7.6.8.2 DCDB Register=0D - //=0D - if (Urb->Direction =3D=3D EfiUsbDataIn) {=0D - Dcdb =3D 0x100;=0D - } else {=0D - Dcdb =3D 0x0;=0D - }=0D -=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCDB,=0D - Dcdb=0D - );=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Execute the transfer by polling the URB. This is a synchronous operation= .=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Urb The URB to execute.=0D - @param Timeout The time to wait before abort, in millisecond.= =0D -=0D - @return EFI_DEVICE_ERROR The transfer failed due to transfer error.=0D - @return EFI_TIMEOUT The transfer failed due to time out.=0D - @return EFI_SUCCESS The transfer finished OK.=0D -=0D -**/=0D -EFI_STATUS=0D -XhcExecTransfer (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN URB *Urb,=0D - IN UINTN Timeout=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN Index;=0D - UINTN Loop;=0D - TRB_TEMPLATE *Trb;=0D - TRANSFER_RING *Ring;=0D - TRB_TEMPLATE *TrbStart;=0D - TRB_TEMPLATE *TrbEnd;=0D -=0D - Status =3D EFI_SUCCESS;=0D -=0D - Loop =3D (Timeout * XHC_1_MILLISECOND / XHC_POLL_DELAY) + 1;=0D - if (Timeout =3D=3D 0) {=0D - Loop =3D 0xFFFFFFFF;=0D - }=0D - XhcRingDoorBell (Xhc, Urb);=0D - //=0D - // DSCT BIT0: Event Ring Not Empty bit can only be set to 1 by XHC after= ringing door bell with some delay.=0D - //=0D -=0D - for (Index =3D 0; Index < Loop; Index++) {=0D - Status =3D XhcCheckUrbResult (Xhc, Urb);=0D - if (Urb->Finished) {=0D - break;=0D - }=0D - MicroSecondDelay (XHC_POLL_DELAY);=0D - }=0D - if (Index =3D=3D Loop) {=0D - Urb->Result =3D EFI_USB_ERR_TIMEOUT;=0D - }=0D -=0D - //=0D - // If URB transfer is error, restore transfer ring to original value bef= ore URB transfer=0D - // This will make the current transfer TRB is always at the latest unuse= d one in transfer ring.=0D - // Without this code, when there is read TRB from target, but host does = not write anything, this TRB (A)=0D - // will be still here, next read TRB (B) will be put next to TRB (A), wh= en host write then, the TRB (A)=0D - // will be used to contain data, not TRB(B), this will cause Finished fl= ag will not be set and return error in this function.=0D - //=0D - Ring =3D (TRANSFER_RING *)(UINTN) Urb->Ring;=0D - if (Urb->Result !=3D EFI_USB_NOERROR) {=0D - Ring->RingEnqueue =3D Urb->TrbStart;=0D - //=0D - // Clear CCS flag for next use=0D - //=0D - TrbStart =3D (TRB_TEMPLATE *)(UINTN) Urb->TrbStart;=0D - TrbEnd =3D (TRB_TEMPLATE *)(UINTN) Urb->TrbEnd;=0D - for (Trb =3D TrbStart; Trb <=3D TrbEnd; Trb++) {=0D - Trb->CycleBit =3D ((~Ring->RingPCS) & BIT0);=0D - }=0D - }=0D - return Status;=0D -}=0D -=0D -/**=0D - Create a transfer TRB.=0D -=0D - @param Xhc The XHCI Instance=0D - @param Urb The urb used to construct the transfer TRB.=0D -=0D - @return Created TRB or NULL=0D -=0D -**/=0D -EFI_STATUS=0D -XhcCreateTransferTrb (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN URB *Urb=0D - )=0D -{=0D - TRANSFER_RING *EPRing;=0D - TRB *TrbStart;=0D - UINT32 TotalLen;=0D - UINT32 Len;=0D - UINT32 TrbNum;=0D -=0D - Urb->Finished =3D FALSE;=0D - Urb->StartDone =3D FALSE;=0D - Urb->EndDone =3D FALSE;=0D - Urb->Completed =3D 0;=0D - Urb->Result =3D EFI_USB_NOERROR;=0D -=0D - if (Urb->Direction =3D=3D EfiUsbDataIn) {=0D - EPRing =3D &Xhc->TransferRingIn;=0D - } else {=0D - EPRing =3D &Xhc->TransferRingOut;=0D - }=0D -=0D - Urb->Ring =3D (EFI_PHYSICAL_ADDRESS)(UINTN) EPRing;=0D - //=0D - // Construct the TRB for ED_BULK_OUT and ED_BULK_IN=0D - //=0D - XhcSyncTrsRing (Xhc, EPRing);=0D -=0D - Urb->TrbStart =3D EPRing->RingEnqueue;=0D -=0D - TotalLen =3D 0;=0D - Len =3D 0;=0D - TrbNum =3D 0;=0D - TrbStart =3D (TRB *)(UINTN)EPRing->RingEnqueue;=0D -=0D - while (TotalLen < Urb->DataLen) {=0D - if ((TotalLen + 0x10000) >=3D Urb->DataLen) {=0D - Len =3D Urb->DataLen - TotalLen;=0D - } else {=0D - Len =3D 0x10000;=0D - }=0D - TrbStart =3D (TRB *)(UINTN)EPRing->RingEnqueue;=0D - TrbStart->TrbNormal.TRBPtrLo =3D XHC_LOW_32BIT(Urb->Data + TotalLen);= =0D - TrbStart->TrbNormal.TRBPtrHi =3D XHC_HIGH_32BIT(Urb->Data + TotalLen)= ;=0D - TrbStart->TrbNormal.Length =3D Len;=0D - TrbStart->TrbNormal.TDSize =3D 0;=0D - TrbStart->TrbNormal.IntTarget =3D 0;=0D - TrbStart->TrbNormal.ISP =3D 1;=0D - TrbStart->TrbNormal.IOC =3D 1;=0D - TrbStart->TrbNormal.Type =3D TRB_TYPE_NORMAL;=0D -=0D - //=0D - // Update the cycle bit=0D - //=0D - TrbStart->TrbNormal.CycleBit =3D EPRing->RingPCS & BIT0;=0D -=0D - XhcSyncTrsRing (Xhc, EPRing);=0D - TrbNum++;=0D - TotalLen +=3D Len;=0D - }=0D -=0D - Urb->TrbNum =3D TrbNum;=0D -=0D - //=0D - // Update to the last TRB=0D - //=0D - Urb->TrbEnd =3D (EFI_PHYSICAL_ADDRESS)(UINTN) TrbStart;=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Create a new URB for a new transaction.=0D -=0D - @param Xhc The XHCI Instance=0D - @param Direction The direction of data flow.=0D - @param Data The user data to transfer=0D - @param DataLen The length of data buffer=0D -=0D - @return Created URB or NULL=0D -=0D -**/=0D -URB*=0D -XhcCreateUrb (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN EFI_USB_DATA_DIRECTION Direction,=0D - IN VOID *Data,=0D - IN UINTN DataLen=0D - )=0D -{=0D - EFI_STATUS Status;=0D - URB *Urb;=0D - EFI_PHYSICAL_ADDRESS DataAddress;=0D -=0D - Urb =3D &Xhc->Urb;=0D - ASSERT (Urb->Data !=3D 0);=0D - DataAddress =3D Urb->Data;=0D - ZeroMem (Urb, sizeof (URB));=0D -=0D - Urb->Signature =3D USB3_DEBUG_PORT_INSTANCE_SIGNATURE;=0D - Urb->Direction =3D Direction;=0D - Urb->Data =3D DataAddress;=0D -=0D - ZeroMem ((VOID*)(UINTN) Urb->Data, DataLen);=0D - CopyMem ((VOID*)(UINTN) Urb->Data, Data, DataLen);=0D -=0D - Urb->DataLen =3D (UINT32) DataLen;=0D - Status =3D XhcCreateTransferTrb (Xhc, Urb);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return Urb;=0D -}=0D -=0D -/**=0D - Submits bulk transfer to a bulk endpoint of a USB device.=0D -=0D - @param Xhc The instance of debug device.=0D - @param Direction The direction of data transfer.=0D - @param Data Array of pointers to the buffers of data t= o transmit=0D - from or receive into.=0D - @param DataLength The lenght of the data buffer.=0D - @param Timeout Indicates the maximum time, in millisecond= , which=0D - the transfer is allowed to complete.=0D - @param TransferResult Transfer result.=0D -=0D - @retval EFI_SUCCESS The transfer was completed successfully.=0D - @retval EFI_OUT_OF_RESOURCES The transfer failed due to lack of resourc= e.=0D - @retval EFI_INVALID_PARAMETER Some parameters are invalid.=0D - @retval EFI_TIMEOUT The transfer failed due to timeout.=0D - @retval EFI_DEVICE_ERROR The transfer failed due to host controller= error.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcDataTransfer (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN EFI_USB_DATA_DIRECTION Direction,=0D - IN OUT VOID *Data,=0D - IN OUT UINTN *DataLength,=0D - IN UINTN Timeout,=0D - OUT UINT32 *TransferResult=0D - )=0D -{=0D - URB *Urb;=0D - EFI_STATUS Status;=0D -=0D - //=0D - // Validate the parameters=0D - //=0D - if ((DataLength =3D=3D NULL) || (*DataLength =3D=3D 0) ||=0D - (Data =3D=3D NULL) || (TransferResult =3D=3D NULL)) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - *TransferResult =3D EFI_USB_ERR_SYSTEM;=0D - Status =3D EFI_DEVICE_ERROR;=0D -=0D - //=0D - // Create a new URB, insert it into the asynchronous=0D - // schedule list, then poll the execution status.=0D - //=0D - Urb =3D XhcCreateUrb (Xhc, Direction, Data, *DataLength);=0D -=0D - if (Urb =3D=3D NULL) {=0D - Status =3D EFI_OUT_OF_RESOURCES;=0D - goto ON_EXIT;=0D - }=0D -=0D - Status =3D XhcExecTransfer (Xhc, Urb, Timeout);=0D -=0D - *TransferResult =3D Urb->Result;=0D - *DataLength =3D Urb->Completed;=0D -=0D - if (*TransferResult =3D=3D EFI_USB_NOERROR) {=0D - Status =3D EFI_SUCCESS;=0D - }=0D -=0D -ON_EXIT:=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Check whether the MMIO Bar is within any of the SMRAM ranges.=0D -=0D - @param[in] XhcMmioBase The address of the MMIO to be checked.=0D -=0D - @retval TURE The XHCI MMIO is in SMRAM ranges.=0D - @retval FALSE The XHCI MMIO is out of SMRAM ranges.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -Usb3DebugIsAddressInSmram (=0D - IN EFI_PHYSICAL_ADDRESS XhcMmioBase=0D - )=0D -{=0D - UINTN Index;=0D -=0D - if (mSmramCheckRangeCount =3D=3D 0) {=0D - //=0D - // When we invoke this function, we are already in SMM mode,=0D - // but SmmAccess->GetCapabilities failed which kept mSmramCheckRanges = as 0.=0D - //=0D - return TRUE;=0D - }=0D -=0D - for (Index =3D 0; Index < mSmramCheckRangeCount; Index ++) {=0D - if (((XhcMmioBase >=3D mSmramCheckRanges[Index].CpuStart) && (XhcMmioB= ase < mSmramCheckRanges[Index].CpuStart + mSmramCheckRanges[Index].Physical= Size)) ||=0D - ((mSmramCheckRanges[Index].CpuStart >=3D XhcMmioBase) && (mSmramCh= eckRanges[Index].CpuStart < XhcMmioBase + mUsb3MmioSize))) {=0D - return TRUE;=0D - }=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D -/**=0D - Transfer data via XHC controller.=0D -=0D - @param Data Data buffer.=0D - @param Length Data length.=0D - @param Direction Transfer direction.=0D -=0D -**/=0D -VOID=0D -Usb3DebugPortDataTransfer (=0D - UINT8 *Data,=0D - UINTN *Length,=0D - EFI_USB_DATA_DIRECTION Direction=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D - UINT16 Command;=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT32 TransferResult;=0D - UINT32 Dcctrl;=0D - EFI_PHYSICAL_ADDRESS UsbBase;=0D - UINTN BytesToSend;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_STATUS Status;=0D - USB3_DEBUG_PORT_INSTANCE UsbDbgInstance;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - //=0D - // MMIO base address is possible to clear, set it if it is cleared. (Xhc= iMemorySpaceClose in PchUsbCommon.c)=0D - //=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D - Command =3D GetXhciPciCommand ();=0D -=0D - if ((XhcMmioBase =3D=3D 0) || (XhcMmioBase =3D=3D XHCI_BASE_ADDRESS_64_B= IT_MASK)) {=0D - //=0D - // XHCI device MMIO base is cleared by someone, set it again=0D - //=0D - UsbBase =3D PcdGet32 (PcdXhciDefaultBaseAddress);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG= _OFFSET), (UINT32)UsbBase);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG= _OFFSET + 4), 0x0);=0D - UsbBase =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE= _ADDRESSREG_OFFSET)) & XHCI_BASE_ADDRESS_32_BIT_MASK;=0D - if (UsbBase =3D=3D 0 || UsbBase =3D=3D XHCI_BASE_ADDRESS_32_BIT_MASK) = {=0D - return;=0D - }=0D - }=0D -=0D - //=0D - // Check if XHC debug MMIO range is in SMRAM=0D - //=0D - if ((mUsb3InSmm) && (Usb3DebugIsAddressInSmram (XhcMmioBase))) {=0D - return;=0D - }=0D -=0D - //=0D - // Save and set Command Register=0D - //=0D - if (((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) || ((Command & E= FI_PCI_COMMAND_BUS_MASTER) =3D=3D 0)) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE | EFI_PCI_COMMAND_BUS_MASTER);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - Instance =3D GetUsb3DebugPortInstance ();=0D -=0D - if (Instance !=3D NULL) {=0D - if (!Instance->DebugSupport) {=0D - //=0D - // Debug device is not supported by XHCI, return=0D - //=0D - goto Done;=0D - }=0D - }=0D -=0D - if ((Instance !=3D NULL) && (Instance->Ready)) {=0D - //=0D - // Debug device is broken suddently (e.g. Windows OS), return=0D - //=0D - Dcctrl =3D XhcReadDebugReg (Instance, XHC_DC_DCCTRL);=0D - if ((Dcctrl & BIT0) =3D=3D 0) {=0D - goto Done;=0D - }=0D - }=0D -=0D - if ((Instance !=3D NULL) && (!Instance->Ready)) {=0D - //=0D - // Debug host does not connect with target=0D - //=0D - goto Done;=0D - }=0D -=0D - if (Instance =3D=3D NULL) {=0D - ZeroMem (&UsbDbgInstance, sizeof (USB3_DEBUG_PORT_INSTANCE));=0D - DiscoverUsb3DebugPort (&UsbDbgInstance);=0D - if (UsbDbgInstance.DebugSupport) {=0D - if (!IsAllocatePagesReady ()) {=0D - //=0D - // AllocatePages can not work, return=0D - //=0D - goto Done;=0D - }=0D - }=0D - Status =3D USB3InitializeReal ();=0D - if (EFI_ERROR (Status)) {=0D - //=0D - // Debug device is failed to initialize=0D - //=0D - goto Done;=0D - }=0D -=0D - //=0D - // Update instance=0D - //=0D - Instance =3D GetUsb3DebugPortInstance ();=0D -=0D - if (Instance =3D=3D NULL) {=0D - //=0D - // Debug device instance is failed to create=0D - //=0D - goto Done;=0D - }=0D -=0D - if ((!Instance->Ready) || (!Instance->DebugSupport)) {=0D - //=0D - // Debug host does not connect at first or is not supported=0D - //=0D - goto Done;=0D - }=0D - }=0D -=0D - BytesToSend =3D 0;=0D - while (*Length > 0) {=0D - BytesToSend =3D ((*Length) > XHC_DEBUG_PORT_DATA_LENGTH) ? XHC_DEBUG_P= ORT_DATA_LENGTH : *Length;=0D - XhcDataTransfer (=0D - Instance,=0D - Direction,=0D - Data,=0D - &BytesToSend,=0D - DATA_TRANSFER_TIME_OUT,=0D - &TransferResult=0D - );=0D - if (TransferResult !=3D EFI_USB_NOERROR) {=0D - break;=0D - }=0D - *Length -=3D BytesToSend;=0D - Data +=3D BytesToSend;=0D - }=0D -=0D -Done:=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16(PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET), = Command);=0D -=0D -}=0D -=0D -/**=0D - Receive data over the USB3 debug cable.=0D -=0D - @param[out] Data Pointer to data=0D - @param[in, out] Length Pointer to data length=0D -=0D -**/=0D -RETURN_STATUS=0D -Usb3DbgIn (=0D - OUT UINT8 *Data,=0D - IN OUT UINTN *Length=0D - )=0D -{=0D - Usb3DebugPortDataTransfer (Data, Length, EfiUsbDataIn);=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Send data over the USB3 debug cable.=0D -=0D - @param[out] Data Pointer to data=0D - @param[in, out] Length Pointer to data length=0D -=0D -**/=0D -VOID=0D -Usb3DbgOut (=0D - OUT UINT8 *Data,=0D - IN OUT UINTN *Length=0D - )=0D -{=0D - Usb3DebugPortDataTransfer (Data, Length, EfiUsbDataOut);=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortInitialize.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortL= ib/Usb3DebugPortInitialize.c deleted file mode 100644 index dbdae59253..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= Initialize.c +++ /dev/null @@ -1,726 +0,0 @@ -/** @file=0D - Usb3 Debug Port initialization=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -UINT16 mString0Desc[] =3D {=0D - // String Descriptor Type + Length=0D - ( USB_DESC_TYPE_STRING << 8 ) + STRING0_DESC_LEN,=0D - 0x0409=0D -};=0D -=0D -UINT16 mManufacturerStrDesc[] =3D {=0D - // String Descriptor Type + Length=0D - ( USB_DESC_TYPE_STRING << 8 ) + MANU_DESC_LEN,=0D - 'I', 'n', 't', 'e', 'l'=0D -};=0D -=0D -//USB 3.0 Debug Cable=0D -UINT16 mProductStrDesc[] =3D {=0D - // String Descriptor Type + Length=0D - ( USB_DESC_TYPE_STRING << 8 ) + PRODUCT_DESC_LEN,=0D - 'U', 'S', 'B', ' ', '3', '.', '0', ' ', 'D', 'e', 'b', 'u', 'g', ' ', 'C= ', 'a', 'b', 'l', 'e'=0D -};=0D -=0D -UINT16 mSerialNumberStrDesc[] =3D {=0D - // String Descriptor Type + Length=0D - ( USB_DESC_TYPE_STRING << 8 ) + SERIAL_DESC_LEN,=0D - '1'=0D -};=0D -=0D -XHC_DC_CONTEXT DebugCapabilityContextTemplate =3D {=0D - {=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - STRING0_DESC_LEN,=0D - MANU_DESC_LEN,=0D - PRODUCT_DESC_LEN,=0D - SERIAL_DESC_LEN,=0D - 0,=0D - 0,=0D - 0,=0D - 0=0D - },=0D - {=0D - 0, // EPState=0D - 0, // RsvdZ1=0D - 0, // Mult=0D - 0, // MaxPStreams=0D - 0, // LSA=0D - 0, // Interval=0D - 0, // RsvdZ2=0D - 0, // RsvdZ3=0D - 3, // CERR=0D - ED_BULK_OUT, // EPType=0D - 0, // RsvdZ4=0D - 0, // HID=0D - 0, // MaxBurstSize=0D - 1024, // MaxPacketSize=0D - 0, // PtrLo=0D - 0, // PtrHi=0D - 0x1000, // AverageTRBLength=0D - 0, // MaxESITPayload=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0=0D - },=0D - {=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 3, //CERR=0D - ED_BULK_IN,=0D - 0,=0D - 0,=0D - 0,=0D - 1024, //MaxPacketSize=0D - 0,=0D - 0,=0D - 0x1000,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0,=0D - 0=0D - }=0D -};=0D -=0D -/**=0D - Return command register value in XHCI controller.=0D -=0D -**/=0D -UINT16=0D -GetXhciPciCommand (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D -=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D - Command =3D PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND= _OFFSET));=0D - return Command;=0D -}=0D -=0D -/**=0D - Discover the USB3 debug device.=0D -=0D - @param[in] Instance Pointer to USB3 debug port object instance= .=0D -=0D - @retval RETURN_SUCCESS The USB3 debug device was found.=0D - @retval RETURN_DEVICE_ERROR The USB3 debug device was not found.=0D -=0D -**/=0D -RETURN_STATUS=0D -DiscoverUsb3DebugPort(=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT16 Command;=0D - EFI_PHYSICAL_ADDRESS UsbBase;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_PHYSICAL_ADDRESS CapabilityPointer;=0D - UINT32 Capability;=0D - BOOLEAN Flag;=0D - UINT8 CapLength;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D - if ((PciRead8(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_CLASSCODE_OFFSE= T + 2)) !=3D PCI_CLASS_SERIAL) ||=0D - (PciRead8(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_CLASSCODE_OFFSE= T + 1)) !=3D PCI_CLASS_SERIAL_USB) ||=0D - (PciRead8(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_CLASSCODE_OFFSE= T)) !=3D 0x30)) {=0D - //=0D - // The device is not XHCI controller=0D - //=0D - return RETURN_NOT_FOUND;=0D - }=0D -=0D - //=0D - // USBBASE is at 10-13h, i.e. the first BAR, clear the low bits which is= not part of base address=0D - //=0D - UsbBase =3D GetXhciBaseAddress ();=0D -=0D - //=0D - // Set XHCI MMIO base address if necessary=0D - //=0D - if ((UsbBase =3D=3D 0) || (UsbBase =3D=3D XHCI_BASE_ADDRESS_64_BIT_MASK)= ) {=0D - UsbBase =3D PcdGet32 (PcdXhciDefaultBaseAddress);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG= _OFFSET), (UINT32)UsbBase);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG= _OFFSET + 4), 0x0);=0D - UsbBase =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE= _ADDRESSREG_OFFSET)) & XHCI_BASE_ADDRESS_32_BIT_MASK;=0D - if (UsbBase =3D=3D 0 || UsbBase =3D=3D XHCI_BASE_ADDRESS_32_BIT_MASK) = {=0D - return RETURN_DEVICE_ERROR;=0D - }=0D - }=0D -=0D - //=0D - // Set MSE and BME bit - enable the address space=0D - //=0D - Command =3D PciRead16 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAN= D_OFFSET));=0D - if ((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - CapLength =3D MmioRead8 ((UINTN) UsbBase);=0D -=0D - //=0D - // Get capability pointer from HCCPARAMS at offset 0x10=0D - //=0D - CapabilityPointer =3D UsbBase + (MmioRead32 ((UINTN)(UsbBase + XHC_HCCPA= RAMS_OFFSET)) >> 16) * 4;=0D -=0D - //=0D - // Search XHCI debug capability=0D - //=0D - Flag =3D FALSE;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - while (TRUE) {=0D - if ((Capability & XHC_CAPABILITY_ID_MASK) =3D=3D PCI_CAPABILITY_ID_DEB= UG_PORT) {=0D - Flag =3D TRUE;=0D - break;=0D - }=0D - if ((((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) & XHC_CAPABILITY_I= D_MASK) =3D=3D 0) {=0D - //=0D - // Reach the end of capability list, quit=0D - //=0D - break;=0D - }=0D - CapabilityPointer +=3D ((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) = * 4;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - }=0D -=0D - Instance->Signature =3D USB3_DEBUG_PORT_INSTANCE_SIGNATURE;= =0D -=0D - if (Flag) {=0D - Instance->DebugSupport =3D TRUE;=0D - Instance->DebugCapabilityBase =3D CapabilityPointer;=0D - Instance->DebugCapabilityOffset =3D CapabilityPointer - UsbBase;=0D -=0D - Instance->XhciOpRegister =3D UsbBase + CapLength;=0D - Instance->XhcMmioBase =3D UsbBase;=0D -=0D - Instance->PciBusNumber =3D Bus;=0D - Instance->PciDeviceNumber =3D Device;=0D - Instance->PciFunctionNumber =3D Function;=0D - }=0D -=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16(PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET), = Command);=0D -=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Create XHCI event ring.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param EventRing The created event ring.=0D -=0D -**/=0D -EFI_STATUS=0D -CreateEventRing (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - OUT EVENT_RING *EventRing=0D - )=0D -{=0D - VOID *Buf;=0D - EVENT_RING_SEG_TABLE_ENTRY *ERSTBase;=0D -=0D - ASSERT (EventRing !=3D NULL);=0D -=0D - //=0D - // Allocate Event Ring=0D - //=0D - Buf =3D AllocateAlignBuffer (sizeof (TRB_TEMPLATE) * EVENT_RING_TRB_NUMB= ER);=0D - ASSERT (Buf !=3D NULL);=0D - ASSERT (((UINTN) Buf & 0x3F) =3D=3D 0);=0D - ZeroMem (Buf, sizeof (TRB_TEMPLATE) * EVENT_RING_TRB_NUMBER);=0D -=0D - EventRing->EventRingSeg0 =3D (EFI_PHYSICAL_ADDRESS)(UINTN) Buf;=0D - EventRing->TrbNumber =3D EVENT_RING_TRB_NUMBER;=0D - EventRing->EventRingDequeue =3D (EFI_PHYSICAL_ADDRESS)(UINTN) EventRing-= >EventRingSeg0;=0D - EventRing->EventRingEnqueue =3D (EFI_PHYSICAL_ADDRESS)(UINTN) EventRing-= >EventRingSeg0;=0D -=0D - //=0D - // Software maintains an Event Ring Consumer Cycle State (CCS) bit, init= ializing it to '1'=0D - // and toggling it every time the Event Ring Dequeue Pointer wraps back = to the beginning of the Event Ring.=0D - //=0D - EventRing->EventRingCCS =3D 1;=0D -=0D - //=0D - // Allocate Event Ring Segment Table Entry 0 in Event Ring Segment Table= =0D - //=0D - Buf =3D AllocateAlignBuffer (sizeof (EVENT_RING_SEG_TABLE_ENTRY) * ERST_= NUMBER);=0D - ASSERT (Buf !=3D NULL);=0D - ASSERT (((UINTN) Buf & 0x3F) =3D=3D 0);=0D - ZeroMem (Buf, sizeof (EVENT_RING_SEG_TABLE_ENTRY) * ERST_NUMBER);=0D -=0D - ERSTBase =3D (EVENT_RING_SEG_TABLE_ENTRY *) Buf;=0D - EventRing->ERSTBase =3D (EFI_PHYSICAL_ADDRESS)(UINTN) ERSTBase;=0D -=0D - //=0D - // Fill Event Segment address=0D - //=0D - ERSTBase->PtrLo =3D XHC_LOW_32BIT (EventRing->EventRingSeg0);=0D - ERSTBase->PtrHi =3D XHC_HIGH_32BIT (EventRing->EventRingSeg0);=0D - ERSTBase->RingTrbSize =3D EVENT_RING_TRB_NUMBER;=0D -=0D - //=0D - // Program the Interrupter Event Ring Dequeue Pointer (DCERDP) register = (7.6.4.1)=0D - //=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCERDP,=0D - XHC_LOW_32BIT((UINT64)(UINTN)EventRing->EventRingDequeue)=0D - );=0D -=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCERDP + 4,=0D - XHC_HIGH_32BIT((UINT64)(UINTN)EventRing->EventRingDequeue)=0D - );=0D -=0D - //=0D - // Program the Debug Capability Event Ring Segment Table Base Address (D= CERSTBA) register(7.6.4.1)=0D - //=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCERSTBA,=0D - XHC_LOW_32BIT((UINT64)(UINTN)ERSTBase)=0D - );=0D -=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCERSTBA + 4,=0D - XHC_HIGH_32BIT((UINT64)(UINTN)ERSTBase)=0D - );=0D -=0D - //=0D - // Program the Debug Capability Event Ring Segment Table Size (DCERSTSZ)= register(7.6.4.1)=0D - //=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCERSTSZ,=0D - ERST_NUMBER=0D - );=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Create XHCI transfer ring.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param TrbNum The number of TRB in the ring.=0D - @param TransferRing The created transfer ring.=0D -=0D -**/=0D -VOID=0D -CreateTransferRing (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 TrbNum,=0D - OUT TRANSFER_RING *TransferRing=0D - )=0D -{=0D - VOID *Buf;=0D - LINK_TRB *EndTrb;=0D -=0D - Buf =3D AllocateAlignBuffer (sizeof (TRB_TEMPLATE) * TrbNum);=0D - ASSERT (Buf !=3D NULL);=0D - ASSERT (((UINTN) Buf & 0xF) =3D=3D 0);=0D - ZeroMem (Buf, sizeof (TRB_TEMPLATE) * TrbNum);=0D -=0D - TransferRing->RingSeg0 =3D (EFI_PHYSICAL_ADDRESS)(UINTN) Buf;=0D - TransferRing->TrbNumber =3D TrbNum;=0D - TransferRing->RingEnqueue =3D TransferRing->RingSeg0;=0D - TransferRing->RingDequeue =3D TransferRing->RingSeg0;=0D - TransferRing->RingPCS =3D 1;=0D - //=0D - // 4.9.2 Transfer Ring Management=0D - // To form a ring (or circular queue) a Link TRB may be inserted at the = end of a ring to=0D - // point to the first TRB in the ring.=0D - //=0D - EndTrb =3D (LINK_TRB *) ((UINTN)Buf + sizeof (TRB_TEMPLATE) * (Tr= bNum - 1));=0D - EndTrb->Type =3D TRB_TYPE_LINK;=0D - EndTrb->PtrLo =3D XHC_LOW_32BIT (Buf);=0D - EndTrb->PtrHi =3D XHC_HIGH_32BIT (Buf);=0D - //=0D - // Toggle Cycle (TC). When set to '1', the xHC shall toggle its interpre= tation of the Cycle bit.=0D - //=0D - EndTrb->TC =3D 1;=0D - //=0D - // Set Cycle bit as other TRB PCS init value=0D - //=0D - EndTrb->CycleBit =3D 0;=0D -}=0D -=0D -/**=0D - Create debug capability context for XHC debug device.=0D -=0D - @param Xhc The XHCI Instance.=0D -=0D - @retval EFI_SUCCESS The bit successfully changed by host controller.=0D - @retval EFI_TIMEOUT The time out occurred.=0D -=0D -**/=0D -EFI_STATUS=0D -CreateDebugCapabilityContext (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc=0D - )=0D -{=0D - VOID *Buf;=0D - XHC_DC_CONTEXT *DebugCapabilityContext;=0D - UINT8 *String0Desc;=0D - UINT8 *ManufacturerStrDesc;=0D - UINT8 *ProductStrDesc;=0D - UINT8 *SerialNumberStrDesc;=0D -=0D - //=0D - // Allocate debug device context=0D - //=0D - Buf =3D AllocateAlignBuffer (sizeof (XHC_DC_CONTEXT));=0D - ASSERT (Buf !=3D NULL);=0D - ASSERT (((UINTN) Buf & 0xF) =3D=3D 0);=0D - ZeroMem (Buf, sizeof (XHC_DC_CONTEXT));=0D -=0D - DebugCapabilityContext =3D (XHC_DC_CONTEXT *)(UINTN) Buf;=0D - Xhc->DebugCapabilityContext =3D (EFI_PHYSICAL_ADDRESS)(UINTN) DebugCapab= ilityContext;=0D -=0D - CopyMem (DebugCapabilityContext, &DebugCapabilityContextTemplate, sizeof= (XHC_DC_CONTEXT));=0D -=0D - //=0D - // Update string descriptor address=0D - //=0D - String0Desc =3D (UINT8 *) AllocateAlignBuffer (STRING0_DESC_LEN + MANU_D= ESC_LEN + PRODUCT_DESC_LEN + SERIAL_DESC_LEN);=0D - ASSERT (String0Desc !=3D NULL);=0D - ZeroMem (String0Desc, STRING0_DESC_LEN + MANU_DESC_LEN + PRODUCT_DESC_LE= N + SERIAL_DESC_LEN);=0D - CopyMem (String0Desc, mString0Desc, STRING0_DESC_LEN);=0D - DebugCapabilityContext->DbcInfoContext.String0DescAddress =3D (UINT64)(U= INTN)String0Desc;=0D -=0D - ManufacturerStrDesc =3D String0Desc + STRING0_DESC_LEN;=0D - CopyMem (ManufacturerStrDesc, mManufacturerStrDesc, MANU_DESC_LEN);=0D - DebugCapabilityContext->DbcInfoContext.ManufacturerStrDescAddress =3D (U= INT64)(UINTN)ManufacturerStrDesc;=0D -=0D - ProductStrDesc =3D ManufacturerStrDesc + MANU_DESC_LEN;=0D - CopyMem (ProductStrDesc, mProductStrDesc, PRODUCT_DESC_LEN);=0D - DebugCapabilityContext->DbcInfoContext.ProductStrDescAddress =3D (UINT64= )(UINTN)ProductStrDesc;=0D -=0D - SerialNumberStrDesc =3D ProductStrDesc + PRODUCT_DESC_LEN;=0D - CopyMem (SerialNumberStrDesc, mSerialNumberStrDesc, SERIAL_DESC_LEN);=0D - DebugCapabilityContext->DbcInfoContext.SerialNumberStrDescAddress =3D (U= INT64)(UINTN)SerialNumberStrDesc;=0D -=0D - //=0D - // Allocate and initialize the Transfer Ring for the Input Endpoint Cont= ext.=0D - //=0D - ZeroMem (&Xhc->TransferRingIn, sizeof (TRANSFER_RING));=0D - CreateTransferRing (Xhc, TR_RING_TRB_NUMBER, &Xhc->TransferRingIn);=0D -=0D - //=0D - // Can not set BIT0, otherwise there is no transfer ring detected.=0D - //=0D - DebugCapabilityContext->EpInContext.PtrLo =3D XHC_LOW_32BIT (Xhc->Transf= erRingIn.RingSeg0) | BIT0;=0D - DebugCapabilityContext->EpInContext.PtrHi =3D XHC_HIGH_32BIT (Xhc->Trans= ferRingIn.RingSeg0);=0D -=0D - //=0D - // Allocate and initialize the Transfer Ring for the Output Endpoint Con= text.=0D - //=0D - ZeroMem (&Xhc->TransferRingOut, sizeof (TRANSFER_RING));=0D - CreateTransferRing (Xhc, TR_RING_TRB_NUMBER, &Xhc->TransferRingOut);=0D -=0D - //=0D - // Can not set BIT0, otherwise there is no transfer ring detected.=0D - //=0D - DebugCapabilityContext->EpOutContext.PtrLo =3D XHC_LOW_32BIT (Xhc->Trans= ferRingOut.RingSeg0) | BIT0;=0D - DebugCapabilityContext->EpOutContext.PtrHi =3D XHC_HIGH_32BIT (Xhc->Tran= sferRingOut.RingSeg0);=0D -=0D - //=0D - // Program the Debug Capability Context Pointer (DCCP) register(7.6.8.7)= =0D - //=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCCP,=0D - XHC_LOW_32BIT((UINT64)(UINTN)DebugCapabilityContext)=0D - );=0D - XhcWriteDebugReg (=0D - Xhc,=0D - XHC_DC_DCCP + 4,=0D - XHC_HIGH_32BIT((UINT64)(UINTN)DebugCapabilityContext)=0D - );=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize the USB3 debug Device hardware.=0D -=0D - @param[in] Instance Pointer to USB3 debug port object instance.=0D -=0D - @retval RETURN_SUCCESS The USB3 debug device was initialized successf= ully.=0D - @retval !RETURN_SUCCESS Error.=0D -=0D -**/=0D -RETURN_STATUS=0D -InitializeUsb3DebugPort (=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - )=0D -{=0D - RETURN_STATUS Status;=0D - UINT64 XhciOpRegister;=0D - volatile UINT32 Dcctrl;=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT16 Command;=0D - EFI_BOOT_MODE BootMode;=0D - UINT64 TimeOut;=0D - CHAR8 *TestString;=0D - UINTN Length;=0D - UINT32 TransferResult;=0D -=0D - Bus =3D Instance->PciBusNumber;=0D - Device =3D Instance->PciDeviceNumber;=0D - Function =3D Instance->PciFunctionNumber;=0D -=0D - Command =3D GetXhciPciCommand ();=0D -=0D - //=0D - // Save and set Command Register=0D - //=0D - if (((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) || ((Command & E= FI_PCI_COMMAND_BUS_MASTER) =3D=3D 0)) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE | EFI_PCI_COMMAND_BUS_MASTER);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - //=0D - // Clear DCE bit and LSE bit in DCCTRL=0D - //=0D - if ((XhcReadDebugReg (Instance, XHC_DC_DCCTRL) & (BIT1|BIT31)) =3D=3D (B= IT1|BIT31)) {=0D - XhcClearDebugRegBit (Instance, XHC_DC_DCCTRL, BIT1|BIT31);=0D - }=0D -=0D - XhciOpRegister =3D Instance->XhciOpRegister;=0D -=0D - //=0D - // Get current Boot Mode=0D - //=0D - BootMode =3D GetBootModeHob ();=0D -=0D - if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D - if (!XhcIsBitSet((UINTN)(XhciOpRegister + XHC_USBSTS_OFFSET), XHC_USBS= TS_HALT)) {=0D - XhcClrR32Bit((UINTN) XhciOpRegister + XHC_USBCMD_OFFSET, XHC_USBCMD_= RUN);=0D - while (!XhcIsBitSet((UINTN)(XhciOpRegister + XHC_USBSTS_OFFSET), XHC= _USBSTS_HALT)) {=0D - MicroSecondDelay (10);=0D - }=0D - }=0D -=0D - //=0D - // Reset host controller=0D - //=0D - XhcSetR32Bit((UINTN)XhciOpRegister + XHC_USBCMD_OFFSET, XHC_USBCMD_RES= ET);=0D -=0D - //=0D - // Ensure that the host controller is reset (RESET bit must be cleared= after reset)=0D - //=0D - while (XhcIsBitSet((UINTN)XhciOpRegister + XHC_USBCMD_OFFSET, XHC_USBC= MD_RESET)) {=0D - MicroSecondDelay (10);=0D - }=0D - }=0D -=0D - //=0D - // Initialize event ring=0D - //=0D - ZeroMem (&Instance->EventRing, sizeof (EVENT_RING));=0D - Status =3D CreateEventRing (Instance, &Instance->EventRing);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - // Init IN and OUT endpoint context=0D - //=0D - Status =3D CreateDebugCapabilityContext (Instance);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - // Init data buffer used to transfer=0D - //=0D - Instance->Urb.Data =3D (EFI_PHYSICAL_ADDRESS) (UINTN) AllocateAlignBuffe= r (XHC_DEBUG_PORT_DATA_LENGTH);=0D -=0D - //=0D - // Init DCDDI1 and DCDDI2=0D - //=0D - XhcWriteDebugReg (=0D - Instance,=0D - XHC_DC_DCDDI1,=0D - (UINT32)((XHCI_DEBUG_DEVICE_VENDOR_ID << 16) | XHCI_DEBUG_DEVICE_PROTOC= OL)=0D - );=0D -=0D - XhcWriteDebugReg (=0D - Instance,=0D - XHC_DC_DCDDI2,=0D - (UINT32)((XHCI_DEBUG_DEVICE_REVISION << 16) | XHCI_DEBUG_DEVICE_PRODUCT= _ID)=0D - );=0D -=0D - //=0D - // Set DCE bit and LSE bit to "1" in DCCTRL=0D - //=0D - XhcSetDebugRegBit (Instance, XHC_DC_DCCTRL, BIT1|BIT31);=0D -=0D - TimeOut =3D DivU64x32 (PcdGet64 (PcdXhciHostWaitTimeout), XHC_POLL_DELAY= ) + 1;=0D - while (TimeOut !=3D 0) {=0D - //=0D - // Check if debug device is in configured state=0D - //=0D - Dcctrl =3D XhcReadDebugReg (Instance, XHC_DC_DCCTRL);=0D - if ((Dcctrl & BIT0) !=3D 0) {=0D - //=0D - // Set the flag to indicate debug device is ready=0D - //=0D - Instance->Ready =3D TRUE;=0D - break;=0D - }=0D - MicroSecondDelay (XHC_POLL_DELAY);=0D - TimeOut--;=0D - }=0D -=0D - if (!Instance->Ready) {=0D - XhcClearDebugRegBit (Instance, XHC_DC_DCCTRL, BIT1|BIT31);=0D - } else {=0D - TestString =3D "Usb 3.0 Debug Message Start\n";=0D - Length =3D AsciiStrLen (TestString);=0D - XhcDataTransfer (=0D - Instance,=0D - EfiUsbDataOut,=0D - TestString,=0D - &Length,=0D - 0,=0D - &TransferResult=0D - );=0D - }=0D -=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command);=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Update XHC hardware address when MMIO base is changed.=0D -=0D - @param Instance The XHCI Instance.=0D - @param XhcMmioBase XHCI MMIO base address.=0D -=0D -**/=0D -VOID=0D -FixUsb3InstanceResource (=0D - IN OUT USB3_DEBUG_PORT_INSTANCE *Instance,=0D - IN EFI_PHYSICAL_ADDRESS XhcMmioBase=0D - )=0D -{=0D - if ((Instance =3D=3D NULL) || (Instance->XhcMmioBase =3D=3D XhcMmioBase)= ) {=0D - return;=0D - }=0D -=0D - //=0D - // Need fix Instance data according to PCI resource=0D - //=0D - Instance->XhcMmioBase =3D XhcMmioBase;=0D - Instance->DebugCapabilityBase =3D XhcMmioBase + Instance->DebugCapabilit= yOffset;=0D - Instance->XhciOpRegister =3D XhcMmioBase + MmioRead8 ((UINTN)XhcMmi= oBase);=0D -}=0D -=0D -/**=0D - Save USB3 instance address.=0D -=0D - @param[in] Instance The XHCI Instance.=0D -=0D -**/=0D -VOID=0D -SaveUsb3InstanceAddress (=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - )=0D -{=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D -=0D - Command =3D GetXhciPciCommand ();=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - //=0D - // Set Command Register=0D - //=0D - if ((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - //=0D - // After debug device is finished to enumerate, use DCDDI2 register to s= tore instance address=0D - //=0D - XhcWriteDebugReg (=0D - Instance,=0D - XHC_DC_DCDDI2,=0D - (UINT32)(UINTN)Instance=0D - );=0D -=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command);=0D -}=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibDxe.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/U= sb3DebugPortLibDxe.c deleted file mode 100644 index 8c3dd999db..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibDxe.c +++ /dev/null @@ -1,454 +0,0 @@ -/** @file=0D - Usb3 Debug Port library instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -extern EFI_SMRAM_DESCRIPTOR mSmramCheckRanges[MAX_SMRAM_RANGE];=0D -extern UINTN mSmramCheckRangeCount;=0D -extern BOOLEAN mUsb3InSmm;=0D -extern UINT64 mUsb3MmioSize;=0D -extern BOOLEAN mUsb3GetCapSuccess;=0D -=0D -GUID gUsb3DbgGuid =3D USB3_DBG_GUID;=0D -=0D -USB3_DEBUG_PORT_CONTROLLER mUsb3DebugPort;=0D -USB3_DEBUG_PORT_INSTANCE *mUsb3Instance =3D NULL;=0D -=0D -/**=0D - Return XHCI MMIO base address.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -GetXhciBaseAddress (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - UINT32 Low;=0D - UINT32 High;=0D -=0D - if (mUsb3DebugPort.Controller =3D=3D 0) {=0D - mUsb3DebugPort.Controller =3D GetUsb3DebugPortController();=0D - }=0D -=0D - Bus =3D mUsb3DebugPort.PciAddress.Bus;=0D - Device =3D mUsb3DebugPort.PciAddress.Device;=0D - Function =3D mUsb3DebugPort.PciAddress.Function;=0D -=0D - Low =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRE= SSREG_OFFSET));=0D - High =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDR= ESSREG_OFFSET + 4));=0D - Address =3D (EFI_PHYSICAL_ADDRESS) (LShiftU64 ((UINT64) High, 32) | Low)= ;=0D - //=0D - // Mask other parts which are not part of base address=0D - //=0D - Address &=3D XHCI_BASE_ADDRESS_64_BIT_MASK;=0D - return Address;=0D -}=0D -=0D -/**=0D - Return XHCI debug instance address.=0D -=0D -**/=0D -USB3_DEBUG_PORT_INSTANCE *=0D -GetUsb3DebugPortInstance (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D - UINT64 CapabilityPointer;=0D - UINT32 Capability;=0D - BOOLEAN Flag;=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D -=0D - Instance =3D NULL;=0D -=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - if ((XhcMmioBase =3D=3D 0) || (XhcMmioBase =3D=3D XHCI_BASE_ADDRESS_64_B= IT_MASK)) {=0D - return NULL;=0D - }=0D -=0D - if (mUsb3Instance !=3D NULL) {=0D - FixUsb3InstanceResource (mUsb3Instance, XhcMmioBase);=0D - return mUsb3Instance;=0D - }=0D -=0D - Command =3D GetXhciPciCommand ();=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - //=0D - // Set Command Register=0D - //=0D - if ((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - //=0D - // Calculate capability offset from HCCPARAMS [16:31], in 32-bit words=0D - //=0D - CapabilityPointer =3D XhcMmioBase + (MmioRead32 ((UINTN)(XhcMmioBase + X= HC_HCCPARAMS_OFFSET)) >> 16) * 4;=0D -=0D - //=0D - // Search XHCI debug capability=0D - //=0D - Flag =3D FALSE;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - while (TRUE) {=0D - if ((Capability & XHC_CAPABILITY_ID_MASK) =3D=3D PCI_CAPABILITY_ID_DEB= UG_PORT) {=0D - Flag =3D TRUE;=0D - break;=0D - }=0D - if ((((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) & XHC_CAPABILITY_I= D_MASK) =3D=3D 0) {=0D - //=0D - // Reach the end of list, quit=0D - //=0D - break;=0D - }=0D - CapabilityPointer +=3D ((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) = * 4;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - }=0D -=0D - if (Flag) {=0D - Instance =3D (USB3_DEBUG_PORT_INSTANCE *)(UINTN) MmioRead32 ((UINTN) (= CapabilityPointer + XHC_DC_DCDDI2));=0D -=0D - if (Instance !=3D NULL) {=0D - FixUsb3InstanceResource (Instance, XhcMmioBase);=0D - }=0D - }=0D -=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16(PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET), = Command);=0D -=0D - return Instance;=0D -}=0D -=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The USB3 debug port was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3Initialize (=0D - VOID=0D - )=0D -{=0D - //=0D - // Leave it empty, we assume PEI phase already do initialization=0D - //=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3InitializeReal (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE UsbDbg;=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - EFI_STATUS Status;=0D -=0D - if ((gST =3D=3D NULL) || (gBS =3D=3D NULL)) {=0D - //=0D - // gST and gBS have not been initialized yet=0D - //=0D - return EFI_DEVICE_ERROR;=0D - }=0D -=0D - Status =3D EfiGetSystemConfigurationTable (&gUsb3DbgGuid, (VOID **) &mUs= b3Instance);=0D - if (!EFI_ERROR (Status)) {=0D - return RETURN_SUCCESS;=0D - }=0D -=0D - //=0D - // It is first time to run DXE instance, copy Instance from Hob to ACPIN= vs=0D - // NOTE: Hob is not ready at this time, so copy it from XHCI register.=0D - //=0D - Instance =3D GetUsb3DebugPortInstance ();=0D - if (Instance =3D=3D NULL) {=0D - //=0D - // Initialize USB debug=0D - //=0D - SetMem (&UsbDbg, sizeof(UsbDbg), 0);=0D - DiscoverUsb3DebugPort (&UsbDbg);=0D - if (UsbDbg.DebugSupport) {=0D - InitializeUsb3DebugPort (&UsbDbg);=0D - }=0D - Instance =3D &UsbDbg;=0D - }=0D - Address =3D SIZE_4GB;=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (sizeof (USB3_DEBUG_PORT_INSTANCE)),=0D - &Address=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - CopyMem (=0D - (VOID *)(UINTN)Address,=0D - Instance,=0D - sizeof (USB3_DEBUG_PORT_INSTANCE)=0D - );=0D - mUsb3Instance =3D (USB3_DEBUG_PORT_INSTANCE *)(UINTN)Address;=0D -=0D - Status =3D gBS->InstallConfigurationTable (&gUsb3DbgGuid, mUsb3Instance)= ;=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - if (mUsb3Instance->DebugSupport) {=0D - SaveUsb3InstanceAddress (mUsb3Instance);=0D - }=0D -=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Calculate the size of XHCI MMIO space.=0D -=0D - @retval TURE The XHCI MMIO is in SMRAM ranges.=0D - @retval FALSE The XHCI MMIO is out of SMRAM ranges.=0D -**/=0D -UINT64=0D -CalculateMmioSize (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT32 Value;=0D - UINT32 Mask;=0D - UINT64 MmioSize;=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - Mask =3D 0xFFFFFFF0;=0D - MmioSize =3D 0;=0D -=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - //=0D - // Disable MSE=0D - //=0D - Command =3D PciRead16 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAN= D_OFFSET));=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command & ~(EFI_PCI_COMMAND_MEMORY_SPACE));=0D -=0D - //=0D - // Get Mmio Size=0D - //=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET), 0xFFFFFFFF);=0D - Value =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_= ADDRESSREG_OFFSET));=0D -=0D - switch (Value & 0x07) {=0D - case 0x0:=0D - //=0D - // Memory space: anywhere in 32 bit address space=0D - //=0D - MmioSize =3D (~(Value & Mask)) + 1;=0D - break;=0D - case 0x4:=0D - //=0D - // Memory space: anywhere in 64 bit address space=0D - //=0D - MmioSize =3D Value & Mask;=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSR= EG_OFFSET + 4), 0xFFFFFFFF);=0D - Value =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_B= ASE_ADDRESSREG_OFFSET + 4));=0D - //=0D - // Fix the length to support some spefic 64 bit BAR=0D - //=0D - Value |=3D ((UINT32)(-1) << HighBitSet32 (Value));=0D - //=0D - // Calculate the size of 64bit bar=0D - //=0D - MmioSize |=3D LShiftU64 ((UINT64) Value, 32);=0D - MmioSize =3D (~(MmioSize)) + 1;=0D - break;=0D - default:=0D - //=0D - // Unknown BAR type=0D - //=0D - MmioSize =3D (~(Value & Mask)) + 1;=0D - break;=0D - };=0D -=0D -=0D - //=0D - // Restore MMIO address=0D - //=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET), (UINT32)XhcMmioBase);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET + 4), (UINT32) (XhcMmioBase >> 32));=0D -=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D -=0D - return MmioSize;=0D -}=0D -=0D -/**=0D - The constructor function initialize USB3 debug port.=0D -=0D - @param ImageHandle The firmware allocated handle for the EFI image.=0D - @param SystemTable A pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -Usb3DebugPortLibDxeConstructor (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_SMM_BASE2_PROTOCOL *SmmBase;=0D - EFI_SMM_ACCESS2_PROTOCOL *SmmAccess;=0D - UINTN Size;=0D - EFI_STATUS Status;=0D -=0D - //=0D - // Do real initialization here, because we need copy data from Hob to AC= PINvs.=0D - // We must do it in constructor because it depends on UefiBootServicesTa= bleLib.=0D - //=0D - if (FeaturePcdGet (PcdStatusCodeUseUsb3Serial)) {=0D - USB3InitializeReal ();=0D - }=0D -=0D - mUsb3MmioSize =3D CalculateMmioSize ();=0D -=0D - if (gBS !=3D NULL) {=0D - SmmBase =3D NULL;=0D - Status =3D gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID= **)&SmmBase);=0D - if (!EFI_ERROR (Status)) {=0D - SmmBase->InSmm(SmmBase, &mUsb3InSmm);=0D - }=0D -=0D - if (mUsb3InSmm) {=0D - //=0D - // Get SMRAM information=0D - //=0D - SmmAccess =3D NULL;=0D - Status =3D gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (= VOID **)&SmmAccess);=0D - if (!EFI_ERROR (Status)) {=0D - Size =3D sizeof (mSmramCheckRanges);=0D -=0D - Status =3D SmmAccess->GetCapabilities (SmmAccess, &Size, mSmramChe= ckRanges);=0D - if (!EFI_ERROR (Status)) {=0D - mSmramCheckRangeCount =3D Size / sizeof (EFI_SMRAM_DESCRIPTOR);= =0D - }=0D - }=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Allocate aligned memory for XHC's usage.=0D -=0D - @param BufferSize The size, in bytes, of the Buffer.=0D -=0D - @return A pointer to the allocated buffer or NULL if allocation fails.=0D -=0D -**/=0D -VOID*=0D -AllocateAlignBuffer (=0D - IN UINTN BufferSize=0D - )=0D -{=0D - VOID *Buf;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - EFI_STATUS Status;=0D -=0D - Buf =3D NULL;=0D -=0D - if (gBS !=3D NULL) {=0D - Address =3D 0xFFFFFFFF;=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &Address=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Buf =3D (VOID *)(UINTN)Address;=0D - }=0D - }=0D -=0D - return Buf;=0D -}=0D -=0D -/**=0D - Check whether AllocatePages in permanent memory is ready.=0D -=0D - @retval TRUE AllocatePages in permanent memory is ready.=0D - @retval FALSE AllocatePages in permanent memory is not ready.=0D -=0D -**/=0D -BOOLEAN=0D -IsAllocatePagesReady (=0D - VOID=0D - )=0D -{=0D - if (gBS !=3D NULL) {=0D - return TRUE;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibDxe.inf b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibDxe.inf deleted file mode 100644 index e238fa0de9..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibDxe.inf +++ /dev/null @@ -1,55 +0,0 @@ -## @file=0D -# Usb3 debug port library.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D Usb3DebugPortLibDxe=0D - FILE_GUID =3D 08A575C4-D962-4ca5-8855-D3B4AE93A141= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortLib|DXE_CORE DXE_DRIVER = DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIV= ER SMM_CORE=0D - CONSTRUCTOR =3D Usb3DebugPortLibDxeConstructor=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[Sources]=0D - Usb3DebugPortLibDxe.c=0D - Usb3DebugPortDataTransfer.c=0D - Usb3DebugPortInitialize.c=0D - MiscServices.c=0D - Usb3DebugPortLibInternal.h=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - PcdLib=0D - IoLib=0D - PciLib=0D - TimerLib=0D - UefiBootServicesTableLib=0D - UefiLib=0D - HobLib=0D - Usb3DebugPortParameterLib=0D -=0D -[Protocols]=0D - gEfiSmmAccess2ProtocolGuid ## CONSUMES=0D - gEfiSmmBase2ProtocolGuid ## CONSUMES=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress ## SOMETIME= S_CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout ## CONSUMES= =0D -=0D -[FeaturePcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseUsb3Serial ## CONSUMES= =0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibDxeIoMmu.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPort= Lib/Usb3DebugPortLibDxeIoMmu.c deleted file mode 100644 index 97c3f88113..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibDxeIoMmu.c +++ /dev/null @@ -1,828 +0,0 @@ -/** @file=0D - Usb3 Debug Port library instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -extern EFI_SMRAM_DESCRIPTOR mSmramCheckRanges[MAX_SMRAM_RANGE];=0D -extern UINTN mSmramCheckRangeCount;=0D -extern BOOLEAN mUsb3InSmm;=0D -extern UINT64 mUsb3MmioSize;=0D -extern BOOLEAN mUsb3GetCapSuccess;=0D -=0D -GUID gUsb3DbgGuid =3D USB3_DBG_GUID;=0D -=0D -USB3_DEBUG_PORT_CONTROLLER mUsb3DebugPort;=0D -USB3_DEBUG_PORT_INSTANCE *mUsb3Instance =3D NULL;=0D -EFI_PCI_IO_PROTOCOL *mUsb3PciIo =3D NULL;=0D -=0D -/**=0D - Creates a named event that can be signaled.=0D -=0D - This function creates an event using NotifyTpl, NoifyFunction.=0D - If Name is NULL, then ASSERT().=0D - If NotifyTpl is not a legal TPL value, then ASSERT().=0D - If NotifyFunction is NULL, then ASSERT().=0D -=0D - @param Name Supplies the GUID name of the event.=0D - @param NotifyTpl Supplies the task priority level of the ev= ent notifications.=0D - @param NotifyFunction Supplies the function to notify when the e= vent is signaled.=0D - @param Event A pointer to the event created.=0D -=0D - @retval EFI_SUCCESS A named event was created.=0D - @retval EFI_OUT_OF_RESOURCES There are not enough resource to create th= e named event.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -Usb3NamedEventListen (=0D - IN CONST EFI_GUID *Name,=0D - IN EFI_TPL NotifyTpl,=0D - IN EFI_EVENT_NOTIFY NotifyFunction,=0D - IN EFI_EVENT *Event=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *RegistrationLocal;=0D -=0D - ASSERT (Name !=3D NULL);=0D - ASSERT (NotifyFunction !=3D NULL);=0D - ASSERT (NotifyTpl <=3D TPL_HIGH_LEVEL);=0D -=0D - //=0D - // Create event=0D - //=0D - Status =3D gBS->CreateEvent (=0D - EVT_NOTIFY_SIGNAL,=0D - NotifyTpl,=0D - NotifyFunction,=0D - NULL,=0D - Event=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - // Register for an installation of protocol interface=0D - //=0D - Status =3D gBS->RegisterProtocolNotify (=0D - (EFI_GUID *) Name,=0D - *Event,=0D - &RegistrationLocal=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - USB3 map one DMA buffer.=0D -=0D - @param PciIo Pointer to PciIo for USB3 debug port.=0D - @param Address DMA buffer address to be mapped.=0D - @param NumberOfBytes Number of bytes to be mapped.=0D -=0D -**/=0D -VOID=0D -Usb3MapOneDmaBuffer (=0D - IN EFI_PCI_IO_PROTOCOL *PciIo,=0D - IN EFI_PHYSICAL_ADDRESS Address,=0D - IN UINTN NumberOfBytes=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *HostAddress;=0D - EFI_PHYSICAL_ADDRESS DeviceAddress;=0D - VOID *Mapping;=0D -=0D - HostAddress =3D (VOID *) (UINTN) Address;=0D - Status =3D PciIo->Map (=0D - PciIo,=0D - EfiPciIoOperationBusMasterCommonBuffer,=0D - HostAddress,=0D - &NumberOfBytes,=0D - &DeviceAddress,=0D - &Mapping=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - ASSERT (DeviceAddress =3D=3D ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress= ));=0D -}=0D -=0D -/**=0D - USB3 map DMA buffers.=0D -=0D - @param Instance Pointer to USB3 debug port instance.=0D - @param PciIo Pointer to PciIo for USB3 debug port.=0D -=0D -**/=0D -VOID=0D -Usb3MapDmaBuffers (=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance,=0D - IN EFI_PCI_IO_PROTOCOL *PciIo=0D - )=0D -{=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->Urb.Data,=0D - XHC_DEBUG_PORT_DATA_LENGTH=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->TransferRingIn.RingSeg0,=0D - sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->TransferRingOut.RingSeg0,=0D - sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->EventRing.EventRingSeg0,=0D - sizeof (TRB_TEMPLATE) * EVENT_RING_TRB_NUMBER=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->EventRing.ERSTBase,=0D - sizeof (EVENT_RING_SEG_TABLE_ENTRY) * ERST_NUMBER=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - Instance->DebugCapabilityContext,=0D - sizeof (XHC_DC_CONTEXT)=0D - );=0D -=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - ((XHC_DC_CONTEXT *) (UINTN) Instance->DebugCapabilityContext)->DbcInfo= Context.String0DescAddress,=0D - STRING0_DESC_LEN + MANU_DESC_LEN + PRODUCT_DESC_LEN + SERIAL_DESC_LEN= =0D - );=0D -}=0D -=0D -/**=0D - Invoke a notification event=0D -=0D - @param[in] Event Event whose notification function is b= eing invoked.=0D - @param[in] Context The pointer to the notification functi= on's context,=0D - which is implementation-dependent.=0D -=0D -**/=0D -VOID=0D -EFIAPI=0D -Usb3DxeSmmReadyToLockNotify (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -{=0D - ASSERT (mUsb3Instance !=3D NULL);=0D -=0D - //=0D - // For the case that the USB3 debug port instance and DMA buffers are=0D - // from PEI HOB with IOMMU enabled.=0D - // Reinitialize USB3 debug port with granted DXE DMA buffer accessible=0D - // by SMM environment.=0D - //=0D - InitializeUsb3DebugPort (mUsb3Instance);=0D -=0D - SaveUsb3InstanceAddress (mUsb3Instance);=0D -=0D - gBS->CloseEvent (Event);=0D -}=0D -=0D -/**=0D - USB3 get IOMMU protocol.=0D -=0D - @return Pointer to IOMMU protocol.=0D -=0D -**/=0D -EDKII_IOMMU_PROTOCOL *=0D -Usb3GetIoMmu (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EDKII_IOMMU_PROTOCOL *IoMmu;=0D -=0D - IoMmu =3D NULL;=0D - Status =3D gBS->LocateProtocol (=0D - &gEdkiiIoMmuProtocolGuid,=0D - NULL,=0D - (VOID **) &IoMmu=0D - );=0D - if (!EFI_ERROR (Status) && (IoMmu !=3D NULL)) {=0D - return IoMmu;=0D - }=0D -=0D - return NULL;=0D -}=0D -=0D -/**=0D - Invoke a notification event=0D -=0D - @param[in] Event Event whose notification function is b= eing invoked.=0D - @param[in] Context The pointer to the notification functi= on's context,=0D - which is implementation-dependent.=0D -=0D -**/=0D -VOID=0D -EFIAPI=0D -Usb3PciIoNotify (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN PciIoHandleCount;=0D - EFI_HANDLE *PciIoHandleBuffer;=0D - UINTN Index;=0D - EFI_PCI_IO_PROTOCOL *PciIo;=0D - UINTN PciSegment;=0D - UINTN PciBusNumber;=0D - UINTN PciDeviceNumber;=0D - UINTN PciFunctionNumber;=0D - EFI_EVENT SmmReadyToLockEvent;=0D -=0D - Status =3D gBS->LocateHandleBuffer (=0D - ByProtocol,=0D - &gEfiPciIoProtocolGuid,=0D - NULL,=0D - &PciIoHandleCount,=0D - &PciIoHandleBuffer=0D - );=0D - if (!EFI_ERROR (Status) &&=0D - (PciIoHandleBuffer !=3D NULL) &&=0D - (PciIoHandleCount !=3D 0)) {=0D - for (Index =3D 0; Index < PciIoHandleCount; Index++) {=0D - Status =3D gBS->HandleProtocol (=0D - PciIoHandleBuffer[Index],=0D - &gEfiPciIoProtocolGuid,=0D - (VOID **) &PciIo=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - Status =3D PciIo->GetLocation (PciIo, &PciSegment, &PciBusNumber, &P= ciDeviceNumber, &PciFunctionNumber);=0D - ASSERT_EFI_ERROR (Status);=0D - if ((PciBusNumber =3D=3D mUsb3DebugPort.PciAddress.Bus) &&=0D - (PciDeviceNumber =3D=3D mUsb3DebugPort.PciAddress.Device) &&=0D - (PciFunctionNumber =3D=3D mUsb3DebugPort.PciAddress.Function)) {= =0D - //=0D - // Found the PciIo for USB3 debug port.=0D - //=0D - ASSERT (mUsb3Instance !=3D NULL);=0D - if (Usb3GetIoMmu () !=3D NULL) {=0D - Usb3MapDmaBuffers (mUsb3Instance, PciIo);=0D -=0D - if (mUsb3Instance->FromHob) {=0D - mUsb3PciIo =3D PciIo;=0D - Usb3NamedEventListen (=0D - &gEfiDxeSmmReadyToLockProtocolGuid,=0D - TPL_NOTIFY,=0D - Usb3DxeSmmReadyToLockNotify,=0D - &SmmReadyToLockEvent=0D - );=0D - }=0D - }=0D - gBS->CloseEvent (Event);=0D - break;=0D - }=0D - }=0D -=0D - gBS->FreePool (PciIoHandleBuffer);=0D - }=0D -}=0D -=0D -/**=0D - Return XHCI MMIO base address.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -GetXhciBaseAddress (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - UINT32 Low;=0D - UINT32 High;=0D -=0D - if (mUsb3DebugPort.Controller =3D=3D 0) {=0D - mUsb3DebugPort.Controller =3D GetUsb3DebugPortController();=0D - }=0D -=0D - Bus =3D mUsb3DebugPort.PciAddress.Bus;=0D - Device =3D mUsb3DebugPort.PciAddress.Device;=0D - Function =3D mUsb3DebugPort.PciAddress.Function;=0D -=0D - Low =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRE= SSREG_OFFSET));=0D - High =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDR= ESSREG_OFFSET + 4));=0D - Address =3D (EFI_PHYSICAL_ADDRESS) (LShiftU64 ((UINT64) High, 32) | Low)= ;=0D - //=0D - // Mask other parts which are not part of base address=0D - //=0D - Address &=3D XHCI_BASE_ADDRESS_64_BIT_MASK;=0D - return Address;=0D -}=0D -=0D -/**=0D - Return XHCI debug instance address.=0D -=0D -**/=0D -USB3_DEBUG_PORT_INSTANCE *=0D -GetUsb3DebugPortInstance (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D - UINT64 CapabilityPointer;=0D - UINT32 Capability;=0D - BOOLEAN Flag;=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D -=0D - Instance =3D NULL;=0D -=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - if ((XhcMmioBase =3D=3D 0) || (XhcMmioBase =3D=3D XHCI_BASE_ADDRESS_64_B= IT_MASK)) {=0D - return NULL;=0D - }=0D -=0D - if (mUsb3Instance !=3D NULL) {=0D - FixUsb3InstanceResource (mUsb3Instance, XhcMmioBase);=0D - return mUsb3Instance;=0D - }=0D -=0D - Command =3D GetXhciPciCommand ();=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - //=0D - // Set Command Register=0D - //=0D - if ((Command & EFI_PCI_COMMAND_MEMORY_SPACE) =3D=3D 0) {=0D - PciWrite16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D - PciRead16(PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAND_OFFSET));= =0D - }=0D -=0D - //=0D - // Calculate capability offset from HCCPARAMS [16:31], in 32-bit words=0D - //=0D - CapabilityPointer =3D XhcMmioBase + (MmioRead32 ((UINTN)(XhcMmioBase + X= HC_HCCPARAMS_OFFSET)) >> 16) * 4;=0D -=0D - //=0D - // Search XHCI debug capability=0D - //=0D - Flag =3D FALSE;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - while (TRUE) {=0D - if ((Capability & XHC_CAPABILITY_ID_MASK) =3D=3D PCI_CAPABILITY_ID_DEB= UG_PORT) {=0D - Flag =3D TRUE;=0D - break;=0D - }=0D - if ((((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) & XHC_CAPABILITY_I= D_MASK) =3D=3D 0) {=0D - //=0D - // Reach the end of list, quit=0D - //=0D - break;=0D - }=0D - CapabilityPointer +=3D ((Capability & XHC_NEXT_CAPABILITY_MASK) >> 8) = * 4;=0D - Capability =3D MmioRead32 ((UINTN)CapabilityPointer);=0D - }=0D -=0D - if (Flag) {=0D - Instance =3D (USB3_DEBUG_PORT_INSTANCE *)(UINTN) MmioRead32 ((UINTN) (= CapabilityPointer + XHC_DC_DCDDI2));=0D -=0D - if (Instance !=3D NULL) {=0D - FixUsb3InstanceResource (Instance, XhcMmioBase);=0D - }=0D - }=0D -=0D - //=0D - // Restore Command Register=0D - //=0D - PciWrite16(PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET), = Command);=0D -=0D - return Instance;=0D -}=0D -=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The USB3 debug port was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3Initialize (=0D - VOID=0D - )=0D -{=0D - //=0D - // Leave it empty, we assume PEI phase already do initialization=0D - //=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3InitializeReal (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE UsbDbg;=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - EFI_STATUS Status;=0D - EFI_EVENT Event;=0D -=0D - if ((gST =3D=3D NULL) || (gBS =3D=3D NULL)) {=0D - //=0D - // gST and gBS have not been initialized yet=0D - //=0D - return EFI_DEVICE_ERROR;=0D - }=0D -=0D - Status =3D EfiGetSystemConfigurationTable (&gUsb3DbgGuid, (VOID **) &mUs= b3Instance);=0D - if (!EFI_ERROR (Status)) {=0D - goto Done;=0D - }=0D -=0D - //=0D - // It is first time to run DXE instance, copy Instance from Hob to ACPIN= vs=0D - // NOTE: Hob is not ready at this time, so copy it from XHCI register.=0D - //=0D - Instance =3D GetUsb3DebugPortInstance ();=0D - if (Instance =3D=3D NULL) {=0D - //=0D - // Initialize USB debug=0D - //=0D - SetMem (&UsbDbg, sizeof(UsbDbg), 0);=0D - DiscoverUsb3DebugPort (&UsbDbg);=0D - if (UsbDbg.DebugSupport) {=0D - InitializeUsb3DebugPort (&UsbDbg);=0D - }=0D - Instance =3D &UsbDbg;=0D - }=0D - Address =3D SIZE_4GB;=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (sizeof (USB3_DEBUG_PORT_INSTANCE)),=0D - &Address=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - CopyMem (=0D - (VOID *)(UINTN)Address,=0D - Instance,=0D - sizeof (USB3_DEBUG_PORT_INSTANCE)=0D - );=0D - mUsb3Instance =3D (USB3_DEBUG_PORT_INSTANCE *)(UINTN)Address;=0D -=0D - Status =3D gBS->InstallConfigurationTable (&gUsb3DbgGuid, mUsb3Instance)= ;=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - if (mUsb3Instance->DebugSupport) {=0D - SaveUsb3InstanceAddress (mUsb3Instance);=0D - }=0D -=0D -Done:=0D - if ((mUsb3Instance !=3D NULL) && mUsb3Instance->Ready && (mUsb3Instance-= >PciIoEvent =3D=3D 0)) {=0D - Status =3D Usb3NamedEventListen (=0D - &gEfiPciIoProtocolGuid,=0D - TPL_NOTIFY,=0D - Usb3PciIoNotify,=0D - &Event=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - mUsb3Instance->PciIoEvent =3D (EFI_PHYSICAL_ADDRESS) (UINTN) Event;= =0D - }=0D - }=0D -=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Calculate the size of XHCI MMIO space.=0D -=0D - @retval TURE The XHCI MMIO is in SMRAM ranges.=0D - @retval FALSE The XHCI MMIO is out of SMRAM ranges.=0D -**/=0D -UINT64=0D -CalculateMmioSize (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - UINT32 Value;=0D - UINT32 Mask;=0D - UINT64 MmioSize;=0D - UINT16 Command;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D -=0D - Mask =3D 0xFFFFFFF0;=0D - MmioSize =3D 0;=0D -=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - //=0D - // Disable MSE=0D - //=0D - Command =3D PciRead16 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_COMMAN= D_OFFSET));=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command & ~(EFI_PCI_COMMAND_MEMORY_SPACE));=0D -=0D - //=0D - // Get Mmio Size=0D - //=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET), 0xFFFFFFFF);=0D - Value =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_= ADDRESSREG_OFFSET));=0D -=0D - switch (Value & 0x07) {=0D - case 0x0:=0D - //=0D - // Memory space: anywhere in 32 bit address space=0D - //=0D - MmioSize =3D (~(Value & Mask)) + 1;=0D - break;=0D - case 0x4:=0D - //=0D - // Memory space: anywhere in 64 bit address space=0D - //=0D - MmioSize =3D Value & Mask;=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSR= EG_OFFSET + 4), 0xFFFFFFFF);=0D - Value =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_B= ASE_ADDRESSREG_OFFSET + 4));=0D - //=0D - // Fix the length to support some spefic 64 bit BAR=0D - //=0D - Value |=3D ((UINT32)(-1) << HighBitSet32 (Value));=0D - //=0D - // Calculate the size of 64bit bar=0D - //=0D - MmioSize |=3D LShiftU64 ((UINT64) Value, 32);=0D - MmioSize =3D (~(MmioSize)) + 1;=0D - break;=0D - default:=0D - //=0D - // Unknown BAR type=0D - //=0D - MmioSize =3D (~(Value & Mask)) + 1;=0D - break;=0D - };=0D -=0D -=0D - //=0D - // Restore MMIO address=0D - //=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET), (UINT32)XhcMmioBase);=0D - PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_O= FFSET + 4), (UINT32) (XhcMmioBase >> 32));=0D -=0D - PciWrite16 (PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET),= Command | EFI_PCI_COMMAND_MEMORY_SPACE);=0D -=0D - return MmioSize;=0D -}=0D -=0D -/**=0D - The constructor function initialize USB3 debug port.=0D -=0D - @param ImageHandle The firmware allocated handle for the EFI image.=0D - @param SystemTable A pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -Usb3DebugPortLibDxeConstructor (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_SMM_BASE2_PROTOCOL *SmmBase;=0D - EFI_SMM_ACCESS2_PROTOCOL *SmmAccess;=0D - UINTN Size;=0D - EFI_STATUS Status;=0D -=0D - //=0D - // Do real initialization here, because we need copy data from Hob to AC= PINvs.=0D - // We must do it in constructor because it depends on UefiBootServicesTa= bleLib.=0D - //=0D - if (FeaturePcdGet (PcdStatusCodeUseUsb3Serial)) {=0D - USB3InitializeReal ();=0D - }=0D -=0D - mUsb3MmioSize =3D CalculateMmioSize ();=0D -=0D - if (gBS !=3D NULL) {=0D - SmmBase =3D NULL;=0D - Status =3D gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID= **)&SmmBase);=0D - if (!EFI_ERROR (Status)) {=0D - SmmBase->InSmm(SmmBase, &mUsb3InSmm);=0D - }=0D -=0D - if (mUsb3InSmm) {=0D - //=0D - // Get SMRAM information=0D - //=0D - SmmAccess =3D NULL;=0D - Status =3D gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (= VOID **)&SmmAccess);=0D - if (!EFI_ERROR (Status)) {=0D - Size =3D sizeof (mSmramCheckRanges);=0D -=0D - Status =3D SmmAccess->GetCapabilities (SmmAccess, &Size, mSmramChe= ckRanges);=0D - if (!EFI_ERROR (Status)) {=0D - mSmramCheckRangeCount =3D Size / sizeof (EFI_SMRAM_DESCRIPTOR);= =0D - }=0D - }=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - The destructor function.=0D -=0D - @param ImageHandle The firmware allocated handle for the EFI image.=0D - @param SystemTable A pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS The destructor always returns EFI_SUCCESS.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -Usb3DebugPortLibDxeDestructor (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - if ((mUsb3Instance !=3D NULL) && (mUsb3Instance->PciIoEvent !=3D 0)) {=0D - //=0D - // Close the event created.=0D - //=0D - gBS->CloseEvent ((EFI_EVENT) (UINTN) mUsb3Instance->PciIoEvent);=0D - mUsb3Instance->PciIoEvent =3D 0;=0D - }=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Allocates pages that are suitable for an OperationBusMasterCommonBuffer = or=0D - OperationBusMasterCommonBuffer64 mapping.=0D -=0D - @param PciIo Pointer to PciIo for USB3 debug port.=0D - @param Pages The number of pages to allocate.=0D - @param Address A pointer to store the base system memory = address of the=0D - allocated range.=0D -=0D - @retval EFI_SUCCESS The requested memory pages were allocated.= =0D - @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal = attribute bits are=0D - MEMORY_WRITE_COMBINE and MEMORY_CACHED.=0D - @retval EFI_INVALID_PARAMETER One or more parameters are invalid.=0D - @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.=0D -=0D -**/=0D -EFI_STATUS=0D -Usb3AllocateDmaBuffer (=0D - IN EFI_PCI_IO_PROTOCOL *PciIo,=0D - IN UINTN Pages,=0D - OUT VOID **Address=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - *Address =3D NULL;=0D - Status =3D PciIo->AllocateBuffer (=0D - PciIo,=0D - AllocateAnyPages,=0D - EfiRuntimeServicesData,=0D - Pages,=0D - Address,=0D - 0=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Usb3MapOneDmaBuffer (=0D - PciIo,=0D - (EFI_PHYSICAL_ADDRESS) (UINTN) *Address,=0D - EFI_PAGES_TO_SIZE (Pages)=0D - );=0D - }=0D - return Status;=0D -}=0D -=0D -/**=0D - Allocate aligned memory for XHC's usage.=0D -=0D - @param BufferSize The size, in bytes, of the Buffer.=0D -=0D - @return A pointer to the allocated buffer or NULL if allocation fails.=0D -=0D -**/=0D -VOID*=0D -AllocateAlignBuffer (=0D - IN UINTN BufferSize=0D - )=0D -{=0D - VOID *Buf;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - EFI_STATUS Status;=0D -=0D - Buf =3D NULL;=0D -=0D - if (gBS !=3D NULL) {=0D - if (mUsb3PciIo !=3D NULL) {=0D - Usb3AllocateDmaBuffer (=0D - mUsb3PciIo,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &Buf=0D - );=0D - } else {=0D - Address =3D 0xFFFFFFFF;=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &Address=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Buf =3D (VOID *)(UINTN)Address;=0D - }=0D - }=0D - }=0D -=0D - return Buf;=0D -}=0D -=0D -/**=0D - Check whether AllocatePages in permanent memory is ready.=0D -=0D - @retval TRUE AllocatePages in permanent memory is ready.=0D - @retval FALSE AllocatePages in permanent memory is not ready.=0D -=0D -**/=0D -BOOLEAN=0D -IsAllocatePagesReady (=0D - VOID=0D - )=0D -{=0D - if (gBS !=3D NULL) {=0D - return TRUE;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibDxeIoMmu.inf b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPo= rtLib/Usb3DebugPortLibDxeIoMmu.inf deleted file mode 100644 index c9c56d7ade..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibDxeIoMmu.inf +++ /dev/null @@ -1,63 +0,0 @@ -## @file=0D -# Usb3 debug port library.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D Usb3DebugPortLibDxeIoMmu=0D - FILE_GUID =3D BC48A65D-5E5E-4512-8ACC-90E79E2D80C2= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortLib|DXE_CORE DXE_DRIVER = DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIV= ER SMM_CORE=0D - CONSTRUCTOR =3D Usb3DebugPortLibDxeConstructor=0D - DESTRUCTOR =3D Usb3DebugPortLibDxeDestructor=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[Sources]=0D - Usb3DebugPortLibDxeIoMmu.c=0D - Usb3DebugPortDataTransfer.c=0D - Usb3DebugPortInitialize.c=0D - MiscServices.c=0D - Usb3DebugPortLibInternal.h=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - PcdLib=0D - IoLib=0D - PciLib=0D - TimerLib=0D - UefiBootServicesTableLib=0D - UefiLib=0D - HobLib=0D - Usb3DebugPortParameterLib=0D -=0D -[Protocols]=0D - gEfiSmmAccess2ProtocolGuid ## CONSUMES=0D - gEfiSmmBase2ProtocolGuid ## CONSUMES=0D - ## NOTIFY=0D - ## SOMETIMES_CONSUMES=0D - gEfiPciIoProtocolGuid=0D - gEdkiiIoMmuProtocolGuid ## SOMETIMES_CONSUMES=0D - ## NOTIFY=0D - gEfiDxeSmmReadyToLockProtocolGuid=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress ## SOMETIME= S_CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout ## CONSUMES= =0D -=0D -[FeaturePcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseUsb3Serial ## CONSUMES= =0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibInternal.h b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPort= Lib/Usb3DebugPortLibInternal.h deleted file mode 100644 index 3641cc1d52..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibInternal.h +++ /dev/null @@ -1,887 +0,0 @@ -/** @file=0D - This library class provides common Usb debug port functions.=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USB3_DEBUG_PORT_LIB_INTERNAL__=0D -#define __USB3_DEBUG_PORT_LIB_INTERNAL__=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -//=0D -// USB Debug GUID value=0D -//=0D -#define USB3_DBG_GUID \=0D - { \=0D - 0xb2a56f4d, 0x9177, 0x4fc8, { 0xa6, 0x77, 0xdd, 0x96, 0x3e, 0xb4, 0x= cb, 0x1b } \=0D - }=0D -=0D -//=0D -// Define the maximum of SMRAM ranges=0D -//=0D -#define MAX_SMRAM_RANGE 8=0D -=0D -#define XHCI_DEBUG_DEVICE_VENDOR_ID 0x8086=0D -#define XHCI_DEBUG_DEVICE_PRODUCT_ID 0x1234=0D -#define XHCI_DEBUG_DEVICE_PROTOCOL 0xFF=0D -#define XHCI_DEBUG_DEVICE_REVISION 0x00=0D -=0D -#define XHCI_BASE_ADDRESS_64_BIT_MASK 0xFFFFFFFFFFFF0000ULL=0D -#define XHCI_BASE_ADDRESS_32_BIT_MASK 0xFFFF0000=0D -=0D -#define PCI_CAPABILITY_ID_DEBUG_PORT 0x0A=0D -#define XHC_HCCPARAMS_OFFSET 0x10=0D -#define XHC_CAPABILITY_ID_MASK 0xFF=0D -#define XHC_NEXT_CAPABILITY_MASK 0xFF00=0D -=0D -#define XHC_USBCMD_OFFSET 0x0 // USB Command Register Offset=0D -#define XHC_USBSTS_OFFSET 0x4 // USB Status Register Offset=0D -=0D -#define XHC_USBCMD_RUN BIT0 // Run/Stop=0D -#define XHC_USBCMD_RESET BIT1 // Host Controller Reset=0D -=0D -#define XHC_USBSTS_HALT BIT0=0D -=0D -//=0D -// Transfer the data of 8 bytes each time=0D -//=0D -#define XHC_DEBUG_PORT_DATA_LENGTH 8=0D -=0D -//=0D -// Indicate the timeout when data is transferred. 0 means infinite timeout= .=0D -//=0D -#define DATA_TRANSFER_TIME_OUT 0=0D -=0D -//=0D -// USB debug device string descritpor (header size + unicode string length= )=0D -//=0D -#define STRING0_DESC_LEN 4=0D -#define MANU_DESC_LEN 12=0D -#define PRODUCT_DESC_LEN 40=0D -#define SERIAL_DESC_LEN 4=0D -=0D -//=0D -// Debug Capability Register Offset=0D -//=0D -#define XHC_DC_DCID 0x0=0D -#define XHC_DC_DCDB 0x4=0D -#define XHC_DC_DCERSTSZ 0x8=0D -#define XHC_DC_DCERSTBA 0x10=0D -#define XHC_DC_DCERDP 0x18=0D -#define XHC_DC_DCCTRL 0x20=0D -#define XHC_DC_DCST 0x24=0D -#define XHC_DC_DCPORTSC 0x28=0D -#define XHC_DC_DCCP 0x30=0D -#define XHC_DC_DCDDI1 0x38=0D -#define XHC_DC_DCDDI2 0x3C=0D -=0D -#define TRB_TYPE_LINK 6=0D -=0D -#define ERST_NUMBER 0x01=0D -#define TR_RING_TRB_NUMBER 0x100=0D -#define EVENT_RING_TRB_NUMBER 0x200=0D -#define CMD_RING_TRB_NUMBER 0x100=0D -=0D -#define ED_BULK_OUT 2=0D -#define ED_BULK_IN 6=0D -=0D -#define XHC_LOW_32BIT(Addr64) ((UINT32)(((UINTN)(Addr64)) & 0xFFF= FFFFF))=0D -#define XHC_HIGH_32BIT(Addr64) ((UINT32)(RShiftU64((UINT64)(UINTN)= (Addr64), 32) & 0xFFFFFFFF))=0D -#define XHC_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) =3D=3D = (Bit)))=0D -=0D -#define XHC_REG_BIT_IS_SET(Xhc, Offset, Bit) \=0D - (XHC_BIT_IS_SET(XhcReadMmioReg ((Xhc), (Offset)), (Bit)))=0D -=0D -//=0D -// Endpoint Type (EP Type).=0D -//=0D -#define ED_NOT_VALID 0=0D -#define ED_ISOCH_OUT 1=0D -#define ED_BULK_OUT 2=0D -#define ED_INTERRUPT_OUT 3=0D -#define ED_CONTROL_BIDIR 4=0D -#define ED_ISOCH_IN 5=0D -#define ED_BULK_IN 6=0D -#define ED_INTERRUPT_IN 7=0D -=0D -//=0D -// 6.4.5 TRB Completion Codes=0D -//=0D -#define TRB_COMPLETION_INVALID 0=0D -#define TRB_COMPLETION_SUCCESS 1=0D -#define TRB_COMPLETION_DATA_BUFFER_ERROR 2=0D -#define TRB_COMPLETION_BABBLE_ERROR 3=0D -#define TRB_COMPLETION_USB_TRANSACTION_ERROR 4=0D -#define TRB_COMPLETION_TRB_ERROR 5=0D -#define TRB_COMPLETION_STALL_ERROR 6=0D -#define TRB_COMPLETION_SHORT_PACKET 13=0D -=0D -//=0D -// 6.4.6 TRB Types=0D -//=0D -#define TRB_TYPE_NORMAL 1=0D -#define TRB_TYPE_SETUP_STAGE 2=0D -#define TRB_TYPE_DATA_STAGE 3=0D -#define TRB_TYPE_STATUS_STAGE 4=0D -#define TRB_TYPE_ISOCH 5=0D -#define TRB_TYPE_LINK 6=0D -#define TRB_TYPE_EVENT_DATA 7=0D -#define TRB_TYPE_NO_OP 8=0D -#define TRB_TYPE_EN_SLOT 9=0D -#define TRB_TYPE_DIS_SLOT 10=0D -#define TRB_TYPE_ADDRESS_DEV 11=0D -#define TRB_TYPE_CON_ENDPOINT 12=0D -#define TRB_TYPE_EVALU_CONTXT 13=0D -#define TRB_TYPE_RESET_ENDPOINT 14=0D -#define TRB_TYPE_STOP_ENDPOINT 15=0D -#define TRB_TYPE_SET_TR_DEQUE 16=0D -#define TRB_TYPE_RESET_DEV 17=0D -#define TRB_TYPE_GET_PORT_BANW 21=0D -#define TRB_TYPE_FORCE_HEADER 22=0D -#define TRB_TYPE_NO_OP_COMMAND 23=0D -#define TRB_TYPE_TRANS_EVENT 32=0D -#define TRB_TYPE_COMMAND_COMPLT_EVENT 33=0D -#define TRB_TYPE_PORT_STATUS_CHANGE_EVENT 34=0D -#define TRB_TYPE_HOST_CONTROLLER_EVENT 37=0D -#define TRB_TYPE_DEVICE_NOTIFI_EVENT 38=0D -#define TRB_TYPE_MFINDEX_WRAP_EVENT 39=0D -=0D -//=0D -// Convert millisecond to microsecond.=0D -//=0D -#define XHC_1_MILLISECOND (1000)=0D -#define XHC_POLL_DELAY (1000)=0D -#define XHC_GENERIC_TIMEOUT (10 * 1000)=0D -=0D -#define EFI_USB_SPEED_FULL 0x0000 ///< 12 Mb/s, USB 1.= 1 OHCI and UHCI HC.=0D -#define EFI_USB_SPEED_LOW 0x0001 ///< 1 Mb/s, USB 1.1= OHCI and UHCI HC.=0D -#define EFI_USB_SPEED_HIGH 0x0002 ///< 480 Mb/s, USB 2= .0 EHCI HC.=0D -#define EFI_USB_SPEED_SUPER 0x0003 ///< 4.8 Gb/s, USB 3= .0 XHCI HC.=0D -=0D -//=0D -// Transfer types, used in URB to identify the transfer type=0D -//=0D -#define XHC_CTRL_TRANSFER 0x01=0D -#define XHC_BULK_TRANSFER 0x02=0D -#define XHC_INT_TRANSFER_SYNC 0x04=0D -#define XHC_INT_TRANSFER_ASYNC 0x08=0D -#define XHC_INT_ONLY_TRANSFER_ASYNC 0x10=0D -=0D -//=0D -// USB Transfer Results=0D -//=0D -#define EFI_USB_NOERROR 0x00=0D -#define EFI_USB_ERR_NOTEXECUTE 0x01=0D -#define EFI_USB_ERR_STALL 0x02=0D -#define EFI_USB_ERR_BUFFER 0x04=0D -#define EFI_USB_ERR_BABBLE 0x08=0D -#define EFI_USB_ERR_NAK 0x10=0D -#define EFI_USB_ERR_CRC 0x20=0D -#define EFI_USB_ERR_TIMEOUT 0x40=0D -#define EFI_USB_ERR_BITSTUFF 0x80=0D -#define EFI_USB_ERR_SYSTEM 0x100=0D -=0D -#define USB3_DEBUG_PORT_INSTANCE_SIGNATURE SIGNATURE_32('D', 'B', 'G', '= P')=0D -=0D -#pragma pack(1)=0D -=0D -//=0D -// 7.6.9 OUT/IN EP Context: 64 bytes=0D -// 7.6.9.2 When used by the DbC it is always a 64 byte data structure=0D -//=0D -typedef struct _ENDPOINT_CONTEXT_64 {=0D - UINT32 EPState:3;=0D - UINT32 RsvdZ1:5;=0D - UINT32 Mult:2; // set to 0=0D - UINT32 MaxPStreams:5; // set to 0=0D - UINT32 LSA:1; // set to 0=0D - UINT32 Interval:8; // set to 0=0D - UINT32 RsvdZ2:8;=0D -=0D - UINT32 RsvdZ3:1;=0D - UINT32 CErr:2;=0D - UINT32 EPType:3;=0D - UINT32 RsvdZ4:1;=0D - UINT32 HID:1; // set to 0=0D - UINT32 MaxBurstSize:8;=0D - UINT32 MaxPacketSize:16;=0D -=0D - UINT32 PtrLo;=0D -=0D - UINT32 PtrHi;=0D -=0D - UINT32 AverageTRBLength:16;=0D - UINT32 MaxESITPayload:16; // set to 0=0D -=0D - UINT32 RsvdZ5; // Reserved=0D - UINT32 RsvdZ6;=0D - UINT32 RsvdZ7;=0D -=0D - UINT32 RsvdZ8;=0D - UINT32 RsvdZ9;=0D - UINT32 RsvdZ10;=0D - UINT32 RsvdZ11;=0D -=0D - UINT32 RsvdZ12;=0D - UINT32 RsvdZ13;=0D - UINT32 RsvdZ14;=0D - UINT32 RsvdZ15;=0D -} ENDPOINT_CONTEXT_64;=0D -=0D -//=0D -// 6.4.1.1 Normal TRB: 16 bytes=0D -// A Normal TRB is used in several ways; exclusively on Bulk and Interrupt= Transfer Rings for normal and=0D -// Scatter/Gather operations, to define additional data buffers for Scatte= r/Gather operations on Isoch Transfer=0D -// Rings, and to define the Data stage information for Control Transfer Ri= ngs.=0D -//=0D -typedef struct _TRANSFER_TRB_NORMAL {=0D - UINT32 TRBPtrLo;=0D -=0D - UINT32 TRBPtrHi;=0D -=0D - UINT32 Length:17;=0D - UINT32 TDSize:5;=0D - UINT32 IntTarget:10;=0D -=0D - UINT32 CycleBit:1;=0D - UINT32 ENT:1;=0D - UINT32 ISP:1;=0D - UINT32 NS:1;=0D - UINT32 CH:1;=0D - UINT32 IOC:1;=0D - UINT32 IDT:1;=0D - UINT32 RsvdZ1:2;=0D - UINT32 BEI:1;=0D - UINT32 Type:6;=0D - UINT32 RsvdZ2:16;=0D -} TRANSFER_TRB_NORMAL;=0D -=0D -//=0D -// 6.4.2.1 Transfer Event TRB: 16 bytes=0D -// A Transfer Event provides the completion status associated with a Trans= fer TRB. Refer to section 4.11.3.1=0D -// for more information on the use and operation of Transfer Events.=0D -//=0D -typedef struct _EVT_TRB_TRANSFER {=0D - UINT32 TRBPtrLo;=0D -=0D - UINT32 TRBPtrHi;=0D -=0D - UINT32 Length:24;=0D - UINT32 Completecode:8;=0D -=0D - UINT32 CycleBit:1;=0D - UINT32 RsvdZ1:1;=0D - UINT32 ED:1;=0D - UINT32 RsvdZ2:7;=0D - UINT32 Type:6;=0D - UINT32 EndpointId:5;=0D - UINT32 RsvdZ3:3;=0D - UINT32 SlotId:8;=0D -} EVT_TRB_TRANSFER;=0D -=0D -//=0D -// 6.4.4.1 Link TRB: 16 bytes=0D -// A Link TRB provides support for non-contiguous TRB Rings.=0D -//=0D -typedef struct _LINK_TRB {=0D - UINT32 PtrLo;=0D -=0D - UINT32 PtrHi;=0D -=0D - UINT32 RsvdZ1:22;=0D - UINT32 InterTarget:10;=0D -=0D - UINT32 CycleBit:1;=0D - UINT32 TC:1;=0D - UINT32 RsvdZ2:2;=0D - UINT32 CH:1;=0D - UINT32 IOC:1;=0D - UINT32 RsvdZ3:4;=0D - UINT32 Type:6;=0D - UINT32 RsvdZ4:16;=0D -} LINK_TRB;=0D -=0D -//=0D -// TRB Template: 16 bytes=0D -//=0D -typedef struct _TRB_TEMPLATE {=0D - UINT32 Parameter1;=0D -=0D - UINT32 Parameter2;=0D -=0D - UINT32 Status;=0D -=0D - UINT32 CycleBit:1;=0D - UINT32 RsvdZ1:9;=0D - UINT32 Type:6;=0D - UINT32 Control:16;=0D -} TRB_TEMPLATE;=0D -=0D -//=0D -// Refer to XHCI 6.5 Event Ring Segment Table: 16 bytes=0D -//=0D -typedef struct _EVENT_RING_SEG_TABLE_ENTRY {=0D - UINT32 PtrLo;=0D - UINT32 PtrHi;=0D - UINT32 RingTrbSize:16;=0D - UINT32 RsvdZ1:16;=0D - UINT32 RsvdZ2;=0D -} EVENT_RING_SEG_TABLE_ENTRY;=0D -=0D -//=0D -// Size: 40 bytes=0D -//=0D -typedef struct _EVENT_RING {=0D - EFI_PHYSICAL_ADDRESS ERSTBase;=0D - EFI_PHYSICAL_ADDRESS EventRingSeg0;=0D - UINT32 TrbNumber;=0D - EFI_PHYSICAL_ADDRESS EventRingEnqueue;=0D - EFI_PHYSICAL_ADDRESS EventRingDequeue;=0D - UINT32 EventRingCCS;=0D -} EVENT_RING;=0D -=0D -// Size: 32 bytes=0D -typedef struct _TRANSFER_RING {=0D - EFI_PHYSICAL_ADDRESS RingSeg0;=0D - UINT32 TrbNumber;=0D - EFI_PHYSICAL_ADDRESS RingEnqueue;=0D - EFI_PHYSICAL_ADDRESS RingDequeue;=0D - UINT32 RingPCS;=0D -} TRANSFER_RING;=0D -=0D -//=0D -// Size: 64 bytes=0D -//=0D -typedef struct _DBC_INFO_CONTEXT {=0D - UINT64 String0DescAddress;=0D - UINT64 ManufacturerStrDescAddress;=0D - UINT64 ProductStrDescAddress;=0D - UINT64 SerialNumberStrDescAddress;=0D - UINT64 String0Length:8;=0D - UINT64 ManufacturerStrLength:8;=0D - UINT64 ProductStrLength:8;=0D - UINT64 SerialNumberStrLength:8;=0D - UINT64 RsvdZ1:32;=0D - UINT64 RsvdZ2;=0D - UINT64 RsvdZ3;=0D - UINT64 RsvdZ4;=0D -} DBC_INFO_CONTEXT;=0D -=0D -//=0D -// Debug Capability Context Data Structure: 192 bytes=0D -//=0D -typedef struct _XHC_DC_CONTEXT {=0D - DBC_INFO_CONTEXT DbcInfoContext;=0D - ENDPOINT_CONTEXT_64 EpOutContext;=0D - ENDPOINT_CONTEXT_64 EpInContext;=0D -} XHC_DC_CONTEXT;=0D -=0D -//=0D -// Size: 16 bytes=0D -//=0D -typedef union _TRB {=0D - TRB_TEMPLATE TrbTemplate;=0D - TRANSFER_TRB_NORMAL TrbNormal;=0D -} TRB;=0D -=0D -///=0D -/// USB data transfer direction=0D -///=0D -typedef enum {=0D - EfiUsbDataIn,=0D - EfiUsbDataOut,=0D - EfiUsbNoData=0D -} EFI_USB_DATA_DIRECTION;=0D -=0D -//=0D -// URB (Usb Request Block) contains information for all kinds of=0D -// usb requests.=0D -//=0D -typedef struct _URB {=0D - UINT32 Signature;=0D - //=0D - // Transfer data=0D - //=0D - EFI_PHYSICAL_ADDRESS Data;=0D - UINT32 DataLen;=0D - //=0D - // Execute result=0D - //=0D - UINT32 Result;=0D - //=0D - // Completed data length=0D - //=0D - UINT32 Completed;=0D - //=0D - // Tranfer Ring info=0D - //=0D - EFI_PHYSICAL_ADDRESS Ring;=0D - EFI_PHYSICAL_ADDRESS TrbStart;=0D - EFI_PHYSICAL_ADDRESS TrbEnd;=0D - UINT32 TrbNum;=0D - BOOLEAN StartDone;=0D - BOOLEAN EndDone;=0D - BOOLEAN Finished;=0D - EFI_USB_DATA_DIRECTION Direction;=0D -} URB;=0D -=0D -//=0D -// Size: 90 bytes=0D -//=0D -typedef struct _USB3_DEBUG_PORT_INSTANCE {=0D - UINT32 Signature;=0D -=0D - UINT8 PciBusNumber;=0D - UINT8 PciDeviceNumber;=0D - UINT8 PciFunctionNumber;=0D -=0D - //=0D - // The flag indicates debug capability is supported=0D - //=0D - BOOLEAN DebugSupport;=0D -=0D - //=0D - // The flag indicates debug device is ready=0D - //=0D - BOOLEAN Ready;=0D -=0D - //=0D - // The flag indicates the instance is from HOB=0D - //=0D - BOOLEAN FromHob;=0D -=0D - //=0D - // PciIo protocol event=0D - //=0D - EFI_PHYSICAL_ADDRESS PciIoEvent;=0D -=0D - //=0D - // XHCI MMIO Base address=0D - //=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D -=0D - //=0D - // XHCI OP RegisterBase address=0D - //=0D - EFI_PHYSICAL_ADDRESS XhciOpRegister;=0D -=0D - //=0D - // XHCI Debug Register Base Address=0D - //=0D - EFI_PHYSICAL_ADDRESS DebugCapabilityBase;=0D -=0D - //=0D - // XHCI Debug Capability offset=0D - //=0D - UINT64 DebugCapabilityOffset;=0D -=0D - //=0D - // XHCI Debug Context Address=0D - //=0D - EFI_PHYSICAL_ADDRESS DebugCapabilityContext;=0D -=0D - //=0D - // Transfer Ring=0D - //=0D - TRANSFER_RING TransferRingOut;=0D - TRANSFER_RING TransferRingIn;=0D -=0D - //=0D - // EventRing=0D - //=0D - EVENT_RING EventRing;=0D -=0D - //=0D - // URB=0D - //=0D - URB Urb;=0D -} USB3_DEBUG_PORT_INSTANCE;=0D -=0D -#pragma pack()=0D -=0D -/**=0D - Clear one bit of the debug register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcClearDebugRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - );=0D -=0D -/**=0D - Clear one bit of the MMIO register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the MMIO register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcClearMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - );=0D -=0D -/**=0D - Read XHCI debug register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D -=0D - @return The register content read=0D -=0D -**/=0D -UINT32=0D -XhcReadDebugReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset=0D - );=0D -=0D -/**=0D - Read XHCI MMIO register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the MMIO register.=0D -=0D - @return The register content read=0D -=0D -**/=0D -UINT32=0D -XhcReadMmioReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset=0D - );=0D -=0D -/**=0D - Set one bit of the debug register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcSetDebugRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - );=0D -=0D -/**=0D - Set one bit of the MMIO register while keeping other bits.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the MMIO register.=0D - @param Bit The bit mask of the register to set.=0D -=0D -**/=0D -VOID=0D -XhcSetMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit=0D - );=0D -=0D -/**=0D - Wait the MMIO register's bit as specified by Bit=0D - to be set (or clear).=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the MMIO register.=0D - @param Bit The bit of the register to wait for.=0D - @param WaitToSet Wait the bit to set or clear.=0D - @param Timeout The time to wait before abort (in millisecond, ms).= =0D -=0D - @retval EFI_SUCCESS The bit successfully changed by host controller.=0D - @retval EFI_TIMEOUT The time out occurred.=0D -=0D -**/=0D -EFI_STATUS=0D -XhcWaitMmioRegBit (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Bit,=0D - IN BOOLEAN WaitToSet,=0D - IN UINT32 Timeout=0D - );=0D -=0D -/**=0D - Write the data to the debug register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the debug register.=0D - @param Data The data to write.=0D -=0D -**/=0D -VOID=0D -XhcWriteDebugReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Data=0D - );=0D -=0D -/**=0D - Write the data to the MMIO register.=0D -=0D - @param Xhc The XHCI Instance.=0D - @param Offset The offset of the MMIO register.=0D - @param Data The data to write.=0D -=0D -**/=0D -VOID=0D -XhcWriteMmioReg (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN UINT32 Offset,=0D - IN UINT32 Data=0D - );=0D -=0D -/**=0D - Discover the USB3 debug device.=0D -=0D - @param[in] Instance Pointer to USB3 debug port object instance= .=0D -=0D - @retval RETURN_SUCCESS The USB3 debug device was found.=0D - @retval RETURN_DEVICE_ERROR The USB3 debug device was not found.=0D -=0D -**/=0D -RETURN_STATUS=0D -DiscoverUsb3DebugPort(=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - );=0D -=0D -/**=0D - Initialize the USB3 debug Device hardware.=0D -=0D - @param[in] Instance Pointer to USB3 debug port object instance.=0D -=0D - @retval RETURN_SUCCESS The USB3 debug device was initialized successf= ully.=0D - @retval !RETURN_SUCCESS Error.=0D -=0D -**/=0D -RETURN_STATUS=0D -InitializeUsb3DebugPort (=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - );=0D -=0D -/**=0D - Return XHCI MMIO base address.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -GetXhciBaseAddress (=0D - VOID=0D - );=0D -=0D -/**=0D - Return XHCI debug instance address.=0D -=0D -**/=0D -USB3_DEBUG_PORT_INSTANCE *=0D -GetUsb3DebugPortInstance (=0D - VOID=0D - );=0D -=0D -/**=0D - Send data over the USB3 debug cable.=0D -=0D - @param[out] Data Pointer to data=0D - @param[in, out] Length Pointer to data length=0D -=0D -**/=0D -VOID=0D -Usb3DbgOut (=0D - OUT UINT8 *Data,=0D - IN OUT UINTN *Length=0D - );=0D -=0D -/**=0D - Receive data over the USB3 debug cable.=0D -=0D - @param[out] Data Pointer to data=0D - @param[in, out] Length Pointer to data length=0D -=0D -**/=0D -RETURN_STATUS=0D -Usb3DbgIn (=0D - OUT UINT8 *Data,=0D - IN OUT UINTN *Length=0D - );=0D -=0D -/**=0D - Verifies if the bit positions specified by a mask are set in a register.= =0D -=0D - @param[in, out] Register UNITN register=0D - @param[in] BitMask 32-bit mask=0D -=0D - @return BOOLEAN - TRUE if all bits specified by the mask are enabled.= =0D - - FALSE even if one of the bits specified by the mask= =0D - is not enabled.=0D -**/=0D -BOOLEAN=0D -XhcIsBitSet(=0D - UINTN Register,=0D - UINT32 BitMask=0D - );=0D -=0D -/**=0D - Sets bits as per the enabled bit positions in the mask.=0D -=0D - @param[in, out] Register UINTN register=0D - @param[in] BitMask 32-bit mask=0D -**/=0D -VOID=0D -XhcSetR32Bit(=0D - UINTN Register,=0D - UINT32 BitMask=0D - );=0D -=0D -/**=0D - Clears bits as per the enabled bit positions in the mask.=0D -=0D - @param[in, out] Register UINTN register=0D - @param[in] BitMask 32-bit mask=0D -**/=0D -VOID=0D -XhcClrR32Bit(=0D - UINTN Register,=0D - UINT32 BitMask=0D - );=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3Initialize (=0D - VOID=0D - );=0D -=0D -/**=0D - Return command register value in XHCI controller.=0D -=0D -**/=0D -UINT16=0D -GetXhciPciCommand (=0D - VOID=0D - );=0D -=0D -/**=0D - Allocate aligned memory for XHC's usage.=0D -=0D - @param BufferSize The size, in bytes, of the Buffer.=0D -=0D - @return A pointer to the allocated buffer or NULL if allocation fails.=0D -=0D -**/=0D -VOID*=0D -AllocateAlignBuffer (=0D - IN UINTN BufferSize=0D - );=0D -=0D -/**=0D - Check whether AllocatePages in permanent memory is ready.=0D -=0D - @retval TRUE AllocatePages in permanent memory is ready.=0D - @retval FALSE AllocatePages in permanent memory is not ready.=0D -=0D -**/=0D -BOOLEAN=0D -IsAllocatePagesReady (=0D - VOID=0D - );=0D -=0D -/**=0D - The real function to initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3InitializeReal (=0D - VOID=0D - );=0D -=0D -/**=0D - Update XHC hardware address when MMIO base is changed.=0D -=0D - @param Instance The XHCI Instance.=0D - @param XhcMmioBase XHCI MMIO base address.=0D -=0D -**/=0D -VOID=0D -FixUsb3InstanceResource (=0D - IN OUT USB3_DEBUG_PORT_INSTANCE *Instance,=0D - IN EFI_PHYSICAL_ADDRESS XhcMmioBase=0D - );=0D -=0D -/**=0D - Save USB3 instance address.=0D -=0D - @param[in] Instance The XHCI Instance.=0D -=0D -**/=0D -VOID=0D -SaveUsb3InstanceAddress (=0D - IN USB3_DEBUG_PORT_INSTANCE *Instance=0D - );=0D -=0D -/**=0D - Submits bulk transfer to a bulk endpoint of a USB device.=0D -=0D - @param Xhc The instance of debug device.=0D - @param Direction The direction of data transfer.=0D - @param Data Array of pointers to the buffers of data t= o transmit=0D - from or receive into.=0D - @param DataLength The lenght of the data buffer.=0D - @param Timeout Indicates the maximum time, in millisecond= , which=0D - the transfer is allowed to complete.=0D - @param TransferResult Transfer result.=0D -=0D - @retval EFI_SUCCESS The transfer was completed successfully.=0D - @retval EFI_OUT_OF_RESOURCES The transfer failed due to lack of resourc= e.=0D - @retval EFI_INVALID_PARAMETER Some parameters are invalid.=0D - @retval EFI_TIMEOUT The transfer failed due to timeout.=0D - @retval EFI_DEVICE_ERROR The transfer failed due to host controller= error.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -XhcDataTransfer (=0D - IN USB3_DEBUG_PORT_INSTANCE *Xhc,=0D - IN EFI_USB_DATA_DIRECTION Direction,=0D - IN OUT VOID *Data,=0D - IN OUT UINTN *DataLength,=0D - IN UINTN Timeout,=0D - OUT UINT32 *TransferResult=0D - );=0D -=0D -#endif //__SERIAL_PORT_LIB_USB__=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibNull.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/= Usb3DebugPortLibNull.c deleted file mode 100644 index 319cebecbb..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibNull.c +++ /dev/null @@ -1,103 +0,0 @@ -/** @file=0D - Usb Debug Port library NULL instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -/**=0D - Initialize the USB3 debug port hardware.=0D -=0D - If no initialization is required, then return RETURN_SUCCESS.=0D - If the serial device was successfully initialized, then return RETURN_SU= CCESS.=0D - If the serial device could not be initialized, then return RETURN_DEVICE= _ERROR.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D - @retval RETURN_DEVICE_ERROR The serial device could not be initialized= .=0D -=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -Usb3DebugPortInitialize (=0D - VOID=0D - )=0D -{=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Write data from buffer to USB3 debug port.=0D -=0D - Writes NumberOfBytes data bytes from Buffer to the serial device.=0D - The number of bytes actually written to the serial device is returned.=0D - If the return value is less than NumberOfBytes, then the write operation= failed.=0D - If Buffer is NULL, then ASSERT().=0D - If NumberOfBytes is zero, then return 0.=0D -=0D - @param Buffer Pointer to the data buffer to be written.=0D - @param NumberOfBytes Number of bytes to written to the serial device= .=0D -=0D - @retval 0 NumberOfBytes is 0.=0D - @retval >0 The number of bytes written to the serial devic= e.=0D - If this value is less than NumberOfBytes, then = the read operation failed.=0D -=0D -**/=0D -UINTN=0D -EFIAPI=0D -Usb3DebugPortWrite (=0D - IN UINT8 *Buffer,=0D - IN UINTN NumberOfBytes=0D - )=0D -{=0D - return 0;=0D -}=0D -=0D -=0D -/**=0D - Read data from USB3 debug port and save the datas in buffer.=0D -=0D - Reads NumberOfBytes data bytes from a serial device into the buffer=0D - specified by Buffer. The number of bytes actually read is returned.=0D - If the return value is less than NumberOfBytes, then the rest operation = failed.=0D - If Buffer is NULL, then ASSERT().=0D - If NumberOfBytes is zero, then return 0.=0D -=0D - @param Buffer Pointer to the data buffer to store the data re= ad from the serial device.=0D - @param NumberOfBytes Number of bytes which will be read.=0D -=0D - @retval 0 Read data failed, no data is to be read.=0D - @retval >0 Actual number of bytes read from serial device.= =0D -=0D -**/=0D -UINTN=0D -EFIAPI=0D -Usb3DebugPortRead (=0D - OUT UINT8 *Buffer,=0D - IN UINTN NumberOfBytes=0D - )=0D -{=0D - return 0;=0D -}=0D -=0D -/**=0D - Polls a USB3 debug port to see if there is any data waiting to be read.= =0D -=0D - Polls a serial device to see if there is any data waiting to be read.=0D - If there is data waiting to be read from the serial device, then TRUE is= returned.=0D - If there is no data waiting to be read from the serial device, then FALS= E is returned.=0D -=0D - @retval TRUE Data is waiting to be read from the serial devi= ce.=0D - @retval FALSE There is no data waiting to be read from the se= rial device.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -Usb3DebugPortPoll (=0D - VOID=0D - )=0D -{=0D - return FALSE;=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibNull.inf b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLi= b/Usb3DebugPortLibNull.inf deleted file mode 100644 index f632150c26..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibNull.inf +++ /dev/null @@ -1,28 +0,0 @@ -## @file=0D -# Usb3 debug port library.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D USB3DebugPortLibNull=0D - FILE_GUID =3D 3E895F08-0A69-42a2-AF4A-3E9EFAA40361= =0D - MODULE_TYPE =3D BASE=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortLib=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[Sources]=0D - Usb3DebugPortLibNull.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibPei.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/U= sb3DebugPortLibPei.c deleted file mode 100644 index a1e0bdbf6d..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibPei.c +++ /dev/null @@ -1,236 +0,0 @@ -/** @file=0D - Usb Debug Port library instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -GUID gUsb3DbgGuid =3D USB3_DBG_GUID;=0D -=0D -/**=0D - Return XHCI MMIO base address.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -GetXhciBaseAddress (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - UINT32 Low;=0D - UINT32 High;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D - Low =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRE= SSREG_OFFSET));=0D - High =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDR= ESSREG_OFFSET + 4));=0D - Address =3D (EFI_PHYSICAL_ADDRESS) (LShiftU64 ((UINT64) High, 32) | Low)= ;=0D -=0D - //=0D - // Mask other parts which are not part of base address=0D - //=0D - Address &=3D XHCI_BASE_ADDRESS_64_BIT_MASK;=0D - return Address;=0D -}=0D -=0D -/**=0D - Return XHCI debug instance address.=0D -=0D -**/=0D -USB3_DEBUG_PORT_INSTANCE *=0D -GetUsb3DebugPortInstance (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PEI_HOB_POINTERS Hob;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D -=0D - Hob.Raw =3D GetFirstGuidHob (&gUsb3DbgGuid);=0D - if (Hob.Raw =3D=3D NULL) {=0D - return NULL;=0D - }=0D - Instance =3D GET_GUID_HOB_DATA (Hob.Guid);=0D -=0D - //=0D - // Update XHCI MMIO base address=0D - //=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - FixUsb3InstanceResource (Instance, XhcMmioBase);=0D -=0D - return Instance;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3Initialize (=0D - VOID=0D - )=0D -{=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3InitializeReal (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE UsbDbg;=0D - VOID *DataPtr;=0D - EFI_PEI_HOB_POINTERS Hob;=0D -=0D - //=0D - // USB Initilization has to be done only once. So this function should j= ust return when=0D - // it is called more than once.=0D - //=0D - Hob.Raw =3D GetFirstGuidHob (&gUsb3DbgGuid);=0D - if (Hob.Raw !=3D NULL) {=0D - return RETURN_SUCCESS;=0D - }=0D -=0D - //=0D - // Initialize USB debug for PEI at the first time=0D - //=0D - SetMem (&UsbDbg, sizeof(UsbDbg), 0);=0D - UsbDbg.FromHob =3D TRUE;=0D - DiscoverUsb3DebugPort (&UsbDbg);=0D - if (UsbDbg.DebugSupport) {=0D - InitializeUsb3DebugPort (&UsbDbg);=0D - }=0D -=0D - //=0D - // Save Instance into HOB=0D - //=0D - DataPtr =3D BuildGuidDataHob (=0D - &gUsb3DbgGuid,=0D - (VOID*) &UsbDbg,=0D - sizeof (UsbDbg)=0D - );=0D -=0D - if (UsbDbg.DebugSupport) {=0D - SaveUsb3InstanceAddress ((USB3_DEBUG_PORT_INSTANCE *) DataPtr);=0D - }=0D -=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Allocate aligned memory for XHC's usage.=0D -=0D - @param BufferSize The size, in bytes, of the Buffer.=0D -=0D - @return A pointer to the allocated buffer or NULL if allocation fails.=0D -=0D -**/=0D -VOID*=0D -AllocateAlignBuffer (=0D - IN UINTN BufferSize=0D - )=0D -{=0D - VOID *Buf;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D - EFI_STATUS Status;=0D - VOID *MemoryDiscoveredPpi;=0D -=0D - Buf =3D NULL;=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - //=0D - // Make sure the allocated memory is physical memory.=0D - //=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEfiPeiMemoryDiscoveredPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &MemoryDiscoveredPpi=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Status =3D (*PeiServices)->AllocatePages (=0D - PeiServices,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &Address=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Buf =3D (VOID *)(UINTN) Address;=0D - }=0D - }=0D - return Buf;=0D -}=0D -=0D -/**=0D - Check whether AllocatePages in permanent memory is ready.=0D -=0D - @retval TRUE AllocatePages in permanent memory is ready.=0D - @retval FALSE AllocatePages in permanent memory is not ready.=0D -=0D -**/=0D -BOOLEAN=0D -IsAllocatePagesReady (=0D - VOID=0D - )=0D -{=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D - EFI_STATUS Status;=0D - VOID *MemoryDiscoveredPpi;=0D -=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - //=0D - // Make sure the allocated memory is physical memory.=0D - //=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEfiPeiMemoryDiscoveredPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &MemoryDiscoveredPpi=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - return TRUE;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibPei.inf b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib= /Usb3DebugPortLibPei.inf deleted file mode 100644 index 0edde82769..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibPei.inf +++ /dev/null @@ -1,48 +0,0 @@ -## @file=0D -# Usb3 debug port library.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D USB3DebugPortLibPei=0D - FILE_GUID =3D 62C974F0-D0E0-4963-B93A-22FBCEB69AB4= =0D - MODULE_TYPE =3D PEIM=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortLib|PEIM PEI_CORE=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[Sources]=0D - Usb3DebugPortLibPei.c=0D - Usb3DebugPortDataTransfer.c=0D - Usb3DebugPortInitialize.c=0D - MiscServices.c=0D - Usb3DebugPortLibInternal.h=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - PcdLib=0D - IoLib=0D - PciLib=0D - TimerLib=0D - HobLib=0D - Usb3DebugPortParameterLib=0D - PeiServicesTablePointerLib=0D -=0D -[Ppis]=0D - gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress ## SOME= TIMES_CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout ## CONS= UMES=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibPeiIoMmu.c b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPort= Lib/Usb3DebugPortLibPeiIoMmu.c deleted file mode 100644 index 68543c8562..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibPeiIoMmu.c +++ /dev/null @@ -1,440 +0,0 @@ -/** @file=0D - Usb Debug Port library instance=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "Usb3DebugPortLibInternal.h"=0D -=0D -GUID gUsb3DbgGuid =3D USB3_DBG_GUID;=0D -=0D -/**=0D - USB3 IOMMU PPI notify.=0D -=0D - @param[in] PeiServices Pointer to PEI Services Table.=0D - @param[in] NotifyDesc Pointer to the descriptor for the Notification= event that=0D - caused this function to execute.=0D - @param[in] Ppi Pointer to the PPI data associated with this f= unction.=0D -=0D - @retval EFI_STATUS Always return EFI_SUCCESS=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -Usb3IoMmuPpiNotify (=0D - IN EFI_PEI_SERVICES **PeiServices,=0D - IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,=0D - IN VOID *Ppi=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D -=0D - Instance =3D GetUsb3DebugPortInstance ();=0D - ASSERT (Instance !=3D NULL);=0D - //=0D - // Reinitialize USB3 debug port with granted DMA buffer from IOMMU PPI.= =0D - //=0D - InitializeUsb3DebugPort (Instance);=0D -=0D - SaveUsb3InstanceAddress (Instance);=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -EFI_PEI_NOTIFY_DESCRIPTOR mUsb3IoMmuPpiNotifyDesc =3D {=0D - (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINA= TE_LIST),=0D - &gEdkiiIoMmuPpiGuid,=0D - Usb3IoMmuPpiNotify=0D -};=0D -=0D -/**=0D - Allocates pages that are suitable for an OperationBusMasterCommonBuffer = or=0D - OperationBusMasterCommonBuffer64 mapping.=0D -=0D - @param IoMmu Pointer to IOMMU PPI.=0D - @param Pages The number of pages to allocate.=0D - @param HostAddress A pointer to store the base system memory = address of the=0D - allocated range.=0D - @param DeviceAddress The resulting map address for the bus mast= er PCI controller to use to=0D - access the hosts HostAddress.=0D - @param Mapping A resulting value to pass to Unmap().=0D -=0D - @retval EFI_SUCCESS The requested memory pages were allocated.= =0D - @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal = attribute bits are=0D - MEMORY_WRITE_COMBINE and MEMORY_CACHED.=0D - @retval EFI_INVALID_PARAMETER One or more parameters are invalid.=0D - @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.=0D -=0D -**/=0D -EFI_STATUS=0D -IoMmuAllocateBuffer (=0D - IN EDKII_IOMMU_PPI *IoMmu,=0D - IN UINTN Pages,=0D - OUT VOID **HostAddress,=0D - OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,=0D - OUT VOID **Mapping=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN NumberOfBytes;=0D -=0D - *HostAddress =3D NULL;=0D - *DeviceAddress =3D 0;=0D - *Mapping =3D NULL;=0D -=0D - Status =3D IoMmu->AllocateBuffer (=0D - IoMmu,=0D - EfiRuntimeServicesData,=0D - Pages,=0D - HostAddress,=0D - 0=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - NumberOfBytes =3D EFI_PAGES_TO_SIZE (Pages);=0D - Status =3D IoMmu->Map (=0D - IoMmu,=0D - EdkiiIoMmuOperationBusMasterCommonBuffer,=0D - *HostAddress,=0D - &NumberOfBytes,=0D - DeviceAddress,=0D - Mapping=0D - );=0D - if (EFI_ERROR (Status)) {=0D - IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress);=0D - *HostAddress =3D NULL;=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D - Status =3D IoMmu->SetAttribute (=0D - IoMmu,=0D - *Mapping,=0D - EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE=0D - );=0D - if (EFI_ERROR (Status)) {=0D - IoMmu->Unmap (IoMmu, *Mapping);=0D - IoMmu->FreeBuffer (IoMmu, Pages, *HostAddress);=0D - *Mapping =3D NULL;=0D - *HostAddress =3D NULL;=0D - return Status;=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - USB3 get IOMMU PPI.=0D -=0D - @return Pointer to IOMMU PPI.=0D -=0D -**/=0D -EDKII_IOMMU_PPI *=0D -Usb3GetIoMmu (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EDKII_IOMMU_PPI *IoMmu;=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D -=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - IoMmu =3D NULL;=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEdkiiIoMmuPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &IoMmu=0D - );=0D - if (!EFI_ERROR (Status) && (IoMmu !=3D NULL)) {=0D - return IoMmu;=0D - }=0D -=0D - return NULL;=0D -}=0D -=0D -/**=0D - Return XHCI MMIO base address.=0D -=0D -**/=0D -EFI_PHYSICAL_ADDRESS=0D -GetXhciBaseAddress (=0D - VOID=0D - )=0D -{=0D - UINT8 Bus;=0D - UINT8 Device;=0D - UINT8 Function;=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - UINT32 Low;=0D - UINT32 High;=0D -=0D - UsbDebugPort.Controller =3D GetUsb3DebugPortController();=0D - Bus =3D UsbDebugPort.PciAddress.Bus;=0D - Device =3D UsbDebugPort.PciAddress.Device;=0D - Function =3D UsbDebugPort.PciAddress.Function;=0D - Low =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRE= SSREG_OFFSET));=0D - High =3D PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDR= ESSREG_OFFSET + 4));=0D - Address =3D (EFI_PHYSICAL_ADDRESS) (LShiftU64 ((UINT64) High, 32) | Low)= ;=0D -=0D - //=0D - // Mask other parts which are not part of base address=0D - //=0D - Address &=3D XHCI_BASE_ADDRESS_64_BIT_MASK;=0D - return Address;=0D -}=0D -=0D -/**=0D - Return XHCI debug instance address.=0D -=0D -**/=0D -USB3_DEBUG_PORT_INSTANCE *=0D -GetUsb3DebugPortInstance (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_INSTANCE *Instance;=0D - EFI_PEI_HOB_POINTERS Hob;=0D - EFI_PHYSICAL_ADDRESS XhcMmioBase;=0D -=0D - Hob.Raw =3D GetFirstGuidHob (&gUsb3DbgGuid);=0D - if (Hob.Raw =3D=3D NULL) {=0D - return NULL;=0D - }=0D - Instance =3D GET_GUID_HOB_DATA (Hob.Guid);=0D -=0D - //=0D - // Update XHCI MMIO base address=0D - //=0D - XhcMmioBase =3D GetXhciBaseAddress ();=0D -=0D - FixUsb3InstanceResource (Instance, XhcMmioBase);=0D -=0D - return Instance;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3Initialize (=0D - VOID=0D - )=0D -{=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize USB3 debug port.=0D -=0D - This method invokes various internal functions to facilitate=0D - detection and initialization of USB3 debug port.=0D -=0D - @retval RETURN_SUCCESS The serial device was initialized.=0D -**/=0D -RETURN_STATUS=0D -EFIAPI=0D -USB3InitializeReal (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - USB3_DEBUG_PORT_INSTANCE UsbDbg;=0D - VOID *DataPtr;=0D - EFI_PEI_HOB_POINTERS Hob;=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D -=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - //=0D - // USB Initilization has to be done only once. So this function should j= ust return when=0D - // it is called more than once.=0D - //=0D - Hob.Raw =3D GetFirstGuidHob (&gUsb3DbgGuid);=0D - if (Hob.Raw !=3D NULL) {=0D - return RETURN_SUCCESS;=0D - }=0D -=0D - //=0D - // Initialize USB debug for PEI at the first time=0D - //=0D - SetMem (&UsbDbg, sizeof(UsbDbg), 0);=0D - UsbDbg.FromHob =3D TRUE;=0D - DiscoverUsb3DebugPort (&UsbDbg);=0D - if (UsbDbg.DebugSupport) {=0D - InitializeUsb3DebugPort (&UsbDbg);=0D - }=0D -=0D - if (UsbDbg.Ready && (Usb3GetIoMmu () =3D=3D NULL)) {=0D - Status =3D (*PeiServices)->NotifyPpi (PeiServices, &mUsb3IoMmuPpiNotif= yDesc);=0D - ASSERT_EFI_ERROR (Status);=0D - }=0D -=0D - //=0D - // Save Instance into HOB=0D - //=0D - DataPtr =3D BuildGuidDataHob (=0D - &gUsb3DbgGuid,=0D - (VOID*) &UsbDbg,=0D - sizeof (UsbDbg)=0D - );=0D -=0D - if (UsbDbg.DebugSupport) {=0D - SaveUsb3InstanceAddress ((USB3_DEBUG_PORT_INSTANCE *) DataPtr);=0D - }=0D -=0D - return RETURN_SUCCESS;=0D -}=0D -=0D -/**=0D - Allocate aligned memory for XHC's usage.=0D -=0D - @param BufferSize The size, in bytes, of the Buffer.=0D -=0D - @return A pointer to the allocated buffer or NULL if allocation fails.=0D -=0D -**/=0D -VOID*=0D -AllocateAlignBuffer (=0D - IN UINTN BufferSize=0D - )=0D -{=0D - VOID *Buf;=0D - EFI_PHYSICAL_ADDRESS Address;=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D - EFI_STATUS Status;=0D - VOID *MemoryDiscoveredPpi;=0D - EDKII_IOMMU_PPI *IoMmu;=0D - VOID *HostAddress;=0D - VOID *Mapping;=0D -=0D - Buf =3D NULL;=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - //=0D - // Make sure the allocated memory is physical memory.=0D - //=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEfiPeiMemoryDiscoveredPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &MemoryDiscoveredPpi=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - IoMmu =3D Usb3GetIoMmu ();=0D - if (IoMmu !=3D NULL) {=0D - Status =3D IoMmuAllocateBuffer (=0D - IoMmu,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &HostAddress,=0D - &Address,=0D - &Mapping=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - ASSERT (Address =3D=3D ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress= ));=0D - Buf =3D (VOID *)(UINTN) Address;=0D - }=0D - } else {=0D - Status =3D (*PeiServices)->AllocatePages (=0D - PeiServices,=0D - EfiACPIMemoryNVS,=0D - EFI_SIZE_TO_PAGES (BufferSize),=0D - &Address=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Buf =3D (VOID *)(UINTN) Address;=0D - }=0D - }=0D - }=0D - return Buf;=0D -}=0D -=0D -/**=0D - Check whether AllocatePages in permanent memory is ready.=0D -=0D - @retval TRUE AllocatePages in permanent memory is ready.=0D - @retval FALSE AllocatePages in permanent memory is not ready.=0D -=0D -**/=0D -BOOLEAN=0D -IsAllocatePagesReady (=0D - VOID=0D - )=0D -{=0D - CONST EFI_PEI_SERVICES **PeiServices;=0D - EFI_STATUS Status;=0D - VOID *MemoryDiscoveredPpi;=0D - EDKII_IOMMU_PPI *IoMmu;=0D - VOID *HostAddress;=0D -=0D - PeiServices =3D GetPeiServicesTablePointer ();=0D -=0D - //=0D - // Make sure the allocated memory is physical memory.=0D - //=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEfiPeiMemoryDiscoveredPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &MemoryDiscoveredPpi=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Status =3D (*PeiServices)->LocatePpi (=0D - PeiServices,=0D - &gEdkiiIoMmuPpiGuid,=0D - 0,=0D - NULL,=0D - (VOID **) &IoMmu=0D - );=0D - if (!EFI_ERROR (Status)) {=0D - Status =3D IoMmu->AllocateBuffer (=0D - IoMmu,=0D - EfiRuntimeServicesData,=0D - 1,=0D - &HostAddress,=0D - 0=0D - );=0D - if (EFI_ERROR (Status)) {=0D - //=0D - // DMA protection has been enabled,=0D - // but DMA buffer could not be allocated yet.=0D - //=0D - return FALSE;=0D - }=0D - IoMmu->FreeBuffer (=0D - IoMmu,=0D - 1,=0D - HostAddress=0D - );=0D - }=0D - return TRUE;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3De= bugPortLibPeiIoMmu.inf b/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPo= rtLib/Usb3DebugPortLibPeiIoMmu.inf deleted file mode 100644 index f27c23faab..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort= LibPeiIoMmu.inf +++ /dev/null @@ -1,51 +0,0 @@ -## @file=0D -# Usb3 debug port library.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D USB3DebugPortLibPeiIoMmu=0D - FILE_GUID =3D C973C5E8-A0D8-4FEE-A0F0-7DA6C3C72451= =0D - MODULE_TYPE =3D PEIM=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortLib|PEIM PEI_CORE=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 IPF=0D -#=0D -=0D -[Sources]=0D - Usb3DebugPortLibPeiIoMmu.c=0D - Usb3DebugPortDataTransfer.c=0D - Usb3DebugPortInitialize.c=0D - MiscServices.c=0D - Usb3DebugPortLibInternal.h=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - PcdLib=0D - IoLib=0D - PciLib=0D - TimerLib=0D - HobLib=0D - Usb3DebugPortParameterLib=0D - PeiServicesTablePointerLib=0D -=0D -[Ppis]=0D - gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES=0D - gEdkiiIoMmuPpiGuid ## SOMETIMES_CONSUMES=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress ## SOME= TIMES_CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout ## CONS= UMES=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterL= ibPcd/Usb3DebugPortParameterLibPcd.c b/Platform/Intel/DebugFeaturePkg/Libra= ry/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.c deleted file mode 100644 index 747c5dccc9..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/U= sb3DebugPortParameterLibPcd.c +++ /dev/null @@ -1,58 +0,0 @@ -/** @file=0D - USB3 debug Port Parameter library instance based on PCD.=0D -=0D - Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Returns the USB3 debug port controller.=0D - bit: 0~ 7: Function=0D - bit: 8~15: Device=0D - bit: 16~24: Bus=0D -=0D - @return Controller information of USB debug port.=0D -=0D -**/=0D -UINT32=0D -EFIAPI=0D -GetUsb3DebugPortController (=0D - VOID=0D - )=0D -{=0D - USB3_DEBUG_PORT_CONTROLLER UsbDebugPort;=0D -=0D - UsbDebugPort.Controller =3D 0;=0D - UsbDebugPort.PciAddress.Bus =3D PcdGet8(PcdUsbSerialXhciBus);=0D - UsbDebugPort.PciAddress.Device =3D PcdGet8(PcdUsbSerialXhciDev);=0D - UsbDebugPort.PciAddress.Function =3D PcdGet8(PcdUsbSerialXhciFunc);=0D -=0D - return UsbDebugPort.Controller;=0D -}=0D -=0D -/**=0D - Sets the USB debug port controller.=0D - bit: 0~ 7: Function=0D - bit: 8~15: Device=0D - bit: 16~24: Bus=0D -=0D - @param[in] Controller information of USB debug port value to be set.= =0D -=0D - @retval TRUE The controller of USB debug port was sucessfully= set.=0D - @retval FALSE The controller of USB debug port could not be se= t.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -SetUsb3DebugPortController (=0D - UINT32 Controller=0D - )=0D -{=0D - return FALSE;=0D -}=0D diff --git a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterL= ibPcd/Usb3DebugPortParameterLibPcd.inf b/Platform/Intel/DebugFeaturePkg/Lib= rary/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.inf deleted file mode 100644 index 09f44920f6..0000000000 --- a/Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/U= sb3DebugPortParameterLibPcd.inf +++ /dev/null @@ -1,31 +0,0 @@ -## @file=0D -# USB3 debug Port Parameter library instance based on PCD.=0D -#=0D -# Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D Usb3DebugPortParameterLibPcd=0D - FILE_GUID =3D 4990A700-4002-4d08-8E00-622720032662= =0D - MODULE_TYPE =3D BASE=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D Usb3DebugPortParameterLib=0D -=0D -[Sources]=0D - Usb3DebugPortParameterLibPcd.c=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - DebugLib=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - DebugFeaturePkg/DebugFeaturePkg.dec=0D -=0D -[Pcd]=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciBus ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciDev ## CONSUMES=0D - gDebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciFunc ## CONSUMES=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Include/Guid/UserAuthen= tication.h b/Platform/Intel/UserInterfaceFeaturePkg/Include/Guid/UserAuthen= tication.h deleted file mode 100644 index 2a41a46cdc..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Include/Guid/UserAuthenticatio= n.h +++ /dev/null @@ -1,45 +0,0 @@ -/** @file=0D - GUID is for UserAuthentication SMM communication.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USER_AUTHENTICATION_GUID_H__=0D -#define __USER_AUTHENTICATION_GUID_H__=0D -=0D -#define PASSWORD_MIN_SIZE 9 // MIN number of chars of password, includ= ing NULL.=0D -#define PASSWORD_MAX_SIZE 33 // MAX number of chars of password, includ= ing NULL.=0D -=0D -#define USER_AUTHENTICATION_GUID \=0D - { 0xf06e3ea7, 0x611c, 0x4b6b, { 0xb4, 0x10, 0xc2, 0xbf, 0x94, 0x3f, 0x38= , 0xf2 } }=0D -=0D -extern EFI_GUID gUserAuthenticationGuid;=0D -=0D -typedef struct {=0D - UINTN Function;=0D - EFI_STATUS ReturnStatus;=0D -} SMM_PASSWORD_COMMUNICATE_HEADER;=0D -=0D -#define SMM_PASSWORD_FUNCTION_IS_PASSWORD_SET 1=0D -#define SMM_PASSWORD_FUNCTION_SET_PASSWORD 2=0D -#define SMM_PASSWORD_FUNCTION_VERIFY_PASSWORD 3=0D -#define SMM_PASSWORD_FUNCTION_SET_VERIFY_POLICY 4=0D -#define SMM_PASSWORD_FUNCTION_GET_VERIFY_POLICY 5=0D -#define SMM_PASSWORD_FUNCTION_WAS_PASSWORD_VERIFIED 6=0D -=0D -typedef struct {=0D - CHAR8 NewPassword[PASSWORD_MAX_SIZE];=0D - CHAR8 OldPassword[PASSWORD_MAX_SIZE];=0D -} SMM_PASSWORD_COMMUNICATE_SET_PASSWORD;=0D -=0D -typedef struct {=0D - CHAR8 Password[PASSWORD_MAX_SIZE];=0D -} SMM_PASSWORD_COMMUNICATE_VERIFY_PASSWORD;=0D -=0D -typedef struct {=0D - BOOLEAN NeedReVerify;=0D -} SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY;=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/Platfor= mPasswordLib.h b/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/Pla= tformPasswordLib.h deleted file mode 100644 index ce27947f6d..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/PlatformPasswo= rdLib.h +++ /dev/null @@ -1,48 +0,0 @@ -/** @file=0D - Provides a platform-specific method to return password policy.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __PLATFORM_PASSWORD_LIB_H__=0D -#define __PLATFORM_PASSWORD_LIB_H__=0D -=0D -/**=0D - This function is called at password driver entrypoint.=0D - This function should be called only once, to clear the password.=0D -=0D - This function provides a way to reset the password, just in case=0D - the platform owner forgets the password.=0D - The platform should provide a secure way to make sure=0D - only the platform owner is allowed to clear password.=0D -=0D - Once the password is cleared, the platform should provide a way=0D - to set a new password.=0D -=0D - @retval TRUE There is a platform request to clear the password.=0D - @retval FALSE There is no platform request to clear the password.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -IsPasswordCleared (=0D - VOID=0D - );=0D -=0D -/**=0D - This function is called if the password driver finds that the password i= s not enrolled,=0D - when the password is required to input.=0D -=0D - This function should return the action according to platform policy.=0D -=0D - @retval TRUE The caller should force the user to enroll the password.=0D - @retval FALSE The caller may skip the password enroll.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -NeedEnrollPassword (=0D - VOID=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserPas= swordLib.h b/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserPas= swordLib.h deleted file mode 100644 index b6aad224e9..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserPasswordLi= b.h +++ /dev/null @@ -1,70 +0,0 @@ -/** @file=0D - Provides services to set/verify password and return if the password is s= et.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USER_PASSWORD_LIB_H__=0D -#define __USER_PASSWORD_LIB_H__=0D -=0D -/**=0D - Validate if the password is correct.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval EFI_SUCCESS The password is correct.=0D - @retval EFI_SECURITY_VIOLATION The password is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to verify the p= assword.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -VerifyPassword (=0D - IN CHAR16 *Password,=0D - IN UINTN PasswordSize=0D - );=0D -=0D -/**=0D - Set a new password.=0D -=0D - @param[in] NewPassword The user input new password.=0D - NULL means clear password.=0D - @param[in] NewPasswordSize The size of NewPassword in byte.=0D - @param[in] OldPassword The user input old password.=0D - NULL means no old password.=0D - @param[in] OldPasswordSize The size of OldPassword in byte.=0D -=0D - @retval EFI_SUCCESS The NewPassword is set successfully.=0D - @retval EFI_SECURITY_VIOLATION The OldPassword is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set the pass= word.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D - @retval EFI_UNSUPPORTED NewPassword is not strong enough.=0D - @retval EFI_ALREADY_STARTED NewPassword is in history.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -SetPassword (=0D - IN CHAR16 *NewPassword, OPTIONAL=0D - IN UINTN NewPasswordSize,=0D - IN CHAR16 *OldPassword, OPTIONAL=0D - IN UINTN OldPasswordSize=0D - );=0D -=0D -/**=0D - Return if the password is set.=0D -=0D - @retval TRUE The password is set.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -IsPasswordInstalled (=0D - VOID=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserPas= swordUiLib.h b/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserP= asswordUiLib.h deleted file mode 100644 index 117f480733..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Include/Library/UserPasswordUi= Lib.h +++ /dev/null @@ -1,37 +0,0 @@ -/** @file=0D - Provides services to do password authentication.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USER_PASSWORD_UI_LIB_H__=0D -#define __USER_PASSWORD_UI_LIB_H__=0D -=0D -/**=0D - Do password authentication.=0D -=0D - @retval EFI_SUCCESS Password authentication pass.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UiDoPasswordAuthentication (=0D - VOID=0D - );=0D -=0D -/**=0D - Set password verification policy.=0D -=0D - @param[in] NeedReVerify Need re-verify or not.=0D -=0D - @retval EFI_SUCCESS Set verification policy successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set verifica= tion policy.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UiSetPasswordVerificationPolicy (=0D - IN BOOLEAN NeedReVerify=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswor= dLibNull/PlatformPasswordLibNull.c b/Platform/Intel/UserInterfaceFeaturePkg= /Library/PlatformPasswordLibNull/PlatformPasswordLibNull.c deleted file mode 100644 index 08e081aa99..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswordLibNul= l/PlatformPasswordLibNull.c +++ /dev/null @@ -1,78 +0,0 @@ -/** @file=0D - NULL PlatformPasswordLib instance does NOT really detect whether the pas= sword is cleared=0D - but returns the PCD value directly. This instance can be used to verify = security=0D - related features during platform enabling and development. It should be = replaced=0D - by a platform-specific method(e.g. Button pressed) in a real platform fo= r product.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -BOOLEAN mPasswordCleared =3D FALSE;=0D -=0D -/**=0D - This function is called at password driver entrypoint.=0D - This function should be called only once, to clear the password.=0D -=0D - This function provides a way to reset the password, just in case=0D - the platform owner forgets the password.=0D - The platform should provide a secure way to make sure=0D - only the platform owner is allowed to clear password.=0D -=0D - Once the password is cleared, the platform should provide a way=0D - to set a new password.=0D -=0D - @retval TRUE There is a platform request to clear the password.=0D - @retval FALSE There is no platform request to clear the password.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -IsPasswordCleared (=0D - VOID=0D - )=0D -{=0D - return mPasswordCleared;=0D -}=0D -=0D -/**=0D - This function is called if the password driver finds that the password i= s not enrolled,=0D - when the password is required to input.=0D -=0D - This function should return the action according to platform policy.=0D -=0D - @retval TRUE The caller should force the user to enroll the password.=0D - @retval FALSE The caller may skip the password enroll.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -NeedEnrollPassword (=0D - VOID=0D - )=0D -{=0D - return FALSE;=0D -}=0D -=0D -=0D -/**=0D - Save password clear state from a PCD to mPasswordCleared.=0D -=0D - @param ImageHandle ImageHandle of the loaded driver.=0D - @param SystemTable Pointer to the EFI System Table.=0D -=0D - @retval EFI_SUCCESS PcdPasswordCleared is got successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -PlatformPasswordLibNullConstructor (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D -=0D - mPasswordCleared =3D PcdGetBool(PcdPasswordCleared);=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswor= dLibNull/PlatformPasswordLibNull.inf b/Platform/Intel/UserInterfaceFeatureP= kg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf deleted file mode 100644 index 6f4e40f174..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswordLibNul= l/PlatformPasswordLibNull.inf +++ /dev/null @@ -1,39 +0,0 @@ -## @file=0D -# NULL platform password library instance that returns the password clear= state based upon PCD.=0D -#=0D -# NULL PlatformPasswordLib instance does NOT really detect whether the pa= ssword is cleared=0D -# but returns the PCD value directly. This instance can be used to verify= security=0D -# related features during platform enabling and development. It should be= replaced=0D -# by a platform-specific method(e.g. Button pressed) in a real platform f= or product.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010006=0D - BASE_NAME =3D PlatformPasswordLibNull=0D - MODULE_UNI_FILE =3D PlatformPasswordLibNull.uni=0D - FILE_GUID =3D 27417BCA-0CCD-4089-9711-AD069A33C555= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D PlatformPasswordLib|DXE_RUNTIME_DRIVE= R DXE_SMM_DRIVER DXE_DRIVER=0D - CONSTRUCTOR =3D PlatformPasswordLibNullConstructor=0D -=0D -#=0D -# The following information is for reference only and not required by the = build tools.=0D -#=0D -# VALID_ARCHITECTURES =3D IA32 X64 EBC=0D -#=0D -=0D -[Sources]=0D - PlatformPasswordLibNull.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[Pcd]=0D - gEfiUserInterfaceFeaturePkgTokenSpaceGuid.PcdPasswordCleared ## CONSU= MES=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswor= dLibNull/PlatformPasswordLibNull.uni b/Platform/Intel/UserInterfaceFeatureP= kg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.uni deleted file mode 100644 index b0255889e0..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/PlatformPasswordLibNul= l/PlatformPasswordLibNull.uni +++ /dev/null @@ -1,19 +0,0 @@ -// /** @file=0D -// NULL platform password library instance that returns the password clear= state based upon PCD.=0D -//=0D -// NULL PlatformPasswordLib instance does NOT really detect whether the pa= ssword is cleared=0D -// but returns the PCD value directly. This instance can be used to verify= security=0D -// related features during platform enabling and development. It should be= replaced=0D -// by a platform-specific method(e.g. Button pressed) in a real platform f= or product.=0D -//=0D -// Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -//=0D -// SPDX-License-Identifier: BSD-2-Clause-Patent=0D -//=0D -// **/=0D -=0D -=0D -#string STR_MODULE_ABSTRACT #language en-US "NULL platform pas= sword library instance that returns the password clear state based upon PCD= ."=0D -=0D -#string STR_MODULE_DESCRIPTION #language en-US "NULL PlatformPass= wordLib instance does NOT really detect whether the password is cleared but= returns the PCD value directly. This instance can be used to verify securi= ty related features during platform enabling and development. It should be = replaced by a platform-specific method(e.g. Button pressed) in a real platf= orm for product."=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordLib= /UserPasswordLib.c b/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPas= swordLib/UserPasswordLib.c deleted file mode 100644 index cbaf572378..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPa= sswordLib.c +++ /dev/null @@ -1,274 +0,0 @@ -/** @file=0D - UserPasswordLib instance implementation provides services to=0D - set/verify password and return if the password is set.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Initialize the communicate buffer using DataSize and Function.=0D -=0D - @param[out] DataPtr Points to the data in the communicate = buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D - @param[in] Function The function number to initialize the = communicate header.=0D -=0D - @return Communicate buffer.=0D -**/=0D -VOID*=0D -UserPasswordLibInitCommunicateBuffer (=0D - OUT VOID **DataPtr OPTIONAL,=0D - IN UINTN DataSize,=0D - IN UINTN Function=0D - )=0D -{=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D - VOID *Buffer;=0D - EDKII_PI_SMM_COMMUNICATION_REGION_TABLE *SmmCommRegionTable;=0D - EFI_MEMORY_DESCRIPTOR *SmmCommMemRegion;=0D - UINTN Index;=0D - UINTN Size;=0D - EFI_STATUS Status;=0D -=0D - Buffer =3D NULL;=0D - Status =3D EfiGetSystemConfigurationTable (=0D - &gEdkiiPiSmmCommunicationRegionTableGuid,=0D - (VOID **) &SmmCommRegionTable=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return NULL;=0D - }=0D - ASSERT (SmmCommRegionTable !=3D NULL);=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) (SmmCommRegionTable + 1);= =0D - Size =3D 0;=0D - for (Index =3D 0; Index < SmmCommRegionTable->NumberOfEntries; Index++) = {=0D - if (SmmCommMemRegion->Type =3D=3D EfiConventionalMemory) {=0D - Size =3D EFI_PAGES_TO_SIZE ((UINTN) SmmCommMemRegion->NumberOfPages)= ;=0D - if (Size >=3D (DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Dat= a) + sizeof (SMM_PASSWORD_COMMUNICATE_HEADER))) {=0D - break;=0D - }=0D - }=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) SmmCommMemRe= gion + SmmCommRegionTable->DescriptorSize);=0D - }=0D - ASSERT (Index < SmmCommRegionTable->NumberOfEntries);=0D -=0D - Buffer =3D (VOID*)(UINTN)SmmCommMemRegion->PhysicalStart;=0D - ASSERT (Buffer !=3D NULL);=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gUserAuthenticationGuid);= =0D - SmmCommunicateHeader->MessageLength =3D DataSize + sizeof (SMM_PASSWORD_= COMMUNICATE_HEADER);=0D -=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *) SmmCom= municateHeader->Data;=0D - ZeroMem (SmmPasswordFunctionHeader, DataSize + sizeof (SMM_PASSWORD_COMM= UNICATE_HEADER));=0D - SmmPasswordFunctionHeader->Function =3D Function;=0D - if (DataPtr !=3D NULL) {=0D - *DataPtr =3D SmmPasswordFunctionHeader + 1;=0D - }=0D -=0D - return Buffer;=0D -}=0D -=0D -/**=0D - Send the data in communicate buffer to SMM.=0D -=0D - @param[in] Buffer Points to the data in the communicat= e buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D -=0D - @retval EFI_SUCCESS Success is returned from the functio= n in SMM.=0D - @retval Others Failure is returned from the functio= n in SMM.=0D -=0D -**/=0D -EFI_STATUS=0D -UserPasswordLibSendCommunicateBuffer (=0D - IN VOID *Buffer,=0D - IN UINTN DataSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN CommSize;=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D - EFI_SMM_COMMUNICATION_PROTOCOL *SmmCommunication;=0D -=0D - //=0D - // Locates SMM Communication protocol.=0D - //=0D - Status =3D gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL,= (VOID **) &SmmCommunication);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - CommSize =3D DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + s= izeof (SMM_PASSWORD_COMMUNICATE_HEADER);=0D -=0D - Status =3D SmmCommunication->Communicate (SmmCommunication, Buffer, &Com= mSize);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *)SmmComm= unicateHeader->Data;=0D - return SmmPasswordFunctionHeader->ReturnStatus;=0D -}=0D -=0D -/**=0D - Validate if the password is correct.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval EFI_SUCCESS The password is correct.=0D - @retval EFI_SECURITY_VIOLATION The password is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to verify the p= assword.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -VerifyPassword (=0D - IN CHAR16 *Password,=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_PASSWORD *VerifyPassword;=0D -=0D - ASSERT (Password !=3D NULL);=0D -=0D - if (PasswordSize > sizeof(VerifyPassword->Password) * sizeof(CHAR16)) {= =0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - Buffer =3D UserPasswordLibInitCommunicateBuffer (=0D - (VOID**)&VerifyPassword,=0D - sizeof(*VerifyPassword),=0D - SMM_PASSWORD_FUNCTION_VERIFY_PASSWORD=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - Status =3D UnicodeStrToAsciiStrS (Password, VerifyPassword->Password, si= zeof(VerifyPassword->Password));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D -=0D - Status =3D UserPasswordLibSendCommunicateBuffer (Buffer, sizeof(*VerifyP= assword));=0D -=0D -EXIT:=0D - ZeroMem (VerifyPassword, sizeof(*VerifyPassword));=0D - return Status;=0D -}=0D -=0D -/**=0D - Set a new password.=0D -=0D - @param[in] NewPassword The user input new password.=0D - NULL means clear password.=0D - @param[in] NewPasswordSize The size of NewPassword in byte.=0D - @param[in] OldPassword The user input old password.=0D - NULL means no old password.=0D - @param[in] OldPasswordSize The size of OldPassword in byte.=0D -=0D - @retval EFI_SUCCESS The NewPassword is set successfully.=0D - @retval EFI_SECURITY_VIOLATION The OldPassword is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set the pass= word.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D - @retval EFI_UNSUPPORTED NewPassword is not strong enough.=0D - @retval EFI_ALREADY_STARTED NewPassword is in history.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -SetPassword (=0D - IN CHAR16 *NewPassword, OPTIONAL=0D - IN UINTN NewPasswordSize,=0D - IN CHAR16 *OldPassword, OPTIONAL=0D - IN UINTN OldPasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_SET_PASSWORD *SetPassword;=0D -=0D - if (NewPasswordSize > sizeof(SetPassword->NewPassword) * sizeof(CHAR16))= {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - if (OldPasswordSize > sizeof(SetPassword->OldPassword) * sizeof(CHAR16))= {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - Buffer =3D UserPasswordLibInitCommunicateBuffer (=0D - (VOID**)&SetPassword,=0D - sizeof(*SetPassword),=0D - SMM_PASSWORD_FUNCTION_SET_PASSWORD=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - if (NewPassword !=3D NULL) {=0D - Status =3D UnicodeStrToAsciiStrS (NewPassword, SetPassword->NewPasswor= d, sizeof(SetPassword->NewPassword));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D - } else {=0D - SetPassword->NewPassword[0] =3D 0;=0D - }=0D -=0D - if (OldPassword !=3D NULL) {=0D - Status =3D UnicodeStrToAsciiStrS (OldPassword, SetPassword->OldPasswor= d, sizeof(SetPassword->OldPassword));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D - } else {=0D - SetPassword->OldPassword[0] =3D 0;=0D - }=0D -=0D - Status =3D UserPasswordLibSendCommunicateBuffer (Buffer, sizeof(*SetPass= word));=0D -=0D -EXIT:=0D - ZeroMem (SetPassword, sizeof(*SetPassword));=0D - return Status;=0D -}=0D -=0D -/**=0D - Return if the password is set.=0D -=0D - @retval TRUE The password is set.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -IsPasswordInstalled (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D -=0D - Buffer =3D UserPasswordLibInitCommunicateBuffer (=0D - NULL,=0D - 0,=0D - SMM_PASSWORD_FUNCTION_IS_PASSWORD_SET=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D UserPasswordLibSendCommunicateBuffer (Buffer, 0);=0D - if (EFI_ERROR (Status)) {=0D - return FALSE;=0D - }=0D -=0D - return TRUE;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordLib= /UserPasswordLib.inf b/Platform/Intel/UserInterfaceFeaturePkg/Library/UserP= asswordLib/UserPasswordLib.inf deleted file mode 100644 index 6dc6ca734f..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPa= sswordLib.inf +++ /dev/null @@ -1,37 +0,0 @@ -## @file=0D -# UserPasswordLib instance provides services to set/verify password=0D -# and return if the password is set.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D UserPasswordLib=0D - FILE_GUID =3D 422BA58A-F162-4ECC-BD9A-AD84FE940F37= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D UserPasswordLib|DXE_RUNTIME_DRIVER DX= E_SMM_DRIVER DXE_DRIVER UEFI_APPLICATION=0D -=0D -[Sources]=0D - UserPasswordLib.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - DebugLib=0D - UefiLib=0D - BaseMemoryLib=0D -=0D -[Guids]=0D - gUserAuthenticationGuid ## CONSUMES ## GUID=0D - gEdkiiPiSmmCommunicationRegionTableGuid ## CONSUMES ## SystemTabl= e=0D -=0D -[Protocols]=0D - gEfiSmmCommunicationProtocolGuid ## CONSUMES=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordUiL= ib/UserPasswordUiLib.c b/Platform/Intel/UserInterfaceFeaturePkg/Library/Use= rPasswordUiLib/UserPasswordUiLib.c deleted file mode 100644 index 050bfda63a..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordUiLib/User= PasswordUiLib.c +++ /dev/null @@ -1,522 +0,0 @@ -/** @file=0D - UserPasswordUiLib instance provides services to do password authenticati= on.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Initialize the communicate buffer using DataSize and Function.=0D -=0D - @param[out] DataPtr Points to the data in the communicate = buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D - @param[in] Function The function number to initialize the = communicate header.=0D -=0D - @return Communicate buffer.=0D -**/=0D -VOID*=0D -UserPasswordUiLibInitCommunicateBuffer (=0D - OUT VOID **DataPtr OPTIONAL,=0D - IN UINTN DataSize,=0D - IN UINTN Function=0D - )=0D -{=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D - VOID *Buffer;=0D - EDKII_PI_SMM_COMMUNICATION_REGION_TABLE *SmmCommRegionTable;=0D - EFI_MEMORY_DESCRIPTOR *SmmCommMemRegion;=0D - UINTN Index;=0D - UINTN Size;=0D - EFI_STATUS Status;=0D -=0D - Buffer =3D NULL;=0D - Status =3D EfiGetSystemConfigurationTable (=0D - &gEdkiiPiSmmCommunicationRegionTableGuid,=0D - (VOID **) &SmmCommRegionTable=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return NULL;=0D - }=0D - ASSERT (SmmCommRegionTable !=3D NULL);=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) (SmmCommRegionTable + 1);= =0D - Size =3D 0;=0D - for (Index =3D 0; Index < SmmCommRegionTable->NumberOfEntries; Index++) = {=0D - if (SmmCommMemRegion->Type =3D=3D EfiConventionalMemory) {=0D - Size =3D EFI_PAGES_TO_SIZE ((UINTN) SmmCommMemRegion->NumberOfPages)= ;=0D - if (Size >=3D (DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Dat= a) + sizeof (SMM_PASSWORD_COMMUNICATE_HEADER))) {=0D - break;=0D - }=0D - }=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) SmmCommMemRe= gion + SmmCommRegionTable->DescriptorSize);=0D - }=0D - ASSERT (Index < SmmCommRegionTable->NumberOfEntries);=0D -=0D - Buffer =3D (VOID*)(UINTN)SmmCommMemRegion->PhysicalStart;=0D - ASSERT (Buffer !=3D NULL);=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gUserAuthenticationGuid);= =0D - SmmCommunicateHeader->MessageLength =3D DataSize + sizeof (SMM_PASSWORD_= COMMUNICATE_HEADER);=0D -=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *) SmmCom= municateHeader->Data;=0D - ZeroMem (SmmPasswordFunctionHeader, DataSize + sizeof (SMM_PASSWORD_COMM= UNICATE_HEADER));=0D - SmmPasswordFunctionHeader->Function =3D Function;=0D - if (DataPtr !=3D NULL) {=0D - *DataPtr =3D SmmPasswordFunctionHeader + 1;=0D - }=0D -=0D - return Buffer;=0D -}=0D -=0D -/**=0D - Send the data in communicate buffer to SMM.=0D -=0D - @param[in] Buffer Points to the data in the communicat= e buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D -=0D - @retval EFI_SUCCESS Success is returned from the functio= n in SMM.=0D - @retval Others Failure is returned from the functio= n in SMM.=0D -=0D -**/=0D -EFI_STATUS=0D -UserPasswordUiLibSendCommunicateBuffer (=0D - IN VOID *Buffer,=0D - IN UINTN DataSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN CommSize;=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D - EFI_SMM_COMMUNICATION_PROTOCOL *SmmCommunication;=0D -=0D - //=0D - // Locates SMM Communication protocol.=0D - //=0D - Status =3D gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL,= (VOID **) &SmmCommunication);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - CommSize =3D DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + s= izeof (SMM_PASSWORD_COMMUNICATE_HEADER);=0D -=0D - Status =3D SmmCommunication->Communicate (SmmCommunication, Buffer, &Com= mSize);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *)SmmComm= unicateHeader->Data;=0D - return SmmPasswordFunctionHeader->ReturnStatus;=0D -}=0D -=0D -/**=0D - Set password verification policy.=0D -=0D - @param[in] NeedReVerify Need re-verify or not.=0D -=0D - @retval EFI_SUCCESS Set verification policy successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set verifica= tion policy.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UiSetPasswordVerificationPolicy (=0D - IN BOOLEAN NeedReVerify=0D - )=0D -{=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *SetVerifyPolicy;=0D -=0D - Buffer =3D UserPasswordUiLibInitCommunicateBuffer (=0D - (VOID**)&SetVerifyPolicy,=0D - sizeof(*SetVerifyPolicy),=0D - SMM_PASSWORD_FUNCTION_SET_VERIFY_POLICY=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - SetVerifyPolicy->NeedReVerify =3D NeedReVerify;=0D -=0D - return UserPasswordUiLibSendCommunicateBuffer (Buffer, sizeof(*SetVerify= Policy));=0D -}=0D -=0D -/**=0D - Get a user input string.=0D -=0D - @param[in] PopUpString A popup string to inform user.=0D - @param[in, out] UserInput The user input string=0D - @param[in] UserInputMaxLen The max unicode count of the UserInput= without NULL terminator.=0D -**/=0D -EFI_STATUS=0D -GetUserInput (=0D - IN CHAR16 *PopUpString,=0D - IN OUT CHAR16 *UserInput,=0D - IN UINTN UserInputMaxLen=0D - )=0D -{=0D - EFI_INPUT_KEY InputKey;=0D - UINTN InputLength;=0D - CHAR16 *Mask;=0D -=0D - UserInput[0] =3D 0;=0D - Mask =3D AllocateZeroPool ((UserInputMaxLen + 1) * sizeof(CHAR16));=0D - if (Mask =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - InputLength =3D 0;=0D -=0D - while (TRUE) {=0D - if (InputLength < UserInputMaxLen) {=0D - Mask[InputLength] =3D L'_';=0D - }=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &InputKey,=0D - PopUpString,=0D - L"--------------------------------",=0D - Mask,=0D - NULL=0D - );=0D - if (InputKey.ScanCode =3D=3D SCAN_NULL) {=0D - //=0D - // Check whether finish inputing password.=0D - //=0D - if (InputKey.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN && InputLength = > 0) {=0D - //=0D - // Add the null terminator.=0D - //=0D - UserInput[InputLength] =3D 0;=0D - break;=0D - } else if ((InputKey.UnicodeChar =3D=3D CHAR_NULL) ||=0D - (InputKey.UnicodeChar =3D=3D CHAR_LINEFEED) ||=0D - (InputKey.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN)=0D - ) {=0D - continue;=0D - } else {=0D - //=0D - // delete last key entered=0D - //=0D - if (InputKey.UnicodeChar =3D=3D CHAR_BACKSPACE) {=0D - if (InputLength > 0) {=0D - UserInput[InputLength] =3D 0;=0D - Mask[InputLength] =3D 0;=0D - InputLength--;=0D - }=0D - } else {=0D - if (InputLength =3D=3D UserInputMaxLen) {=0D - Mask[InputLength] =3D 0;=0D - continue;=0D - }=0D - //=0D - // add Next key entry=0D - //=0D - UserInput[InputLength] =3D InputKey.UnicodeChar;=0D - Mask[InputLength] =3D L'*';=0D - InputLength++;=0D - }=0D - }=0D - }=0D - }=0D - FreePool (Mask);=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Display a message box to end user.=0D -=0D - @param[in] DisplayString The string in message box.=0D -**/=0D -VOID=0D -MessageBox (=0D - IN CHAR16 *DisplayString=0D - )=0D -{=0D - EFI_INPUT_KEY Key;=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D -}=0D -=0D -/**=0D - Force system reset.=0D -**/=0D -VOID=0D -ForceSystemReset (=0D - VOID=0D - )=0D -{=0D - MessageBox (L"Password retry count reach, reset system!");=0D - gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);=0D - CpuDeadLoop();=0D -}=0D -=0D -/**=0D - Display message for set password.=0D -=0D - @param[in] ReturnStatus The return status for set password.=0D -**/=0D -VOID=0D -PrintSetPasswordStatus (=0D - IN EFI_STATUS ReturnStatus=0D - )=0D -{=0D - CHAR16 *DisplayString;=0D - CHAR16 *DisplayString2;=0D -=0D - EFI_INPUT_KEY Key;=0D -=0D - if (ReturnStatus =3D=3D EFI_UNSUPPORTED) {=0D - DisplayString =3D L"New password is not strong enough!";=0D - DisplayString2 =3D L"Password must at least 8 chars and include lowerc= ase, uppercase alphabetic, number and symbol";=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - DisplayString2,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - } else {=0D - if (ReturnStatus =3D=3D EFI_SUCCESS) {=0D - DisplayString =3D L"New password is updated successfully!";=0D - } else if (ReturnStatus =3D=3D EFI_ALREADY_STARTED) {=0D - DisplayString =3D L"New password is found in the history passwords!"= ;=0D - } else {=0D - DisplayString =3D L"New password update fails!";=0D - }=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - }=0D -}=0D -=0D -/**=0D - Get password verification policy.=0D -=0D - @param[out] VerifyPolicy Verification policy.=0D -=0D - @retval EFI_SUCCESS Get verification policy successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to get verifica= tion policy.=0D -**/=0D -EFI_STATUS=0D -GetPasswordVerificationPolicy (=0D - OUT SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *VerifyPolicy=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *TempVerifyPolicy;=0D -=0D - Buffer =3D UserPasswordUiLibInitCommunicateBuffer (=0D - (VOID**)&TempVerifyPolicy,=0D - sizeof(*TempVerifyPolicy),=0D - SMM_PASSWORD_FUNCTION_GET_VERIFY_POLICY=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - Status =3D UserPasswordUiLibSendCommunicateBuffer (Buffer, sizeof(*TempV= erifyPolicy));=0D - if (!EFI_ERROR (Status)) {=0D - CopyMem (VerifyPolicy, TempVerifyPolicy, sizeof (SMM_PASSWORD_COMMUNIC= ATE_VERIFY_POLICY));=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Return if the password was verified.=0D -=0D - @retval TRUE The password was verified.=0D - @retval FALSE The password was not verified.=0D -**/=0D -BOOLEAN=0D -WasPasswordVerified (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D -=0D - Buffer =3D UserPasswordUiLibInitCommunicateBuffer (=0D - NULL,=0D - 0,=0D - SMM_PASSWORD_FUNCTION_WAS_PASSWORD_VERIFIED=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D UserPasswordUiLibSendCommunicateBuffer (Buffer, 0);=0D - if (EFI_ERROR (Status)) {=0D - return FALSE;=0D - }=0D -=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Require user input password.=0D -=0D - @retval TRUE User input correct password successfully.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -RequireUserPassword (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 UserInputPw[PASSWORD_MAX_SIZE]= ;=0D - CHAR16 *PopUpString;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY VerifyPolicy;=0D -=0D - Status =3D EFI_SUCCESS;=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D -=0D - if (!IsPasswordInstalled ()) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D GetPasswordVerificationPolicy (&VerifyPolicy);=0D - if (!EFI_ERROR (Status)) {=0D - if (WasPasswordVerified() && (!VerifyPolicy.NeedReVerify)) {=0D - DEBUG ((DEBUG_INFO, "Password was verified and Re-verify is not need= ed\n"));=0D - return TRUE;=0D - }=0D - }=0D -=0D - PopUpString =3D L"Please input admin password";=0D -=0D - while (TRUE) {=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString, UserInputPw, PASSWORD_MAX_SIZE - 1);=0D -=0D - Status =3D VerifyPassword (UserInputPw, StrSize(UserInputPw));=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - if (Status =3D=3D EFI_ACCESS_DENIED) {=0D - //=0D - // Password retry count reach.=0D - //=0D - ForceSystemReset ();=0D - }=0D - MessageBox (L"Incorrect password!");=0D - }=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D -=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D -=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Set user password.=0D -=0D -**/=0D -VOID=0D -SetUserPassword (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 UserInputPw[PASSWORD_MAX_SIZE];=0D - CHAR16 TmpPassword[PASSWORD_MAX_SIZE];=0D - CHAR16 *PopUpString;=0D - CHAR16 *PopUpString2;=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D - ZeroMem(TmpPassword, sizeof(TmpPassword));=0D -=0D - PopUpString =3D L"Please set admin password";=0D -=0D - while (TRUE) {=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString, UserInputPw, PASSWORD_MAX_SIZE - 1);=0D -=0D - PopUpString2 =3D L"Please confirm your new password";=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString2, TmpPassword, PASSWORD_MAX_SIZE - 1);=0D - if (StrCmp (TmpPassword, UserInputPw) !=3D 0) {=0D - MessageBox (L"Password are not the same!");=0D - continue;=0D - }=0D -=0D - Status =3D SetPassword (UserInputPw, StrSize(UserInputPw), NULL, 0);=0D - PrintSetPasswordStatus (Status);=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - }=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D - ZeroMem(TmpPassword, sizeof(TmpPassword));=0D -=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D -}=0D -=0D -/**=0D - Do password authentication.=0D -=0D - @retval EFI_SUCCESS Password authentication pass.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UiDoPasswordAuthentication (=0D - VOID=0D - )=0D -{=0D - BOOLEAN PasswordSet;=0D -=0D - PasswordSet =3D RequireUserPassword ();=0D - if (PasswordSet) {=0D - DEBUG ((DEBUG_INFO, "Welcome Admin!\n"));=0D - } else {=0D - DEBUG ((DEBUG_INFO, "Admin password is not set!\n"));=0D - if (NeedEnrollPassword()) {=0D - SetUserPassword ();=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordUiL= ib/UserPasswordUiLib.inf b/Platform/Intel/UserInterfaceFeaturePkg/Library/U= serPasswordUiLib/UserPasswordUiLib.inf deleted file mode 100644 index bdd8680ba0..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/Library/UserPasswordUiLib/User= PasswordUiLib.inf +++ /dev/null @@ -1,41 +0,0 @@ -## @file=0D -# UserPasswordUiLib instance provides services to do password authenticat= ion.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D UserPasswordUiLib=0D - FILE_GUID =3D E2E92636-F511-46BC-A08B-02F815AFA884= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D UserPasswordUiLib|DXE_RUNTIME_DRIVER = DXE_SMM_DRIVER DXE_DRIVER UEFI_APPLICATION=0D -=0D -[Sources]=0D - UserPasswordUiLib.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - UefiRuntimeServicesTableLib=0D - DebugLib=0D - UefiLib=0D - MemoryAllocationLib=0D - BaseMemoryLib=0D - PrintLib=0D - PlatformPasswordLib=0D - UserPasswordLib=0D -=0D -[Guids]=0D - gUserAuthenticationGuid ## CONSUMES ## GUID=0D - gEdkiiPiSmmCommunicationRegionTableGuid ## CONSUMES ## SystemTabl= e=0D -=0D -[Protocols]=0D - gEfiSmmCommunicationProtocolGuid ## CONSUMES=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeyS= ervice.c b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeySer= vice.c deleted file mode 100644 index 8b06e58ca5..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeyService.c +++ /dev/null @@ -1,133 +0,0 @@ -/** @file=0D - Password key service.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include "KeyService.h"=0D -=0D -/**=0D - Compares the contents of two buffers with slow algorithm=0D -=0D - This function compares Length bytes of SourceBuffer to Length bytes of D= estinationBuffer.=0D - If all Length bytes of the two buffers are identical, then 0 is returned= . Otherwise, the=0D - value returned is the first mismatched byte in SourceBuffer subtracted f= rom the first=0D - mismatched byte in DestinationBuffer.=0D -=0D - If Length > 0 and DestinationBuffer is NULL, then ASSERT().=0D - If Length > 0 and SourceBuffer is NULL, then ASSERT().=0D - If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then AS= SERT().=0D - If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(= ).=0D -=0D - @param DestinationBuffer The pointer to the destination buffer to compa= re.=0D - @param SourceBuffer The pointer to the source buffer to compare.=0D - @param Length The number of bytes to compare.=0D -=0D - @return 0 All Length bytes of the two buffers are identi= cal.=0D - @retval -1 The SourceBuffer is not identical to Destinati= onBuffer.=0D -=0D -**/=0D -INTN=0D -EFIAPI=0D -KeyLibSlowCompareMem (=0D - IN CONST VOID *DestinationBuffer,=0D - IN CONST VOID *SourceBuffer,=0D - IN UINTN Length=0D - )=0D -{=0D - UINT8 Delta;=0D - UINTN Index;=0D - UINT8 *Destination;=0D - UINT8 *Source;=0D -=0D - Destination =3D (UINT8 *)DestinationBuffer;=0D - Source =3D (UINT8 *)SourceBuffer;=0D - Delta =3D 0;=0D - for (Index =3D 0; Index < Length; Index++) {=0D - Delta |=3D Destination[Index] ^ Source[Index];=0D - }=0D - if (Delta =3D=3D 0) {=0D - return 0;=0D - } else {=0D - return -1;=0D - }=0D -}=0D -=0D -/**=0D - Generate Salt value.=0D -=0D - @param[in, out] SaltValue Points to the salt buffer=0D - @param[in] SaltSize Size of the salt buffer=0D -=0D - @retval TRUE Salt is generated.=0D - @retval FALSE Salt is not generated.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -KeyLibGenerateSalt (=0D - IN OUT UINT8 *SaltValue,=0D - IN UINTN SaltSize=0D - )=0D -{=0D - if (SaltValue =3D=3D NULL) {=0D - return FALSE;=0D - }=0D - RandomSeed(NULL, 0);=0D - RandomBytes(SaltValue, SaltSize);=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Hash the password with PBKDF2.=0D -=0D - @param[in] HashType Hash type=0D - @param[in] Key Points to the key buffer=0D - @param[in] KeySize Key buffer size=0D - @param[in] SaltValue Points to the salt buffer=0D - @param[in] SaltSize Size of the salt buffer=0D - @param[out] KeyHash Points to the hashed result=0D - @param[in] KeyHashSize Size of the hash buffer=0D -=0D - @retval TRUE Hash the data successfully.=0D - @retval FALSE Failed to hash the data.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -KeyLibGeneratePBKDF2Hash (=0D - IN UINT32 HashType,=0D - IN VOID *Key,=0D - IN UINTN KeySize,=0D - IN UINT8 *SaltValue,=0D - IN UINTN SaltSize,=0D - OUT UINT8 *KeyHash,=0D - IN UINTN KeyHashSize=0D - )=0D -{=0D - BOOLEAN Result;=0D -=0D - if (HashType !=3D HASH_TYPE_SHA256) {=0D - return FALSE;=0D - }=0D - if (KeyHashSize !=3D SHA256_DIGEST_SIZE) {=0D - return FALSE;=0D - }=0D -=0D - Result =3D Pkcs5HashPassword (=0D - KeySize,=0D - Key,=0D - SaltSize,=0D - SaltValue,=0D - DEFAULT_PBKDF2_ITERATION_COUNT,=0D - SHA256_DIGEST_SIZE,=0D - KeyHashSize,=0D - KeyHash=0D - );=0D - return Result;=0D -}=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeyS= ervice.h b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeySer= vice.h deleted file mode 100644 index d0b20851fa..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/KeyService.h +++ /dev/null @@ -1,88 +0,0 @@ -/** @file=0D - Header file for key service.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __KEY_LIB_H__=0D -#define __KEY_LIB_H__=0D -=0D -/**=0D - Compares the contents of two buffers with slow algorithm=0D -=0D - This function compares Length bytes of SourceBuffer to Length bytes of D= estinationBuffer.=0D - If all Length bytes of the two buffers are identical, then 0 is returned= . Otherwise, the=0D - value returned is the first mismatched byte in SourceBuffer subtracted f= rom the first=0D - mismatched byte in DestinationBuffer.=0D -=0D - If Length > 0 and DestinationBuffer is NULL, then ASSERT().=0D - If Length > 0 and SourceBuffer is NULL, then ASSERT().=0D - If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then AS= SERT().=0D - If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(= ).=0D -=0D - @param DestinationBuffer The pointer to the destination buffer to compa= re.=0D - @param SourceBuffer The pointer to the source buffer to compare.=0D - @param Length The number of bytes to compare.=0D -=0D - @return 0 All Length bytes of the two buffers are identi= cal.=0D - @retval -1 The SourceBuffer is not identical to Destinati= onBuffer.=0D -=0D -**/=0D -INTN=0D -EFIAPI=0D -KeyLibSlowCompareMem (=0D - IN CONST VOID *DestinationBuffer,=0D - IN CONST VOID *SourceBuffer,=0D - IN UINTN Length=0D - );=0D -=0D -/**=0D - Generate Salt value.=0D -=0D - @param[in, out] SaltValue Points to the salt buffer=0D - @param[in] SaltSize Size of the salt buffer=0D -=0D - @retval TRUE Salt is generated.=0D - @retval FALSE Salt is not generated.=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -KeyLibGenerateSalt(=0D - IN OUT UINT8 *SaltValue,=0D - IN UINTN SaltSize=0D - );=0D -=0D -#define HASH_TYPE_SHA256 0x000B=0D -#define DEFAULT_PBKDF2_ITERATION_COUNT 1000=0D -=0D -/**=0D - Hash the password with PBKDF2.=0D -=0D - @param[in] HashType Hash type=0D - @param[in] Key Points to the key buffer=0D - @param[in] KeySize Key buffer size=0D - @param[in] SaltValue Points to the salt buffer=0D - @param[in] SaltSize Size of the salt buffer=0D - @param[out] KeyHash Points to the hashed result=0D - @param[in] KeyHashSize Size of the hash buffer=0D -=0D - @retval TRUE Hash the data successfully.=0D - @retval FALSE Failed to hash the data.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -KeyLibGeneratePBKDF2Hash (=0D - IN UINT32 HashType,=0D - IN VOID *Key,=0D - IN UINTN KeySize,=0D - IN UINT8 *SaltValue,=0D - IN UINTN SaltSize,=0D - OUT UINT8 *KeyHash,=0D - IN UINTN KeyHashSize=0D - );=0D -=0D -#endif=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= Authentication2Dxe.c b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentic= ation/UserAuthentication2Dxe.c deleted file mode 100644 index b4326d380f..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= ication2Dxe.c +++ /dev/null @@ -1,484 +0,0 @@ -/** @file=0D - This Driver mainly provides Setup Form to change password.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "UserAuthentication2Dxe.h"=0D -=0D -USER_AUTHENTICATION_PRIVATE_DATA *mUserAuthenticationData =3D NULL;=0D -=0D -EFI_GUID mUserAuthenticationVendorGuid =3D USER_AUTHENTICATION_FORMSET_GUI= D;=0D -HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath =3D {=0D - {=0D - {=0D - HARDWARE_DEVICE_PATH,=0D - HW_VENDOR_DP,=0D - {=0D - (UINT8) (sizeof (VENDOR_DEVICE_PATH)),=0D - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)=0D - }=0D - },=0D - USER_AUTHENTICATION_FORMSET_GUID=0D - },=0D - {=0D - END_DEVICE_PATH_TYPE,=0D - END_ENTIRE_DEVICE_PATH_SUBTYPE,=0D - {=0D - (UINT8) (END_DEVICE_PATH_LENGTH),=0D - (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)=0D - }=0D - }=0D -};=0D -=0D -/**=0D - Display a message box to end user.=0D -=0D - @param[in] DisplayString The string in message box.=0D -**/=0D -VOID=0D -MessageBox (=0D - IN CHAR16 *DisplayString=0D - )=0D -{=0D - EFI_INPUT_KEY Key;=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D -}=0D -=0D -/**=0D - Force system reset.=0D -**/=0D -VOID=0D -ForceSystemReset (=0D - VOID=0D - )=0D -{=0D - MessageBox (L"Password retry count reach, reset system!");=0D - gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);=0D - CpuDeadLoop();=0D -}=0D -=0D -/**=0D - Display message for set password.=0D -=0D - @param[in] ReturnStatus The return status for set password.=0D -**/=0D -VOID=0D -PrintSetPasswordStatus (=0D - IN EFI_STATUS ReturnStatus=0D - )=0D -{=0D - CHAR16 *DisplayString;=0D - CHAR16 *DisplayString2;=0D -=0D - EFI_INPUT_KEY Key;=0D -=0D - if (ReturnStatus =3D=3D EFI_UNSUPPORTED) {=0D - DisplayString =3D L"New password is not strong enough!";=0D - DisplayString2 =3D L"Password must at least 8 chars and include lowerc= ase, uppercase alphabetic, number and symbol";=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - DisplayString2,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - } else {=0D - if (ReturnStatus =3D=3D EFI_SUCCESS) {=0D - DisplayString =3D L"New password is updated successfully!";=0D - } else if (ReturnStatus =3D=3D EFI_ALREADY_STARTED) {=0D - DisplayString =3D L"New password is found in the history passwords!"= ;=0D - } else {=0D - DisplayString =3D L"New password update fails!";=0D - }=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - }=0D -}=0D -=0D -/**=0D - This function allows a caller to extract the current configuration for o= ne=0D - or more named elements from the target driver.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Request A null-terminated Unicode string in=0D - format.=0D - @param Progress On return, points to a character in the R= equest=0D - string. Points to the string's null termi= nator if=0D - request was successful. Points to the mos= t recent=0D - '&' before the first failing name/value p= air (or=0D - the beginning of the string if the failur= e is in=0D - the first name/value pair) if the request= was not=0D - successful.=0D - @param Results A null-terminated Unicode string in=0D - format which has all valu= es filled=0D - in for the names in the Request string. S= tring to=0D - be allocated by the called function.=0D -=0D - @retval EFI_SUCCESS The Results is filled with the requested = values.=0D - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.=0D - @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown nam= e.=0D - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this=0D - driver.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -ExtractConfig (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN CONST EFI_STRING Request,=0D - OUT EFI_STRING *Progress,=0D - OUT EFI_STRING *Results=0D - )=0D -{=0D - if (Progress =3D=3D NULL || Results =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - *Progress =3D Request;=0D - return EFI_NOT_FOUND;=0D -}=0D -=0D -=0D -/**=0D - This function processes the results of changes in configuration.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Configuration A null-terminated Unicode string in =0D - format.=0D - @param Progress A pointer to a string filled in with the = offset of=0D - the most recent '&' before the first fail= ing=0D - name/value pair (or the beginning of the = string if=0D - the failure is in the first name/value pa= ir) or=0D - the terminating NULL if all was successfu= l.=0D -=0D - @retval EFI_SUCCESS The Results is processed successfully.=0D - @retval EFI_INVALID_PARAMETER Configuration is NULL.=0D - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this=0D - driver.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -RouteConfig (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN CONST EFI_STRING Configuration,=0D - OUT EFI_STRING *Progress=0D - )=0D -{=0D - if (Configuration =3D=3D NULL || Progress =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - *Progress =3D Configuration;=0D -=0D - return EFI_NOT_FOUND;=0D -}=0D -=0D -/**=0D - HII update Admin Password status.=0D -=0D -**/=0D -VOID=0D -HiiUpdateAdminPasswordStatus (=0D - VOID=0D - )=0D -{=0D - if (IsPasswordInstalled ()) {=0D - HiiSetString (=0D - mUserAuthenticationData->HiiHandle,=0D - STRING_TOKEN (STR_ADMIN_PASSWORD_STS_CONTENT),=0D - L"Installed",=0D - NULL=0D - );=0D - } else {=0D - HiiSetString (=0D - mUserAuthenticationData->HiiHandle,=0D - STRING_TOKEN (STR_ADMIN_PASSWORD_STS_CONTENT),=0D - L"Not Installed",=0D - NULL=0D - );=0D - }=0D -}=0D -=0D -/**=0D - This function processes the results of changes in configuration.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Action Specifies the type of action taken by the= browser.=0D - @param QuestionId A unique value which is sent to the origi= nal=0D - exporting driver so that it can identify = the type=0D - of data to expect.=0D - @param Type The type of value for the question.=0D - @param Value A pointer to the data being sent to the o= riginal=0D - exporting driver.=0D - @param ActionRequest On return, points to the action requested= by the=0D - callback function.=0D -=0D - @retval EFI_SUCCESS The callback successfully handled the act= ion.=0D - @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold t= he=0D - variable and its data.=0D - @retval EFI_DEVICE_ERROR The variable could not be saved.=0D - @retval EFI_UNSUPPORTED The specified Action is not supported by = the=0D - callback.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthenticationCallback (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN EFI_BROWSER_ACTION Action,=0D - IN EFI_QUESTION_ID QuestionId,=0D - IN UINT8 Type,=0D - IN EFI_IFR_TYPE_VALUE *Value,=0D - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 *UserInputPassword;=0D -=0D - Status =3D EFI_SUCCESS;=0D -=0D - if (((Value =3D=3D NULL) && (Action !=3D EFI_BROWSER_ACTION_FORM_OPEN) &= & (Action !=3D EFI_BROWSER_ACTION_FORM_CLOSE)) ||=0D - (ActionRequest =3D=3D NULL)) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - switch (Action) {=0D - case EFI_BROWSER_ACTION_FORM_OPEN:=0D - {=0D - switch (QuestionId) {=0D - case ADMIN_PASSWORD_KEY_ID:=0D - HiiUpdateAdminPasswordStatus ();=0D - default:=0D - break;=0D - }=0D - }=0D - break;=0D - case EFI_BROWSER_ACTION_CHANGING:=0D - {=0D - switch (QuestionId) {=0D - case ADMIN_PASSWORD_KEY_ID:=0D - if ((Type =3D=3D EFI_IFR_TYPE_STRING) && (Value->string =3D=3D 0) = &&=0D - (mUserAuthenticationData->PasswordState =3D=3D BROWSER_STATE_S= ET_PASSWORD)) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDAT= E_PASSWORD;=0D - ZeroMem (mUserAuthenticationData->OldPassword, sizeof(mUserAuthe= nticationData->OldPassword));=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - //=0D - // The Callback is responsible for validating old password input b= y user,=0D - // If Callback return EFI_SUCCESS, it indicates validation pass.=0D - //=0D - switch (mUserAuthenticationData->PasswordState) {=0D - case BROWSER_STATE_VALIDATE_PASSWORD:=0D - UserInputPassword =3D HiiGetString (mUserAuthenticationData->Hii= Handle, Value->string, NULL);=0D - if (UserInputPassword =3D=3D NULL) {=0D - return EFI_UNSUPPORTED;=0D - }=0D - if ((StrLen (UserInputPassword) >=3D PASSWORD_MAX_SIZE)) {=0D - Status =3D EFI_NOT_READY;=0D - break;=0D - }=0D - if (UserInputPassword[0] =3D=3D 0) {=0D - //=0D - // Setup will use an empty password to check whether the old p= assword is set,=0D - // If the validation is successful, means there is no old pass= word, return=0D - // success to set the new password. Or need to return EFI_NOT_= READY to=0D - // let user input the old password.=0D - //=0D - Status =3D VerifyPassword (UserInputPassword, StrSize (UserInp= utPassword));=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_SET= _PASSWORD;=0D - } else {=0D - Status =3D EFI_NOT_READY;=0D - }=0D - break;=0D - }=0D - Status =3D VerifyPassword (UserInputPassword, StrSize (UserInput= Password));=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_SET_P= ASSWORD;=0D - StrCpyS (=0D - mUserAuthenticationData->OldPassword,=0D - sizeof(mUserAuthenticationData->OldPassword)/sizeof(CHAR16),= =0D - UserInputPassword=0D - );=0D - } else {=0D - //=0D - // Old password mismatch, return EFI_NOT_READY to prompt for e= rror message.=0D - //=0D - if (Status =3D=3D EFI_ACCESS_DENIED) {=0D - //=0D - // Password retry count reach.=0D - //=0D - ForceSystemReset ();=0D - }=0D - Status =3D EFI_NOT_READY;=0D - }=0D - break;=0D -=0D - case BROWSER_STATE_SET_PASSWORD:=0D - UserInputPassword =3D HiiGetString (mUserAuthenticationData->Hii= Handle, Value->string, NULL);=0D - if (UserInputPassword =3D=3D NULL) {=0D - return EFI_UNSUPPORTED;=0D - }=0D - if ((StrLen (UserInputPassword) >=3D PASSWORD_MAX_SIZE)) {=0D - Status =3D EFI_NOT_READY;=0D - break;=0D - }=0D - Status =3D SetPassword (UserInputPassword, StrSize (UserInputPas= sword), mUserAuthenticationData->OldPassword, StrSize(mUserAuthenticationDa= ta->OldPassword));=0D - PrintSetPasswordStatus (Status);=0D - ZeroMem (mUserAuthenticationData->OldPassword, sizeof(mUserAuthe= nticationData->OldPassword));=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDAT= E_PASSWORD;=0D - HiiUpdateAdminPasswordStatus ();=0D - break;=0D -=0D - default:=0D - break;=0D - }=0D - default:=0D - break;=0D - }=0D - }=0D - break;=0D - default:=0D - break;=0D - }=0D - return Status;=0D -}=0D -=0D -/**=0D - User Authentication entry point.=0D -=0D - @param ImageHandle The image handle.=0D - @param SystemTable The system table.=0D -=0D - @retval EFI_SUCCESS The entry point is executed successfully.=0D - @return other Contain some other errors.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthentication2Entry (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_HANDLE DriverHandle;=0D - EFI_HII_HANDLE HiiHandle;=0D -=0D - DriverHandle =3D NULL;=0D -=0D - mUserAuthenticationData =3D AllocateZeroPool (sizeof (USER_AUTHENTICATIO= N_PRIVATE_DATA));=0D - if (mUserAuthenticationData =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - mUserAuthenticationData->ConfigAccess.ExtractConfig =3D ExtractConfig;=0D - mUserAuthenticationData->ConfigAccess.RouteConfig =3D RouteConfig;=0D - mUserAuthenticationData->ConfigAccess.Callback =3D UserAuthenticationCal= lback;=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDATE_PASSWO= RD;=0D -=0D - //=0D - // Install Config Access protocol to driver handle.=0D - //=0D - Status =3D gBS->InstallMultipleProtocolInterfaces (=0D - &DriverHandle,=0D - &gEfiDevicePathProtocolGuid,=0D - &mHiiVendorDevicePath,=0D - &gEfiHiiConfigAccessProtocolGuid,=0D - &mUserAuthenticationData->ConfigAccess,=0D - NULL=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - mUserAuthenticationData->DriverHandle =3D DriverHandle;=0D -=0D - //=0D - // Add HII data to database.=0D - //=0D - HiiHandle =3D HiiAddPackages (=0D - &mUserAuthenticationVendorGuid,=0D - DriverHandle,=0D - UserAuthentication2DxeStrings,=0D - UserAuthenticationDxeVfrBin,=0D - NULL=0D - );=0D - if (HiiHandle =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D - mUserAuthenticationData->HiiHandle =3D HiiHandle;=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Unloads the application and its installed protocol.=0D -=0D - @param[in] ImageHandle Handle that identifies the image to be unl= oaded.=0D -=0D - @retval EFI_SUCCESS The image has been unloaded.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthentication2Unload (=0D - IN EFI_HANDLE ImageHandle=0D - )=0D -{=0D - ASSERT (mUserAuthenticationData !=3D NULL);=0D -=0D - //=0D - // Uninstall Config Access Protocol.=0D - //=0D - if (mUserAuthenticationData->DriverHandle !=3D NULL) {=0D - gBS->UninstallMultipleProtocolInterfaces (=0D - mUserAuthenticationData->DriverHandle,=0D - &gEfiDevicePathProtocolGuid,=0D - &mHiiVendorDevicePath,=0D - &gEfiHiiConfigAccessProtocolGuid,=0D - &mUserAuthenticationData->ConfigAccess,=0D - NULL=0D - );=0D - mUserAuthenticationData->DriverHandle =3D NULL;=0D - }=0D -=0D - //=0D - // Remove Hii Data.=0D - //=0D - if (mUserAuthenticationData->HiiHandle !=3D NULL) {=0D - HiiRemovePackages (mUserAuthenticationData->HiiHandle);=0D - }=0D -=0D - FreePool (mUserAuthenticationData);=0D - mUserAuthenticationData =3D NULL;=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= Authentication2Dxe.h b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentic= ation/UserAuthentication2Dxe.h deleted file mode 100644 index 3b7fba026d..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= ication2Dxe.h +++ /dev/null @@ -1,55 +0,0 @@ -/** @file=0D - Header file for UserAuthentication2Dxe.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _USER_AUTHENTICATION_DXE_H_=0D -#define _USER_AUTHENTICATION_DXE_H_=0D -=0D -=0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "UserAuthenticationDxeFormset.h"=0D -=0D -extern UINT8 UserAuthenticationDxeVfrBin[];=0D -extern UINT8 UserAuthentication2DxeStrings[];=0D -=0D -typedef struct {=0D - EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;=0D - EFI_HANDLE DriverHandle;=0D - EFI_HII_HANDLE HiiHandle;=0D - UINT8 PasswordState;=0D - CHAR16 OldPassword[PASSWORD_MAX_SIZE];=0D -} USER_AUTHENTICATION_PRIVATE_DATA;=0D -=0D -#pragma pack(1)=0D -///=0D -/// HII specific Vendor Device Path definition.=0D -///=0D -typedef struct {=0D - VENDOR_DEVICE_PATH VendorDevicePath;=0D - EFI_DEVICE_PATH_PROTOCOL End;=0D -} HII_VENDOR_DEVICE_PATH;=0D -#pragma pack()=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= Authentication2Dxe.inf b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthent= ication/UserAuthentication2Dxe.inf deleted file mode 100644 index d93d511005..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= ication2Dxe.inf +++ /dev/null @@ -1,53 +0,0 @@ -## @file=0D -# User Authentication 2 Dxe Driver.=0D -#=0D -# This Driver mainly provides Setup Form to change password.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D UserAuthentication2Dxe=0D - FILE_GUID =3D 4EF592F4-C716-40CC-8C07-1E4E3BD71F11= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 2.0=0D - ENTRY_POINT =3D UserAuthentication2Entry=0D - UNLOAD_IMAGE =3D UserAuthentication2Unload=0D -=0D -[Sources]=0D - UserAuthentication2Dxe.c=0D - UserAuthentication2Dxe.h=0D - UserAuthenticationDxeFormset.h=0D - UserAuthenticationDxeVfr.vfr=0D - UserAuthenticationDxeStrings.uni=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - UefiRuntimeServicesTableLib=0D - BaseMemoryLib=0D - DebugLib=0D - UefiLib=0D - HiiLib=0D - DevicePathLib=0D - MemoryAllocationLib=0D - UserPasswordLib=0D -=0D -[Protocols]=0D - gEfiDevicePathProtocolGuid ## PRODUCES=0D - gEfiHiiConfigAccessProtocolGuid ## PRODUCES=0D -=0D -[Depex]=0D - gEfiSimpleTextOutProtocolGuid AND=0D - gEfiSmmCommunicationProtocolGuid AND=0D - gEfiVariableArchProtocolGuid AND=0D - gEfiVariableWriteArchProtocolGuid=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxe.c b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentica= tion/UserAuthenticationDxe.c deleted file mode 100644 index bba2057a96..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxe.c +++ /dev/null @@ -1,780 +0,0 @@ -/** @file=0D - This Driver mainly provides Setup Form to change password and=0D - does user authentication before entering Setup.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "UserAuthenticationDxe.h"=0D -=0D -EFI_EVENT mExitBootServicesEvent =3D NULL;=0D -EFI_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol =3D NULL;=0D -USER_AUTHENTICATION_PRIVATE_DATA *mUserAuthenticationData =3D NULL;=0D -EFI_SMM_COMMUNICATION_PROTOCOL *mSmmCommunication =3D NULL;=0D -=0D -EFI_GUID mUserAuthenticationVendorGuid =3D USER_AUTHENTICATION_FORMSET_GUI= D;=0D -HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath =3D {=0D - {=0D - {=0D - HARDWARE_DEVICE_PATH,=0D - HW_VENDOR_DP,=0D - {=0D - (UINT8) (sizeof (VENDOR_DEVICE_PATH)),=0D - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)=0D - }=0D - },=0D - USER_AUTHENTICATION_FORMSET_GUID=0D - },=0D - {=0D - END_DEVICE_PATH_TYPE,=0D - END_ENTIRE_DEVICE_PATH_SUBTYPE,=0D - {=0D - (UINT8) (END_DEVICE_PATH_LENGTH),=0D - (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)=0D - }=0D - }=0D -};=0D -=0D -/**=0D - Get a user input string.=0D -=0D - @param[in] PopUpString A popup string to inform user.=0D - @param[in, out] UserInput The user input string=0D - @param[in] UserInputMaxLen The max unicode count of the UserInput= without NULL terminator.=0D -**/=0D -EFI_STATUS=0D -GetUserInput (=0D - IN CHAR16 *PopUpString,=0D - IN OUT CHAR16 *UserInput,=0D - IN UINTN UserInputMaxLen=0D - )=0D -{=0D - EFI_INPUT_KEY InputKey;=0D - UINTN InputLength;=0D - CHAR16 *Mask;=0D -=0D - UserInput[0] =3D 0;=0D - Mask =3D AllocateZeroPool ((UserInputMaxLen + 1) * sizeof(CHAR16));=0D - if (Mask =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - InputLength =3D 0;=0D -=0D - while (TRUE) {=0D - if (InputLength < UserInputMaxLen) {=0D - Mask[InputLength] =3D L'_';=0D - }=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &InputKey,=0D - PopUpString,=0D - L"--------------------------------",=0D - Mask,=0D - NULL=0D - );=0D - if (InputKey.ScanCode =3D=3D SCAN_NULL) {=0D - //=0D - // Check whether finish inputing password.=0D - //=0D - if (InputKey.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN && InputLength = > 0) {=0D - //=0D - // Add the null terminator.=0D - //=0D - UserInput[InputLength] =3D 0;=0D - break;=0D - } else if ((InputKey.UnicodeChar =3D=3D CHAR_NULL) ||=0D - (InputKey.UnicodeChar =3D=3D CHAR_LINEFEED) ||=0D - (InputKey.UnicodeChar =3D=3D CHAR_CARRIAGE_RETURN)=0D - ) {=0D - continue;=0D - } else {=0D - //=0D - // delete last key entered=0D - //=0D - if (InputKey.UnicodeChar =3D=3D CHAR_BACKSPACE) {=0D - if (InputLength > 0) {=0D - UserInput[InputLength] =3D 0;=0D - Mask[InputLength] =3D 0;=0D - InputLength--;=0D - }=0D - } else {=0D - if (InputLength =3D=3D UserInputMaxLen) {=0D - Mask[InputLength] =3D 0;=0D - continue;=0D - }=0D - //=0D - // add Next key entry=0D - //=0D - UserInput[InputLength] =3D InputKey.UnicodeChar;=0D - Mask[InputLength] =3D L'*';=0D - InputLength++;=0D - }=0D - }=0D - }=0D - }=0D - FreePool (Mask);=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Display a message box to end user.=0D -=0D - @param[in] DisplayString The string in message box.=0D -**/=0D -VOID=0D -MessageBox (=0D - IN CHAR16 *DisplayString=0D - )=0D -{=0D - EFI_INPUT_KEY Key;=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D -}=0D -=0D -/**=0D - Force system reset.=0D -**/=0D -VOID=0D -ForceSystemReset (=0D - VOID=0D - )=0D -{=0D - MessageBox (L"Password retry count reach, reset system!");=0D - gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);=0D - CpuDeadLoop();=0D -}=0D -=0D -/**=0D - Display message for set password.=0D -=0D - @param[in] ReturnStatus The return status for set password.=0D -**/=0D -VOID=0D -PrintSetPasswordStatus (=0D - IN EFI_STATUS ReturnStatus=0D - )=0D -{=0D - CHAR16 *DisplayString;=0D - CHAR16 *DisplayString2;=0D -=0D - EFI_INPUT_KEY Key;=0D -=0D - if (ReturnStatus =3D=3D EFI_UNSUPPORTED) {=0D - DisplayString =3D L"New password is not strong enough!";=0D - DisplayString2 =3D L"Password must at least 8 chars and include lowerc= ase, uppercase alphabetic, number and symbol";=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - DisplayString2,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - } else {=0D - if (ReturnStatus =3D=3D EFI_SUCCESS) {=0D - DisplayString =3D L"New password is updated successfully!";=0D - } else if (ReturnStatus =3D=3D EFI_ALREADY_STARTED) {=0D - DisplayString =3D L"New password is found in the history passwords!"= ;=0D - } else {=0D - DisplayString =3D L"New password update fails!";=0D - }=0D -=0D - do {=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"",=0D - DisplayString,=0D - L"Press ENTER to continue ...",=0D - L"",=0D - NULL=0D - );=0D - } while (Key.UnicodeChar !=3D CHAR_CARRIAGE_RETURN);=0D - }=0D -}=0D -=0D -/**=0D - Require user input password.=0D -=0D - @retval TRUE User input correct password successfully.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -RequireUserPassword (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 UserInputPw[PASSWORD_MAX_S= IZE];=0D - CHAR16 *PopUpString;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY VerifyPolicy;=0D -=0D - Status =3D EFI_SUCCESS;=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D -=0D - if (!IsPasswordInstalled ()) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D GetPasswordVerificationPolicy (&VerifyPolicy);=0D - if (!EFI_ERROR (Status)) {=0D - if (WasPasswordVerified() && (!VerifyPolicy.NeedReVerify)) {=0D - DEBUG ((DEBUG_INFO, "Password was verified and Re-verify is not need= ed\n"));=0D - return TRUE;=0D - }=0D - }=0D -=0D - PopUpString =3D L"Please input admin password";=0D -=0D - while (TRUE) {=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString, UserInputPw, PASSWORD_MAX_SIZE - 1);=0D -=0D - Status =3D VerifyPassword (UserInputPw, StrSize(UserInputPw));=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - if (Status =3D=3D EFI_ACCESS_DENIED) {=0D - //=0D - // Password retry count reach.=0D - //=0D - ForceSystemReset ();=0D - }=0D - MessageBox (L"Incorrect password!");=0D - }=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D -=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D -=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Set user password.=0D -=0D -**/=0D -VOID=0D -SetUserPassword (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 UserInputPw[PASSWORD_MAX_SIZE];=0D - CHAR16 TmpPassword[PASSWORD_MAX_SIZE];=0D - CHAR16 *PopUpString;=0D - CHAR16 *PopUpString2;=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D - ZeroMem(TmpPassword, sizeof(TmpPassword));=0D -=0D - PopUpString =3D L"Please set admin password";=0D -=0D - while (TRUE) {=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString, UserInputPw, PASSWORD_MAX_SIZE - 1);=0D -=0D - PopUpString2 =3D L"Please confirm your new password";=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D - GetUserInput (PopUpString2, TmpPassword, PASSWORD_MAX_SIZE - 1);=0D - if (StrCmp (TmpPassword, UserInputPw) !=3D 0) {=0D - MessageBox (L"Password are not the same!");=0D - continue;=0D - }=0D -=0D - Status =3D SetPassword (UserInputPw, StrSize(UserInputPw), NULL, 0);=0D - PrintSetPasswordStatus (Status);=0D - if (!EFI_ERROR(Status)) {=0D - break;=0D - }=0D - }=0D -=0D - ZeroMem(UserInputPw, sizeof(UserInputPw));=0D - ZeroMem(TmpPassword, sizeof(TmpPassword));=0D -=0D - gST->ConOut->ClearScreen(gST->ConOut);=0D -}=0D -=0D -/**=0D - Check password before entering into setup.=0D -=0D - @param CodeType Indicates the type of status code being reported. = Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.=0D -=0D - @param Value Describes the current status of a hardware or soft= ware entity.=0D - This included information about the class and subc= lass that is used to classify the entity=0D - as well as an operation. For progress codes, the = operation is the current activity.=0D - For error codes, it is the exception. For debug c= odes, it is not defined at this time.=0D - Type EFI_STATUS_CODE_VALUE is defined in "Related = Definitions" below.=0D - Specific values are discussed in the Intel? Platfo= rm Innovation Framework for EFI Status Code Specification.=0D -=0D - @param Instance The enumeration of a hardware or software entity w= ithin the system.=0D - A system may contain multiple entities that match = a class/subclass pairing.=0D - The instance differentiates between them. An inst= ance of 0 indicates that instance information is unavailable,=0D - not meaningful, or not relevant. Valid instance n= umbers start with 1.=0D -=0D -=0D - @param CallerId This optional parameter may be used to identify th= e caller.=0D - This parameter allows the status code driver to ap= ply different rules to different callers.=0D - Type EFI_GUID is defined in InstallProtocolInterfa= ce() in the UEFI 2.0 Specification.=0D -=0D -=0D - @param Data This optional parameter may be used to pass additi= onal data=0D -=0D - @retval EFI_SUCCESS Status code is what we expected.=0D - @retval EFI_UNSUPPORTED Status code not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CheckForPassword (=0D - IN EFI_STATUS_CODE_TYPE CodeType,=0D - IN EFI_STATUS_CODE_VALUE Value,=0D - IN UINT32 Instance,=0D - IN EFI_GUID *CallerId, OPTIONAL=0D - IN EFI_STATUS_CODE_DATA *Data OPTIONAL=0D - )=0D -{=0D - BOOLEAN PasswordSet;=0D -=0D - if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) =3D=3D EFI_PROGRESS_CODE) &&= =0D - (Value =3D=3D (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP))) = {=0D - //=0D - // Check whether enter setup page.=0D - //=0D - PasswordSet =3D RequireUserPassword ();=0D - if (PasswordSet) {=0D - DEBUG ((DEBUG_INFO, "Welcome Admin!\n"));=0D - } else {=0D - DEBUG ((DEBUG_INFO, "Admin password is not set!\n"));=0D - if (NeedEnrollPassword()) {=0D - SetUserPassword ();=0D - }=0D - }=0D -=0D - return EFI_SUCCESS;=0D - } else{=0D - return EFI_UNSUPPORTED;=0D - }=0D -}=0D -=0D -/**=0D - This function allows a caller to extract the current configuration for o= ne=0D - or more named elements from the target driver.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Request A null-terminated Unicode string in=0D - format.=0D - @param Progress On return, points to a character in the R= equest=0D - string. Points to the string's null termi= nator if=0D - request was successful. Points to the mos= t recent=0D - '&' before the first failing name/value p= air (or=0D - the beginning of the string if the failur= e is in=0D - the first name/value pair) if the request= was not=0D - successful.=0D - @param Results A null-terminated Unicode string in=0D - format which has all valu= es filled=0D - in for the names in the Request string. S= tring to=0D - be allocated by the called function.=0D -=0D - @retval EFI_SUCCESS The Results is filled with the requested = values.=0D - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.=0D - @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown nam= e.=0D - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this=0D - driver.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -ExtractConfig (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN CONST EFI_STRING Request,=0D - OUT EFI_STRING *Progress,=0D - OUT EFI_STRING *Results=0D - )=0D -{=0D - if (Progress =3D=3D NULL || Results =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - *Progress =3D Request;=0D - return EFI_NOT_FOUND;=0D -}=0D -=0D -=0D -/**=0D - This function processes the results of changes in configuration.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Configuration A null-terminated Unicode string in =0D - format.=0D - @param Progress A pointer to a string filled in with the = offset of=0D - the most recent '&' before the first fail= ing=0D - name/value pair (or the beginning of the = string if=0D - the failure is in the first name/value pa= ir) or=0D - the terminating NULL if all was successfu= l.=0D -=0D - @retval EFI_SUCCESS The Results is processed successfully.=0D - @retval EFI_INVALID_PARAMETER Configuration is NULL.=0D - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this=0D - driver.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -RouteConfig (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN CONST EFI_STRING Configuration,=0D - OUT EFI_STRING *Progress=0D - )=0D -{=0D - if (Configuration =3D=3D NULL || Progress =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - *Progress =3D Configuration;=0D -=0D - return EFI_NOT_FOUND;=0D -}=0D -=0D -/**=0D - HII update Admin Password status.=0D -=0D -**/=0D -VOID=0D -HiiUpdateAdminPasswordStatus (=0D - VOID=0D - )=0D -{=0D - if (IsPasswordInstalled ()) {=0D - HiiSetString (=0D - mUserAuthenticationData->HiiHandle,=0D - STRING_TOKEN (STR_ADMIN_PASSWORD_STS_CONTENT),=0D - L"Installed",=0D - NULL=0D - );=0D - } else {=0D - HiiSetString (=0D - mUserAuthenticationData->HiiHandle,=0D - STRING_TOKEN (STR_ADMIN_PASSWORD_STS_CONTENT),=0D - L"Not Installed",=0D - NULL=0D - );=0D - }=0D -}=0D -=0D -/**=0D - This function processes the results of changes in configuration.=0D -=0D - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL.=0D - @param Action Specifies the type of action taken by the= browser.=0D - @param QuestionId A unique value which is sent to the origi= nal=0D - exporting driver so that it can identify = the type=0D - of data to expect.=0D - @param Type The type of value for the question.=0D - @param Value A pointer to the data being sent to the o= riginal=0D - exporting driver.=0D - @param ActionRequest On return, points to the action requested= by the=0D - callback function.=0D -=0D - @retval EFI_SUCCESS The callback successfully handled the act= ion.=0D - @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold t= he=0D - variable and its data.=0D - @retval EFI_DEVICE_ERROR The variable could not be saved.=0D - @retval EFI_UNSUPPORTED The specified Action is not supported by = the=0D - callback.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthenticationCallback (=0D - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,=0D - IN EFI_BROWSER_ACTION Action,=0D - IN EFI_QUESTION_ID QuestionId,=0D - IN UINT8 Type,=0D - IN EFI_IFR_TYPE_VALUE *Value,=0D - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest=0D - )=0D -{=0D - EFI_STATUS Status;=0D - CHAR16 *UserInputPassword;=0D -=0D - Status =3D EFI_SUCCESS;=0D -=0D - if (((Value =3D=3D NULL) && (Action !=3D EFI_BROWSER_ACTION_FORM_OPEN) &= & (Action !=3D EFI_BROWSER_ACTION_FORM_CLOSE)) ||=0D - (ActionRequest =3D=3D NULL)) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - switch (Action) {=0D - case EFI_BROWSER_ACTION_FORM_OPEN:=0D - {=0D - switch (QuestionId) {=0D - case ADMIN_PASSWORD_KEY_ID:=0D - HiiUpdateAdminPasswordStatus ();=0D - default:=0D - break;=0D - }=0D - }=0D - break;=0D - case EFI_BROWSER_ACTION_CHANGING:=0D - {=0D - switch (QuestionId) {=0D - case ADMIN_PASSWORD_KEY_ID:=0D - if ((Type =3D=3D EFI_IFR_TYPE_STRING) && (Value->string =3D=3D 0) = &&=0D - (mUserAuthenticationData->PasswordState =3D=3D BROWSER_STATE_S= ET_PASSWORD)) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDAT= E_PASSWORD;=0D - ZeroMem (mUserAuthenticationData->OldPassword, sizeof(mUserAuthe= nticationData->OldPassword));=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - //=0D - // The Callback is responsible for validating old password input b= y user,=0D - // If Callback return EFI_SUCCESS, it indicates validation pass.=0D - //=0D - switch (mUserAuthenticationData->PasswordState) {=0D - case BROWSER_STATE_VALIDATE_PASSWORD:=0D - UserInputPassword =3D HiiGetString (mUserAuthenticationData->Hii= Handle, Value->string, NULL);=0D - if ((StrLen (UserInputPassword) >=3D PASSWORD_MAX_SIZE)) {=0D - Status =3D EFI_NOT_READY;=0D - break;=0D - }=0D - if (UserInputPassword[0] =3D=3D 0) {=0D - //=0D - // Setup will use a NULL password to check whether the old pas= sword is set,=0D - // If the validation is successful, means there is no old pass= word, return=0D - // success to set the new password. Or need to return EFI_NOT_= READY to=0D - // let user input the old password.=0D - //=0D - Status =3D VerifyPassword (UserInputPassword, StrSize (UserInp= utPassword));=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_SET= _PASSWORD;=0D - } else {=0D - Status =3D EFI_NOT_READY;=0D - }=0D - break;=0D - }=0D - Status =3D VerifyPassword (UserInputPassword, StrSize (UserInput= Password));=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_SET_P= ASSWORD;=0D - StrCpyS (=0D - mUserAuthenticationData->OldPassword,=0D - sizeof(mUserAuthenticationData->OldPassword)/sizeof(CHAR16),= =0D - UserInputPassword=0D - );=0D - } else {=0D - //=0D - // Old password mismatch, return EFI_NOT_READY to prompt for e= rror message.=0D - //=0D - if (Status =3D=3D EFI_ACCESS_DENIED) {=0D - //=0D - // Password retry count reach.=0D - //=0D - ForceSystemReset ();=0D - }=0D - Status =3D EFI_NOT_READY;=0D - }=0D - break;=0D -=0D - case BROWSER_STATE_SET_PASSWORD:=0D - UserInputPassword =3D HiiGetString (mUserAuthenticationData->Hii= Handle, Value->string, NULL);=0D - if ((StrLen (UserInputPassword) >=3D PASSWORD_MAX_SIZE)) {=0D - Status =3D EFI_NOT_READY;=0D - break;=0D - }=0D - Status =3D SetPassword (UserInputPassword, StrSize (UserInputPas= sword), mUserAuthenticationData->OldPassword, StrSize(mUserAuthenticationDa= ta->OldPassword));=0D - PrintSetPasswordStatus (Status);=0D - ZeroMem (mUserAuthenticationData->OldPassword, sizeof(mUserAuthe= nticationData->OldPassword));=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDAT= E_PASSWORD;=0D - HiiUpdateAdminPasswordStatus ();=0D - break;=0D -=0D - default:=0D - break;=0D - }=0D - default:=0D - break;=0D - }=0D - }=0D - break;=0D - default:=0D - break;=0D - }=0D - return Status;=0D -}=0D -=0D -/**=0D - Unregister status code callback functions.=0D -=0D - @param Event Event whose notification function is being invoked= .=0D - @param Context Pointer to the notification function's context, wh= ich is=0D - always zero in current implementation.=0D -=0D -**/=0D -VOID=0D -EFIAPI=0D -UnregisterBootTimeHandlers (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -{=0D - mRscHandlerProtocol->Unregister (CheckForPassword);=0D -}=0D -=0D -/**=0D - User Authentication entry point.=0D -=0D - @param ImageHandle The image handle.=0D - @param SystemTable The system table.=0D -=0D - @retval EFI_SUCCESS The entry point is executed successfully.=0D - @return other Contain some other errors.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthenticationEntry (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_HANDLE DriverHandle;=0D - EFI_HII_HANDLE HiiHandle;=0D -=0D - DriverHandle =3D NULL;=0D -=0D - mUserAuthenticationData =3D AllocateZeroPool (sizeof (USER_AUTHENTICATIO= N_PRIVATE_DATA));=0D - if (mUserAuthenticationData =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - mUserAuthenticationData->ConfigAccess.ExtractConfig =3D ExtractConfig;=0D - mUserAuthenticationData->ConfigAccess.RouteConfig =3D RouteConfig;=0D - mUserAuthenticationData->ConfigAccess.Callback =3D UserAuthenticationCal= lback;=0D - mUserAuthenticationData->PasswordState =3D BROWSER_STATE_VALIDATE_PASSWO= RD;=0D -=0D - //=0D - // Install Config Access protocol to driver handle.=0D - //=0D - Status =3D gBS->InstallMultipleProtocolInterfaces (=0D - &DriverHandle,=0D - &gEfiDevicePathProtocolGuid,=0D - &mHiiVendorDevicePath,=0D - &gEfiHiiConfigAccessProtocolGuid,=0D - &mUserAuthenticationData->ConfigAccess,=0D - NULL=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - mUserAuthenticationData->DriverHandle =3D DriverHandle;=0D -=0D - //=0D - // Add HII data to database.=0D - //=0D - HiiHandle =3D HiiAddPackages (=0D - &mUserAuthenticationVendorGuid,=0D - DriverHandle,=0D - UserAuthenticationDxeStrings,=0D - UserAuthenticationDxeVfrBin,=0D - NULL=0D - );=0D - if (HiiHandle =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D - mUserAuthenticationData->HiiHandle =3D HiiHandle;=0D -=0D - //=0D - // Locate report status code protocol.=0D - //=0D - Status =3D gBS->LocateProtocol (=0D - &gEfiRscHandlerProtocolGuid,=0D - NULL,=0D - (VOID **) &mRscHandlerProtocol=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - //Register the callback function for ReportStatusCode() notification.=0D - //=0D - mRscHandlerProtocol->Register (CheckForPassword, TPL_HIGH_LEVEL);=0D -=0D - //=0D - // Unregister boot time report status code listener at ExitBootService E= vent.=0D - //=0D - Status =3D gBS->CreateEventEx (=0D - EVT_NOTIFY_SIGNAL,=0D - TPL_NOTIFY,=0D - UnregisterBootTimeHandlers,=0D - NULL,=0D - &gEfiEventExitBootServicesGuid,=0D - &mExitBootServicesEvent=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - // Locates SMM Communication protocol.=0D - //=0D - Status =3D gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL,= (VOID **) &mSmmCommunication);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Unloads the application and its installed protocol.=0D -=0D - @param[in] ImageHandle Handle that identifies the image to be unl= oaded.=0D -=0D - @retval EFI_SUCCESS The image has been unloaded.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -UserAuthenticationUnload (=0D - IN EFI_HANDLE ImageHandle=0D - )=0D -{=0D - ASSERT (mUserAuthenticationData !=3D NULL);=0D -=0D - //=0D - // Uninstall Config Access Protocol.=0D - //=0D - if (mUserAuthenticationData->DriverHandle !=3D NULL) {=0D - gBS->UninstallMultipleProtocolInterfaces (=0D - mUserAuthenticationData->DriverHandle,=0D - &gEfiDevicePathProtocolGuid,=0D - &mHiiVendorDevicePath,=0D - &gEfiHiiConfigAccessProtocolGuid,=0D - &mUserAuthenticationData->ConfigAccess,=0D - NULL=0D - );=0D - mUserAuthenticationData->DriverHandle =3D NULL;=0D - }=0D -=0D - //=0D - // Remove Hii Data.=0D - //=0D - if (mUserAuthenticationData->HiiHandle !=3D NULL) {=0D - HiiRemovePackages (mUserAuthenticationData->HiiHandle);=0D - }=0D -=0D - FreePool (mUserAuthenticationData);=0D - mUserAuthenticationData =3D NULL;=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxe.h b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentica= tion/UserAuthenticationDxe.h deleted file mode 100644 index e183424f35..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxe.h +++ /dev/null @@ -1,138 +0,0 @@ -/** @file=0D - Header file for UserAuthenticationDxe.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _USER_AUTHENTICATION_DXE_H_=0D -#define _USER_AUTHENTICATION_DXE_H_=0D -=0D -=0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "UserAuthenticationDxeFormset.h"=0D -=0D -extern UINT8 UserAuthenticationDxeVfrBin[];=0D -extern UINT8 UserAuthenticationDxeStrings[];=0D -extern EFI_SMM_COMMUNICATION_PROTOCOL *mSmmCommunication;=0D -=0D -typedef struct {=0D - EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;=0D - EFI_HANDLE DriverHandle;=0D - EFI_HII_HANDLE HiiHandle;=0D - UINT8 PasswordState;=0D - CHAR16 OldPassword[PASSWORD_MAX_SIZE];=0D -} USER_AUTHENTICATION_PRIVATE_DATA;=0D -=0D -#pragma pack(1)=0D -///=0D -/// HII specific Vendor Device Path definition.=0D -///=0D -typedef struct {=0D - VENDOR_DEVICE_PATH VendorDevicePath;=0D - EFI_DEVICE_PATH_PROTOCOL End;=0D -} HII_VENDOR_DEVICE_PATH;=0D -#pragma pack()=0D -=0D -/**=0D - Validate if the password is correct.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval EFI_SUCCESS The password is correct.=0D - @retval EFI_SECURITY_VIOLATION The password is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to verify the p= assword.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D -**/=0D -EFI_STATUS=0D -VerifyPassword (=0D - IN CHAR16 *Password,=0D - IN UINTN PasswordSize=0D - );=0D -=0D -/**=0D - Set a new password.=0D -=0D - @param[in] NewPassword The user input new password.=0D - NULL means clear password.=0D - @param[in] NewPasswordSize The size of NewPassword in byte.=0D - @param[in] OldPassword The user input old password.=0D - NULL means no old password.=0D - @param[in] OldPasswordSize The size of OldPassword in byte.=0D -=0D - @retval EFI_SUCCESS The NewPassword is set successfully.=0D - @retval EFI_SECURITY_VIOLATION The OldPassword is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set the pass= word.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D - @retval EFI_UNSUPPORTED NewPassword is not strong enough.=0D - @retval EFI_ALREADY_STARTED NewPassword is in history.=0D -**/=0D -EFI_STATUS=0D -SetPassword (=0D - IN CHAR16 *NewPassword, OPTIONAL=0D - IN UINTN NewPasswordSize,=0D - IN CHAR16 *OldPassword, OPTIONAL=0D - IN UINTN OldPasswordSize=0D - );=0D -=0D -/**=0D - Return if the password is set.=0D -=0D - @retval TRUE The password is set.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -IsPasswordInstalled (=0D - VOID=0D - );=0D -=0D -/**=0D - Get password verification policy.=0D -=0D - @param[out] VerifyPolicy Verification policy.=0D -=0D - @retval EFI_SUCCESS Get verification policy successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to get verifica= tion policy.=0D -**/=0D -EFI_STATUS=0D -GetPasswordVerificationPolicy (=0D - OUT SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *VerifyPolicy=0D - );=0D -=0D -/**=0D - Return if the password was verified.=0D -=0D - @retval TRUE The password was verified.=0D - @retval FALSE The password was not verified.=0D -**/=0D -BOOLEAN=0D -WasPasswordVerified (=0D - VOID=0D - );=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxe.inf b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthenti= cation/UserAuthenticationDxe.inf deleted file mode 100644 index 61f5f27e63..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxe.inf +++ /dev/null @@ -1,63 +0,0 @@ -## @file=0D -# User Authentication Dxe Driver.=0D -#=0D -# This Driver mainly provides Setup Form to change password and=0D -# does user authentication before entering Setup.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D UserAuthenticationDxe=0D - FILE_GUID =3D 0683FB88-664C-4BA6-9ED4-1C0916EE43A4= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 2.0=0D - ENTRY_POINT =3D UserAuthenticationEntry=0D - UNLOAD_IMAGE =3D UserAuthenticationUnload=0D -=0D -=0D -[Sources]=0D - UserAuthenticationDxe.c=0D - UserAuthenticationDxe.h=0D - UserAuthenticationDxePassword.c=0D - UserAuthenticationDxeFormset.h=0D - UserAuthenticationDxeVfr.vfr=0D - UserAuthenticationDxeStrings.uni=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - UefiRuntimeServicesTableLib=0D - BaseMemoryLib=0D - DebugLib=0D - UefiLib=0D - HiiLib=0D - DevicePathLib=0D - MemoryAllocationLib=0D - PlatformPasswordLib=0D - PrintLib=0D -=0D -[Guids]=0D - gUserAuthenticationGuid ## CONSUMES ## GUID=0D - gEfiEventExitBootServicesGuid ## CONSUMES ## Event=0D - gEdkiiPiSmmCommunicationRegionTableGuid ## CONSUMES ## SystemTabl= e=0D -=0D -[Protocols]=0D - gEfiRscHandlerProtocolGuid ## CONSUMES=0D - gEfiDevicePathProtocolGuid ## PRODUCES=0D - gEfiHiiConfigAccessProtocolGuid ## PRODUCES=0D - gEfiSmmCommunicationProtocolGuid ## CONSUMES=0D -=0D -[Depex]=0D - gEfiSimpleTextOutProtocolGuid AND=0D - gEfiSmmCommunicationProtocolGuid AND=0D - gEfiVariableArchProtocolGuid AND=0D - gEfiVariableWriteArchProtocolGuid=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxeFormset.h b/Platform/Intel/UserInterfaceFeaturePkg/UserAut= hentication/UserAuthenticationDxeFormset.h deleted file mode 100644 index 581849b534..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxeFormset.h +++ /dev/null @@ -1,23 +0,0 @@ -/** @file=0D - Header file for UserAuthentication formset.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef _USER_AUTHENTICATION_DXE_FORMSET_H_=0D -#define _USER_AUTHENTICATION_DXE_FORMSET_H_=0D -=0D -//=0D -// Vendor GUID of the formset=0D -//=0D -#define USER_AUTHENTICATION_FORMSET_GUID \=0D - { 0x760e3022, 0xf149, 0x4560, {0x9c, 0x6f, 0x33, 0xaa, 0x7d, 0x48, 0x75,= 0xfa} }=0D -=0D -#define ADMIN_PASSWORD_KEY_ID 0x2001=0D -=0D -#define MAX_PASSWORD_LEN 32=0D -#define MIN_PASSWORD_LEN 0=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxePassword.c b/Platform/Intel/UserInterfaceFeaturePkg/UserAu= thentication/UserAuthenticationDxePassword.c deleted file mode 100644 index 6e1fedfab7..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxePassword.c +++ /dev/null @@ -1,319 +0,0 @@ -/** @file=0D - UserAuthentication DXE password wrapper.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "UserAuthenticationDxe.h"=0D -=0D -/**=0D - Initialize the communicate buffer using DataSize and Function.=0D -=0D - @param[out] DataPtr Points to the data in the communicate = buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D - @param[in] Function The function number to initialize the = communicate header.=0D -=0D - @return Communicate buffer.=0D -**/=0D -VOID*=0D -InitCommunicateBuffer (=0D - OUT VOID **DataPtr OPTIONAL,=0D - IN UINTN DataSize,=0D - IN UINTN Function=0D - )=0D -{=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D - VOID *Buffer;=0D - EDKII_PI_SMM_COMMUNICATION_REGION_TABLE *SmmCommRegionTable;=0D - EFI_MEMORY_DESCRIPTOR *SmmCommMemRegion;=0D - UINTN Index;=0D - UINTN Size;=0D - EFI_STATUS Status;=0D -=0D - Buffer =3D NULL;=0D - Status =3D EfiGetSystemConfigurationTable (=0D - &gEdkiiPiSmmCommunicationRegionTableGuid,=0D - (VOID **) &SmmCommRegionTable=0D - );=0D - if (EFI_ERROR (Status)) {=0D - return NULL;=0D - }=0D - ASSERT (SmmCommRegionTable !=3D NULL);=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) (SmmCommRegionTable + 1);= =0D - Size =3D 0;=0D - for (Index =3D 0; Index < SmmCommRegionTable->NumberOfEntries; Index++) = {=0D - if (SmmCommMemRegion->Type =3D=3D EfiConventionalMemory) {=0D - Size =3D EFI_PAGES_TO_SIZE ((UINTN) SmmCommMemRegion->NumberOfPages)= ;=0D - if (Size >=3D (DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Dat= a) + sizeof (SMM_PASSWORD_COMMUNICATE_HEADER))) {=0D - break;=0D - }=0D - }=0D - SmmCommMemRegion =3D (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) SmmCommMemRe= gion + SmmCommRegionTable->DescriptorSize);=0D - }=0D - ASSERT (Index < SmmCommRegionTable->NumberOfEntries);=0D -=0D - Buffer =3D (VOID*)(UINTN)SmmCommMemRegion->PhysicalStart;=0D - ASSERT (Buffer !=3D NULL);=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gUserAuthenticationGuid);= =0D - SmmCommunicateHeader->MessageLength =3D DataSize + sizeof (SMM_PASSWORD_= COMMUNICATE_HEADER);=0D -=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *) SmmCom= municateHeader->Data;=0D - ZeroMem (SmmPasswordFunctionHeader, DataSize + sizeof (SMM_PASSWORD_COMM= UNICATE_HEADER));=0D - SmmPasswordFunctionHeader->Function =3D Function;=0D - if (DataPtr !=3D NULL) {=0D - *DataPtr =3D SmmPasswordFunctionHeader + 1;=0D - }=0D -=0D - return Buffer;=0D -}=0D -=0D -/**=0D - Send the data in communicate buffer to SMM.=0D -=0D - @param[in] Buffer Points to the data in the communicat= e buffer.=0D - @param[in] DataSize The data size to send to SMM.=0D -=0D - @retval EFI_SUCCESS Success is returned from the functio= n in SMM.=0D - @retval Others Failure is returned from the functio= n in SMM.=0D -=0D -**/=0D -EFI_STATUS=0D -SendCommunicateBuffer (=0D - IN VOID *Buffer,=0D - IN UINTN DataSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN CommSize;=0D - EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmPasswordFunctionHeader;=0D -=0D - CommSize =3D DataSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + s= izeof (SMM_PASSWORD_COMMUNICATE_HEADER);=0D -=0D - Status =3D mSmmCommunication->Communicate (mSmmCommunication, Buffer, &C= ommSize);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - SmmCommunicateHeader =3D (EFI_SMM_COMMUNICATE_HEADER *) Buffer;=0D - SmmPasswordFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *)SmmComm= unicateHeader->Data;=0D - return SmmPasswordFunctionHeader->ReturnStatus;=0D -}=0D -=0D -/**=0D - Validate if the password is correct.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval EFI_SUCCESS The password is correct.=0D - @retval EFI_SECURITY_VIOLATION The password is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to verify the p= assword.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D -**/=0D -EFI_STATUS=0D -VerifyPassword (=0D - IN CHAR16 *Password,=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_PASSWORD *VerifyPassword;=0D -=0D - ASSERT (Password !=3D NULL);=0D -=0D - if (PasswordSize > sizeof(VerifyPassword->Password) * sizeof(CHAR16)) {= =0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - Buffer =3D InitCommunicateBuffer (=0D - (VOID**)&VerifyPassword,=0D - sizeof(*VerifyPassword),=0D - SMM_PASSWORD_FUNCTION_VERIFY_PASSWORD=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - Status =3D UnicodeStrToAsciiStrS (Password, VerifyPassword->Password, si= zeof(VerifyPassword->Password));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D -=0D - Status =3D SendCommunicateBuffer (Buffer, sizeof(*VerifyPassword));=0D -=0D -EXIT:=0D - ZeroMem (VerifyPassword, sizeof(*VerifyPassword));=0D - return Status;=0D -}=0D -=0D -/**=0D - Set a new password.=0D -=0D - @param[in] NewPassword The user input new password.=0D - NULL means clear password.=0D - @param[in] NewPasswordSize The size of NewPassword in byte.=0D - @param[in] OldPassword The user input old password.=0D - NULL means no old password.=0D - @param[in] OldPasswordSize The size of OldPassword in byte.=0D -=0D - @retval EFI_SUCCESS The NewPassword is set successfully.=0D - @retval EFI_SECURITY_VIOLATION The OldPassword is incorrect.=0D - @retval EFI_INVALID_PARAMETER The password or size is invalid.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to set the pass= word.=0D - @retval EFI_ACCESS_DENIED Password retry count reach.=0D - @retval EFI_UNSUPPORTED NewPassword is not strong enough.=0D - @retval EFI_ALREADY_STARTED NewPassword is in history.=0D -**/=0D -EFI_STATUS=0D -SetPassword (=0D - IN CHAR16 *NewPassword, OPTIONAL=0D - IN UINTN NewPasswordSize,=0D - IN CHAR16 *OldPassword, OPTIONAL=0D - IN UINTN OldPasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_SET_PASSWORD *SetPassword;=0D -=0D - if (NewPasswordSize > sizeof(SetPassword->NewPassword) * sizeof(CHAR16))= {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D - if (OldPasswordSize > sizeof(SetPassword->OldPassword) * sizeof(CHAR16))= {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - Buffer =3D InitCommunicateBuffer (=0D - (VOID**)&SetPassword,=0D - sizeof(*SetPassword),=0D - SMM_PASSWORD_FUNCTION_SET_PASSWORD=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - if (NewPassword !=3D NULL) {=0D - Status =3D UnicodeStrToAsciiStrS (NewPassword, SetPassword->NewPasswor= d, sizeof(SetPassword->NewPassword));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D - } else {=0D - SetPassword->NewPassword[0] =3D 0;=0D - }=0D -=0D - if (OldPassword !=3D NULL) {=0D - Status =3D UnicodeStrToAsciiStrS (OldPassword, SetPassword->OldPasswor= d, sizeof(SetPassword->OldPassword));=0D - if (EFI_ERROR(Status)) {=0D - goto EXIT;=0D - }=0D - } else {=0D - SetPassword->OldPassword[0] =3D 0;=0D - }=0D -=0D - Status =3D SendCommunicateBuffer (Buffer, sizeof(*SetPassword));=0D -=0D -EXIT:=0D - ZeroMem (SetPassword, sizeof(*SetPassword));=0D - return Status;=0D -}=0D -=0D -/**=0D - Return if the password is set.=0D -=0D - @retval TRUE The password is set.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -IsPasswordInstalled (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D -=0D - Buffer =3D InitCommunicateBuffer (=0D - NULL,=0D - 0,=0D - SMM_PASSWORD_FUNCTION_IS_PASSWORD_SET=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D SendCommunicateBuffer (Buffer, 0);=0D - if (EFI_ERROR (Status)) {=0D - return FALSE;=0D - }=0D -=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Get password verification policy.=0D -=0D - @param[out] VerifyPolicy Verification policy.=0D -=0D - @retval EFI_SUCCESS Get verification policy successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to get verifica= tion policy.=0D -**/=0D -EFI_STATUS=0D -GetPasswordVerificationPolicy (=0D - OUT SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *VerifyPolicy=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *GetVerifyPolicy;=0D -=0D - Buffer =3D InitCommunicateBuffer (=0D - (VOID**)&GetVerifyPolicy,=0D - sizeof(*GetVerifyPolicy),=0D - SMM_PASSWORD_FUNCTION_GET_VERIFY_POLICY=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return EFI_OUT_OF_RESOURCES;=0D - }=0D -=0D - Status =3D SendCommunicateBuffer (Buffer, sizeof(*GetVerifyPolicy));=0D - if (!EFI_ERROR (Status)) {=0D - CopyMem (VerifyPolicy, GetVerifyPolicy, sizeof (SMM_PASSWORD_COMMUNICA= TE_VERIFY_POLICY));=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Return if the password was verified.=0D -=0D - @retval TRUE The password was verified.=0D - @retval FALSE The password was not verified.=0D -**/=0D -BOOLEAN=0D -WasPasswordVerified (=0D - VOID=0D - )=0D -{=0D - EFI_STATUS Status;=0D - VOID *Buffer;=0D -=0D - Buffer =3D InitCommunicateBuffer (=0D - NULL,=0D - 0,=0D - SMM_PASSWORD_FUNCTION_WAS_PASSWORD_VERIFIED=0D - );=0D - if (Buffer =3D=3D NULL) {=0D - return FALSE;=0D - }=0D -=0D - Status =3D SendCommunicateBuffer (Buffer, 0);=0D - if (EFI_ERROR (Status)) {=0D - return FALSE;=0D - }=0D -=0D - return TRUE;=0D -}=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxeStrings.uni b/Platform/Intel/UserInterfaceFeaturePkg/UserA= uthentication/UserAuthenticationDxeStrings.uni deleted file mode 100644 index 1e3a179677..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxeStrings.uni +++ /dev/null @@ -1,30 +0,0 @@ -/** @file=0D -// String definitions for User Authentication formset.=0D -//=0D -// Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -//=0D -// SPDX-License-Identifier: BSD-2-Clause-Patent=0D -//=0D -**/=0D -=0D -#langdef en-US "English"=0D -#langdef fr-FR "Francais"=0D -=0D -=0D -#string STR_FORM_SET_TITLE #language en-US "User Password Mana= gement"=0D - #language fr-FR "User Password Mana= gement"=0D -#string STR_FORM_SET_TITLE_HELP #language en-US "This Driver mainly= handle user's password"=0D - #language fr-FR "This Driver mainly= handle user's password"=0D -#string STR_FORM_TITLE #language en-US "Password Managemen= t Form"=0D - #language fr-FR "Password Managemen= t Form"=0D -#string STR_ADMIN_PASSWORD_PROMPT #language en-US "Change Admin Passw= ord"=0D - #language fr-FR "Change Admin Passw= ord"=0D -#string STR_ADMIN_PASSWORD_HELP #language en-US "Input old admin pa= ssword if it was set, then you can change the password to a new one. After = the change action, you may need input the new password when you enter UI. T= he new password must be between 8 and 32 chars include lowercase, uppercase= alphabetic, number, and symbol. Input an empty password can clean old admi= n password, then no need input password to enter UI."=0D - #language fr-FR "Input old admin pa= ssword if it was set, then you can change the password to a new one. After = the change action, you may need input the new password when you enter UI. T= he new password must be between 8 and 32 chars include lowercase, uppercase= alphabetic, number, and symbol. Input an empty password can clean old admi= n password, then no need input password to enter UI."=0D -#string STR_ADMIN_PASSWORD_STS_HELP #language en-US "Current Admin Pass= word status: Installed or Not Installed."=0D - #language fr-FR "Current Admin Pass= word status: Installed or Not Installed."=0D -#string STR_ADMIN_PASSWORD_STS_PROMPT #language en-US "Admin Password Sta= tus"=0D - #language fr-FR "Admin Password Sta= tus"=0D -#string STR_ADMIN_PASSWORD_STS_CONTENT #language en-US ""=0D - #language fr-FR ""=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationDxeVfr.vfr b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthe= ntication/UserAuthenticationDxeVfr.vfr deleted file mode 100644 index ca1d5ddec1..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationDxeVfr.vfr +++ /dev/null @@ -1,39 +0,0 @@ -///** @file=0D -// UserAuthentication formset.=0D -//=0D -// Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -// SPDX-License-Identifier: BSD-2-Clause-Patent=0D -//=0D -//**/=0D -=0D -#include =0D -#include "UserAuthenticationDxeFormset.h"=0D -=0D -formset=0D - guid =3D USER_AUTHENTICATION_FORMSET_GUID,=0D - title =3D STRING_TOKEN(STR_FORM_SET_TITLE),=0D - help =3D STRING_TOKEN(STR_FORM_SET_TITLE_HELP),=0D - classguid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID,=0D -=0D - form formid =3D 1,=0D - title =3D STRING_TOKEN(STR_FORM_TITLE);=0D -=0D - grayoutif TRUE;=0D - text=0D - help =3D STRING_TOKEN(STR_ADMIN_PASSWORD_STS_HELP),=0D - text =3D STRING_TOKEN(STR_ADMIN_PASSWORD_STS_PROMPT),=0D - text =3D STRING_TOKEN(STR_ADMIN_PASSWORD_STS_CONTENT);=0D - endif;=0D -=0D - password=0D - prompt =3D STRING_TOKEN(STR_ADMIN_PASSWORD_PROMPT),=0D - help =3D STRING_TOKEN(STR_ADMIN_PASSWORD_HELP),=0D - flags =3D INTERACTIVE,=0D - key =3D ADMIN_PASSWORD_KEY_ID,=0D - minsize =3D MIN_PASSWORD_LEN,=0D - maxsize =3D MAX_PASSWORD_LEN,=0D - endpassword;=0D -=0D - endform;=0D -=0D -endformset;=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationSmm.c b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentica= tion/UserAuthenticationSmm.c deleted file mode 100644 index 07e834ebfa..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationSmm.c +++ /dev/null @@ -1,674 +0,0 @@ -/** @file=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "UserAuthenticationSmm.h"=0D -=0D -EFI_SMM_VARIABLE_PROTOCOL *mSmmVariable;=0D -=0D -UINTN mAdminPasswordTryCount =3D 0;=0D -=0D -BOOLEAN mNeedReVerify =3D TRUE;=0D -BOOLEAN mPasswordVerified =3D FALSE;=0D -=0D -/**=0D - Verify if the password is correct.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D - @param[in] UserPasswordVarStruct The storage of password in variable.= =0D -=0D - @retval EFI_SUCCESS The password is correct.=0D - @retval EFI_SECURITY_VIOLATION The password is incorrect.=0D -**/=0D -EFI_STATUS=0D -VerifyPassword (=0D - IN CHAR8 *Password,=0D - IN UINTN PasswordSize,=0D - IN USER_PASSWORD_VAR_STRUCT *UserPasswordVarStruct=0D - )=0D -{=0D - BOOLEAN HashOk;=0D - UINT8 HashData[PASSWORD_HASH_SIZE];=0D -=0D - HashOk =3D KeyLibGeneratePBKDF2Hash (=0D - HASH_TYPE_SHA256,=0D - (UINT8 *)Password,=0D - PasswordSize,=0D - UserPasswordVarStruct->PasswordSalt,=0D - sizeof(UserPasswordVarStruct->PasswordSalt),=0D - HashData,=0D - sizeof(HashData)=0D - );=0D - if (!HashOk) {=0D - return EFI_DEVICE_ERROR;=0D - }=0D - if (KeyLibSlowCompareMem (UserPasswordVarStruct->PasswordHash, HashData,= PASSWORD_HASH_SIZE) =3D=3D 0) {=0D - return EFI_SUCCESS;=0D - } else {=0D - return EFI_SECURITY_VIOLATION;=0D - }=0D -}=0D -=0D -/**=0D - Get hash data of password from non-volatile variable region.=0D -=0D - @param[in] UserGuid The user GUID of the password variab= le.=0D - @param[in] Index The index of the password.=0D - 0 means current password.=0D - Non-0 means the password history.=0D - @param[out] UserPasswordVarStruct The storage of password in variable.= =0D -=0D - @retval EFI_SUCCESS The password hash is returned successful= ly.=0D - @retval EFI_NOT_FOUND The password hash is not found.=0D -**/=0D -EFI_STATUS=0D -GetPasswordHashFromVariable (=0D - IN EFI_GUID *UserGuid,=0D - IN UINTN Index,=0D - OUT USER_PASSWORD_VAR_STRUCT *UserPasswordVarStruct=0D - )=0D -{=0D - UINTN DataSize;=0D - CHAR16 PasswordName[sizeof(USER_AUTHENTICATIO= N_VAR_NAME)/sizeof(CHAR16) + 5];=0D -=0D - if (Index !=3D 0) {=0D - UnicodeSPrint (PasswordName, sizeof (PasswordName), L"%s%04x", USER_AU= THENTICATION_VAR_NAME, Index);=0D - } else {=0D - UnicodeSPrint (PasswordName, sizeof (PasswordName), L"%s", USER_AUTHEN= TICATION_VAR_NAME);=0D - }=0D -=0D - DataSize =3D sizeof(*UserPasswordVarStruct);=0D - return mSmmVariable->SmmGetVariable (=0D - PasswordName,=0D - UserGuid,=0D - NULL,=0D - &DataSize,=0D - UserPasswordVarStruct=0D - );=0D -}=0D -=0D -/**=0D - Save password hash data to non-volatile variable region.=0D -=0D - @param[in] UserGuid The user GUID of the password variab= le.=0D - @param[in] UserPasswordVarStruct The storage of password in variable.= =0D -=0D - @retval EFI_SUCCESS The password hash is saved successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to save the passw= ord hash.=0D -**/=0D -EFI_STATUS=0D -SavePasswordHashToVariable (=0D - IN EFI_GUID *UserGuid,=0D - IN USER_PASSWORD_VAR_STRUCT *UserPasswordVarStruct=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - if (UserPasswordVarStruct =3D=3D NULL) {=0D - Status =3D mSmmVariable->SmmSetVariable (=0D - USER_AUTHENTICATION_VAR_NAME,=0D - UserGuid,=0D - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABL= E_NON_VOLATILE,=0D - 0,=0D - NULL=0D - );=0D - } else {=0D - Status =3D mSmmVariable->SmmSetVariable (=0D - USER_AUTHENTICATION_VAR_NAME,=0D - UserGuid,=0D - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABL= E_NON_VOLATILE,=0D - sizeof(*UserPasswordVarStruct),=0D - UserPasswordVarStruct=0D - );=0D - }=0D - if (EFI_ERROR (Status)) {=0D - DEBUG ((DEBUG_ERROR, "SavePasswordHashToVariable fails with %r\n", Sta= tus));=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Save old password hash data to non-volatile variable region as history.= =0D -=0D - The number of password history variable is limited.=0D - If all the password history variables are used, the new password history= =0D - will override the oldest one.=0D -=0D - @param[in] UserGuid The user GUID of the password variab= le.=0D - @param[in] UserPasswordVarStruct The storage of password in variable.= =0D -=0D - @retval EFI_SUCCESS The password hash is saved successfully.= =0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to save the passw= ord hash.=0D -**/=0D -EFI_STATUS=0D -SaveOldPasswordToHistory (=0D - IN EFI_GUID *UserGuid,=0D - IN USER_PASSWORD_VAR_STRUCT *UserPasswordVarStruct=0D - )=0D -{=0D - EFI_STATUS Status;=0D - UINTN DataSize;=0D - UINT32 LastIndex;=0D - CHAR16 PasswordName[sizeof(USER_AUTHENTICATIO= N_VAR_NAME)/sizeof(CHAR16) + 5];=0D -=0D - DEBUG ((DEBUG_INFO, "SaveOldPasswordToHistory\n"));=0D -=0D - DataSize =3D sizeof(LastIndex);=0D - Status =3D mSmmVariable->SmmGetVariable (=0D - USER_AUTHENTICATION_HISTORY_LAST_VAR_NAME,=0D - UserGuid,=0D - NULL,=0D - &DataSize,=0D - &LastIndex=0D - );=0D - if (EFI_ERROR(Status)) {=0D - LastIndex =3D 0;=0D - }=0D - if (LastIndex >=3D PASSWORD_HISTORY_CHECK_COUNT) {=0D - LastIndex =3D 0;=0D - }=0D -=0D - LastIndex ++;=0D - UnicodeSPrint (PasswordName, sizeof (PasswordName), L"%s%04x", USER_AUTH= ENTICATION_VAR_NAME, LastIndex);=0D -=0D -=0D - Status =3D mSmmVariable->SmmSetVariable (=0D - PasswordName,=0D - UserGuid,=0D - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_= NON_VOLATILE,=0D - sizeof(*UserPasswordVarStruct),=0D - UserPasswordVarStruct=0D - );=0D - DEBUG ((DEBUG_INFO, " -- to %s, %r\n", PasswordName, Status));=0D - if (!EFI_ERROR(Status)) {=0D - Status =3D mSmmVariable->SmmSetVariable (=0D - USER_AUTHENTICATION_HISTORY_LAST_VAR_NAME,=0D - UserGuid,=0D - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABL= E_NON_VOLATILE,=0D - sizeof(LastIndex),=0D - &LastIndex=0D - );=0D - DEBUG ((DEBUG_INFO, " LastIndex - 0x%04x, %r\n", LastIndex, Status));= =0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Calculate password hash data and save it to non-volatile variable region= .=0D -=0D - @param[in] UserGuid The user GUID of the password variabl= e.=0D - @param[in] Password The user input password.=0D - NULL means delete the password variab= le.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval EFI_SUCCESS The password hash is calculated and save= d.=0D - @retval EFI_OUT_OF_RESOURCES Insufficient resources to save the passw= ord hash.=0D -**/=0D -EFI_STATUS=0D -SavePasswordToVariable (=0D - IN EFI_GUID *UserGuid,=0D - IN CHAR8 *Password, OPTIONAL=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - USER_PASSWORD_VAR_STRUCT UserPasswordVarStruct;=0D - BOOLEAN HashOk;=0D -=0D - //=0D - // If password is NULL, it means we want to clean password field saved i= n variable region.=0D - //=0D - if (Password !=3D NULL) {=0D - KeyLibGenerateSalt (UserPasswordVarStruct.PasswordSalt, sizeof(UserPas= swordVarStruct.PasswordSalt));=0D - HashOk =3D KeyLibGeneratePBKDF2Hash (=0D - HASH_TYPE_SHA256,=0D - (UINT8 *)Password,=0D - PasswordSize,=0D - UserPasswordVarStruct.PasswordSalt,=0D - sizeof(UserPasswordVarStruct.PasswordSalt),=0D - UserPasswordVarStruct.PasswordHash,=0D - sizeof(UserPasswordVarStruct.PasswordHash)=0D - );=0D - if (!HashOk) {=0D - return EFI_DEVICE_ERROR;=0D - }=0D - Status =3D SavePasswordHashToVariable (UserGuid, &UserPasswordVarStruc= t);=0D - //=0D - // Save Password data to history variable=0D - //=0D - if (!EFI_ERROR(Status)) {=0D - SaveOldPasswordToHistory (UserGuid, &UserPasswordVarStruct);=0D - }=0D - } else {=0D - Status =3D SavePasswordHashToVariable (UserGuid, NULL);=0D - }=0D -=0D - return Status;=0D -}=0D -=0D -/**=0D - Verify the password.=0D - If the password variable does not exist, it passes the verification.=0D - If the password variable exists, it does verification based upon passwor= d variable.=0D -=0D - @param[in] UserGuid The user GUID of the password variabl= e.=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval TRUE The verification passes.=0D - @retval FALSE The verification fails.=0D -**/=0D -BOOLEAN=0D -IsPasswordVerified (=0D - IN EFI_GUID *UserGuid,=0D - IN CHAR8 *Password,=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - USER_PASSWORD_VAR_STRUCT UserPasswordVarStruct;=0D - EFI_STATUS Status;=0D - UINTN *PasswordTryCount;=0D -=0D - PasswordTryCount =3D &mAdminPasswordTryCount;=0D -=0D - Status =3D GetPasswordHashFromVariable (UserGuid, 0, &UserPasswordVarStr= uct);=0D - if (EFI_ERROR(Status)) {=0D - return TRUE;=0D - }=0D -=0D - //=0D - // Old password exists=0D - //=0D - Status =3D VerifyPassword (Password, PasswordSize, &UserPasswordVarStruc= t);=0D - if (EFI_ERROR(Status)) {=0D - if (Password[0] !=3D 0) {=0D - *PasswordTryCount =3D *PasswordTryCount + 1;=0D - }=0D - return FALSE;=0D - }=0D -=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Return if the password is set.=0D -=0D - @param[in] UserGuid The user GUID of the password variabl= e.=0D -=0D - @retval TRUE The password is set.=0D - @retval FALSE The password is not set.=0D -**/=0D -BOOLEAN=0D -IsPasswordSet (=0D - IN EFI_GUID *UserGuid=0D - )=0D -{=0D - USER_PASSWORD_VAR_STRUCT UserPasswordVarStruct;=0D - EFI_STATUS Status;=0D -=0D - Status =3D GetPasswordHashFromVariable(UserGuid, 0, &UserPasswordVarStru= ct);=0D - if (EFI_ERROR(Status)) {=0D - return FALSE;=0D - }=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Return if the password is strong.=0D - Criteria:=0D - 1) length >=3D PASSWORD_MIN_SIZE=0D - 2) include lower case, upper case, number, symbol.=0D -=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval TRUE The password is strong.=0D - @retval FALSE The password is weak.=0D -**/=0D -BOOLEAN=0D -IsPasswordStrong (=0D - IN CHAR8 *Password,=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - UINTN Index;=0D - BOOLEAN HasLowerCase;=0D - BOOLEAN HasUpperCase;=0D - BOOLEAN HasNumber;=0D - BOOLEAN HasSymbol;=0D -=0D - if (PasswordSize < PASSWORD_MIN_SIZE) {=0D - return FALSE;=0D - }=0D -=0D - HasLowerCase =3D FALSE;=0D - HasUpperCase =3D FALSE;=0D - HasNumber =3D FALSE;=0D - HasSymbol =3D FALSE;=0D - for (Index =3D 0; Index < PasswordSize - 1; Index++) {=0D - if (Password[Index] >=3D 'a' && Password[Index] <=3D 'z') {=0D - HasLowerCase =3D TRUE;=0D - } else if (Password[Index] >=3D 'A' && Password[Index] <=3D 'Z') {=0D - HasUpperCase =3D TRUE;=0D - } else if (Password[Index] >=3D '0' && Password[Index] <=3D '9') {=0D - HasNumber =3D TRUE;=0D - } else {=0D - HasSymbol =3D TRUE;=0D - }=0D - }=0D - if ((!HasLowerCase) || (!HasUpperCase) || (!HasNumber) || (!HasSymbol)) = {=0D - return FALSE;=0D - }=0D - return TRUE;=0D -}=0D -=0D -/**=0D - Return if the password is set before in PASSWORD_HISTORY_CHECK_COUNT.=0D -=0D - @param[in] UserGuid The user GUID of the password variabl= e.=0D - @param[in] Password The user input password.=0D - @param[in] PasswordSize The size of Password in byte.=0D -=0D - @retval TRUE The password is set before.=0D - @retval FALSE The password is not set before.=0D -**/=0D -BOOLEAN=0D -IsPasswordInHistory (=0D - IN EFI_GUID *UserGuid,=0D - IN CHAR8 *Password,=0D - IN UINTN PasswordSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - USER_PASSWORD_VAR_STRUCT UserPasswordVarStruct;=0D - UINTN Index;=0D -=0D - for (Index =3D 1; Index <=3D PASSWORD_HISTORY_CHECK_COUNT; Index++) {=0D - Status =3D GetPasswordHashFromVariable (UserGuid, Index, &UserPassword= VarStruct);=0D - if (!EFI_ERROR(Status)) {=0D - Status =3D VerifyPassword (Password, PasswordSize, &UserPasswordVarS= truct);=0D - if (!EFI_ERROR(Status)) {=0D - return TRUE;=0D - }=0D - }=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D -/**=0D - Communication service SMI Handler entry.=0D -=0D - This SMI handler provides services for password management.=0D -=0D - @param[in] DispatchHandle The unique handle assigned to this handle= r by SmiHandlerRegister().=0D - @param[in] RegisterContext Points to an optional handler context whi= ch was specified when the=0D - handler was registered.=0D - @param[in, out] CommBuffer A pointer to a collection of data in memo= ry that will=0D - be conveyed from a non-SMM environment in= to an SMM environment.=0D - @param[in, out] CommBufferSize The size of the CommBuffer.=0D -=0D - @retval EFI_SUCCESS The interrupt was handled an= d quiesced. No other handlers=0D - should still be called.=0D - @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quies= ced but other handlers should=0D - still be called.=0D - @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pendi= ng and other handlers should still=0D - be called.=0D - @retval EFI_INTERRUPT_PENDING The interrupt could not be q= uiesced.=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -SmmPasswordHandler (=0D - IN EFI_HANDLE DispatchHandle,=0D - IN CONST VOID *RegisterContext,=0D - IN OUT VOID *CommBuffer,=0D - IN OUT UINTN *CommBufferSize=0D - )=0D -{=0D - EFI_STATUS Status;=0D - SMM_PASSWORD_COMMUNICATE_HEADER *SmmFunctionHeader;=0D - UINTN CommBufferPayloadSize;=0D - UINTN TempCommBufferSize;=0D - SMM_PASSWORD_COMMUNICATE_SET_PASSWORD SmmCommunicateSetPassword;=0D - SMM_PASSWORD_COMMUNICATE_VERIFY_PASSWORD SmmCommunicateVerifyPassword;= =0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY SmmCommunicateSetVerifyPolicy;= =0D - SMM_PASSWORD_COMMUNICATE_VERIFY_POLICY *SmmCommunicateGetVerifyPolicy= ;=0D - UINTN PasswordLen;=0D - EFI_GUID *UserGuid;=0D - UINTN *PasswordTryCount;=0D -=0D - //=0D - // If input is invalid, stop processing this SMI=0D - //=0D - if (CommBuffer =3D=3D NULL || CommBufferSize =3D=3D NULL) {=0D - return EFI_SUCCESS;=0D - }=0D -=0D - TempCommBufferSize =3D *CommBufferSize;=0D - PasswordLen =3D 0;=0D -=0D - if (TempCommBufferSize < sizeof (SMM_PASSWORD_COMMUNICATE_HEADER)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SMM communication buffer siz= e invalid!\n"));=0D - return EFI_SUCCESS;=0D - }=0D -=0D - CommBufferPayloadSize =3D TempCommBufferSize - sizeof (SMM_PASSWORD_COMM= UNICATE_HEADER);=0D -=0D - Status =3D EFI_SUCCESS;=0D - SmmFunctionHeader =3D (SMM_PASSWORD_COMMUNICATE_HEADER *)CommBuffer;=0D -=0D - UserGuid =3D &gUserAuthenticationGuid;=0D - PasswordTryCount =3D &mAdminPasswordTryCount;=0D -=0D - switch (SmmFunctionHeader->Function) {=0D - case SMM_PASSWORD_FUNCTION_IS_PASSWORD_SET:=0D - PasswordTryCount =3D NULL;=0D - if (CommBufferPayloadSize !=3D 0) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: IS_PASSWORD_SET payload bu= ffer invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - if (IsPasswordSet(UserGuid)) {=0D - Status =3D EFI_SUCCESS;=0D - } else {=0D - Status =3D EFI_NOT_FOUND;=0D - }=0D - break;=0D - case SMM_PASSWORD_FUNCTION_SET_PASSWORD:=0D - if (*PasswordTryCount >=3D PASSWORD_MAX_TRY_COUNT) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SET_PASSWORD try count rea= ch!\n"));=0D - PasswordTryCount =3D NULL;=0D - Status =3D EFI_ACCESS_DENIED;=0D - goto EXIT;=0D - }=0D - if (CommBufferPayloadSize !=3D sizeof(SMM_PASSWORD_COMMUNICATE_SET_PAS= SWORD)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SET_PASSWORD payload buffe= r invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - CopyMem (&SmmCommunicateSetPassword, SmmFunctionHeader + 1, sizeof(Smm= CommunicateSetPassword));=0D -=0D - PasswordLen =3D AsciiStrnLenS(SmmCommunicateSetPassword.OldPassword, s= izeof(SmmCommunicateSetPassword.OldPassword));=0D - if (PasswordLen =3D=3D sizeof(SmmCommunicateSetPassword.OldPassword)) = {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: OldPassword invalid!\n"));= =0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D -=0D - if (!IsPasswordVerified (UserGuid, SmmCommunicateSetPassword.OldPasswo= rd, PasswordLen + 1)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify - FAIL\n"))= ;=0D - Status =3D EFI_SECURITY_VIOLATION;=0D - goto EXIT;=0D - }=0D -=0D - PasswordLen =3D AsciiStrnLenS(SmmCommunicateSetPassword.NewPassword, s= izeof(SmmCommunicateSetPassword.NewPassword));=0D - if (PasswordLen =3D=3D sizeof(SmmCommunicateSetPassword.NewPassword)) = {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: NewPassword invalid!\n"));= =0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - if (PasswordLen !=3D 0 && !IsPasswordStrong (SmmCommunicateSetPassword= .NewPassword, PasswordLen + 1)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: NewPassword too weak!\n"))= ;=0D - Status =3D EFI_UNSUPPORTED;=0D - goto EXIT;=0D - }=0D - if (PasswordLen !=3D 0 && IsPasswordInHistory (UserGuid, SmmCommunicat= eSetPassword.NewPassword, PasswordLen + 1)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: NewPassword in history!\n"= ));=0D - Status =3D EFI_ALREADY_STARTED;=0D - goto EXIT;=0D - }=0D -=0D - if (PasswordLen =3D=3D 0) {=0D - Status =3D SavePasswordToVariable (UserGuid, NULL, 0);=0D - } else {=0D - Status =3D SavePasswordToVariable (UserGuid, SmmCommunicateSetPasswo= rd.NewPassword, PasswordLen + 1);=0D - }=0D - break;=0D -=0D - case SMM_PASSWORD_FUNCTION_VERIFY_PASSWORD:=0D - if (*PasswordTryCount >=3D PASSWORD_MAX_TRY_COUNT) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: VERIFY_PASSWORD try count = reach!\n"));=0D - PasswordTryCount =3D NULL;=0D - Status =3D EFI_ACCESS_DENIED;=0D - goto EXIT;=0D - }=0D - if (CommBufferPayloadSize !=3D sizeof(SMM_PASSWORD_COMMUNICATE_VERIFY_= PASSWORD)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: VERIFY_PASSWORD payload bu= ffer invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - CopyMem (&SmmCommunicateVerifyPassword, SmmFunctionHeader + 1, sizeof(= SmmCommunicateVerifyPassword));=0D -=0D - PasswordLen =3D AsciiStrnLenS(SmmCommunicateVerifyPassword.Password, s= izeof(SmmCommunicateVerifyPassword.Password));=0D - if (PasswordLen =3D=3D sizeof(SmmCommunicateVerifyPassword.Password)) = {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: Password invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - if (!IsPasswordVerified (UserGuid, SmmCommunicateVerifyPassword.Passwo= rd, PasswordLen + 1)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify - FAIL\n"))= ;=0D - Status =3D EFI_SECURITY_VIOLATION;=0D - goto EXIT;=0D - }=0D - mPasswordVerified =3D TRUE;=0D - Status =3D EFI_SUCCESS;=0D - break;=0D -=0D - case SMM_PASSWORD_FUNCTION_SET_VERIFY_POLICY:=0D - PasswordTryCount =3D NULL;=0D - if (CommBufferPayloadSize !=3D sizeof(SMM_PASSWORD_COMMUNICATE_VERIFY_= POLICY)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SET_VERIFY_POLICY payload = buffer invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - CopyMem (&SmmCommunicateSetVerifyPolicy, SmmFunctionHeader + 1, sizeof= (SmmCommunicateSetVerifyPolicy));=0D - mNeedReVerify =3D SmmCommunicateSetVerifyPolicy.NeedReVerify;=0D - break;=0D -=0D - case SMM_PASSWORD_FUNCTION_GET_VERIFY_POLICY:=0D - PasswordTryCount =3D NULL;=0D - if (CommBufferPayloadSize !=3D sizeof(SMM_PASSWORD_COMMUNICATE_VERIFY_= POLICY)) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: GET_VERIFY_POLICY payload = buffer invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - SmmCommunicateGetVerifyPolicy =3D (SMM_PASSWORD_COMMUNICATE_VERIFY_POL= ICY *) (SmmFunctionHeader + 1);=0D - SmmCommunicateGetVerifyPolicy->NeedReVerify =3D mNeedReVerify;=0D - break;=0D - case SMM_PASSWORD_FUNCTION_WAS_PASSWORD_VERIFIED:=0D - PasswordTryCount =3D NULL;=0D - if (CommBufferPayloadSize !=3D 0) {=0D - DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: WAS_PASSWORD_VERIFIED payl= oad buffer invalid!\n"));=0D - Status =3D EFI_INVALID_PARAMETER;=0D - goto EXIT;=0D - }=0D - if (mPasswordVerified) {=0D - Status =3D EFI_SUCCESS;=0D - } else {=0D - Status =3D EFI_NOT_STARTED;=0D - }=0D - break;=0D -=0D - default:=0D - PasswordTryCount =3D NULL;=0D - Status =3D EFI_UNSUPPORTED;=0D - break;=0D - }=0D -=0D -EXIT:=0D - if (PasswordTryCount !=3D NULL) {=0D - if (Status =3D=3D EFI_SUCCESS) {=0D - *PasswordTryCount =3D 0;=0D - }=0D - }=0D - SmmFunctionHeader->ReturnStatus =3D Status;=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Main entry for this driver.=0D -=0D - @param ImageHandle Image handle this driver.=0D - @param SystemTable Pointer to SystemTable.=0D -=0D - @retval EFI_SUCESS This function always complete successfully.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -PasswordSmmInit (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_HANDLE SmmHandle;=0D - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;=0D - CHAR16 PasswordHistoryName[sizeof(USER_AU= THENTICATION_VAR_NAME)/sizeof(CHAR16) + 5];=0D - UINTN Index;=0D -=0D - ASSERT (PASSWORD_HASH_SIZE =3D=3D SHA256_DIGEST_SIZE);=0D - ASSERT (PASSWORD_HISTORY_CHECK_COUNT < 0xFFFF);=0D -=0D - Status =3D gSmst->SmmLocateProtocol (&gEfiSmmVariableProtocolGuid, NULL,= (VOID**)&mSmmVariable);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - //=0D - // Make password variables read-only for DXE driver for security concern= .=0D - //=0D - Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (= VOID **) &VariableLock);=0D - if (!EFI_ERROR (Status)) {=0D - Status =3D VariableLock->RequestToLock (VariableLock, USER_AUTHENTICAT= ION_VAR_NAME, &gUserAuthenticationGuid);=0D - ASSERT_EFI_ERROR (Status);=0D -=0D - for (Index =3D 1; Index <=3D PASSWORD_HISTORY_CHECK_COUNT; Index++) {= =0D - UnicodeSPrint (PasswordHistoryName, sizeof (PasswordHistoryName), L"= %s%04x", USER_AUTHENTICATION_VAR_NAME, Index);=0D - Status =3D VariableLock->RequestToLock (VariableLock, PasswordHistor= yName, &gUserAuthenticationGuid);=0D - ASSERT_EFI_ERROR (Status);=0D - }=0D - Status =3D VariableLock->RequestToLock (VariableLock, USER_AUTHENTICAT= ION_HISTORY_LAST_VAR_NAME, &gUserAuthenticationGuid);=0D - ASSERT_EFI_ERROR (Status);=0D - }=0D -=0D - SmmHandle =3D NULL;=0D - Status =3D gSmst->SmiHandlerRegister (SmmPasswordHandler, &gUserAuthe= nticationGuid, &SmmHandle);=0D - ASSERT_EFI_ERROR (Status);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D - }=0D -=0D - if (IsPasswordCleared()) {=0D - DEBUG ((DEBUG_INFO, "IsPasswordCleared\n"));=0D - SavePasswordToVariable (&gUserAuthenticationGuid, NULL, 0);=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationSmm.h b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentica= tion/UserAuthenticationSmm.h deleted file mode 100644 index 47bb95529f..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationSmm.h +++ /dev/null @@ -1,52 +0,0 @@ -/** @file=0D - Header file for UserAuthenticationSmm.=0D -=0D - Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __USER_AUTHENTICATION_SMM_H__=0D -#define __USER_AUTHENTICATION_SMM_H__=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -#include "KeyService.h"=0D -=0D -#define PASSWORD_SALT_SIZE 32=0D -#define PASSWORD_HASH_SIZE 32 // SHA256_DIGEST_SIZE=0D -=0D -#define PASSWORD_MAX_TRY_COUNT 3=0D -#define PASSWORD_HISTORY_CHECK_COUNT 5=0D -=0D -//=0D -// Name of the variable=0D -//=0D -#define USER_AUTHENTICATION_VAR_NAME L"Password"=0D -#define USER_AUTHENTICATION_HISTORY_LAST_VAR_NAME L"PasswordLast"=0D -=0D -//=0D -// Variable storage=0D -//=0D -typedef struct {=0D - UINT8 PasswordHash[PASSWORD_HASH_SIZE];=0D - UINT8 PasswordSalt[PASSWORD_SALT_SIZE];=0D -} USER_PASSWORD_VAR_STRUCT;=0D -=0D -#endif=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/User= AuthenticationSmm.inf b/Platform/Intel/UserInterfaceFeaturePkg/UserAuthenti= cation/UserAuthenticationSmm.inf deleted file mode 100644 index c5d15ada5e..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserAuthentication/UserAuthent= icationSmm.inf +++ /dev/null @@ -1,53 +0,0 @@ -## @file=0D -# User Authentication Smm Driver.=0D -#=0D -# This driver provides SMM services for DXE user authentication module.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x00010005=0D - BASE_NAME =3D UserAuthenticationSmm=0D - FILE_GUID =3D 8fc6aaaa-4561-4815-8cf7-b87312992dce= =0D - MODULE_TYPE =3D DXE_SMM_DRIVER=0D - VERSION_STRING =3D 1.0=0D - PI_SPECIFICATION_VERSION =3D 0x0001000A=0D - ENTRY_POINT =3D PasswordSmmInit=0D -=0D -[Sources]=0D - UserAuthenticationSmm.c=0D - UserAuthenticationSmm.h=0D - KeyService.c=0D - KeyService.h=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D - CryptoPkg/CryptoPkg.dec=0D - UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec=0D -=0D -[LibraryClasses]=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D - DebugLib=0D - BaseLib=0D - BaseMemoryLib=0D - PrintLib=0D - SmmServicesTableLib=0D - MemoryAllocationLib=0D - UefiLib=0D - BaseCryptLib=0D - PlatformPasswordLib=0D -=0D -[Guids]=0D - gUserAuthenticationGuid ## CONSUMES ## GUID=0D -=0D -[Protocols]=0D - gEdkiiVariableLockProtocolGuid ## CONSUMES=0D - gEfiSmmVariableProtocolGuid ## CONSUMES=0D -=0D -[Depex]=0D - gEfiSmmVariableProtocolGuid AND gEfiVariableWriteArchProtocolGuid=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg= .dec b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec deleted file mode 100644 index 3c8fe1da01..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dec +++ /dev/null @@ -1,45 +0,0 @@ -## @file=0D -# This package provides UI related modules.=0D -#=0D -# The DEC files are used by the utilities that parse DSC and=0D -# INF files to generate AutoGen.c and AutoGen.h files=0D -# for the build infrastructure.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - DEC_SPECIFICATION =3D 0x00010017=0D - PACKAGE_NAME =3D UserInterfaceFeaturePkg=0D - PACKAGE_VERSION =3D 0.1=0D - PACKAGE_GUID =3D 5A92199C-C2ED-4A3F-9ED0-C278DEA0DA47=0D -=0D -[Includes]=0D - Include=0D -=0D -[LibraryClasses]=0D - ## @libraryclass Provides a platform-specific method to return passwor= d policy.=0D - PlatformPasswordLib|Include/Library/PlatformPasswordLib.h=0D -=0D - ## @libraryclass Provides services to set/verify password and return i= f the password is set.=0D - UserPasswordLib|Include/Library/UserPasswordLib.h=0D -=0D - ## @libraryclass Provides services to do password authentication.=0D - UserPasswordUiLib|Include/Library/UserPasswordUiLib.h=0D -=0D -[Guids]=0D - gEfiUserInterfaceFeaturePkgTokenSpaceGuid =3D { 0x13c2147c, 0x75b6, 0x4= 8ee, { 0xa4, 0x4b, 0xfc, 0x4, 0xb, 0x44, 0x97, 0xbd } }=0D -=0D - ## Include Include/Guid/UserAuthentication.h=0D - gUserAuthenticationGuid =3D { 0xee24a7f7, 0x606b, 0x4724, { 0xb3, 0xc9, = 0xf5, 0xae, 0x4a, 0x3b, 0x81, 0x65} }=0D -=0D -[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]=0D - ## Indicate whether the password is cleared.=0D - # When it is configured to Dynamic or DynamicEx, it can be set through d= etection using=0D - # a platform-specific method (e.g. Board Jumper set) in a actual platfor= m in early boot phase.

=0D - # @Prompt The password clear status=0D - gEfiUserInterfaceFeaturePkgTokenSpaceGuid.PcdPasswordCleared|FALSE|BOOLE= AN|0x00000001=0D -=0D diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg= .dsc b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc deleted file mode 100644 index bd09052f3c..0000000000 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc +++ /dev/null @@ -1,101 +0,0 @@ -## @file=0D -# This package provides UI related modules.=0D -# This package should only depend on EDKII Core packages and MinPlatformPk= g.=0D -#=0D -# The DEC files are used by the utilities that parse DSC and=0D -# INF files to generate AutoGen.c and AutoGen.h files=0D -# for the build infrastructure.=0D -#=0D -# Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - PLATFORM_NAME =3D UserInterfaceFeaturePkg=0D - PLATFORM_GUID =3D 66536B4C-84A3-42FD-B0AE-603414A4CE9E= =0D - PLATFORM_VERSION =3D 0.1=0D - DSC_SPECIFICATION =3D 0x00010005=0D - OUTPUT_DIRECTORY =3D Build/UserInterfaceFeaturePkg=0D - SUPPORTED_ARCHITECTURES =3D IA32|X64=0D - BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT=0D - SKUID_IDENTIFIER =3D DEFAULT=0D -=0D -[LibraryClasses]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf=0D - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf=0D - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf=0D - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf=0D - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf=0D - OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf=0D - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf=0D - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf=0D - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplat= e.inf=0D - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf=0D - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf=0D - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf=0D - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf=0D - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf=0D -=0D - #####################################=0D - # User Interface Feature Package=0D - #####################################=0D - PlatformPasswordLib|UserInterfaceFeaturePkg/Library/PlatformPasswordLibN= ull/PlatformPasswordLibNull.inf=0D - UserPasswordLib|UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPass= wordLib.inf=0D -=0D -[LibraryClasses.common.DXE_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D -=0D -[LibraryClasses.common.DXE_SMM_DRIVER]=0D - #######################################=0D - # Edk2 Packages=0D - #######################################=0D - BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf=0D - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAlloc= ationLib.inf=0D - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf=0D -=0D -##########################################################################= #########################=0D -#=0D -# Components Section - list of the modules and components that will be pro= cessed by compilation=0D -# tools and the EDK II tools to generate PE32/PE32+/C= off image files.=0D -#=0D -# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed=0D -# into firmware volume images. This section is just a list of module= s to compile from=0D -# source into UEFI-compliant binaries.=0D -# It is the FDF file that contains information on combining binary f= iles into firmware=0D -# volume images, whose concept is beyond UEFI and is described in PI= specification.=0D -# Binary modules do not need to be listed in this section, as they s= hould be=0D -# specified in the FDF file. For example: Shell binary (Shell_Full.e= fi), FAT binary (Fat.efi),=0D -# Logo (Logo.bmp), and etc.=0D -# There may also be modules listed in this section that are not requ= ired in the FDF file,=0D -# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be=0D -# generated for it, but the binary will not be put into any firmware= volume.=0D -#=0D -##########################################################################= #########################=0D -[Components]=0D - #####################################=0D - # User Interface Feature Package=0D - #####################################=0D -=0D - # Add library instances here that are not included in package components= and should be tested=0D - # in the package build.=0D - UserInterfaceFeaturePkg/Library/PlatformPasswordLibNull/PlatformPassword= LibNull.inf=0D - UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf=0D - UserInterfaceFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf= =0D -=0D - # Add components here that should be included in the package build.=0D - UserInterfaceFeaturePkg/UserAuthentication/UserAuthenticationDxe.inf=0D - UserInterfaceFeaturePkg/UserAuthentication/UserAuthentication2Dxe.inf=0D - UserInterfaceFeaturePkg/UserAuthentication/UserAuthenticationSmm.inf=0D -=0D -[BuildOptions]=0D - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=0D --=20 2.23.0.windows.1