qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Francisco Iglesias <frasse.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: edgari@xilinx.com, alistai@xilinx.com,
	francisco.iglesias@feimtech.se, mar.krzeminski@gmail.com
Subject: [Qemu-devel] [PATCH v5 01/13] m25p80: Add support for continuous read out of RDSR and READ_FSR
Date: Sun, 29 Oct 2017 11:13:31 +0100	[thread overview]
Message-ID: <20171029101343.15544-2-frasse.iglesias@gmail.com> (raw)
In-Reply-To: <20171029101343.15544-1-frasse.iglesias@gmail.com>

Add support for continuous read out of the RDSR and READ_FSR status
registers until the chip select is deasserted. This feature is supported
by amongst others 1 or more flashtypes manufactured by Numonyx (Micron),
Windbond, SST, Gigadevice, Eon and Macronix.

Signed-off-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Acked-by: Marcin Krzemiński <mar.krzeminski@gmail.com>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
---
 hw/block/m25p80.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index a2438b9..2971519 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -423,6 +423,7 @@ typedef struct Flash {
     uint8_t data[M25P80_INTERNAL_DATA_BUFFER_SZ];
     uint32_t len;
     uint32_t pos;
+    bool data_read_loop;
     uint8_t needed_bytes;
     uint8_t cmd_in_progress;
     uint32_t cur_addr;
@@ -983,6 +984,7 @@ static void decode_new_cmd(Flash *s, uint32_t value)
         }
         s->pos = 0;
         s->len = 1;
+        s->data_read_loop = true;
         s->state = STATE_READING_DATA;
         break;
 
@@ -993,6 +995,7 @@ static void decode_new_cmd(Flash *s, uint32_t value)
         }
         s->pos = 0;
         s->len = 1;
+        s->data_read_loop = true;
         s->state = STATE_READING_DATA;
         break;
 
@@ -1133,6 +1136,7 @@ static int m25p80_cs(SSISlave *ss, bool select)
         s->pos = 0;
         s->state = STATE_IDLE;
         flash_sync_dirty(s, -1);
+        s->data_read_loop = false;
     }
 
     DB_PRINT_L(0, "%sselect\n", select ? "de" : "");
@@ -1198,7 +1202,9 @@ static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx)
         s->pos++;
         if (s->pos == s->len) {
             s->pos = 0;
-            s->state = STATE_IDLE;
+            if (!s->data_read_loop) {
+                s->state = STATE_IDLE;
+            }
         }
         break;
 
-- 
2.9.3

  reply	other threads:[~2017-10-29 10:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29 10:13 [Qemu-devel] [PATCH v5 00/13] Add support for the ZynqMP Generic QSPI Francisco Iglesias
2017-10-29 10:13 ` Francisco Iglesias [this message]
2017-10-29 15:08   ` [Qemu-devel] [PATCH v5 01/13] m25p80: Add support for continuous read out of RDSR and READ_FSR mar.krzeminski
2017-10-31 11:26     ` francisco iglesias
2017-10-31 11:55       ` mar.krzeminski
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 02/13] m25p80: Add support for SST READ ID 0x90/0xAB commands Francisco Iglesias
2017-10-29 15:21   ` mar.krzeminski
2017-10-29 21:13     ` francisco iglesias
2017-10-31 10:11       ` mar.krzeminski
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 03/13] m25p80: Add support for BRRD/BRWR and BULK_ERASE (0x60) Francisco Iglesias
2017-10-31 10:17   ` mar.krzeminski
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 04/13] m25p80: Add support for n25q512a11 and n25q512a13 Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 05/13] xilinx_spips: Move FlashCMD, XilinxQSPIPS and XilinxSPIPSClass Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 06/13] xilinx_spips: Update striping to be big-endian bit order Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 07/13] xilinx_spips: Add support for RX discard and RX drain Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 08/13] xilinx_spips: Make tx/rx_data_bytes more generic and reusable Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 09/13] xilinx_spips: Add support for zero pumping Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 10/13] xilinx_spips: Add support for 4 byte addresses in the LQSPI Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 11/13] xilinx_spips: Don't set TX FIFO UNDERFLOW at cmd done Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 12/13] xilinx_spips: Add support for the ZynqMP Generic QSPI Francisco Iglesias
2017-10-29 10:13 ` [Qemu-devel] [PATCH v5 13/13] xlnx-zcu102: Add support for the ZynqMP QSPI Francisco Iglesias

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=20171029101343.15544-2-frasse.iglesias@gmail.com \
    --to=frasse.iglesias@gmail.com \
    --cc=alistai@xilinx.com \
    --cc=edgari@xilinx.com \
    --cc=francisco.iglesias@feimtech.se \
    --cc=mar.krzeminski@gmail.com \
    --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).