All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
To: alistair@alistair23.me, crosthwaite.peter@gmail.com,
	peter.maydell@linaro.org, edgar.iglesias@gmail.com,
	frasse.iglesias@gmail.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it
Date: Tue, 17 Apr 2018 19:48:16 +0530	[thread overview]
Message-ID: <1523974696-1965-2-git-send-email-saipava@xilinx.com> (raw)
In-Reply-To: <1523974696-1965-1-git-send-email-saipava@xilinx.com>

For all the commands, which do not have an entry in
xilinx_spips_num_dummies, present logic sends dummy byte when ever we
are in SNOOP_NONE state, fix it to send only if cmd requires them.

Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle.
And also convert dummy bytes to cycles (required by m25p80).

Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
---
 hw/ssi/xilinx_spips.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index 426f971..8278930 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
                 tx_rx[i] = tx;
             }
         } else {
-            /* Extract a dummy byte and generate dummy cycles according to the
-             * link state */
             tx = fifo8_pop(&s->tx_fifo);
-            dummy_cycles = 8 / s->link_state;
+            if (s->cmd_dummies > 0) {
+                /* Extract a dummy byte and generate dummy cycles according to
+                 * the link state */
+                 dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 / s->link_state;
+                 s->cmd_dummies--;
+            } else {
+                for (i = 0; i < num_effective_busses(s); ++i) {
+                    tx_rx[i] = tx;
+                }
+            }
         }
 
         for (i = 0; i < num_effective_busses(s); ++i) {
-- 
2.7.4

  reply	other threads:[~2018-04-17 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 14:18 [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Sai Pavan Boddu
2018-04-17 14:18 ` Sai Pavan Boddu [this message]
2018-04-17 22:43   ` [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it francisco iglesias
2018-04-18  7:17     ` Sai Pavan Boddu
2018-04-17 15:47 ` [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Alistair Francis
2018-04-17 16:08   ` Alistair Francis

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=1523974696-1965-2-git-send-email-saipava@xilinx.com \
    --to=sai.pavan.boddu@xilinx.com \
    --cc=alistair@alistair23.me \
    --cc=crosthwaite.peter@gmail.com \
    --cc=edgar.iglesias@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.