From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::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 36AB181C3B for ; Thu, 12 Jan 2017 22:21:23 -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=ZNuC1rdLSxz/lG3Z3CgyyBM8dpRQQ8wyf1QhR21WP/M=; b=Eb1PdOMf8eVzKmjOh54vfE9/jUNy1mleB6w4qqudA5U2ErGJyMsV2p4iARhxNdIzAUgv/ehJRHuPI4udks9bheHnS5fvUqF9AEsj94+w9wOJM9zQcMYpg1GqwUEgCpSPZtCWzTk+OMyYjYj+C1RAwVYzp46TTRTkd0yF6YDH3zQ= 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:20 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 00:20:56 -0600 Message-ID: <1484288463-7109-4-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: d242ae0f-16f9-4466-4460-08d43b7c64c7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1235; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 3:EVUwZ/3216hgSD7oSQ2sh8mxHGn8Em3bw2JmP9eRoqPps781dTy/o31pNeG2XafGwar3xY7voHxInLUQ0ylUOYPnsRD5yPteu3dykuHmG/7L05uktJJFPiPwcyEU4GN0taUls6ktQMBIq0YCF2XLsrNNnSqW9FoWS22yB+/ZcpUthKADrpYqPrPFuQKg5KxNSVoB2fMIMoCz5TawIbT9Thu2G/cA9DT9aFX1Qr4dko1662PhmUxGiRdViH7gWXEwNrH2DwPbOGzhcAHhCvv6FQ== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 25:2bOUOeCfq/IbZanXOndd3ftcOLjvbBIV2Or1tpG3iMbXA2trUmo8dikYyPMC2HzVU5G4NhAja2gbT7/dpiPrgFq4mV78dS006Q9i37UDEsAf34fNZO4FFZKlpI9ryVqqr/fmf30crksBbiaog5gqr1hZCMCmwMlsWgzCxEvuxXg5iiB3dhXP9G78iaxasG7MpomainSiu7DTW+DQmsRbPXoXfGHIqiQtQh/47uEC/Zu0LLFdndRJ3nRKcfOn0bgs2k8niVyEDduCPVeOXfSNaF4RIeT9I9BopgS91E3sGOqkv1TfJg98q2ekRtnBspZye8Jk+IoN3imOaJDPxUhUwBfI0EQKd10lK7zKDI9euFtX6zTW49YfnAGGMYNTzTQa65+wpwACM2cWmd8YtevZiO2gn3fBm9PcsQhpo6KI/tQGw0WRibjb1Ir6vqz2zE/S175PiUEbkHkSbM9CoyQxSqSAEKkie7C4+/PuwN2+VeY4GVZGcWTcq6/LDIA+H0x+jOJ5SKKDsZiGCdBbuHGw4k6d6/oIPlVPm+4B2J78TnM85qx/a+M5D3p3Fd+0QhDCL/P9rpGhzJ5lse6JN5yULtJllcqhU5lHTYINgoa6q/SYlSXgXyYTgkpbfs5k4SmN/Ez2lTU3qmjEXNjolw1m0ah5mlEFUGlzYs08jfqy0n1H9ljGFaLjvZY0+PgsFNqVBibhh17m88dPxLp9Vvm3KqJ+X2DmN+XkugKObbEEZ3TA7rQIj8zwHGAsoKdnWQXl X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 31:pmUSGtStxocndD58p0epOrLfobUNMP4MDbqXAMrq5Fr5B7b/eXOsihWmyXiju7kKPTL94MHIL2bdoIMDC2c1/+kbG4uNkD8px/k42o9jVJeBBqbrj83nzUvYT4r0L6m6yLNF3kTJWE21DHyACeP2hSzcglkcQYj5hVxg0t2HAwX+SZ1krFv6pSDawv0S6LjG56OGWTe19Skq0CBvxqkG74l05SJxxUAyBvyTv5k03EHaIlb3MzecBLga2a/n8BpBmlTxJfn4WATYhG64KehBKA==; 20:Ts9QSS80OUUuv3l5nZkCLO3OVk5S2XdDDIQxZbTx+1AeyR3M/Xl3RJ56ovR4cYxERzEVsHuT7t1heYTP3Do4GDmj7RXv4RKJZIwTKFOkl8HPERSSZnC2fszZ/i7CE/jYBLcgnt16TmJ90RE4G85lCMK9PWbcWz3ZdvivGTqC2y5u4KaEcUS0zIIUz3rJINEzbPsOGcsDoqFcPyOCUducbLjSh2cN8j3xirc7JfzW2p/VCTyv45Dg/xHiFSGlhCXfrCSeMF8+mkxJQwojZPj0NHI9pCDqZZ+Cbz+M2SddKqmeRgoxNHxyhAXaLQrGaaqaK8Bn2Un1O2gM1VDKe9OZ5XyZHZDo0QJLALk7Ls6U3zByzTpPI987btjPd4raaE++ULE/l3W7v4XhMsclphqkQeb+HtxeyBcIzpAkttnQekSMkMKmGKvBaCN9HuayxBTAVHdiLjGCiZ+8NBNDD2FWiBN+d7kAPlL5SndkXlM+3FQyCjE7tm1Fnqn5yWwMV1ln 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:kp9bIH4e0T30FXUGxiis40+TUdXcxGEHTJ212we39cYx3g7oVAFgRqe0JcyKVtFs5/A4OLt6D36dY7/7euxhrtohYglKXXNA0n1Z1PYALN1EWpR3o5vy5/2fXtEeftiPA8wj3R2BbMiswrCLXd2BRwh21QTVKbAesoVCgB8ntdR45XggWOcaouiqIiRCSQ9xuoIsBPsgChKkJNV8+6pC/M4aeUfH2UUiXvJcWWu3KQZcI7XGBbqgT4xkMrzfLLiGlF+VfeAH2+fKMJ3jQAkySFQV0clXEHtJmSXf4cScRv8jmug1O0PATWfNFpzzvv/1EnMWxOK3tCKUqA77PFj3kxk6TY99AnwrTvZG8EAuszdoHNrB9Ywb4g12/bjNVkWt2uf7K6DO016PcmwxbsWSqVnO05Z2oQN5Oko1EgFL+iXXr+z23/7cv1qoyq9SSH1LclbOYifmzNLVOp8uLCE18nCgy1sCZthypxHwJQk2p2D037R/g4ESaLm1rmHPwD4EsI1Oo1MAVdyaZfEeM+Xu2ZYkTxnikCSP69CN9f7DdDctC3+Tj7d17NYhq6VVhiM5G9mmig9rXCNARGI9KvQAAmgKZdto9yEB1dY58ZFsfvYxH7SYZ16LYLuEE/XsdL1pnePmIFkfZJHezAmjNmFWhqob9ppkUXrRwJhjUfUuJgI= 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:jI4OUNDfxKWMe7amuSLSIgTiAc7DZoE7YGJp+y9Gy?= =?us-ascii?Q?52LwGzgtNcnpXBrWKwmHmeLgDF/1QT2pCGkmpkuK4JEO5uINZW9XG9v7CMdN?= =?us-ascii?Q?5hZhx/TVPL3Bzm8Zf1xYCZgIusMj0JQiATnl2vLpKx05aLhxwno1p4EEBmwF?= =?us-ascii?Q?9t7l0/f/REhoi3Giv1oZXJynn95dK5Mrftk5Wsf8s+1rMrUQKQT4tairFkk4?= =?us-ascii?Q?8R2mUdN5zWy7s/wfi69AjVjn+xFMWat2cShDIS7/QLs6Efc/yQzq8jhbZ24d?= =?us-ascii?Q?1PZAFw+Gs2YWsHq9EwbHqak6oy2xd/mpSwr6Bf5WJ0fo2DI8dU86T+pbWoDx?= =?us-ascii?Q?CTWXf3sRlkOQ1tKCxOZkqHNi0uo3XdktIZx2P3jcCNo5mk7+645YREuDz11G?= =?us-ascii?Q?CZaTHxaLNLecHHupK4y9B0CQ5NiIXLF+TiyUKF7yrcyHhK+pF6NvlWRLQJ23?= =?us-ascii?Q?pI+1eURkF/XxZAU5RcTb1rV3nKrI+J52QK1TxdJulPnkzZWGwrAmMY+LLRJs?= =?us-ascii?Q?6AmMdFIibosEfwoculqzStlfSskvYzlO9l9HTs2D5Z/sOXe3B0j1ruHSPYw7?= =?us-ascii?Q?1KeRE3Fh08lZK48rP/4bvY7db2BXwgDORGkMcUZMmF9upA5Vz6wJwnhvqD7J?= =?us-ascii?Q?8atqGjBbUpDORbKeHJGo86vg/8/J+dBx254Su6Bs2tnIrjmCIWUKOHofPlUP?= =?us-ascii?Q?uCA/6ngTEh+n7rb8bk+yEDzaEwcFkyyWUtjrb6yZ3CEDBdsLSk0OB57hsgPq?= =?us-ascii?Q?78cv+83ejWKNoXfbYZgxVZH2D4boL2O8uwO45o84lHWlvlXvgg13ceYA/P2d?= =?us-ascii?Q?0LGgouR4npAc83b/kxV/4UtCVyli2KzaU4g1TItnbLwaKbxEMeOlg6NFIUFr?= =?us-ascii?Q?jrPBvEJrtaD1Mm1T5LMpbvajT7BL8Lk09lKPUORnD5zXxlHuZfjR8CTTOShv?= =?us-ascii?Q?GRDCK9Dp7V3tbFdJ2abdmPaZO+CmFj6nLsBYEmklNPQEEXI2GaVWQ4IJ5xPm?= =?us-ascii?Q?cxw0ypc1L2Brfp4cWm2p8pg0h6QAFItj2CXembssjIgcxfylN+areuDYOb+A?= =?us-ascii?Q?HqlHjrbc9yPfyNuzQishM9S6TImrTsmojqeJ3AgS4sLxiASi9V09f+myH7SY?= =?us-ascii?Q?+/lV/Cr84N15ODGmpTUWLw9MCCWGVW8R3KTmRNjM3AVb/tg45MdFTorfyjXb?= =?us-ascii?Q?7dOXa3xHeqylhTfXTF/WKwBcpGRqscjEameJvihATpysGTGjia454oRoA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 6:dx+dE2SJKMXq16tIlRf/Zeml2rp8HEAydnZ22+qQpV2+iZEzBnaM9hpYxLIG+9wsrfCy/ty3UMeoO0/z2QeUXPpkwLkP75mS61eSUxeeXReJkmyMLpSV0x4ND1IS+wOF3y9POz3Oo/kC6dP8YNiO4sf7+FKqi6UO6bWyyakYMU+KenB49UPaUvBTPBqSD/FxXOdnp3vlDxLySdRc9ttgdoGGD3hy9dhGGu1eDEDlAS02TYBvGNsZoPOJ0qbgkdNf5S0PG3yVUJnqR0GWokARYzbzZRc4a6of5X9I8e0h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Bm9t03Ip+PQnh/Nx6/WSo8Dnw0v43OSQ8arTsW5Ettjp0KzmMTumzKn9lazW5OlFxrJ0ggpjfj0XSuSMmiYqlm06WFmav74jnsjAxRcXE1E64CiZjiL6NwuP3dI4ROwIWALj2DFpLnicvYRAkedhsJOzTKmgiYh426WMIFXjKbwUUrf97oupOiHa X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 06:21:20.7046 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1235 Subject: [PATCH v2 03/10] UefiCpuPkg: Modify CpuIoPei to support new IoLib library 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:23 -0000 Content-Type: text/plain The IO_PPI supports Fifo types by invoking the Fifo routines in the new BaseIoLibIntrinsic (IoLib class) library. Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Signed-off-by: Leo Duran --- UefiCpuPkg/CpuIoPei/CpuIoPei.c | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/UefiCpuPkg/CpuIoPei/CpuIoPei.c b/UefiCpuPkg/CpuIoPei/CpuIoPei.c index 3c5c8a7..b6d538b 100644 --- a/UefiCpuPkg/CpuIoPei/CpuIoPei.c +++ b/UefiCpuPkg/CpuIoPei/CpuIoPei.c @@ -2,6 +2,8 @@ Produces the CPU I/O PPI. Copyright (c) 2009 - 2012, 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 @@ -375,6 +377,31 @@ CpuIoServiceRead ( InStride = mInStride[Width]; OutStride = mOutStride[Width]; OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03); + + // + // Fifo operations supported for (mInStride[Width] == 0) + // + if (InStride == 0) { + switch (OperationWidth) { + case EfiPeiCpuIoWidthUint8: + IoReadFifo8 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiPeiCpuIoWidthUint16: + IoReadFifo16 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiPeiCpuIoWidthUint32: + IoReadFifo32 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + default: + // + // The CpuIoCheckParameter call above will ensure that this + // path is not taken. + // + ASSERT (FALSE); + break; + } + } + Aligned = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00); for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { if (OperationWidth == EfiPeiCpuIoWidthUint8) { @@ -447,6 +474,31 @@ CpuIoServiceWrite ( InStride = mInStride[Width]; OutStride = mOutStride[Width]; OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03); + + // + // Fifo operations supported for (mInStride[Width] == 0) + // + if (InStride == 0) { + switch (OperationWidth) { + case EfiPeiCpuIoWidthUint8: + IoWriteFifo8 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiPeiCpuIoWidthUint16: + IoWriteFifo16 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiPeiCpuIoWidthUint32: + IoWriteFifo32 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + default: + // + // The CpuIoCheckParameter call above will ensure that this + // path is not taken. + // + ASSERT (FALSE); + break; + } + } + Aligned = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00); for (Uint8Buffer = (UINT8 *)Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { if (OperationWidth == EfiPeiCpuIoWidthUint8) { -- 1.9.1