qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH 3/4] aspeed/smc: handle dummies only in fast read mode
Date: Thu,  9 Feb 2017 14:47:37 +0100	[thread overview]
Message-ID: <1486648058-520-4-git-send-email-clg@kaod.org> (raw)
In-Reply-To: <1486648058-520-1-git-send-email-clg@kaod.org>

HW works fine in normal read mode with dummy bytes being set. So let's
check this case to not transfer bytes.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ssi/aspeed_smc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 087b29e8da10..70177078a8f2 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -536,10 +536,13 @@ static uint64_t aspeed_smc_flash_read(void *opaque, hwaddr addr, unsigned size)
         /*
          * Use fake transfers to model dummy bytes. The value should
          * be configured to some non-zero value in fast read mode and
-         * zero in read mode.
+         * zero in read mode. But, as the HW allows inconsistent
+         * settings, let's check for fast read mode.
          */
-        for (i = 0; i < aspeed_smc_flash_dummies(fl); i++) {
-            ssi_transfer(fl->controller->spi, 0xFF);
+        if (aspeed_smc_flash_mode(fl) == CTRL_FREADMODE) {
+            for (i = 0; i < aspeed_smc_flash_dummies(fl); i++) {
+                ssi_transfer(fl->controller->spi, 0xFF);
+            }
         }
 
         for (i = 0; i < size; i++) {
-- 
2.7.4

  parent reply	other threads:[~2017-02-09 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 13:47 [Qemu-devel] [PATCH 0/4] aspeed: miscellaneous small fixes Cédric Le Goater
2017-02-09 13:47 ` [Qemu-devel] [PATCH 1/4] aspeed: check for negative values returned by blk_getlength() Cédric Le Goater
2017-02-09 13:47 ` [Qemu-devel] [PATCH 2/4] aspeed: remove useless comment on controller segment size Cédric Le Goater
2017-02-09 21:47   ` Philippe Mathieu-Daudé
2017-02-09 13:47 ` Cédric Le Goater [this message]
2017-02-09 13:47 ` [Qemu-devel] [PATCH 4/4] aspeed/smc: use a modulo to check segment limits Cédric Le Goater
2017-02-09 21:49   ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-02-10 15:14 ` [Qemu-devel] [PATCH 0/4] aspeed: miscellaneous small fixes 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=1486648058-520-4-git-send-email-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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).