From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0619.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::619]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 681A981C15 for ; Thu, 12 Jan 2017 22:21:24 -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=yJydLLvvbCrxLEV0uoaymj1TY6SJlpighxkZISw7cXrDYVxn/51M4bb8Y+SlHBtNgt2wljevlkBiCL/rl9ZhXIak+MX66/zTSkICGtHAq6BHoZUhfgPKNEIOe0Ky8Neunt+LtL21dJxC31o4ZYs8fA5JcqAgH/y+UzdM1b4wwTE= 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:22 +0000 From: Leo Duran To: CC: , , , , , , Leo Duran Date: Fri, 13 Jan 2017 00:20:57 -0600 Message-ID: <1484288463-7109-5-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: 5099ba9b-d2ac-4005-1d08-08d43b7c65b6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1235; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 3:cuH5kO6IQAMGR2uDXpxZZvQck2mtb6jvEAWM0YTBJAeGl7pjuPHiOoZB4r8VRNnuN5sHzOfw0N/mOqD2GU8Z0+xIWFQ6nxxvv5HIMqe4US+O89l7sDsojmGx1hrvOj9ZuNoZI7O0OIR6h7a9lYHfWx4fqibdwPqeDtaox8a8IkDtP/E4V/bZvkHXonuRHAgL2SJ7v7DUHKkq0BJ3DWBvh+vG8RGF01BVYnZrpMX4gjxYikHwfyj4HuJaBIevoQkGsHVBT20ULic2I7IP/SHI1Q== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 25:B7CzNgb5BWlpRphigj8BCVkre/qqZ7HwKxbBKUxLk3iNOBXnxGvjWCAbSfKlX1cK92+6A6/2fI7Bfn0ovdcwsKDpVSvwKvIfoaZlHlQoUTCWd0qjYLnYFb394W3UVZ4/nAErkgJOW5DZ+1lJx2kJubulw8WCoRzSnpAhh9OPWecMnxdf1u+WcGykOyWRRra2e3ONCtNGxaKq1JmM+KkQE+NiJQ1t4Z6yVzieVjCxc8WL++QVP27KW+243rI2nlRSa6YUEDkmeeZytzl/Mk62sTZsc55ggmJzaWV8WD0eGKHjmPfMlDMCQ/lsNGDNSoSDBW4kGPrNloZvLweK0yHIGMlI0TBJNZ2Kr5KqOvpqvjadS2V9KfamlfxMKOjEgP3t40syUPDgsLvFnYXHEaxVXjmgLdY4Igxz2VlLAGIdUHBlHasp9PFlozgcUdP7vATu4bUocpJ4JTGmKrBRrlVIE8l/Dg1Y94PSe38JDedwV89ZrE/y6gyD711Vv5lqPexbS+aF3KFeoc2fPhLtUnIseg3SITXEgEoiv40+A0CJH2ciMgdfmuMguO7wME+IjnLdzf9wCyrZvWmSKRz+OItffFvT1a4zAfFS1iqpsRnCxc+N7Z5KjhC2FAaMp1YNzTiQFVzWOqqZJylS7pLIAJMUKAhbSmGyVFHOIQmHcFQlletmasqMeNlFsezTJzym94BLrWdUWOo2Lh+0eVXoe+/cQdgglkyroq1ImfDGLIaNP44D+3KuksjDfmE/KLb6Tnj4mgXJEK42aYX1s2ImkvzTuQ== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1235; 31:J4VdWqv1HDp2F07h+lgic9xmQ9Dy64BSCTBrXlrZzfwtTlH0IDQrpZs4GwLRrlsjjooztFSOtgsV6r+zEBsCpNijQRTCR7TjlOvNg9X7Mn8E7CsZmdnG/hF3Ew7+KgQaHojGvSqg5x51KGGWeFT/J+3yICoowfc0e/lGf2+tQ92Il4EOe7pyYonxtORK0U8n+7cqda8KEMLSnLyR4/KhhjogHI7xH2I8aWO888SdZwz4lNxzV7ewgfwCTFSlOipEBjsgK7NEYgEZCxpmpVCtNA==; 20:ErwqtOSh5ZpQmQKAKeBydzvfUqQvKJkgXh5Nsv3zCtpXXjOYz9zOVaDgBX+h5JtTnBOihvgft+ADRAgVtIbWUiuEFxIBFPt8HfH0tfY/0ko6U994kmuJ4l6q2cQ7DJITtG9KIem3Dsd4cAaEfAEKSZbsRIDdgC9R0mRRwVlPe3qm01sZpqZE7+b/3lXeFVAji6v/e34AjlOTMCt1iS3DMWA798MuQsgudrNZDdREAC+cAnMUkdkd9SMnwb6dw4ykHJjAw5RWW7LyoLWxrW0ZjSEzecUicOYAifX9fKwbtcdS6fS912cmo710i9Tux3Z6AfNt8uRxbAOca7CTMCQtgO/lLrkE0vxjNGdP2TwO4pe4rp8MKjPTq5gDTwXSK0+sKFHlJ9iaFitzMZRcUB1L/N02YecFxozs74B5pr1vEAdh2sg3+XUGQAzz6dZ3VfFAxs6cU2bejNpQvyRZHtsdrwd5X/ri9a8MhLBRZtatzdkaLLj41HS0cEJb149kxujj 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:YGDOSytYGDiaD8OIkXhkfCMgV3GpqNHS7OK1YjzvUqPI5IoB/XKd5DOPUrFOCitkJnlKH87kT4MJSaEVFi1VerlUEJ4sWp0bR35x5mw2/3BSnzNcvJNtApaucP9rzrkjIUt8QgKls2AC6l29etuyfz1ehPOMPbzQkB/SnOsC9CH1JVYZQB0zSpG2uO70SBGv/aC+6aQbA+Cxvkgf31LUIJRiqoSfpMYPINLxwaG8rnCMoKLBiqZwxSoiw03bsKCjd8buuprq3w9gOiCQ/ih/j9BA/c8sQRTbyWvvklnjusLXodXMvaqcrnnV129v8FBbMFvX24/X3Zx37G7KybOkuuYTVH9ofT3jzFcNgT9RKMNQfqjH6p7kzQwPFqoE06pq321yqOZquN0jMeVqiUWRg4dGZ2r/IB3qvderRETMx0uT/1ljqk8wIft0OknrPZp8dOaxJ6wwrNLzndje+dreEBChDAYAxSdLn5CGgLNpr3ftXvejLPZEyujhfYF1FDS4zxJ9tMkKsILyQelaY04bg5khunelfwV7CAGLp4idnXelOV6NxRiYExm084oSkrEByLFolJRJd+KCYJj/ULrIaIVykFY5KwC6iN5TcN+N64x+KAS75kWwm/fAt7R2UCwZHsLrEny961Q/mb8NJE6MMHNRGo4uh88vU+7QZPrX8wc= 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:9w19M0VGdMXHo7DnCsgAIZxcoQK1gefUurjildQPY?= =?us-ascii?Q?3G7Ohi8NGqDcNmCmgST2xMi2Hry6ahVA96XFtAteiu0/kLz01z7Ul4s0G1CC?= =?us-ascii?Q?yCGLd/ab3j2mwdGolevGYJ8ITAplSLA7W+1AY7iKi6V2nlBwEtfVEb8AKgRy?= =?us-ascii?Q?sFv4WXbd9J8o++rgFSCebedouZ3MzU/w9+gw0rVSPt/Q1p96tyAByceSaJmX?= =?us-ascii?Q?Zi6fZo6sl4Ri+XhsGDBEmIXVBwJZ1gvcE+WdfCWp6YjYdFSHIy8HIr523Z9Q?= =?us-ascii?Q?zXYNgPtx3Ex86hWGWZ9iRlbJsOTgNklGoN5ApckRG5gyezvSsWsOT1d3uAN2?= =?us-ascii?Q?Y1SerSM9VoEX/ECgpLxcIVLCiV1IDeDPEtxhEsEfHQ7NOonPuH53oZ+SguZV?= =?us-ascii?Q?VDMKmBUOsUY3LAOFbHw5L4t+lYbHS6QKZ+NQJFwCola4GE82ykPMAlztITAu?= =?us-ascii?Q?Q8kqdV+d5j9BNpoXIyYNWGaQT+gyv+In8elNs3L8xtYh07CrngdSsttQXEzp?= =?us-ascii?Q?0TLLAUMVeZPsNeEDCPhBC4w0M7ldoQ+eQ5DAwuCsksZO7VWT4OVg3RMyQprk?= =?us-ascii?Q?pcTP5cfi6vXLjeQ+jJOlp3ohR19zLUkiie61r7ti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H1dZZ4/tHgxnIO6Gb1bPE0O59WL3RLPleZKWoScFoEvDYvJJoni9GDvyROELGDCYyVsgXO016Z0XfMydhAnFmRBtn6ORoxIONpWV/9WolCtxQ/PT5NJl9BbgUZg2oXI4fv5UUWCWLDixQ36jaE/vJGT+iIywBsni1VcdktBfr+G1zClQm1ocpQs9ihT/P8TYUcEphjiCwOChqAHO+0q5wR0LO9055X/N1HQOvafs5J6cXpUDz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 06:21:22.2709 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1235 Subject: [PATCH v2 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 06:21:24 -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