From: "Fan, Jeff" <jeff.fan@intel.com>
To: Leo Duran <leo.duran@amd.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"Justen, Jordan L" <jordan.l.justen@intel.com>,
"lersek@redhat.com" <lersek@redhat.com>,
"brijesh.singh@amd.com" <brijesh.singh@amd.com>
Subject: Re: [PATCH v3 04/10] IntelFrameworkModulePkg: Modify CpuIoDxe to support new IoLib library
Date: Mon, 16 Jan 2017 00:50:04 +0000 [thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C517029@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1484338200-31337-5-git-send-email-leo.duran@amd.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
-----Original Message-----
From: Leo Duran [mailto:leo.duran@amd.com]
Sent: Saturday, January 14, 2017 4:10 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming; Kinney, Michael D; Fan, Jeff; Justen, Jordan L; lersek@redhat.com; brijesh.singh@amd.com; Leo Duran
Subject: [PATCH v3 04/10] IntelFrameworkModulePkg: Modify CpuIoDxe to support new IoLib library
The IO_PROTOCOL supports Fifo types by invoking the Fifo routines in the new BaseIoLibIntrinsic (IoLib class) library.
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Leo Duran <leo.duran@amd.com>
---
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.<BR>
+Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
+
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
next prev parent reply other threads:[~2017-01-16 0:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 20:09 [PATCH v3 00/10] IoLib class library Leo Duran
2017-01-13 20:09 ` [PATCH v3 01/10] MdePkg: Expand BaseIoLibIntrinsic (IoLib class) library Leo Duran
2017-01-13 20:09 ` [PATCH v3 02/10] UefiCpuPkg: Modify CpuIo2Dxe to use new IoLib library Leo Duran
2017-01-16 0:49 ` Fan, Jeff
2017-01-13 20:09 ` [PATCH v3 03/10] UefiCpuPkg: Modify CpuIoPei to support " Leo Duran
2017-01-16 0:49 ` Fan, Jeff
2017-01-13 20:09 ` [PATCH v3 04/10] IntelFrameworkModulePkg: Modify CpuIoDxe " Leo Duran
2017-01-16 0:50 ` Fan, Jeff [this message]
2017-01-13 20:09 ` [PATCH v3 05/10] MdePkg/DxeIoLibCpuIo2: Add new Fifo routines in IoLib class Leo Duran
2017-01-13 20:09 ` [PATCH v3 06/10] MdePkg/PeiIoLibCpuIo: " Leo Duran
2017-01-13 20:09 ` [PATCH v3 07/10] MdePkg/DxeIoLibEsal: " Leo Duran
2017-01-13 20:09 ` [PATCH v3 08/10] MdePkg/SmmIoLibSmmCpuIo2: " Leo Duran
2017-01-13 20:09 ` [PATCH v3 09/10] IntelFrameworkPkg/DxeIoLibCpuIo: " Leo Duran
2017-01-16 0:54 ` Fan, Jeff
2017-01-13 20:10 ` [PATCH v3 10/10] OvmfPkg: Modify QemuFwCfgLib to use new IoLib class library Leo Duran
2017-01-14 13:00 ` [PATCH v3 00/10] " Gao, Liming
2017-01-14 22:19 ` Jordan Justen
2017-01-15 16:52 ` Duran, Leo
2017-01-17 3:07 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542CF652F8836A4AB8DBFAAD40ED192A4C517029@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox