From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@ml01.01.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 4/5] ArmVirtPkg/QemuFwCfgLib: rebase lib instance to OvmfPkg/IndustryStandard
Date: Thu, 1 Dec 2016 18:56:32 +0100 [thread overview]
Message-ID: <20161201175633.2538-5-lersek@redhat.com> (raw)
In-Reply-To: <20161201175633.2538-1-lersek@redhat.com>
where "QemuFwCfgDma.h" was added in the previous patch.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 24 +++-----------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 2fd8d9050566..62a85dff328e 100644
--- a/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -25,6 +25,8 @@
#include <Protocol/FdtClient.h>
+#include <IndustryStandard/QemuFwCfgDma.h>
+
STATIC UINTN mFwCfgSelectorAddress;
STATIC UINTN mFwCfgDataAddress;
STATIC UINTN mFwCfgDmaAddress;
@@ -53,26 +55,6 @@ STATIC READ_BYTES_FUNCTION DmaReadBytes;
//
STATIC READ_BYTES_FUNCTION *InternalQemuFwCfgReadBytes = MmioReadBytes;
-//
-// Communication structure for DmaReadBytes(). All fields are encoded in big
-// endian.
-//
-#pragma pack (1)
-typedef struct {
- UINT32 Control;
- UINT32 Length;
- UINT64 Address;
-} FW_CFG_DMA_ACCESS;
-#pragma pack ()
-
-//
-// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding).
-//
-#define FW_CFG_DMA_CTL_ERROR BIT0
-#define FW_CFG_DMA_CTL_READ BIT1
-#define FW_CFG_DMA_CTL_SKIP BIT2
-#define FW_CFG_DMA_CTL_SELECT BIT3
-
/**
Returns a boolean indicating if the firmware configuration interface
@@ -183,7 +165,7 @@ QemuFwCfgInitialize (
QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion);
Features = QemuFwCfgRead32 ();
- if ((Features & BIT1) != 0) {
+ if ((Features & FW_CFG_F_DMA) != 0) {
mFwCfgDmaAddress = FwCfgDmaAddress;
InternalQemuFwCfgReadBytes = DmaReadBytes;
}
--
2.9.2
next prev parent reply other threads:[~2016-12-01 17:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 17:56 [PATCH 0/5] OvmfPkg/QemuFwCfgLib: support the DMA-like interface Laszlo Ersek
2016-12-01 17:56 ` [PATCH 1/5] ArmVirtPkg/QemuFwCfgLib: remove superfluous InternalQemuFwCfgIsAvailable() Laszlo Ersek
2016-12-02 10:58 ` Leif Lindholm
2016-12-01 17:56 ` [PATCH 2/5] OvmfPkg/QemuFwCfgLib: move InternalQemuFwCfgIsAvailable() to lib instances Laszlo Ersek
2016-12-01 17:56 ` [PATCH 3/5] OvmfPkg/IndustryStandard: add QemuFwCfgDma.h Laszlo Ersek
2016-12-01 19:34 ` Jordan Justen
2016-12-01 20:48 ` Laszlo Ersek
2016-12-02 1:01 ` Jordan Justen
2016-12-02 10:05 ` Laszlo Ersek
2016-12-01 17:56 ` Laszlo Ersek [this message]
2016-12-02 11:03 ` [PATCH 4/5] ArmVirtPkg/QemuFwCfgLib: rebase lib instance to OvmfPkg/IndustryStandard Leif Lindholm
2016-12-02 11:35 ` Laszlo Ersek
2016-12-01 17:56 ` [PATCH 5/5] OvmfPkg/QemuFwCfgLib: support QEMU's DMA-like fw_cfg access method 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=20161201175633.2538-5-lersek@redhat.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