From: Laszlo Ersek <lersek@redhat.com>
To: "Marc Marí" <markmb@redhat.com>, qemu-devel@nongnu.org
Cc: "Gabriel L. Somlo" <somlo@cmu.edu>,
Stefan Hajnoczi <stefanha@gmail.com>, Drew <drjones@redhat.com>,
Kevin O'Connor <kevin@koconnor.net>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 2/7] fw_cfg DMA interface documentation
Date: Thu, 1 Oct 2015 16:41:53 +0200 [thread overview]
Message-ID: <560D4631.9030109@redhat.com> (raw)
In-Reply-To: <1443701819-13855-3-git-send-email-markmb@redhat.com>
On 10/01/15 14:16, Marc Marí wrote:
> Add fw_cfg DMA interface specification in the documentation.
>
> Based on Gerd Hoffman's initial implementation.
>
> Signed-off-by: Marc Marí <markmb@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> docs/specs/fw_cfg.txt | 65 +++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 61 insertions(+), 4 deletions(-)
>
> diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
> index 5bc7b96..2d6b2da 100644
> --- a/docs/specs/fw_cfg.txt
> +++ b/docs/specs/fw_cfg.txt
> @@ -76,6 +76,13 @@ increasing address order, similar to memcpy().
>
> Selector Register IOport: 0x510
> Data Register IOport: 0x511
> +DMA Address IOport: 0x514
> +
> +=== ARM Register Locations ===
> +
> +Selector Register address: Base + 8 (2 bytes)
> +Data Register address: Base + 0 (8 bytes)
> +DMA Address address: Base + 16 (8 bytes)
>
> == Firmware Configuration Items ==
>
> @@ -86,11 +93,12 @@ by selecting the "signature" item using key 0x0000 (FW_CFG_SIGNATURE),
> and reading four bytes from the data register. If the fw_cfg device is
> present, the four bytes read will contain the characters "QEMU".
>
> -=== Revision (Key 0x0001, FW_CFG_ID) ===
> +=== Revision / feature bitmap (Key 0x0001, FW_CFG_ID) ===
>
> -A 32-bit little-endian unsigned int, this item is used as an interface
> -revision number, and is currently set to 1 by QEMU when fw_cfg is
> -initialized.
> +A 32-bit little-endian unsigned int, this item is used to check for enabled
> +features.
> + - Bit 0: traditional interface. Always set.
> + - Bit 1: DMA interface.
>
> === File Directory (Key 0x0019, FW_CFG_FILE_DIR) ===
>
> @@ -132,6 +140,55 @@ Selector Reg. Range Usage
> In practice, the number of allowed firmware configuration items is given
> by the value of FW_CFG_MAX_ENTRY (see fw_cfg.h).
>
> += Guest-side DMA Interface =
> +
> +If bit 1 of the feature bitmap is set, the DMA interface is present. This does
> +not replace the existing fw_cfg interface, it is an add-on. This interface
> +can be used through the 64-bit wide address register.
> +
> +The address register is in big-endian format. The value for the register is 0
> +at startup and after an operation. A write to the lower half triggers an
suggest "least significant half (at offset 4)" in place of "lower half"
> +operation. This means that operations with 32-bit addresses can be triggered
> +with just one write, whereas operations with 64-bit addresses can be
> +triggered with one 64-bit write or two 32-bit writes, starting with the
> +higher part.
suggest "most significant half (at offset 0)" in place of "higher part".
With those changes:
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks!
Laszlo
> +
> +In this register, the physical address of a FWCfgDmaAccess structure in RAM
> +should be written. This is the format of the FWCfgDmaAccess structure:
> +
> +typedef struct FWCfgDmaAccess {
> + uint32_t control;
> + uint32_t length;
> + uint64_t address;
> +} FWCfgDmaAccess;
> +
> +The fields of the structure are in big endian mode, and the field at the lowest
> +address is the "control" field.
> +
> +The "control" field has the following bits:
> + - Bit 0: Error
> + - Bit 1: Read
> + - Bit 2: Skip
> + - Bit 3: Select. The upper 16 bits are the selected index.
> +
> +When an operation is triggered, if the "control" field has bit 3 set, the
> +upper 16 bits are interpreted as an index of a firmware configuration item.
> +This has the same effect as writing the selector register.
> +
> +If the "control" field has bit 1 set, a read operation will be performed.
> +"length" bytes for the current selector and offset will be copied into the
> +physical RAM address specified by the "address" field.
> +
> +If the "control" field has bit 2 set (and not bit 1), a skip operation will be
> +performed. The offset for the current selector will be advanced "length" bytes.
> +
> +To check the result, read the "control" field:
> + 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).
> +
> = Host-side API =
>
> The following functions are available to the QEMU programmer for adding
>
next prev parent reply other threads:[~2015-10-01 14:41 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 12:14 [Qemu-devel] QEMU fw_cfg DMA interface Marc Marí
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 0/7] " Marc Marí
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 1/7] fw_cfg: document fw_cfg_modify_iXX() update functions Marc Marí
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 2/7] fw_cfg DMA interface documentation Marc Marí
2015-10-01 14:41 ` Laszlo Ersek [this message]
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 3/7] Implement fw_cfg DMA interface Marc Marí
2015-10-01 14:36 ` Laszlo Ersek
2015-10-01 15:52 ` Marc Marí
2015-10-01 17:18 ` Peter Maydell
2015-10-01 19:20 ` Laszlo Ersek
2015-10-06 14:44 ` Stefan Hajnoczi
2015-10-06 14:53 ` Peter Maydell
2015-10-08 9:07 ` Stefan Hajnoczi
2015-10-08 10:01 ` Marc Marí
2015-10-06 14:54 ` Marc Marí
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 4/7] Enable fw_cfg DMA interface for ARM Marc Marí
2015-10-01 14:42 ` Laszlo Ersek
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 5/7] Enable fw_cfg DMA interface for x86 Marc Marí
2015-10-01 14:48 ` Laszlo Ersek
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 6/7] Make the kernel image in the fw_cfg DMA interface bootable Marc Marí
2015-10-01 15:25 ` Laszlo Ersek
2015-10-01 16:02 ` Kevin O'Connor
2015-10-01 16:10 ` Laszlo Ersek
2015-10-01 18:15 ` Marc Marí
2015-10-02 8:16 ` Gerd Hoffmann
2015-10-02 8:24 ` Marc Marí
2015-10-02 9:01 ` Gerd Hoffmann
2015-10-02 11:47 ` Laszlo Ersek
2015-10-02 12:07 ` Gerd Hoffmann
2015-10-02 13:25 ` Laszlo Ersek
2015-10-02 13:30 ` Laszlo Ersek
2015-10-03 0:05 ` Jordan Justen
2015-10-02 13:38 ` Kevin O'Connor
2015-10-05 9:18 ` Gerd Hoffmann
2015-10-02 8:09 ` Gerd Hoffmann
2015-10-02 13:40 ` Kevin O'Connor
2015-10-02 13:50 ` Laszlo Ersek
2015-10-02 15:24 ` Daniel P. Berrange
2015-10-05 9:26 ` Gerd Hoffmann
2015-10-01 12:16 ` [Qemu-devel] [PATCH v4 7/7] fw_cfg: Define a static signature to be returned on DMA port reads Marc Marí
2015-10-01 16:07 ` Laszlo Ersek
2015-10-01 17:02 ` Kevin O'Connor
2015-10-01 17:17 ` Laszlo Ersek
2015-10-01 13:19 ` [Qemu-devel] [PATCH v4 0/7] fw_cfg DMA interface Kevin O'Connor
2015-10-01 16:03 ` [Qemu-devel] QEMU " Eric Blake
2015-10-01 16:11 ` Eric Blake
2015-10-01 16:19 ` Laszlo Ersek
2015-10-01 16:17 ` Laszlo Ersek
2015-10-01 16:21 ` Eric Blake
2015-10-01 16:34 ` 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-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=560D4631.9030109@redhat.com \
--to=lersek@redhat.com \
--cc=drjones@redhat.com \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=markmb@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
--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;
as well as URLs for NNTP newsgroup(s).