From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3D1312258AF02 for ; Sun, 11 Mar 2018 08:10:05 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 08:16:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,455,1515484800"; d="scan'208";a="210652148" Received: from lzeng14-mobl2.ccr.corp.intel.com ([10.255.31.175]) by fmsmga006.fm.intel.com with ESMTP; 11 Mar 2018 08:16:23 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao , Ruiyu Ni , Hao Wu Date: Sun, 11 Mar 2018 23:16:17 +0800 Message-Id: <20180311151619.1260-2-star.zeng@intel.com> X-Mailer: git-send-email 2.13.3.windows.1 In-Reply-To: <20180311151619.1260-1-star.zeng@intel.com> References: <20180311151619.1260-1-star.zeng@intel.com> Subject: [PATCH 1/3] SourceLevelDebugPkg DebugCommUsb3: Refine some formats X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 15:10:05 -0000 Refine some formats and remove some unused prototypes. Cc: Jiewen Yao Cc: Ruiyu Ni Cc: Hao Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- .../DebugCommunicationLibUsb3Common.c | 10 ++--- .../DebugCommunicationLibUsb3Dxe.inf | 6 ++- .../DebugCommunicationLibUsb3Internal.h | 43 ++-------------------- .../DebugCommunicationLibUsb3Pei.inf | 2 +- 4 files changed, 13 insertions(+), 48 deletions(-) diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c index c577df7dea97..e67ff1fe5ca7 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c @@ -87,8 +87,8 @@ XhcClearR32Bit( VOID XhcWriteDebugReg ( IN USB3_DEBUG_PORT_HANDLE *Handle, - IN UINT32 Offset, - IN UINT32 Data + IN UINT32 Offset, + IN UINT32 Data ) { EFI_PHYSICAL_ADDRESS DebugCapabilityBase; @@ -111,7 +111,7 @@ XhcWriteDebugReg ( UINT32 XhcReadDebugReg ( IN USB3_DEBUG_PORT_HANDLE *Handle, - IN UINT32 Offset + IN UINT32 Offset ) { UINT32 Data; @@ -1049,8 +1049,8 @@ DebugPortInitialize ( } if (Function != NULL) { - Function (Context, UsbDebugPortHandle); + Function (Context, (DEBUG_PORT_HANDLE) UsbDebugPortHandle); } - return (DEBUG_PORT_HANDLE)(UINTN)UsbDebugPortHandle; + return (DEBUG_PORT_HANDLE) UsbDebugPortHandle; } diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.inf b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.inf index c4e4282c98b4..3af7e7180d37 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.inf +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.inf @@ -59,8 +59,10 @@ [Pcd] gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugPortHandleBufferSize|250 ## SOMETIMES_CONSUMES [Protocols] - gEfiPciIoProtocolGuid ## CONSUMES - gEdkiiIoMmuProtocolGuid ## CONSUMES + ## NOTIFY + ## SOMETIMES_CONSUMES + gEfiPciIoProtocolGuid + gEdkiiIoMmuProtocolGuid ## SOMETIMES_CONSUMES [LibraryClasses] BaseLib diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h index 66757dafaebe..961786e2a41f 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h @@ -561,7 +561,7 @@ typedef struct _USB3_DEBUG_PORT_INSTANCE { UINT32 XhcReadDebugReg ( IN USB3_DEBUG_PORT_HANDLE *Handle, - IN UINT32 Offset + IN UINT32 Offset ); /** @@ -575,8 +575,8 @@ XhcReadDebugReg ( VOID XhcSetDebugRegBit ( IN USB3_DEBUG_PORT_HANDLE *Handle, - IN UINT32 Offset, - IN UINT32 Bit + IN UINT32 Offset, + IN UINT32 Bit ); /** @@ -595,43 +595,6 @@ XhcWriteDebugReg ( ); /** - Discover the USB3 debug device. - - @param Handle Debug port handle. - - @retval RETURN_SUCCESS The serial device was initialized. - @retval RETURN_DEVICE_ERROR The serial device could not be initialized. - -**/ -RETURN_STATUS -DiscoverUsb3DebugPort( - USB3_DEBUG_PORT_HANDLE *Handle - ); - -/** - Initialize the Serial Device hardware. - - @param Handle Debug port handle. - - @retval RETURN_SUCCESS The serial device was initialized successfully. - @retval !RETURN_SUCCESS Error. - -**/ -RETURN_STATUS -InitializeUsb3DebugPort ( - USB3_DEBUG_PORT_HANDLE *Handle - ); - -/** - Return XHCI MMIO base address. - -**/ -EFI_PHYSICAL_ADDRESS -GetXhciBaseAddress ( - VOID - ); - -/** Verifies if the bit positions specified by a mask are set in a register. @param[in, out] Register UNITN register diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.inf b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.inf index 33074db49a78..4f367622d826 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.inf +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Pei.inf @@ -41,7 +41,7 @@ [Packages] [Ppis] gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES - gEdkiiIoMmuPpiGuid ## CONSUMES + gEdkiiIoMmuPpiGuid ## SOMETIMES_CONSUMES [Pcd] # The memory BAR of ehci host controller, in which usb debug feature is enabled. -- 2.13.3.windows.1