From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::62d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6B71481C52 for ; Thu, 12 Jan 2017 22:21:32 -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=DLcYnGpgtxi2LfLuGnQjrP+F7QaunbMk0Zz57kPe0Z4=; b=MwCge/Mgpv4l7KwDGljq5Xvy/ffStqqMtgkp3elIcuoJnuhlHlWYTOfiEi1KzIxl9D8tKeku9AhvI+Px2EZSo4KaxjfryAx6/yuLFRsrLFtQ4onvVK6J1BBy+asa4Zcc/fTj9cqf1ry5/n51vIuK4M3s3SzI66+FK4b2jop7wKk= 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 BN6PR12MB1235.namprd12.prod.outlook.com (10.168.227.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Fri, 13 Jan 2017 06:21:30 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 00:21:02 -0600 Message-ID: <1484288463-7109-10-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484288463-7109-1-git-send-email-leo.duran@amd.com> References: <1484288463-7109-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR14CA0015.namprd14.prod.outlook.com (10.173.227.25) To BN6PR12MB1235.namprd12.prod.outlook.com (10.168.227.21) X-MS-Office365-Filtering-Correlation-Id: 5b2bfef6-9d9a-49eb-cf02-08d43b7c6a7f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1235; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 3:hhCBAptHT1aWJlNYPZOi7xZjMOgDx5XfZIF24fWm11x9eHaIpaedphLdKNdmfewqYtjNKD/blht9HjazQW/UOzZ8ZY8czoZCt+uXLXtNVoc4HUQpbI9DXJFjGVRzhgxi0JRPZ3dUaPyyvrnhyt7hdM/yEJlMCElNC1RrQxT/km7vhPEmyfTGEvhp8UrJ/Z40sy1/omOpLPnq4xibHnhCSnVGYj6w2p0j9mRWgVjEEKH1KmULAM2uJHibdZoYwu5U3J7ithCtNaZPZGLiIOzxpA==; 25:kJyf+TRQqIxAhj1w5ih67aCqYfO61Kba2wKe2hnrApXagDKufK+OIvFcfIKs1N2U5NJipZSo8XzLeTw4fy7wBnQnrJwO0zhpWD6YJbkCAMymrvqlA/JmBmc3H6layBwa9Aa4cw9yAYxbakArtX1iS6eIDHqmJ1P2B//i9g6zgTe8UTvEM/rDn6bjI16J0c9vOLuWzr3PsWwnn2Q/Dug6B6PjGhMedT80fbim02lmis4cNysEKrLDhJnK264qOjuMC21mbNW3KPPatjSCvKX4++cns5Myji9DqxCw2n/OEzuFs3wFCwJbL78EiIejWh3i4MQldpEpDo9K4R1aF3LZn0PnHGN8oIGO43272wb2D9CQf/CNn8khV3/wC3J9/iFYvjVJVdzXqjg1QZiB/rI6bLERtvmE8wC3hwO+IBXFWdvzf97c+lxT3Y48E56KDCJxZ5G54se+HrC+LSfbpOAiSg== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 31:S85fJ9Ek0iaP8rgXp1xT78HYCN2utL7UzyHGzcKJ3Cqv6bgC7xddo6i2h8HqgB0KX+w6ABs0e6gEOCYTMnCSQyFV5nm1wh7PcBUPuur8QOTfKgL2Nrr/OuOv5AOIrwweuTl0d2D2s9E50/1qD7C2s60WJKQnJWmRf8SXiKIRbff1Im4WPDgwMlN6FuwaiC0LPyx+YW/YFvVQmkn8IfQmaGtFvVJenddvMJZay4q8MPyNBAcZv8RiukNM2YcxOVL3LaQR8+J/aHQu9P25DLemKQ==; 20:J5yp24PRkiiO538wprpc6oFKpoLy2THMaR5P1aUq7G+dit2agQvj2KeHqDEheqEE2NPhRXGvK5lrZ3kGJk/XcemjY7qfVYsDdS7N8qQeUeZ5/mW1to/DdYn32l2ZxqDveVwjeKvh07gGEc56HSeEI9AcP6Rurk3HhGenZq/1ZQGBvxtrKfCjnbn+pIJTx+t63byxvlkwXAuLhuQpDNHA9b03TG/4Ph5WS1yWxUf/RetGKR8bbtbu/uMddvLGDtYe1bO9z7kQzBp8nN5FuOdDdFdosf6XNx50H7o7wXHDUJcTVJpCPGQ8hqYpCEOVZV9gZa/nUbHhGbEUNLTzO4adxdXnQ5GYWC9QasD+jABdP2M2dFmgrrQoe5SzgBXNJmeTd3A1fS+BPorlgleh6P1nHbBPefdyEUOv8XUcy4o65cdRrjWKn2GqKpTUC4yoxLbWvZ9yWY5Py4/sjBzqWOT7OXC8wfhMyiwnZxcZi1AmD7/9MhFwyaBjpkm67EOucFIp 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)(20161123560025)(20161123564025)(6072148); SRVR:BN6PR12MB1235; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1235; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 4:XRaYgd1tCwM5aXdHNS9lTpxNHK9RkEgU0MCxYnuGwnL44GhzPjXrRRF6np41ROJG0awC6ZDdO1PbERzwN4M1Mv2MEiI9NjLe3aY5ZDoDJRrkKQsjA6AViWzpASZGztTDjgK3RfbrCWBIGu0ghNTKtxjtuPQwoeRayrYz86aj6dNPKII0+YHXktVO7er+Sk1f+lL3Oliyt3l7Kc3jUeSBOJrUIyomkb9lJghcP3WR1/EyNxM8hsnM8mQY7MXubPz+xRWbMI0SjRveXsjHETtk+T2wG6gTnKm+HBTLYbOD1aT36k+TqF4ifuHPdAB+YcLm4c91n4WynFrkthMdQTmtimX7iw4sOUnLeAeHu5Sa1mBpTE7CZb7uPvKtRCJeiH3uFH21ATptcgBA94/9ny4vRu8OJdM72bH64xsog5rWgYfuu3v3FSJq0IJMhjq2aFfj/mpFpe6b/Ko7DggHGyHhsJr9K19MpKrZ6Q+MilYC8eShfYIKxXpm/Ke2aulgLGKcP+xxfHYfhBGPyR/261K8ggp1LShghEo/U+49IvOFX6oKR0c69VAikrAqVXdJ9sq4TFf4j7lHA38jYmB776jaOus5eKf0GMwD8mE6T8wevKvtlNEz+WPyvbsFRfucJfrdviribOJwbBHJyOsaM5TkjrRhOSfaiz+okFbMY+YKIbA= X-Forefront-PRVS: 018632C080 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39860400002)(39840400002)(39850400002)(39410400002)(39450400003)(199003)(189002)(305945005)(86362001)(7736002)(33646002)(4326007)(36756003)(3846002)(6116002)(106356001)(47776003)(81156014)(81166006)(8676002)(189998001)(2906002)(42186005)(50226002)(92566002)(53416004)(66066001)(76176999)(97736004)(105586002)(48376002)(5003940100001)(68736007)(50466002)(5660300001)(6486002)(110136003)(50986999)(54906002)(38730400001)(25786008)(2351001)(6916009)(101416001)(6666003)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1235; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BN6PR12MB1235; 23:ciqYKVz5qSffFYorft4R6RhCvCMJY/AP40y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nKBc7lAAAoSCIPlY1U3eu4LGTrJhRQVo3lgr6RMmW98=; 24:G3gSqS9P8KJRW0LqaLI5cEbExeOIt0I7Il8W74Fv3JfUv4/rd1/xv5m7Wk9z7HHSvfr+va/5jXht400I66kziCsx5NYncUuJf1uzV6Bq2js= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 7:jynwtcIOZxVciYb+zHWYZRHMJph1gkBtIJGyBJuBeO3eIS9NIlypAmvnHle6yU18e7AIheoaWBu1GI8euwAn4WpAYLOJfj5kVEylisVR+TvqP967zUdV/YOu7gMz102bcRVU2u7FFtKdJvuJ1jf2Z9ATVItT9AGOj5YPAUj1A1R4N9q1Qh98SvqYqQ3BSMsbyoYMjH/8hYeIjYxaMvk7VE3tRm9AJLMtVoq+c2HPZ0GlQk1In8cN5Epo0H+SI9/WtXz7L0sBfugHkTgKC6g/kFHfAzQVBhJKYgHUBkTgbDG/r4XhgR7kQjHRbTPmnExDV1NjxpY7HbRXh0cKpq4Mm6tR85MyJSKDAgQmEncyBljOvUyYut+afjqUX5LRXGM+SaPEL2T/sYKBbEzfeMS7l0/XfCuNN3gaseSbmfZhdOO+8SogSSpMk9yz8waC8lYzhkgjzKvDKoMYekiRHSpE7Q==; 20:hxLYH324kQzAv8ChkILUznOoXXllNJjVKd7hnAQ03bC77DgATr4dOtxzTdjLuNuBWv3j5qMpd1afBgGI9FLQi88of2vrBiBnVgsp/cQeKTSGf5t8NRK7j1YHgwKicDkXC7FQG/sKpNGbwAmC0puoNdg84cbG91+QIlVYoIl4LTJ+VRGA5kSyHEM3ED3KUUuuPQDGURAu5WpHVzoSzddq7gI4Clw4kXaMkoqxlfsxCccALX7RSlAHATnZb5EgVKyk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 06:21:30.3027 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1235 Subject: [PATCH v2 09/10] IntelFrameworkPkg/DxeIoLibCpuIo: 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 06:21:32 -0000 Content-Type: text/plain Cc: Michael D Kinney Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Signed-off-by: Leo Duran --- .../Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h | 70 +++++- IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c | 248 +++++++++++++++++++++ 2 files changed, 311 insertions(+), 7 deletions(-) diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h index 66c73fe..c15bca8 100644 --- a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h +++ b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h @@ -5,6 +5,8 @@ all source code of this library instance. Copyright (c) 2006 - 2010, 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 @@ -35,8 +37,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. @@ -48,16 +52,18 @@ UINT64 EFIAPI IoReadWorker ( - IN UINTN Port, - IN EFI_CPU_IO_PROTOCOL_WIDTH Width + IN UINTN Port, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width ); /** 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. @@ -70,9 +76,59 @@ IoReadWorker ( UINT64 EFIAPI IoWriteWorker ( - IN UINTN Port, - IN EFI_CPU_IO_PROTOCOL_WIDTH Width, - IN UINT64 Data + IN UINTN Port, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Data + ); + +/** + 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 + ); + +/** + 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 ); /** diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c index c1c48d5..1dbc362 100644 --- a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c +++ b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c @@ -4,6 +4,8 @@ are based on EFI_CPU_IO_PROTOCOL. Copyright (c) 2006 - 2010, 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 @@ -113,6 +115,68 @@ 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 + ) +{ + EFI_STATUS Status; + + Status = mCpuIo->Io.Read (mCpuIo, Width, Port, Count, Buffer); + ASSERT_EFI_ERROR (Status); +} + +/** + 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 + ) +{ + EFI_STATUS Status; + + Status = mCpuIo->Io.Write (mCpuIo, Width, Port, Count, Buffer); + ASSERT_EFI_ERROR (Status); +} + +/** Reads memory-mapped registers in the EFI system memory space. Reads the MMIO registers specified by Address with registers width specified by Width. @@ -402,6 +466,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