From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::61c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F353C81C77 for ; Fri, 13 Jan 2017 12:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cwoHbK2w/GvMqJHvr20O5pJfojGzuNr+ZSksM7+KUCY=; b=PQ2TjeswPZhos1TRDJBt+iD/t40PD/C1LiUqHH/RRXghUE/WNBz8RNi8jdzI1odJz+Yk/n92ku8FReIFUBnL1/ocdHX1tmLQLlxMN8mBlZpHIWdSsT19GUjTbESSIYMwlb98jiCRFtsxQrtqM8lkKNjn1q+PwIVVTvjOoJTRo+8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1238.namprd12.prod.outlook.com (10.168.167.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Fri, 13 Jan 2017 20:10:45 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 14:09:57 -0600 Message-ID: <1484338200-31337-8-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484338200-31337-1-git-send-email-leo.duran@amd.com> References: <1484338200-31337-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BLUPR16CA0013.namprd16.prod.outlook.com (10.164.14.23) To CY4PR12MB1238.namprd12.prod.outlook.com (10.168.167.13) X-MS-Office365-Filtering-Correlation-Id: 5abc9c6f-a2a7-4f1b-c86f-08d43bf042a9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR12MB1238; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 3:GU1spopb+JYJawOG+l+qWLZ5m4vZvmsksh1vtEp5CxWdm+rYpwTXYatPSI4RMJc1F0Nj6UbgM1elUQo/mjjtOFgo5rIzA+gcU0k5Ao4wo1o+2R8TcQD8rDhWffcyuj7/Cue1aHPiH9TT1vELM8BEBTP38mNZVhYLKf4VRyJf6pRrSpHUeYG45kULr2IhO9fp18FI+YLk8BFQmtk90ZWbpaBe25RIw81o0B/uIAXNbXE2TT4A7JwcIGdGTKpidmY57TDLr/Mlc8Vcd/ND1ygbKA== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 25:INQp4Y8/mNuDUpJEKWb5p8BUFI0X/KIinO4FfPR+BX/a1hkyQCtrs3o9iahsFLKId4KrlJ2NA/21PN91GNDWYC775x6lovxkIGI9+WsSk0D78iwRmj3rmLz/PynbinMBCRk4OXC/jxo+H0BC5d1g9+yEuhSK7gYtml8p/t5Tv/knEiAO0E3jMFjSLED1rpYs8dRsHoIkKStj364KBTThk2QtqQb6OkStucQsqMpEdrl+71ApKUi1D4jARfSwaprH0d0LS4VadUxCIdY3f5dcp6HsizvajxW2cjchZ+q8AUYGnR9bydEAkM0zlQi+aTi4mZEi5EmXKcZ5Pd+P2dvUHNgUw+h3WUAolVUlJ71Um4A1IBWCcn2LYgEDXObhuLqD31ECSPi4IrpS28q3SBYxLNXmlp1e3ZVbU+ymF0jOJNc5vWChv4DdfSoKFwh87h3dIfkZN/hXYzy+fkSCHaWdUjYGINmJAb85yNMHjG2WVNqxDhybLDDLtqFWyNQifysvkNBn+eHpAQekcLJL/oA/BtOckN56ZXFIcaIoSJn+QR4Q+qxb+4l3fMZW2Jqy5k4IWxyp6YHzE/WHQy2wJz0315TEulAxV02sudKdALXNBmIRV8QYEx3OBX5a05CivaZQt7BSFqSXvG4NSGwbjeMi6hT3yQZy59kgVClMRFZIqavCowPfdRL0a0Qi90CvDtjqwnVCgA4SDDO1c94LwgmLeTqyHXtgJHagclyF+KAwEDk= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 31:GKEnOg5i4DRIwDDLBBcLgsJGMbZ87iNZgG9D6epD83Y7i1otUqm+4gmcMRVJf9/YzqqPjQfk9/VVa+rYmMcsSAR4JNJQlPU6ZOdpcebFMnm6YT9Z+yWZlFc5Ufy15YXFGLugXs+rUi787ZAe3Q3UcsGWIqAXre0fmJ4lVjlY2ZjxN0W9LdjVT9M+gYblJSIxonAS9qJ9x8JQVf1vbNQoX+hMmN4mKdIdbcDIwN3Z9kFVMJDvIbVHdmQLcoqwBMQSN8kba8EckAx/S2xY7WuCDw==; 20:Q3dBh5LKNgk80Y9bpeMVKLvzMtn3rN9nq3oZLlPXcZ3Fii2q6iRpmOsG1JAKSoOpYnl+LAuXzksi7vk84ng+b9H6ncN6gtcMy1RVyDleCU9qsHRFDHES0zSTK5i/z8qR45fJbOb6IoYJIXjFzGLE4kiVVSK1hY8h+tClrV2ntRJ1fSF047Pf9eDg2vvRh/6FjjN7/mkQoM2YXuSy68aGb7OTOxmEu4BV4XIbDvIuEcpm55xrE1vQwGbD2wocROS2MV/bb/PC7d3+fzUSAgi3t6sDcLUwdk2rnoQeGPrmZ7aiB9x1FzfRN1AOS1MXbDG/925MmFfFbWvPnB44SOTHTs7A+kQHupoWQhZdQaGYuD6o+C26RalOnAwocBZX9g+kkZPqlq4vFWKE6GmOgk3yiURi8WFjsCLCFl4Epi/ME/9r3hQpliugs187r7YZFlvZwAMtrvm3ayz+a/gDk8Wei/0Zb4OyJ8gzKHoNa0ThfwEXs9vxdSpFifqcfAjOI+S6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CY4PR12MB1238; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1238; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 4:g5UYjoUgJUX5FswwPLBC2La/EgT4rRuksrJOiSjkaIF0Na1I/GixqoN83EpDCudgN+odm1E55HFGvOye1ZblmRdWGME4pTS8f6NOVa3VvS0p0Ob0phNWQeCf3oRdvTAILz/G2yL520Ye3cGrx0DHEXe2+vEse8IrRmO2Ebdv0baXJbNUT8N+3WwlS/GUJUlDcxZhWKcdZOXpWgliuqZNpc+uQAnZYQauSzmRitAW44WF8N9C7V1swbNJ2/8+njX2NCvAVmYYmtqkfY0di/sUs8R59V5/7ZFnw4SUgBFh9+e4KqSqswrZicPFlI0EWetQynr/Iy2xTn9vhe0gGmyFA2jtSYIInjoRqaWXYNk1/sAn8rqzOkTpgETahDaUK3ZIbNgPW+yhBmA5Pa7Ll4bOnK6Eu+m3Qhw1Ln90FAacVNG7JKq6vL02gb2Iuhdl4nlJDSD5zuVo/BQzGRB9t7D2depJuZvsjTM7Kuw6nkL6NLE6N8UvGzONbFtVVZQ/WpViqbbsN7UAIBFjebnw8vAFWd3UaHo/uO7/IOnA9dy8ELiDg34xIhlCMV0b82M9RCodotLudUBo9Ly31wVVaeUwuYZhu1iCWL4YWeeiB6Wa+foGnBMYexu2oK9BYy5pLvhYgQBCE/uGljtVHwmly9TEMpE9PvVH1tLDmYCtO1s7N7I= X-Forefront-PRVS: 018632C080 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39840400002)(39860400002)(39410400002)(39850400002)(39450400003)(189002)(199003)(6486002)(106356001)(101416001)(105586002)(2351001)(38730400001)(6916009)(6666003)(48376002)(54906002)(2950100002)(47776003)(7736002)(305945005)(110136003)(5660300001)(25786008)(50466002)(66066001)(86362001)(33646002)(4326007)(5003940100001)(42186005)(53416004)(97736004)(2906002)(6116002)(92566002)(3846002)(36756003)(68736007)(8676002)(50226002)(189998001)(81166006)(50986999)(76176999)(81156014)(27001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1238; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1238; 23:yXD1ex1IYq8acPQ+wz6/1ERkqwO7OcTSFrXBJ2+24?= =?us-ascii?Q?5OVLfHnCzd8NpQzVkrtXQvxS8IyHYFPDyHS599IbKWANz5JGv8K0RdDm5xmq?= =?us-ascii?Q?HuFCptAT5lxd4anYIDa4H1ah+EI4SrLnNKqhOpZEwlpPTRHKG0MPQpQKhd+v?= =?us-ascii?Q?DceZFOHCmc3XNIWW8IzWfQjd++MAfm59UcVUmhk4x5ldb1lFRvOqQtcnNzac?= =?us-ascii?Q?D9wLr71SbfkMw8U7okKSfoq/OTEAlaUXhwLnL/fVtku2fsM8xRioojqgnbQj?= =?us-ascii?Q?cQBv9u6ApL8c0quInnlhLu2pNqez2C+AzJMaFkJ2eQPa3vk9CAdzHY+Fk4AE?= =?us-ascii?Q?Tx9kd0EARyzTQF5hffuYChTCprcHR9nIcKi7ghfiNJO9twRIfOuKl0m8o+Bz?= =?us-ascii?Q?+8mhZlu9pCDeS5CA1xwqT+ZB3cMHz5lvRAbDHXyTPn0Umc6B5bSxyYLmK1Pa?= =?us-ascii?Q?50/x+TyHhnQHAs5akkNmfz1HfKrkT1DnCySZnxSsnOcOjz18f2oWEBu44cnR?= =?us-ascii?Q?nq6Cj39JoL1LfY6eqoPSMtR8IfDSqtNVCdP0FNN4iT3W4kf+yLq/ZMzJYMBy?= =?us-ascii?Q?94bkqocH0PbI+CLAOZso1DHB5T3Kq0EfJGAmZx8NgPf63FZ+O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tYWZgZD16Lgx2LaapWvoag6HbT1a6cM0EDjL7KBfUHKtgieY6aN6QQOU9HzojBtxmSZn8SxX83fEWLfIzSzaUOf6Smp1CdIYMKiW/ZQBr5jFsauVCZ2fV1W3oN1mxU1/dLA3KZHROnBJOQhAtPsOrAwnDHeSiU8HikLcyeopC8IsLU3/XWSAroq+AiqIhsdUU3VNE0Is4ZQaoEsMIX5nLJ/Tc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 20:10:45.3988 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1238 Subject: [PATCH v3 07/10] MdePkg/DxeIoLibEsal: Add new Fifo routines in IoLib class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 20:10:47 -0000 Content-Type: text/plain Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Signed-off-by: Leo Duran --- MdePkg/Library/DxeIoLibEsal/IoLib.c | 278 +++++++++++++++++++++++++++++++++++- 1 file changed, 276 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/DxeIoLibEsal/IoLib.c b/MdePkg/Library/DxeIoLibEsal/IoLib.c index 3a58b51..ab186a6 100644 --- a/MdePkg/Library/DxeIoLibEsal/IoLib.c +++ b/MdePkg/Library/DxeIoLibEsal/IoLib.c @@ -2,6 +2,8 @@ I/O Library basic function implementation and worker functions. Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, AMD Incorporated. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -18,8 +20,10 @@ Reads registers in the EFI CPU I/O space. Reads the I/O port specified by Port with registers width specified by Width. - The read value is returned. If such operations are not supported, then ASSERT(). + The read value is returned. + This function must guarantee that all I/O read and write operations are serialized. + If such operations are not supported, then ASSERT(). @param Port The base address of the I/O operation. The caller is responsible for aligning the Address if required. @@ -60,8 +64,10 @@ IoReadWorker ( Writes registers in the EFI CPU I/O space. Writes the I/O port specified by Port with registers width and value specified by Width - and Data respectively. Data is returned. If such operations are not supported, then ASSERT(). + and Data respectively. Data is returned. + This function must guarantee that all I/O read and write operations are serialized. + If such operations are not supported, then ASSERT(). @param Port The base address of the I/O operation. The caller is responsible for aligning the Address if required. @@ -98,6 +104,90 @@ IoWriteWorker ( } /** + Reads registers in the EFI CPU I/O space. + + Reads the I/O port specified by Port with registers width specified by Width. + The port is read Count times, and the read data is stored in the provided Buffer. + + This function must guarantee that all I/O read and write operations are serialized. + If such operations are not supported, then ASSERT(). + + @param Port The base address of the I/O operation. + The caller is responsible for aligning the Address if required. + @param Width The width of the I/O operation. + @param Count The number of times to read I/O port. + @param Buffer The buffer to store the read data into. + +**/ +VOID +EFIAPI +IoReadFifoWorker ( + IN UINTN Port, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINTN Count, + IN VOID *Buffer + ) +{ + SAL_RETURN_REGS ReturnReg; + + ReturnReg = EsalCall ( + EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, + EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, + IoReadFunctionId, + (UINT64)Width, + Port, + Count, + (UINT64)Buffer, + 0, + 0, + 0 + ); + ASSERT (ReturnReg.Status == EFI_SAL_SUCCESS); +} + +/** + Writes registers in the EFI CPU I/O space. + + Writes the I/O port specified by Port with registers width specified by Width. + The port is written Count times, and the write data is retrieved from the provided Buffer. + + This function must guarantee that all I/O read and write operations are serialized. + If such operations are not supported, then ASSERT(). + + @param Port The base address of the I/O operation. + The caller is responsible for aligning the Address if required. + @param Width The width of the I/O operation. + @param Count The number of times to write I/O port. + @param Buffer The buffer to store the read data into. + +**/ +VOID +EFIAPI +IoWriteFifoWorker ( + IN UINTN Port, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINTN Count, + IN VOID *Buffer + ) +{ + SAL_RETURN_REGS ReturnReg; + + ReturnReg = EsalCall ( + EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, + EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, + IoWriteFunctionId, + (UINT64)Width, + Port, + Count, + (UINT64)Buffer, + 0, + 0, + 0 + ); + ASSERT (ReturnReg.Status == EFI_SAL_SUCCESS); +} + +/** Reads memory-mapped registers in the EFI system memory space. Reads the MMIO registers specified by Address with registers width specified by Width. @@ -397,6 +487,190 @@ IoWrite64 ( } /** + Reads an 8-bit I/O port fifo into a block of memory. + + Reads the 8-bit I/O fifo port specified by Port. + The port is read Count times, and the read data is + stored in the provided Buffer. + + This function must guarantee that all I/O read and write operations are + serialized. + + If 8-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to read. + @param Count The number of times to read I/O port. + @param Buffer The buffer to store the read data into. + +**/ +VOID +EFIAPI +IoReadFifo8 ( + IN UINTN Port, + IN UINTN Count, + OUT VOID *Buffer + ) +{ + IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint8, Count, Buffer); +} + +/** + Writes a block of memory into an 8-bit I/O port fifo. + + Writes the 8-bit I/O fifo port specified by Port. + The port is written Count times, and the write data is + retrieved from the provided Buffer. + + This function must guarantee that all I/O write and write operations are + serialized. + + If 8-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to write. + @param Count The number of times to write I/O port. + @param Buffer The buffer to retrieve the write data from. + +**/ +VOID +EFIAPI +IoWriteFifo8 ( + IN UINTN Port, + IN UINTN Count, + IN VOID *Buffer + ) +{ + IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint8, Count, Buffer); +} + +/** + Reads a 16-bit I/O port fifo into a block of memory. + + Reads the 16-bit I/O fifo port specified by Port. + The port is read Count times, and the read data is + stored in the provided Buffer. + + This function must guarantee that all I/O read and write operations are + serialized. + + If 16-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to read. + @param Count The number of times to read I/O port. + @param Buffer The buffer to store the read data into. + +**/ +VOID +EFIAPI +IoReadFifo16 ( + IN UINTN Port, + IN UINTN Count, + OUT VOID *Buffer + ) +{ + // + // Make sure Port is aligned on a 16-bit boundary. + // + ASSERT ((Port & 1) == 0); + IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint16, Count, Buffer); +} + +/** + Writes a block of memory into a 16-bit I/O port fifo. + + Writes the 16-bit I/O fifo port specified by Port. + The port is written Count times, and the write data is + retrieved from the provided Buffer. + + This function must guarantee that all I/O write and write operations are + serialized. + + If 16-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to write. + @param Count The number of times to write I/O port. + @param Buffer The buffer to retrieve the write data from. + +**/ +VOID +EFIAPI +IoWriteFifo16 ( + IN UINTN Port, + IN UINTN Count, + IN VOID *Buffer + ) +{ + // + // Make sure Port is aligned on a 16-bit boundary. + // + ASSERT ((Port & 1) == 0); + IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint16, Count, Buffer); +} + +/** + Reads a 32-bit I/O port fifo into a block of memory. + + Reads the 32-bit I/O fifo port specified by Port. + The port is read Count times, and the read data is + stored in the provided Buffer. + + This function must guarantee that all I/O read and write operations are + serialized. + + If 32-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to read. + @param Count The number of times to read I/O port. + @param Buffer The buffer to store the read data into. + +**/ +VOID +EFIAPI +IoReadFifo32 ( + IN UINTN Port, + IN UINTN Count, + OUT VOID *Buffer + ) +{ + // + // Make sure Port is aligned on a 32-bit boundary. + // + ASSERT ((Port & 3) == 0); + IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint32, Count, Buffer); +} + +/** + Writes a block of memory into a 32-bit I/O port fifo. + + Writes the 32-bit I/O fifo port specified by Port. + The port is written Count times, and the write data is + retrieved from the provided Buffer. + + This function must guarantee that all I/O write and write operations are + serialized. + + If 32-bit I/O port operations are not supported, then ASSERT(). + + @param Port The I/O port to write. + @param Count The number of times to write I/O port. + @param Buffer The buffer to retrieve the write data from. + +**/ +VOID +EFIAPI +IoWriteFifo32 ( + IN UINTN Port, + IN UINTN Count, + IN VOID *Buffer + ) +{ + // + // Make sure Port is aligned on a 32-bit boundary. + // + ASSERT ((Port & 3) == 0); + IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint32, Count, Buffer); +} + +/** Reads an 8-bit MMIO register. Reads the 8-bit MMIO register specified by Address. The 8-bit read value is -- 1.9.1