From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0605.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::605]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C77681BCF for ; Thu, 12 Jan 2017 22:21:27 -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=Qr+EaJqHatBWo0z94TuHwOMW6MzKotK1HgFU0hPJBKo=; b=W2nVnBiZ9DOUD8ONVQuFBwtpzTGKKM5YRDZgK3bVlL7PFilcXT9yBa4RC2Y5KZyplXS2QSK5bDXKkECqRnzt6fwc+Cn1z3E55RIhZLrRrrR6r9ac/HbggFabQcvoY0ehL9iW0TBqQwFAfoiePNxMnamS8a0/PryjzyWL3iaDTW8= 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:25 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 00:20:59 -0600 Message-ID: <1484288463-7109-7-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: ba48ac31-4473-4a84-cc2e-08d43b7c678a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1235; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 3:/hfBKr8CjK9DfIj5yrKr9tXcmpQomU05MkSpSAf0MSajpXEGwmWLhm+pJ44HzTywOpI+DfdjTA9vRnBstpDPH753T9JNgB5EGuAB9I4vA0yoCoqYAvESHfzK/PTMq/vHUEaf9OE20f3c4cvEZ44wgNUOzJHDj4+qcoAonatSbvDeXDi3AsV3EnKBfI8zdFWVJWpY2tomErPaHjO5MtV1MMFiAfmDdXR7c7GxLAoV5SSteej8fE5QzbSf4O2lNVeXa7ILghFXtzCc9uxKgAtEoA== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 25:Y/XzUU6zmAgSkY9F53K8CfrIECY/tm4KHiSu5nzLOMZtjFNo2HStQLbhC+AYN3B2PEZJaTP1KLfU/NRq6Of/rW7MXkv5cLdX+3ukXis8lRhei2BUOuk+jiCkDtAKVK9t/Iapw4kgPs4ajHjcR4dGFjGWlKLo1h+7N15rE8T1XLILbRX8Isus3GivPt+xuuTK7oURmyxbjyR7qjbZLK9iUnseV4pvucnB8Yh6vZ63HnT+YjQwZGUUsYoLRIR9k0vMx2H5kswYMjoxRz0FagjW9HMagy1zLFJKMgl6NNbjbmlMhE5KpNDY3LxjEMZ/0hlJ92hsv9CQydKYsO6Na406kXMiVnBP/lWZV96uyZDEh+LYj9t8+eh7rSiHeWwACxJubsIF0vg7e0udMgCHcwOyDdZ9iXRX0uhalw4zh3gWEN+Qm+1xGuoZVauMbpN4D8T5whBcIhIVaiRKzoJxUqCxd9k5O/xtIm01Xo3iS7xVl3jxNIRD+uP9RqQgbwW5R80wCe5mS8gzIDTj0rCuOu3e/FWkcdVFZbGva+wL2Mormb+kLFnLX+yt5zWy77PsBJIaCjYP7ZwuofOLdn5/Xz9GJe/VqQAG6PmXzosqwEBuSQKvpR+CEswOJHQNFmcyovyx5h1gvrPChtv87I+pQG2i4XICUy1XnafEhmv2UMCHL9a9X8cSPZx1T7IPduOA2IPSIGTBKBfqAF+01iBgjhofBvqNKvalIn3ZFg5quP5xVDuArlsL6bSX6d0SbMVghoWu X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 31:hcf5qAf1wJIyPmyIB3B1QgPHOEBEImSMo2vJnSwb15baEWAMUO/vJZcySIE8BzeKYRpIOndpG3IFxKITPe3IXrq1bU4emmShDjgosr0Y8fhtj99JeFZrKmLtIy/q6LwEO20oJM1raEUYNz6e42l4WcRTEcBC/AtulPAJ4+qsXtg8dOZ8lN2lkm2k8LYmJLnGwwtN6yR+Bgw4CYF32WMsFdbFO9r1yzIodW2DAhJbuboJd/RjcUrsqO84bsqAMouM; 20:xzL5DgoXAiD+rBGyPiEX6JtSbuYL2Ss9SKu0NA10xVbuKCEMK8fzF7dobA2w/qJbK+zAHe6Kasx5jX0kJwuHCOiwujCL9kp2re7BPVK6QfUnGaU8i0nudzuVICKqgSCm/ove6RUPqfqImYt4xaxr82N15FFUnalkoE4MCucVPDeKOH4DUL1vkj95flWx8ht90FzdKdyiXHezc0CXaTRcWWK+N5GCligTqGlpDxzKIvcTnFkpXMl9XH6NunS08mGtowpM4LeD0r2+RL3cHQNGdq8mwDYioSBLUtR9QCemYkqRgJH4nee7YTpUeFbKypdNk89ayjaRCkD01heHdJBWIWzbnQIqSWOwQnlalaZD//WtEDpl0w7Czia3QNawKBRMCVh7qH/HPjZGFqDk5BEeaa7NlrUNKy2I00tGyozfr1VMkK5eymkXSvPoNUN55lu26MLDLBfI5/PG8zX+pV15z9Q5roXJ90Mhvr14deMjdhG1xUYDKu9TI0SPmRqD4Rb7 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:HwB8wepcKV7ZVlDA5t3aHPHdtXWGZSSjcKhn/pFIvWyq3w5D0UicRA/f0/PTLFK3ll/GrqdYxfw7o6w+AQw3xvXVAkxeAJs2m9i5KODt7prB3ylY8O0XcpsJBnOORS+Uf2V4G4/tZ5Zr7TTK+gnphKLsumCp31jY1EUaEoj0MwaqGbUSUvxIPlvnZxckQUUrAJoJsjQKEzcBZneemmIY7I0+e7CHfOZpBmuIufEfHIUiN3gysfjaL5x8A21bYUZfAMBixnjZxOZQ/Nbzjx+NvDuX2oN+rAlLqZsL/yoLQeFGIUYgfn7mv/F4xV0yOnJ8IBJAoAjkpOuhQ8LBH1FvTLKB6jDdT26PtPjznSmU5yq2tut8myXF62gtGFqoGf4D8zDqfMcHK1a5050FiiSP1eWtUPiysfGmXXqAPiT1nj8mvkEUdJPhbyeBU6tK6oR0+ZHWstvl30GX7cC5a0rjlEN4AUWvGRtPnCZKirlkfh7Qdg+YJ560l7OrXFxr4XSxq/FK5S8MpWiFKU5viOBlqpzhN/1svKWRhGmwiDFFrBPWUXK5KUXM/Dle8FUd+PDG+RCtDNWS7N5KlGVfA3ZOj0UL/THiMlxE9WCYEKIpiS6inYQ+MzgNZmk6Vdz1x9WNxy1em+4zqvxuBPC16I+TSb6505cWZXUePEwbttUQgX4= 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:fs/nB5Yg7swrO+axCf8wFF5v7z6s4EZBtI8j0+pA7?= =?us-ascii?Q?Dybcryt0fTSNbHmAluhlFaluHwmc1ejkjfA4thf7bv7AjupePPlwza1QuOhu?= =?us-ascii?Q?HFKwAKfay26d8EAaliSSqyD11UAXxVqTMrhC2HRrO7NLDE71HkaJXFdIxM8h?= =?us-ascii?Q?krMlg4nEjJKt1e0d12QM6irO6t93O7G8PGDoZsw1KKb9n/ADDYBPJEj35hUR?= =?us-ascii?Q?3LI82WHh2KRqNQfWoMAwkPLZqNwsD02cbQQB9Y456D68svb4IsaN9c4eFi6j?= =?us-ascii?Q?3eo6YmhsL4Ygvzsd8HnGmJ2Vlu53E6O6IQLpUYmnOe48vaO8JaG4cVYyDdY9?= =?us-ascii?Q?wdhCExIrEVoW413luZZg7rWH2v8UoI5elXGozo45RoCIW/IDJ+QlGmtGYQ/B?= =?us-ascii?Q?604E6+qdcq9QIh5tw25hwOacJng0xgm9s3W2Dgt7V7JKmm0AjUugvA+EbqAp?= =?us-ascii?Q?TGmMH7iG57udvwu502H1C+5Lhb9y96c7itTWHO5HbbVXBzHbwljeb29ZARwr?= =?us-ascii?Q?oeQtmMwVe5oaRWCRMIIYj6MUPlnFDgKDnQOT2eUw2eVGF6rM3e27eGkKCH52?= =?us-ascii?Q?6k/KrfWijgMgxkfdmtPyKLnhA/x3tZ6ipDbBzAabUF469aJgTtYjZY4kcTXe?= =?us-ascii?Q?C78iJeNr9JoB+L9mKsIS7PzY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CNcekkBCG9T7XCh94N6c613qRzTmEqsr9mo/txveMvC8lN8jpzEci2tmBegRxTvBIb41zfCL40mvQkskmImWOgdOeQSmJ+k04qbSnIzvHtC5uNQM4J7xebxTuqbnk31yIJiQMsxKMDUn4l5i53rDAYxHM/rE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 06:21:25.3405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1235 Subject: [PATCH v2 06/10] MdePkg/PeiIoLibCpuIo: 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:27 -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/PeiIoLibCpuIo/IoLib.c | 261 +++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) diff --git a/MdePkg/Library/PeiIoLibCpuIo/IoLib.c b/MdePkg/Library/PeiIoLibCpuIo/IoLib.c index 1f50a12..e09bec9 100644 --- a/MdePkg/Library/PeiIoLibCpuIo/IoLib.c +++ b/MdePkg/Library/PeiIoLibCpuIo/IoLib.c @@ -2,6 +2,8 @@ I/O Library. The implementations are based on EFI_PEI_SERVICE->CpuIo interface. Copyright (c) 2006 - 2008, 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 @@ -20,6 +22,81 @@ #include #include + +/** + 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_PEI_CPU_IO_PPI_WIDTH Width, + IN UINTN Count, + IN VOID *Buffer + ) +{ + CONST EFI_PEI_SERVICES **PeiServices; + EFI_PEI_CPU_IO_PPI *CpuIo; + EFI_STATUS Status; + + PeiServices = GetPeiServicesTablePointer (); + CpuIo = (*PeiServices)->CpuIo; + ASSERT (CpuIo != NULL); + + Status = CpuIo->Io.Read (PeiServices, CpuIo, 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_PEI_CPU_IO_PPI_WIDTH Width, + IN UINTN Count, + IN VOID *Buffer + ) +{ + CONST EFI_PEI_SERVICES **PeiServices; + EFI_PEI_CPU_IO_PPI *CpuIo; + EFI_STATUS Status; + + PeiServices = GetPeiServicesTablePointer (); + CpuIo = (*PeiServices)->CpuIo; + ASSERT (CpuIo != NULL); + + Status = CpuIo->Io.Write (PeiServices, CpuIo, Width, Port, Count, Buffer); + ASSERT_EFI_ERROR (Status); +} + /** Reads an 8-bit I/O port. @@ -297,6 +374,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, EfiPeiCpuIoWidthFifoUint8, 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, EfiPeiCpuIoWidthFifoUint8, 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, EfiPeiCpuIoWidthFifoUint16, 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, EfiPeiCpuIoWidthFifoUint16, 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, EfiPeiCpuIoWidthFifoUint32, 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, EfiPeiCpuIoWidthFifoUint32, 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