From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
To: qemu-devel@nongnu.org
Cc: Alistair Francis <alistair@alistair23.me>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
"Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
Francisco Iglesias <frasse.iglesias@gmail.com>
Subject: [Qemu-devel] [PATCH] xilinx_spips: Make dma transactions as per dma_burst_size
Date: Thu, 14 Jun 2018 10:57:04 +0530 [thread overview]
Message-ID: <1528954027-7938-1-git-send-email-saipava@xilinx.com> (raw)
Qspi dma has a burst length of 64 bytes, So limit transaction length to
64 max.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
---
hw/ssi/xilinx_spips.c | 18 +++++++++++++++---
include/hw/ssi/xilinx_spips.h | 3 ++-
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index 03f5fae..ea006c4 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -851,12 +851,17 @@ static void xlnx_zynqmp_qspips_notify(void *opaque)
{
size_t ret;
uint32_t num;
- const void *rxd = pop_buf(recv_fifo, 4, &num);
+ const void *rxd;
+ int len;
+
+ len = recv_fifo->num >= rq->dma_burst_size ? rq->dma_burst_size :
+ recv_fifo->num;
+ rxd = pop_buf(recv_fifo, len, &num);
memcpy(rq->dma_buf, rxd, num);
- ret = stream_push(rq->dma, rq->dma_buf, 4);
- assert(ret == 4);
+ ret = stream_push(rq->dma, rq->dma_buf, num);
+ assert(ret == num);
xlnx_zynqmp_qspips_check_flush(rq);
}
}
@@ -1337,6 +1342,7 @@ static void xlnx_zynqmp_qspips_realize(DeviceState *dev, Error **errp)
fifo8_create(&s->rx_fifo_g, xsc->rx_fifo_size);
fifo8_create(&s->tx_fifo_g, xsc->tx_fifo_size);
fifo32_create(&s->fifo_g, 32);
+ s->dma_buf = g_new0(uint8_t, s->dma_burst_size);
}
static void xlnx_zynqmp_qspips_init(Object *obj)
@@ -1411,6 +1417,11 @@ static const VMStateDescription vmstate_xlnx_zynqmp_qspips = {
}
};
+static Property xilinx_zynqmp_qspips_properties[] = {
+ DEFINE_PROP_UINT32("dma-burst-size", XlnxZynqMPQSPIPS, dma_burst_size, 64),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static Property xilinx_qspips_properties[] = {
/* We had to turn this off for 2.10 as it is not compatible with migration.
* It can be enabled but will prevent the device to be migrated.
@@ -1463,6 +1474,7 @@ static void xlnx_zynqmp_qspips_class_init(ObjectClass *klass, void * data)
dc->realize = xlnx_zynqmp_qspips_realize;
dc->reset = xlnx_zynqmp_qspips_reset;
dc->vmsd = &vmstate_xlnx_zynqmp_qspips;
+ dc->props = xilinx_zynqmp_qspips_properties;
xsc->reg_ops = &xlnx_zynqmp_qspips_ops;
xsc->rx_fifo_size = RXFF_A_Q;
xsc->tx_fifo_size = TXFF_A_Q;
diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h
index d398a4e..cca1813 100644
--- a/include/hw/ssi/xilinx_spips.h
+++ b/include/hw/ssi/xilinx_spips.h
@@ -95,7 +95,8 @@ typedef struct {
XilinxQSPIPS parent_obj;
StreamSlave *dma;
- uint8_t dma_buf[4];
+ uint8_t *dma_buf;
+ uint32_t dma_burst_size;
int gqspi_irqline;
uint32_t regs[XLNX_ZYNQMP_SPIPS_R_MAX];
--
2.7.4
next reply other threads:[~2018-06-14 5:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-14 5:27 Sai Pavan Boddu [this message]
2018-06-14 11:25 ` [Qemu-devel] [PATCH] xilinx_spips: Make dma transactions as per dma_burst_size Edgar E. Iglesias
2018-06-19 20:26 ` Sai Pavan Boddu
-- strict thread matches above, loose matches on Subject: below --
2018-06-12 6:44 Sai Pavan Boddu
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=1528954027-7938-1-git-send-email-saipava@xilinx.com \
--to=sai.pavan.boddu@xilinx.com \
--cc=alistair@alistair23.me \
--cc=crosthwaite.peter@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=frasse.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).