From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0612.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::612]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A051281C60 for ; Fri, 13 Jan 2017 12:10:43 -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=z6bUSOthVAG23nHrh7OOaEixybBHE98IwlBmS6+dISU=; b=5XdifEyYBQZw9ddBQf9JCWpZn/A65jaiys7b58dZiLhKV8QvLP0o6CQ8oHfCkBvRpJiAxrXyKsNjzA2KZnNCOVHjcCQtidYfslpv/ofLC+2sp69hlIBcDnLqOMrWvzYW12x1qQDkXn2ztxF3pYch3IeSobVSVSHrM2nj9KIx8F4= 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:41 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 14:09:54 -0600 Message-ID: <1484338200-31337-5-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: 2129f6a9-23c8-48f6-fbd0-08d43bf04033 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR12MB1238; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 3:Rubj8PPx9pUAO0LVzsUY62pcvpd28GkUQu2KMjR9jezMByGP/N0AMjSM4+kWnJ32yoMqbbKXxU8GliUap2la3aBSCqB51tDH2N0eS/fdOhGiKn4ejzGhF8QuHwUMjhilvLrzmfiScijkbUUscRD7zEVC8f0INoGGz9MG2399GmA9eAnJDPH81BmcHoQsZodxbqMItDrH1z9XJD3UB9ZgfJ/HR+hprPsFTkpUn9c7lTIWTaSVhgy9FRhyK+pRyyZki/YYjQed8/WfRt1wXLiwDw==; 25:6AfdffJh28mVX1+GCu3sPURloPMMobOSiWIGKOKEcgF8kqWQOFoZDvPfWdDD3GqbCAdyjWInPTIdYfuEKIImX6bwwr7UVwQTgS6gf8P44Saa6XXTXRPKqAxxTn5hjCKVEepfGafWGy4UsC4PB9x7+mwlNdPWM/6pc8rVUyQyEc2r1W8MJpCT9atNDwvV8Ep+01xjor2esc79bNRzQYYdf3jOzaw1+9BHQPw/LDeN7RgKvPDKH7VmjAvWKFYY8NVCILIJK4grO+uVTii1jwL6x1QkL84MdFkC2okcixrnzkkIQ04xjgh4rDMkvAKesqJC821VWIivQtFRB01/PGhrq+gmQJuGvCpm6EPbiA59SIzoTZa2c85+SKFbn1Gg0ivBiQioqYqcNkZThhkC8FRErplXB++f/vnNYMa5iZX7MM/YhscA2AS1PL+K1xQ138c2pu/1Aizsv60f24L/uYl9iA== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 31:TDkMQaxO11iaCdKuiiMsdyZ63eJaf/G+N359HyQ71l/V98+sa4RqolSXeVLuy/IyWa+7H4On0wQIw9VpRFkHSK/PnY2aNMOgDhLAxkCX+djvQBbD/ztVKMPPr5YcKgH6OX2EM264TiwWKWgBFijsgci3IAYHf41EZCFcw42dpu6bCD9kDVwre2JApPyWBwsKX0d0AFOTPay/rJn4olsmEw9rKvegQTocT/NTWbqsI5u+ljgaxJdac8MBkus/oV0HoUqj82qLGidoiL7pMmqOkg==; 20:YNYafd4l0wy1m/SDNCVVNP9rl3CRcO8MhbgVUzl9SHOdPSaLXh5EnsaPiZw5m51i/YzwA/2NOE0HyN4GFFO/OASYhAPH7uweCN/qKqCbSTQYos69vSZgfv3uqWU6gosNo5JjtVNFIkq2klShn3XrLnQXJYLDbPMuao+8W4Nm4Ej3a3KFn7l0aje/Nk/Nx+ag9A2/TM9y9kK0O/LlaVc6kOrqqx1Nbng0SPks4vzfp4rnX3qDQ1zJolhVvzycX1JaXbAJME0Nxz5jcSwfCy8xfSCosDV/OSQT7rs3If/NOX4eF1xsUJqRbMxjdjDLqsOfELkBxKick/tTJH2xtuJcqhEHZGHYr0ChRzSFNBWbO8T7pBbpk5OiaOL99As9Go2CWnW+bdmUeCQQ3hJj8PJnJJkT3GVJPWBGIJ40Vj6C0e6SJIXskjSGB6FlK9lHeFgexu0lO5MylrTKUUinbrV0YnL4t+q0nE7ttlAv3X+dE4OFkyGbbeT5i1JMm6aOTV00 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:u+2G8pbZFZSYm2FQYcQuF6ROItGFhkY5vi9n2lsZDzFUF9jkJINcpqOiQMPSeoBNcL+VjeoQJRBei91Orw/vM0+9en9UwzO5ZzMqwiifiJpJkJYgVod57jNbEzCK+duLiJeX7h7I+JRZkL0PYqSy8wT6zuKF/T8OUlvkNJ+QomvLyaPw+A0UiSfFD0wp1+y5I1bQIq2Id3TI0oas2ZmTYVZ7HXbWl8ePlBGCqAFwqoIuNAb8XKElrzRkmsQgmCZ6tftsUjnY7ge9kZW4BnHHjxG5qKDN8djlKQeHnm+FXZ5GplETYEfTa22bzIHoCgBtec6tGoFhGstTd+2a+1mMfDCRLY5oX4Qq3/dGHYOd10RzIeYkMz/dGXX3YSlH47QfUx4XQBStpO8Q+U1OwBYNhdm6JaV2C4WW1Mxs8+YkgMw+8d95QBj2tnwb9S22ojo+ksAwCTAIa43zZ1JqC9fYoC/BvBmsRrIqJE9aV+zQEUODKI1f++bzvhpvaxXYJdRZRygTfpi5cYodJxlaQKH/qBqUdxYSzaaSn0TPhzbPF6iuJdvE+kaMXgQ1LMjGCW5otkJLXaJ/QtgKKkamOUmbifIVYqz8i7TrN5J4bfKSoENDgUsjDvUAzCsMnInSLJ9vqL7BrxWvZaHd6F+X/X95XwzkJWvPjdsjwcge894KWCk= 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:vylQ8wMmj095kFL4/PCp9hpo8eoQU8y2La2fRu8mJ?= =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DNEw==; 24:MC4pRKkeDdPmqG+gP6kxl/DyeTUysJSfRYrSoZCzKHspeSnA0tMvP1nZzIjqOEN9AF7CwXaZCSU9d1737M8bPpo0aqcFg5CNkkXqJda6HY4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1238; 7:E3XPHkbQrpchfCPpAQoznTH255xnCpKs9NyJg4nAz+ZhOUeN+pWkz1aS3jxILWIbZKrW7VXzX/1G3lmvac6WocKVlmt2U9VSxxHRJoq6r/HqPQmmzr/Yjrao1yeH2+EGCIEM/neORYfXKm39L//y/o0I5ce+ZpVz2CM/q88yA3yWcTYFwsPY51yHdRzW3pq6vTbemyC/UtKc6IqD2b9lRrpD2DMkzl3FWzHYLoXVF7+f+9p+TvlS5U5kHnCWjk9lsyMDKlQS9nhYZRgd5zfWSgPLtU+GC5uw5e96FFI6/1SCulcF3uspijmsvnhOPdwr/7e6cLspnCYLph2rCwUxJTHXPEW9EHKREOmGSdUc+LB4fRhw6sDyc9pWthZC0QDyUOOAGbzAJ1e/GqkjRh05mlWjhX+gx7pFsHGq6WDe1gBUHeR+zfdF+cSfXpvV+bKaokXVJ5vpUcRKhgQfqKtKVw==; 20:hr61uz/kvcnd8eP0r81RLffryFOwA3qJynKb9sPT6QXglAI9XB0VgwhgQT+SvOdj/g90MKlUyFDwSMrDIT1M9wUfqfJnog5UwDpbyPShn03asbPL1P92vbwlBvPL68fEsbjASWfluUhP3WbOVrvPuqixFLlznfrGUbk1rzq2GmpFrOYsW/t2cEGp3hjQ0mgURSvC6ieatVlQNYjgeZWZrKP3dIByyflU369RrUQH/EoeJOwsMhd/YtKrWCUUdRmU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 20:10:41.1402 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1238 Subject: [PATCH v3 04/10] IntelFrameworkModulePkg: Modify CpuIoDxe 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 20:10:44 -0000 Content-Type: text/plain The IO_PROTOCOL 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 --- IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c b/IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c index e48b638..9db9dbe 100644 --- a/IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c +++ b/IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c @@ -2,6 +2,8 @@ Uses the services of the I/O Library to produce the CPU I/O Protocol Copyright (c) 2004 - 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 @@ -410,6 +412,31 @@ CpuIoServiceRead ( InStride = mInStride[Width]; OutStride = mOutStride[Width]; OperationWidth = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); + + // + // Fifo operations supported for (mInStride[Width] == 0) + // + if (InStride == 0) { + switch (OperationWidth) { + case EfiCpuIoWidthUint8: + IoReadFifo8 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiCpuIoWidthUint16: + IoReadFifo16 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiCpuIoWidthUint32: + IoReadFifo32 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + default: + // + // The CpuIoCheckParameter call above will ensure that this + // path is not taken. + // + ASSERT (FALSE); + break; + } + } + for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { if (OperationWidth == EfiCpuIoWidthUint8) { *Uint8Buffer = IoRead8 ((UINTN)Address); @@ -492,6 +519,31 @@ CpuIoServiceWrite ( InStride = mInStride[Width]; OutStride = mOutStride[Width]; OperationWidth = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03); + + // + // Fifo operations supported for (mInStride[Width] == 0) + // + if (InStride == 0) { + switch (OperationWidth) { + case EfiCpuIoWidthUint8: + IoWriteFifo8 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiCpuIoWidthUint16: + IoWriteFifo16 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + case EfiCpuIoWidthUint32: + IoWriteFifo32 ((UINTN)Address, Count, Buffer); + return EFI_SUCCESS; + default: + // + // The CpuIoCheckParameter call above will ensure that this + // path is not taken. + // + ASSERT (FALSE); + break; + } + } + for (Uint8Buffer = (UINT8 *)Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) { if (OperationWidth == EfiCpuIoWidthUint8) { IoWrite8 ((UINTN)Address, *Uint8Buffer); -- 1.9.1