From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.18083.1641954049814035968 for ; Tue, 11 Jan 2022 18:20:52 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=U3aYZ+Gw; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641954052; x=1673490052; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PY/xRBtUsaLYYRxl6TUYpaEj8nYGqCME8Wo6XH+S1fA=; b=U3aYZ+GwalA734Kif9ZkZG/gcmfwcn89Yp4eHGO2nsBqMe/7wnXlaoV7 hXMzCMG2yvbxJ4FtTr3LDgZOy0SnaUUsbRT2gyywa9ioBXwK5U912Msuu BzKiuhIIorqn4Yrn2X0/BUdgD16KRx9tCHmAQn2PP6rrsc9QhMNZt5KzQ 5bK+yYBSFrRqrRwlF31GOAz9AYizAyc14fTF/+ZUN6pROvajIn8ud+lk8 +ExACBNsClgEMXR7JWP5VPRmYPMDcvUynvjN9p9n+TOZk+v/eslQYCE8v peMSiZPo+STalbVPTURRg6rlf4HKAWz21itfmNe4FNjcyrVbqbq315OHl w==; X-IronPort-AV: E=McAfee;i="6200,9189,10224"; a="243439835" X-IronPort-AV: E=Sophos;i="5.88,281,1635231600"; d="scan'208";a="243439835" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 18:20:49 -0800 X-IronPort-AV: E=Sophos;i="5.88,281,1635231600"; d="scan'208";a="528990337" Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 18:20:49 -0800 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Isaac Oram , Eric Dong , Liming Gao Subject: [edk2-devel][edk2-platforms][PATCH V1 19/27] Usb3DebugFeaturePkg: Align with feature design guidelines Date: Tue, 11 Jan 2022 18:20:19 -0800 Message-Id: <73c2a258db12f55a69b20e4580b3e78768a72ad0.1641953242.git.isaac.w.oram@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove build of common libraries. Boards will already have those. Modified Usb3DebugFeature.dsc to treat libraries like libraries. Usb3DebugFeaturePkg.dsc uses the component trick for standalone build testing of the libraries. Added a PCD to allow board to select between NULL, regular, and IO MMU library instances. Prior implementation of Usb3DebugFeature.dsc was not useful as an includable file because it didn't specify LibaryClass instance to use. Removed unused CMOS PCD. Updated some of the readme sections. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Isaac Oram --- Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc | 131 ++++---------------- Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md | 50 +++++--- Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec | 14 +-- Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc | 18 +++ 4 files changed, 81 insertions(+), 132 deletions(-) diff --git a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc index 1e3aaecd5d..a87a5b428b 100644 --- a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc +++ b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc @@ -31,122 +31,35 @@ # ################################################################################ -!include MdePkg/MdeLibs.dsc.inc +[LibraryClasses.Common] + Usb3DebugPortParamLibo|Usb3DebugFeaturePkg/Library/Usb3DebugPortParamLibPcd/Usb3DebugPortParamLibPcd.inf -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - -[LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf - -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - -[LibraryClasses.common.UEFI_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -################################################################################ -# -# Component section - list of all components that need built for this feature. -# -# Note: The EDK II DSC file is not used to specify how compiled binary images get placed -# into firmware volume images. This section is just a list of modules to compile from -# source into UEFI-compliant binaries. -# It is the FDF file that contains information on combining binary files into firmware -# volume images, whose concept is beyond UEFI and is described in PI specification. -# There may also be modules listed in this section that are not required in the FDF file, -# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be -# generated for it, but the binary will not be put into any firmware volume. -# -################################################################################ # -# Feature PEI Components +# If NULL Usb3DebugPortLib library instance desired # - -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.IA32] - ##################################### - # USB3 Debug Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortParamLibPcd/Usb3DebugPortParamLibPcd.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf - - # Add components here that should be included in the package build. +!if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance == 0 + [LibraryClasses.Common] + Usb3DebugPortLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf +!endif # -# Feature DXE Components +# If regular Usb3DebugPortLib library instance desired # +!if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance == 1 + [LibraryClasses.PEI_CORE, LibraryClasses.PEIM] + Usb3DebugPortLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.inf -# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.X64] - ##################################### - # USB3 Debug Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortParamLibPcd/Usb3DebugPortParamLibPcd.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.inf - Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.inf + [LibraryClasses.DXE_CORE, LibraryClasses.DXE_DRIVER, LibraryClasses.DXE_RUNTIME_DRIVER, LibraryClasses.SMM_CORE, LibraryClasses.DXE_SMM_DRIVER, LibraryClasses.UEFI_DRIVER] + Usb3DebugPortLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.inf +!endif - # Add components here that should be included in the package build. - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. # -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. +# If regular Usb3DebugPortLib library instance desired # -################################################################################################### -[BuildOptions] +!if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance == 2 + [LibraryClasses.PEI_CORE, LibraryClasses.PEIM] + Usb3DebugPortLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf + + [LibraryClasses.DXE_CORE, LibraryClasses.DXE_DRIVER, LibraryClasses.DXE_RUNTIME_DRIVER, LibraryClasses.SMM_CORE, LibraryClasses.DXE_SMM_DRIVER, LibraryClasses.UEFI_DRIVER] + Usb3DebugPortLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.inf +!endif diff --git a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md index dc92f108ff..c8afcf9fd2 100644 --- a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md +++ b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md @@ -29,12 +29,15 @@ The description should not be constrained to implementation details but provide feature is supposed to work. ## Firmware Volumes -*_TODO_* -A bulleted list of the firmware volumes that feature module(s) are placed in. +Not applicable, the feature only produces libraries. ## Modules -*_TODO_* -A bulleted list of the modules that make up the feature. +* Usb3DebugPortLibDxe +* Usb3DebugPortLibDxeIoMmu +* Usb3DebugPortLibNull +* Usb3DebugPortLibPei +* Usb3DebugPortLibPeiIoMmu +* Usb3DebugPortParamLibPcd ## *_TODO_* @@ -76,11 +79,7 @@ This is particularly useful for features that use custom build tools or require standard flow in the feature package template is used, this section may be empty. ## Test Point Results -*_TODO_* -The test(s) that can verify porting is complete for the feature. - -Each feature must describe at least one test point to verify the feature is successful. If the test point is not -implemented, this should be stated. +No test points implemented ## Functional Exit Criteria *_TODO_* @@ -90,8 +89,28 @@ This section should provide an ordered list of criteria that a board integrator functional on their board. ## Feature Enabling Checklist -*_TODO_* -An ordered list of required activities to achieve desired functionality for the feature. +* In the board DSC file, enable the feature +``` +[PcdsFeatureFlag] + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable|TRUE +``` +* In the board DSC file, select the implementation desired +``` +[PcdsFixedAtBuild] + # 0 = Non-functional instance + # 1 = Regular instance + # 2 = IO MMU instance + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1 +``` +* In the board DSC file, configure the PCI device information +``` +[PcdsFixedAtBuild] + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciBus|0x00 + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciDev|0x14 + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciFunc|0x00 + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdXhciDefaultBaseAddress|0xFEA10000 +``` + ## Performance Impact A general expectation for the impact on overall boot performance due to using this feature. @@ -102,7 +121,8 @@ This section is expected to provide guidance on: * How to manage performance impact of the feature ## Common Optimizations -*_TODO_* -Common size or performance tuning options for this feature. - -This section is recommended but not required. If not used, the contents should be left empty. +* In the board DSC file, tune the timeout value +``` +[PcdsFixedAtBuild] + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout|2000000 +``` diff --git a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec index 2b19e48491..353001b0f8 100644 --- a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec +++ b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec @@ -36,6 +36,12 @@ gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable|FALSE|BOOLEAN|0xA0000001 [PcdsFixedAtBuild] + ## This PCD allows the board to select the Usb3DebugPortLib instance desired + # 0 = NULL instance + # 1 = Regular instance + # 2 = IO MMU instance + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|0|UINT8|0xF0000009 + ## These PCD specify XHCI controller Bus/Device/Function, which are used to enable # XHCI debug device. gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsbSerialXhciBus|0x00|UINT8|0xF0000001 @@ -47,11 +53,3 @@ # Default timeout value is 2000000 microseconds. # If user does not want system stall for long time, it can be set to small value. gUsb3DebugFeaturePkgTokenSpaceGuid.PcdXhciHostWaitTimeout|2000000|UINT64|0xF0000005 - - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes space. - gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortBusIndex|0x59|UINT8|0xF0000006 - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes space. - gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortDeviceIndex|0x5A|UINT8|0xF0000007 - ## This PCD sepcifies the start index in CMOS, it will occupy 1 bytes space. - gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortFunctionIndex|0x5B|UINT8|0xF0000008 - diff --git a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc index 02627d2ed4..6965d26721 100644 --- a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc +++ b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc @@ -24,7 +24,25 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[PcdsFixedAtBuild] + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|0 + # # This package always builds the feature. # !include Include/Usb3DebugFeature.dsc + +# +# This package currently only contains library classes. To force them to be built since there is no code to use them +# we just tell the build that they are components and the build will compile the libraries +# + +[Components] + Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf + Usb3DebugFeaturePkg/Library/Usb3DebugPortParamLibPcd/Usb3DebugPortParamLibPcd.inf + + Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.inf + Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf + + Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.inf + Usb3DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.inf -- 2.27.0.windows.1