From: Peter Maydell <peter.maydell@linaro.org>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: "Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
Xuzhou Cheng <xuzhou.cheng@windriver.com>,
Bin Meng <bin.meng@windriver.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Francisco Iglesias <francisco.iglesias@xilinx.com>,
qemu-arm <qemu-arm@nongnu.org>,
Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH v7 1/5] hw/dma: Implement a Xilinx CSU DMA model
Date: Wed, 10 Mar 2021 13:59:05 +0000 [thread overview]
Message-ID: <CAFEAcA814mW91KMVBUhhspXvwCvv_EAQaFkCpu5F8-yNv_noLQ@mail.gmail.com> (raw)
In-Reply-To: <20210303135254.3970-2-bmeng.cn@gmail.com>
On Wed, 3 Mar 2021 at 13:53, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Xuzhou Cheng <xuzhou.cheng@windriver.com>
>
> ZynqMP QSPI supports SPI transfer using DMA mode, but currently this
> is unimplemented. When QSPI is programmed to use DMA mode, QEMU will
> crash. This is observed when testing VxWorks 7.
>
> This adds a Xilinx CSU DMA model and the implementation is based on
> https://github.com/Xilinx/qemu/blob/master/hw/dma/csu_stream_dma.c.
> The DST part of the model is verified along with ZynqMP GQSPI model.
>
> +/* len is in bytes */
> +static uint32_t xlnx_csu_dma_read(XlnxCSUDMA *s, uint8_t *buf, uint32_t len)
> +{
> + hwaddr addr = (hwaddr)s->regs[R_ADDR_MSB] << 32 | s->regs[R_ADDR];
> + MemTxResult result = MEMTX_OK;
> +
> + if (xlnx_csu_dma_burst_is_fixed(s)) {
> + uint32_t i;
> +
> + for (i = 0; i < len && (result == MEMTX_OK); i += s->width) {
> + uint32_t mlen = MIN(len - i, s->width);
> +
> + result = address_space_rw(s->dma_as, addr, s->attr,
> + buf + i, mlen, false);
> + }
> + } else {
> + result = address_space_rw(s->dma_as, addr, s->attr, buf, len, false);
> + }
> +
> + if (result == MEMTX_OK) {
> + xlnx_csu_dma_data_process(s, buf, len);
> + } else {
> + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address 0x%lx for mem read",
> + __func__, addr);
Using %lx to print a hwaddr (or other 64-bit values) won't compile
on 32-bit hosts or on OSX. For hwaddr you need to use TARGET_FMT_plx.
I've fixed up these issues in the pullreq.
thanks
-- PMM
next prev parent reply other threads:[~2021-03-10 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 13:52 [PATCH v7 0/5] hw/arm: zynqmp: Implement a CSU DMA model and connect it with GQSPI Bin Meng
2021-03-03 13:52 ` [PATCH v7 1/5] hw/dma: Implement a Xilinx CSU DMA model Bin Meng
2021-03-10 13:59 ` Peter Maydell [this message]
2021-03-03 13:52 ` [PATCH v7 2/5] hw/arm: xlnx-zynqmp: Clean up coding convention issues Bin Meng
2021-03-03 13:52 ` [PATCH v7 3/5] hw/arm: xlnx-zynqmp: Connect a Xilinx CSU DMA module for QSPI Bin Meng
2021-03-03 13:52 ` [PATCH v7 4/5] hw/ssi: xilinx_spips: Clean up coding convention issues Bin Meng
2021-03-03 13:52 ` [PATCH v7 5/5] hw/ssi: xilinx_spips: Remove DMA related dead codes from zynqmp_spips Bin Meng
2021-03-08 17:15 ` [PATCH v7 0/5] hw/arm: zynqmp: Implement a CSU DMA model and connect it with GQSPI Peter Maydell
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=CAFEAcA814mW91KMVBUhhspXvwCvv_EAQaFkCpu5F8-yNv_noLQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=bmeng.cn@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=francisco.iglesias@xilinx.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=xuzhou.cheng@windriver.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).