public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Marc Marí" <markmb@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Drew <drjones@redhat.com>, "Stefan Hajnoczi" <stefanha@gmail.com>,
	"Kevin O'Connor" <kevin@koconnor.net>,
	"Gerd Hoffmann" <kraxel@redhat.com>, Laszlo <lersek@redhat.com>,
	"Marc Marí" <markmb@redhat.com>
Subject: [PATCH] QEMU fw_cfg DMA interface documentation
Date: Thu,  6 Aug 2015 13:03:07 +0200	[thread overview]
Message-ID: <1438858987-29566-1-git-send-email-markmb@redhat.com> (raw)
In-Reply-To: <1438858816-29385-1-git-send-email-markmb@redhat.com>

Add fw_cfg DMA interface specfication in the fw_cfg documentation.

Signed-off-by: Marc Marí <markmb@redhat.com>
---
 Documentation/devicetree/bindings/arm/fw-cfg.txt | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/fw-cfg.txt b/Documentation/devicetree/bindings/arm/fw-cfg.txt
index 953fb64..c880eec 100644
--- a/Documentation/devicetree/bindings/arm/fw-cfg.txt
+++ b/Documentation/devicetree/bindings/arm/fw-cfg.txt
@@ -49,6 +49,41 @@ The guest kernel is not expected to use these registers (although it is
 certainly allowed to); the device tree bindings are documented here because
 this is where device tree bindings reside in general.
 
+Starting from revision 2, a DMA interface has also been added. This can be used
+through a write-only, 64-bit wide address register.
+
+In this register, a pointer to a FWCfgDmaAccess structure can be written, in
+big endian mode. This is the format of the FWCfgDmaAccess structure:
+
+typedef struct FWCfgDmaAccess {
+    uint64_t address;
+    uint32_t length;
+    uint32_t control;
+} FWCfgDmaAccess;
+
+Once the address to this structure has been written, an DMA operation is
+started. If the "control" field has value 2, a read operation will be performed.
+"length" bytes for the current selector and offset will be mapped into the
+address specified by the "address" field.
+
+If the field "address" has value 0, the read is considered a skip, and
+the data is not copied anywhere, but the offset is still incremented.
+
+To check result, read the control register:
+   error bit set     ->  something went wrong.
+   all bits cleared  ->  transfer finished successfully.
+   otherwise         ->  transfer still in progress (doesn't happen
+                         today due to implementation not being async,
+                         but may in the future).
+
+Target address goes up and transfer length goes down as the transfer
+happens, so after a successful transfer the length register is zero
+and the address register points right after the memory block written.
+
+If a partial transfer happened before an error occured the address and
+length registers indicate how much data has been transfered
+successfully.
+
 Required properties:
 
 - compatible: "qemu,fw-cfg-mmio".
@@ -56,6 +91,7 @@ Required properties:
 - reg: the MMIO region used by the device.
   * Bytes 0x0 to 0x7 cover the data register.
   * Bytes 0x8 to 0x9 cover the selector register.
+  * From revision 2: Bytes 0xa to 0x11 cover the DMA address register.
   * Further registers may be appended to the region in case of future interface
     revisions / feature bits.
 
-- 
2.4.3


  reply	other threads:[~2015-08-06 11:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 11:00 QEMU fw_cfg DMA interface Marc Marí
2015-08-06 11:03 ` Marc Marí [this message]
2015-08-06 12:12   ` [PATCH] QEMU fw_cfg DMA interface documentation Stefan Hajnoczi
2015-08-06 12:22     ` Laszlo Ersek
2015-08-06 12:29       ` Stefan Hajnoczi
2015-08-06 14:08   ` Andrew Jones
2015-08-06 14:19     ` Marc Marí
2015-08-06 14:28       ` Andrew Jones
2015-08-06 14:55         ` Laszlo Ersek
2015-08-06 15:13           ` Marc Marí
2015-08-06 21:08   ` Laszlo Ersek
2015-08-06 12:27 ` QEMU fw_cfg DMA interface Stefan Hajnoczi
2015-08-06 12:37   ` Marc Marí
2015-08-06 12:40     ` Stefan Hajnoczi
2015-08-06 15:30     ` Kevin O'Connor
2015-08-06 15:53       ` Marc Marí

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-all 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=1438858987-29566-1-git-send-email-markmb@redhat.com \
    --to=markmb@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanha@gmail.com \
    /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